diff options
| author | Michael Kolb <kolby@google.com> | 2011-01-11 15:17:31 -0800 |
|---|---|---|
| committer | Michael Kolb <kolby@google.com> | 2011-01-11 15:27:56 -0800 |
| commit | 793e05e5f64dba439922304e3b95c29969b36fd5 (patch) | |
| tree | 85d581817d904524d999cdcd89b6bf95043db454 /src/com/android | |
| parent | a81e89b643647f69a6329a4a25470b685ab10b67 (diff) | |
| download | packages_apps_Browser-793e05e5f64dba439922304e3b95c29969b36fd5.tar.gz packages_apps_Browser-793e05e5f64dba439922304e3b95c29969b36fd5.tar.bz2 packages_apps_Browser-793e05e5f64dba439922304e3b95c29969b36fd5.zip | |
remove voice button when unsupported
http://b/issue?id=3338108
voice search button is hidden if the selected search engine
does not support voice search
Change-Id: I410d9e0a5fff7b0c045a3f0b1818fac03b247897
Diffstat (limited to 'src/com/android')
| -rw-r--r-- | src/com/android/browser/TitleBarXLarge.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/com/android/browser/TitleBarXLarge.java b/src/com/android/browser/TitleBarXLarge.java index 57cc7249c..8be4df545 100644 --- a/src/com/android/browser/TitleBarXLarge.java +++ b/src/com/android/browser/TitleBarXLarge.java @@ -17,6 +17,7 @@ package com.android.browser; import com.android.browser.UrlInputView.UrlInputListener; +import com.android.browser.search.SearchEngine; import android.app.Activity; import android.app.SearchManager; @@ -373,7 +374,11 @@ public class TitleBarXLarge extends TitleBarBase } private void setSearchMode(boolean voiceSearchEnabled) { - mVoiceSearch.setVisibility(voiceSearchEnabled ? View.VISIBLE : + SearchEngine searchEngine = BrowserSettings.getInstance() + .getSearchEngine(); + boolean showvoicebutton = voiceSearchEnabled && + (searchEngine != null && searchEngine.supportsVoiceSearch()); + mVoiceSearch.setVisibility(showvoicebutton ? View.VISIBLE : View.GONE); mGoButton.setVisibility(voiceSearchEnabled ? View.GONE : View.VISIBLE); |
