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

Commit c2e06072 authored by Mike LeBeau's avatar Mike LeBeau
Browse files

Tell the SearchManager to stopSearch before starting an in-app voice

search. Without this, because of the recent changes to how the search
dialog hides and resumes, we end up re-showing the search dialog after
returning to the app from voice search, obscuring the new voice search
results behind.

Fixes http://b/2025364
parent f4fbdfa5
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -903,6 +903,12 @@ public class SearchDialog extends Dialog implements OnItemClickListener, OnItemS
                    getContext().startActivity(mVoiceWebSearchIntent);
                } else if (mSearchable.getVoiceSearchLaunchRecognizer()) {
                    Intent appSearchIntent = createVoiceAppSearchIntent(mVoiceAppSearchIntent);
                    
                    // 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();
                    
                    getContext().startActivity(appSearchIntent);
                }
            } catch (ActivityNotFoundException e) {