diff options
author | Karl Rosaen <krosaen@google.com> | 2009-07-14 16:03:39 -0700 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2009-07-14 16:03:39 -0700 |
commit | ce63850ff0bbea1a4b418fee272436c47d60e67a (patch) | |
tree | e212bbb75782086dc27e4766a03ccd0cfbc7d89e /core/java | |
parent | 4764605109a0dd993a805b368897f93ab29e8996 (diff) | |
parent | 53d24af774ad943ff26ef529c949f9c433806421 (diff) | |
download | frameworks_base-ce63850ff0bbea1a4b418fee272436c47d60e67a.zip frameworks_base-ce63850ff0bbea1a4b418fee272436c47d60e67a.tar.gz frameworks_base-ce63850ff0bbea1a4b418fee272436c47d60e67a.tar.bz2 |
am 53d24af7: Respect onSearchRequested in Dialog and actually launch search. Also dismiss self.
Merge commit '53d24af774ad943ff26ef529c949f9c433806421'
* commit '53d24af774ad943ff26ef529c949f9c433806421':
Respect onSearchRequested in Dialog and actually launch search. Also dismiss self.
Diffstat (limited to 'core/java')
-rw-r--r-- | core/java/android/app/Dialog.java | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/core/java/android/app/Dialog.java b/core/java/android/app/Dialog.java index 1330912..444f222 100644 --- a/core/java/android/app/Dialog.java +++ b/core/java/android/app/Dialog.java @@ -20,6 +20,7 @@ import com.android.internal.policy.PolicyManager; import android.content.Context; import android.content.DialogInterface; +import android.content.ComponentName; import android.graphics.drawable.Drawable; import android.net.Uri; import android.os.Bundle; @@ -784,8 +785,17 @@ public class Dialog implements DialogInterface, Window.Callback, * This hook is called when the user signals the desire to start a search. */ public boolean onSearchRequested() { - // not during dialogs, no. - return false; + final SearchManager searchManager = (SearchManager) mContext + .getSystemService(Context.SEARCH_SERVICE); + + // associate search with owner activity if possible (otherwise it will default to + // global search). + final ComponentName appName = mOwnerActivity == null ? null + : mOwnerActivity.getComponentName(); + final boolean globalSearch = (appName == null); + searchManager.startSearch(null, false, appName, null, globalSearch); + dismiss(); + return true; } |