SearchManager.isVisible() is a hidden method that should
not be used by applications. Also, SearchManager.stopSearch()
already checks whether the search dialog is visible before
tryinf to dimiss it, so the check in Launcher was redundant.
void stopSearch() {
// Close search dialog
SearchManager searchManager = (SearchManager) getSystemService(Context.SEARCH_SERVICE);
- if (searchManager.isVisible()) {
- searchManager.stopSearch();
- }
+ searchManager.stopSearch();
// Restore search widget to its normal position
Search searchWidget = mWorkspace.findSearchWidgetOnCurrentScreen();
if (searchWidget != null) {