Clear voice search mode when changing search engines.
Not all search engines support voice search. Also, different
search engines may support them differently. So if we are
already in voice search mode when the search engine changes,
exit the mode.
Change-Id: I8d3f200f4829ad1383d554214c9d56d5c0b96aed
diff --git a/src/com/android/browser/Tab.java b/src/com/android/browser/Tab.java
index 2dac050..1700961 100644
--- a/src/com/android/browser/Tab.java
+++ b/src/com/android/browser/Tab.java
@@ -165,6 +165,17 @@
*/
private VoiceSearchData mVoiceSearchData;
/**
+ * Remove voice search mode from this tab.
+ */
+ public void revertVoiceSearchMode() {
+ if (mVoiceSearchData != null) {
+ mVoiceSearchData = null;
+ if (mInForeground) {
+ mActivity.revertVoiceTitleBar();
+ }
+ }
+ }
+ /**
* Return whether the tab is in voice search mode.
*/
public boolean isInVoiceSearchMode() {
@@ -457,10 +468,7 @@
i.putExtra(LoggingEvents.EXTRA_FLUSH, true);
mActivity.sendBroadcast(i);
}
- mVoiceSearchData = null;
- if (mInForeground) {
- mActivity.revertVoiceTitleBar();
- }
+ revertVoiceSearchMode();
}
// We've started to load a new page. If there was a pending message