summaryrefslogtreecommitdiff
path: root/core/java/android/app/SearchDialog.java
diff options
context:
space:
mode:
authorMike LeBeau <mlebeau@android.com>2010-04-01 14:49:58 -0700
committerMike LeBeau <mlebeau@android.com>2010-04-01 15:29:46 -0700
commit6af5ad5e618e773e629a490f1ed268b1bc155d59 (patch)
tree54b2e9a5c8c5ef68ee5f9f3d72542997e464b786 /core/java/android/app/SearchDialog.java
parenteb643f2685bd404ef5abb622123cea0aa17939d7 (diff)
Also send EXTRA_CALLING_PACKAGE for voice search intents that do web
search (not just for in-app search). Needed as part of http://b/2546173 Change-Id: I661ff52bace754459651eacd369a19e97364c3c6
Diffstat (limited to 'core/java/android/app/SearchDialog.java')
-rw-r--r--core/java/android/app/SearchDialog.java15
1 files changed, 14 insertions, 1 deletions
diff --git a/core/java/android/app/SearchDialog.java b/core/java/android/app/SearchDialog.java
index 0ebe3ac09cad..d6bb7b6d6937 100644
--- a/core/java/android/app/SearchDialog.java
+++ b/core/java/android/app/SearchDialog.java
@@ -795,7 +795,9 @@ public class SearchDialog extends Dialog implements OnItemClickListener, OnItemS
SearchableInfo searchable = mSearchable;
try {
if (searchable.getVoiceSearchLaunchWebSearch()) {
- getContext().startActivity(mVoiceWebSearchIntent);
+ Intent webSearchIntent = createVoiceWebSearchIntent(mVoiceWebSearchIntent,
+ searchable);
+ getContext().startActivity(webSearchIntent);
} else if (searchable.getVoiceSearchLaunchRecognizer()) {
Intent appSearchIntent = createVoiceAppSearchIntent(mVoiceAppSearchIntent,
searchable);
@@ -811,6 +813,17 @@ public class SearchDialog extends Dialog implements OnItemClickListener, OnItemS
};
/**
+ * Create and return an Intent that can launch the voice search activity for web search.
+ */
+ private Intent createVoiceWebSearchIntent(Intent baseIntent, SearchableInfo searchable) {
+ Intent voiceIntent = new Intent(baseIntent);
+ ComponentName searchActivity = searchable.getSearchActivity();
+ voiceIntent.putExtra(RecognizerIntent.EXTRA_CALLING_PACKAGE,
+ searchActivity == null ? null : searchActivity.toShortString());
+ return voiceIntent;
+ }
+
+ /**
* Create and return an Intent that can launch the voice search activity, perform a specific
* voice transcription, and forward the results to the searchable activity.
*