Merge change 9704 into donut
* changes: Close the search dialog before starting voice search in all cases, i.e., also when launching web search, not just when it's using the intent API.
This commit is contained in:
@@ -899,16 +899,15 @@ public class SearchDialog extends Dialog implements OnItemClickListener, OnItemS
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
try {
|
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 (mSearchable.getVoiceSearchLaunchWebSearch()) {
|
||||||
getContext().startActivity(mVoiceWebSearchIntent);
|
getContext().startActivity(mVoiceWebSearchIntent);
|
||||||
} else if (mSearchable.getVoiceSearchLaunchRecognizer()) {
|
} else if (mSearchable.getVoiceSearchLaunchRecognizer()) {
|
||||||
Intent appSearchIntent = createVoiceAppSearchIntent(mVoiceAppSearchIntent);
|
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);
|
getContext().startActivity(appSearchIntent);
|
||||||
}
|
}
|
||||||
} catch (ActivityNotFoundException e) {
|
} catch (ActivityNotFoundException e) {
|
||||||
|
|||||||
Reference in New Issue
Block a user