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

Commit fc0e17fc authored by Android (Google) Code Review's avatar Android (Google) Code Review Committed by Android Git Automerger
Browse files

am cd540294: Merge change 9704 into donut

Merge commit 'cd540294'

* commit 'cd540294':
  Close the search dialog before starting voice search in all cases, i.e.,
parents 8db05867 cd540294
Loading
Loading
Loading
Loading
+6 −7
Original line number Diff line number Diff line
@@ -899,16 +899,15 @@ public class SearchDialog extends Dialog implements OnItemClickListener, OnItemS
                return;
            }
            try {
                if (mSearchable.getVoiceSearchLaunchWebSearch()) {
                    getContext().startActivity(mVoiceWebSearchIntent);
                } else if (mSearchable.getVoiceSearchLaunchRecognizer()) {
                    Intent appSearchIntent = createVoiceAppSearchIntent(mVoiceAppSearchIntent);
                    
                    // Stop the existing search before starting voice search, or else we'll end
                // 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()) {
                    getContext().startActivity(mVoiceWebSearchIntent);
                } else if (mSearchable.getVoiceSearchLaunchRecognizer()) {
                    Intent appSearchIntent = createVoiceAppSearchIntent(mVoiceAppSearchIntent);                    
                    getContext().startActivity(appSearchIntent);
                }
            } catch (ActivityNotFoundException e) {