import android.provider.ContactsContract.Intents.Insert;
import android.provider.Downloads;
import android.provider.MediaStore;
+import android.speech.RecognizerResultsIntent;
import android.text.IClipboard;
import android.text.TextUtils;
import android.text.format.DateFormat;
final Tab t = mTabControl.createNewTab(
(Intent.ACTION_VIEW.equals(action) &&
intent.getData() != null)
- || Tab.VoiceSearchData.VOICE_SEARCH_RESULTS.equals(action),
+ || RecognizerResultsIntent.ACTION_VOICE_SEARCH_RESULTS
+ .equals(action),
intent.getStringExtra(Browser.EXTRA_APPLICATION_ID), urlData.mUrl);
mTabControl.setCurrentTab(t);
attachTabToContentView(t);
// just resume the browser
return;
}
- boolean activateVoiceSearch = Tab.VoiceSearchData.VOICE_SEARCH_RESULTS
- .equals(action);
+ boolean activateVoiceSearch = RecognizerResultsIntent
+ .ACTION_VOICE_SEARCH_RESULTS.equals(action);
if (Intent.ACTION_VIEW.equals(action)
|| Intent.ACTION_SEARCH.equals(action)
|| MediaStore.INTENT_ACTION_MEDIA_SEARCH.equals(action)
String url = null;
final String action = intent.getAction();
- if (Tab.VoiceSearchData.VOICE_SEARCH_RESULTS.equals(action)) {
+ if (RecognizerResultsIntent.ACTION_VOICE_SEARCH_RESULTS.equals(
+ action)) {
return false;
}
if (Intent.ACTION_VIEW.equals(action)) {
UrlData(String url, Map<String, String> headers, Intent intent) {
this.mUrl = url;
this.mHeaders = headers;
- if (Tab.VoiceSearchData.VOICE_SEARCH_RESULTS.equals(
- intent.getAction())) {
+ if (RecognizerResultsIntent.ACTION_VOICE_SEARCH_RESULTS
+ .equals(intent.getAction())) {
this.mVoiceIntent = intent;
} else {
this.mVoiceIntent = null;
import android.provider.Browser;
import android.provider.Settings;
import android.provider.Browser.BookmarkColumns;
+import android.speech.RecognizerResultsIntent;
import android.text.TextUtils;
import android.util.Log;
import android.util.TypedValue;
public String getString(int column) {
switch (column) {
case RESULT_ACTION_ID:
- return Tab.VoiceSearchData.VOICE_SEARCH_RESULTS;
+ return RecognizerResultsIntent.ACTION_VOICE_SEARCH_RESULTS;
case RESULT_TEXT_ID:
// The data is used when the phone is in landscape mode. We
// still want to show the result string.
import android.os.Bundle;
import android.os.Message;
import android.provider.Browser;
+import android.speech.RecognizerResultsIntent;
import android.util.Log;
import android.view.KeyEvent;
import android.view.LayoutInflater;
*/
/* package */ void activateVoiceSearchMode(Intent intent) {
ArrayList<String> results = intent.getStringArrayListExtra(
- "result_strings");
+ RecognizerResultsIntent.EXTRA_VOICE_SEARCH_RESULT_STRINGS);
ArrayList<String> urls = intent.getStringArrayListExtra(
- "result_urls");
+ RecognizerResultsIntent.EXTRA_VOICE_SEARCH_RESULT_URLS);
if (results != null) {
// This tab is now entering voice search mode for the first time, or
// a new voice search was done.
mMainView.loadUrl(mVoiceSearchData.mLastVoiceSearchUrl);
}
/* package */ static class VoiceSearchData {
- /**
- * Intent action for a voice search. Will be replaced with a global
- * variable.
- */
- public static final String VOICE_SEARCH_RESULTS
- = "android.speech.action.VOICE_SEARCH_RESULTS";
-
public VoiceSearchData(ArrayList<String> results,
ArrayList<String> urls) {
mVoiceSearchResults = results;