Merge change 8111 into donut
* changes:
Don't start search from a dialog if there is no activity associated with the search manager at that point.
diff --git a/core/java/android/app/Dialog.java b/core/java/android/app/Dialog.java
index 444f222..9432755 100644
--- a/core/java/android/app/Dialog.java
+++ b/core/java/android/app/Dialog.java
@@ -788,6 +788,11 @@
final SearchManager searchManager = (SearchManager) mContext
.getSystemService(Context.SEARCH_SERVICE);
+ // can't start search without an associated activity (e.g a system dialog)
+ if (!searchManager.hasIdent()) {
+ return false;
+ }
+
// associate search with owner activity if possible (otherwise it will default to
// global search).
final ComponentName appName = mOwnerActivity == null ? null
diff --git a/core/java/android/app/SearchManager.java b/core/java/android/app/SearchManager.java
index c98d966..0631ad5 100644
--- a/core/java/android/app/SearchManager.java
+++ b/core/java/android/app/SearchManager.java
@@ -1536,6 +1536,10 @@
mService = ISearchManager.Stub.asInterface(
ServiceManager.getService(Context.SEARCH_SERVICE));
}
+
+ /*package*/ boolean hasIdent() {
+ return mIdent != 0;
+ }
/*package*/ void setIdent(int ident) {
if (mIdent != 0) {