diff options
author | Amith Yamasani <yamasani@google.com> | 2010-02-01 12:13:39 -0800 |
---|---|---|
committer | Amith Yamasani <yamasani@google.com> | 2010-02-01 12:13:39 -0800 |
commit | 0f55b197aabf6e2a902c33217e9ed7fe58cdf9d4 (patch) | |
tree | 935a1a6b58c6dc93d582066c90b6f249ff6984f8 | |
parent | 57853a8aeced842b4d4b964872561e2125da7f92 (diff) | |
download | frameworks_base-0f55b197aabf6e2a902c33217e9ed7fe58cdf9d4.zip frameworks_base-0f55b197aabf6e2a902c33217e9ed7fe58cdf9d4.tar.gz frameworks_base-0f55b197aabf6e2a902c33217e9ed7fe58cdf9d4.tar.bz2 |
Fix an NPE in SearchDialog when clicking on Mic button. Bug: 2410605
-rw-r--r-- | core/java/android/app/SearchDialog.java | 13 |
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); } |