Fix window leak and receiver leak. Bug: 2520143 and Bug: 2517390
In Activity.onDestroy close any open SearchDialog to avoid a window leak.
Register/unregister broadcast receiver in onStart/onStop of the dialog.
diff --git a/core/java/android/app/Activity.java b/core/java/android/app/Activity.java
index 3c5a1c7..a962391 100644
--- a/core/java/android/app/Activity.java
+++ b/core/java/android/app/Activity.java
@@ -1320,6 +1320,11 @@
}
mManagedCursors.clear();
}
+
+ // Close any open search dialog
+ if (mSearchManager != null) {
+ mSearchManager.stopSearch();
+ }
}
/**