summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorAmith Yamasani <yamasani@google.com>2010-02-01 12:37:58 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2010-02-01 12:37:58 -0800
commit504e07134ef4c999241eac988183e1344bec0f3f (patch)
tree708d13f7b5b6dfea74366ec716d871e6710efe89 /core
parent25b910839e8bbe2af0401dc6fc097daa6898ca34 (diff)
parent0f55b197aabf6e2a902c33217e9ed7fe58cdf9d4 (diff)
downloadframeworks_base-504e07134ef4c999241eac988183e1344bec0f3f.zip
frameworks_base-504e07134ef4c999241eac988183e1344bec0f3f.tar.gz
frameworks_base-504e07134ef4c999241eac988183e1344bec0f3f.tar.bz2
Merge "Fix an NPE in SearchDialog when clicking on Mic button. Bug: 2410605"
Diffstat (limited to 'core')
-rw-r--r--core/java/android/app/SearchDialog.java13
1 files changed, 6 insertions, 7 deletions
diff --git a/core/java/android/app/SearchDialog.java b/core/java/android/app/SearchDialog.java
index 3dfbe71..ec9f3b4 100644
--- a/core/java/android/app/SearchDialog.java
+++ b/core/java/android/app/SearchDialog.java
@@ -903,15 +903,14 @@ public class SearchDialog extends Dialog implements OnItemClickListener, OnItemS
if (mSearchable == null) {
return;
}
+ SearchableInfo searchable = mSearchable;
+ // First stop the existing search before starting voice search, or else we'll end
+ // up showing the search dialog again once we return to the app.
+ cancel();
try {
- // First stop the existing search before starting voice search, or else we'll end
- // up showing the search dialog again once we return to the app.
- ((SearchManager) getContext().getSystemService(Context.SEARCH_SERVICE)).
- stopSearch();
-
- if (mSearchable.getVoiceSearchLaunchWebSearch()) {
+ if (searchable.getVoiceSearchLaunchWebSearch()) {
getContext().startActivity(mVoiceWebSearchIntent);
- } else if (mSearchable.getVoiceSearchLaunchRecognizer()) {
+ } else if (searchable.getVoiceSearchLaunchRecognizer()) {
Intent appSearchIntent = createVoiceAppSearchIntent(mVoiceAppSearchIntent);
getContext().startActivity(appSearchIntent);
}