am c30d7676: am 1a846ab0: am b1578d85: Merge "Fix startSearch condition on Dialog, because pressing search key causes ANR popup. If search key is pressed on Dialog and there is no search item then do nothing. How to reproduce the issue: Settings > About phone > Legal 

* commit 'c30d767628861b0bbea907824682e47732c820f9':
  Fix startSearch condition on Dialog, because pressing search key causes ANR popup. If search key is pressed on Dialog and there is no search item then do nothing. How to reproduce the issue: Settings > About phone > Legal information > Google legal > Press search key > Touch list item or press back key > ANR popup is shown
diff --git a/core/java/android/app/Dialog.java b/core/java/android/app/Dialog.java
index 087753b..82186dd 100644
--- a/core/java/android/app/Dialog.java
+++ b/core/java/android/app/Dialog.java
@@ -931,7 +931,7 @@
 
         // associate search with owner activity
         final ComponentName appName = getAssociatedActivity();
-        if (appName != null) {
+        if (appName != null && searchManager.getSearchableInfo(appName) != null) {
             searchManager.startSearch(null, false, appName, null, false);
             dismiss();
             return true;