summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeon Scroggins III <scroggo@google.com>2010-09-14 10:56:25 -0400
committerandroid-build SharedAccount <android-build@sekiwake.mtv.corp.google.com>2010-09-16 13:36:52 -0700
commitec721fd1db4d895b342cfb83c651e0b78afac4dd (patch)
treef2834b67dbdc25606d1a336f98696f47feacf88a
parent6881e729155fab1ca7e6f84bcc789eaf90b9081a (diff)
downloadbase-ec721fd1db4d895b342cfb83c651e0b78afac4dd.tar.gz
Add an option to hide the Voice Search icon.android-2.2.1_r1
Some search engines do not support voice search, so provide a flag to disable showing the icon in the SearchDialog. Change-Id: I7ef4ad5d382edb86c08014260defa4af6d5eca0a
-rw-r--r--core/java/android/app/SearchDialog.java4
-rw-r--r--core/java/android/app/SearchManager.java8
2 files changed, 11 insertions, 1 deletions
diff --git a/core/java/android/app/SearchDialog.java b/core/java/android/app/SearchDialog.java
index 7625c04d61e2..cd22fa13e015 100644
--- a/core/java/android/app/SearchDialog.java
+++ b/core/java/android/app/SearchDialog.java
@@ -588,7 +588,9 @@ public class SearchDialog extends Dialog implements OnItemClickListener, OnItemS
*/
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;
diff --git a/core/java/android/app/SearchManager.java b/core/java/android/app/SearchManager.java
index a1ca707ab7b9..2e9cd96f2695 100644
--- a/core/java/android/app/SearchManager.java
+++ b/core/java/android/app/SearchManager.java
@@ -395,6 +395,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.
*/
private static ISearchManager mService;