fix voice search suggestions
http://b/issue?id=3348242
In voice search mode, make sure the suggestions are
routed via tab's activateVoiceSearch
Change-Id: I464f186510047a1d2b0d6b2be7809ec66ec74b22
diff --git a/src/com/android/browser/TitleBarXLarge.java b/src/com/android/browser/TitleBarXLarge.java
index 8be4df5..b5a8032 100644
--- a/src/com/android/browser/TitleBarXLarge.java
+++ b/src/com/android/browser/TitleBarXLarge.java
@@ -27,6 +27,7 @@
import android.graphics.Bitmap;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
+import android.speech.RecognizerResultsIntent;
import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
@@ -268,7 +269,14 @@
mUiController.getCurrentTopWebView().requestFocus();
mUi.hideFakeTitleBar();
Intent i = new Intent();
- i.setAction(Intent.ACTION_SEARCH);
+ String action = null;
+ if (UrlInputView.VOICE.equals(source)) {
+ action = RecognizerResultsIntent.ACTION_VOICE_SEARCH_RESULTS;
+ source = null;
+ } else {
+ action = Intent.ACTION_SEARCH;
+ }
+ i.setAction(action);
i.putExtra(SearchManager.QUERY, text);
if (extra != null) {
i.putExtra(SearchManager.EXTRA_DATA_KEY, extra);