Skip to content

Commit

Permalink
Add an option to hide the Voice Search icon.
Browse files Browse the repository at this point in the history
Some search engines do not support voice search, so provide a flag
to disable showing the icon in the SearchDialog.

Change-Id: I7ef4ad5d382edb86c08014260defa4af6d5eca0a
  • Loading branch information
LeonScroggins committed Sep 14, 2010
1 parent 51c1898 commit 4a02800
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
4 changes: 3 additions & 1 deletion core/java/android/app/SearchDialog.java
Expand Up @@ -588,7 +588,9 @@ private void updateQueryHint() {
*/
private void updateVoiceButton(boolean empty) {
int visibility = View.GONE;
if (mSearchable.getVoiceSearchEnabled() && empty) {
if ((mAppSearchData == null || !mAppSearchData.getBoolean(
SearchManager.DISABLE_VOICE_SEARCH, false))
&& mSearchable.getVoiceSearchEnabled() && empty) {
Intent testIntent = null;
if (mSearchable.getVoiceSearchLaunchWebSearch()) {
testIntent = mVoiceWebSearchIntent;
Expand Down
8 changes: 8 additions & 0 deletions core/java/android/app/SearchManager.java
Expand Up @@ -394,6 +394,14 @@ public class SearchManager
*/
public final static String CONTEXT_IS_VOICE = "android.search.CONTEXT_IS_VOICE";

/**
* This means that the voice icon should not be shown at all, because the
* current search engine does not support voice search.
* @hide
*/
public final static String DISABLE_VOICE_SEARCH
= "android.search.DISABLE_VOICE_SEARCH";

/**
* Reference to the shared system search service.
*/
Expand Down

0 comments on commit 4a02800

Please sign in to comment.