Permalink
Browse files

Add an option to hide the Voice Search icon.

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...
1 parent 51c1898 commit 4a028009468a95e932fc4fcd9ccdd358e02b1b0a @LeonScroggins LeonScroggins committed Sep 14, 2010
Showing with 11 additions and 1 deletion.
  1. +3 −1 core/java/android/app/SearchDialog.java
  2. +8 −0 core/java/android/app/SearchManager.java
@@ -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;
@@ -394,6 +394,14 @@
*/
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.
*/

0 comments on commit 4a02800

Please sign in to comment.