Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 504e0713 authored by Amith Yamasani's avatar Amith Yamasani Committed by Android (Google) Code Review
Browse files

Merge "Fix an NPE in SearchDialog when clicking on Mic button. Bug: 2410605"

parents 25b91083 0f55b197
Loading
Loading
Loading
Loading
+6 −7
Original line number Diff line number Diff line
@@ -903,15 +903,14 @@ public class SearchDialog extends Dialog implements OnItemClickListener, OnItemS
            if (mSearchable == null) {
                return;
            }
            try {
            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.
                ((SearchManager) getContext().getSystemService(Context.SEARCH_SERVICE)).
                        stopSearch();
                
                if (mSearchable.getVoiceSearchLaunchWebSearch()) {
            cancel();
            try {
                if (searchable.getVoiceSearchLaunchWebSearch()) {
                    getContext().startActivity(mVoiceWebSearchIntent);
                } else if (mSearchable.getVoiceSearchLaunchRecognizer()) {
                } else if (searchable.getVoiceSearchLaunchRecognizer()) {
                    Intent appSearchIntent = createVoiceAppSearchIntent(mVoiceAppSearchIntent);                    
                    getContext().startActivity(appSearchIntent);
                }