diff options
author | Dianne Hackborn <hackbod@google.com> | 2013-01-23 14:39:13 -0800 |
---|---|---|
committer | Dianne Hackborn <hackbod@google.com> | 2013-01-23 14:39:13 -0800 |
commit | f9c5e0fe837a3090820da502ecaabc5accc00ace (patch) | |
tree | bbc72079c958f69d9906f4a4ae803dd88fcf8083 /policy | |
parent | cc7433470f00fac3bbe7835de3ded4b9bf121244 (diff) | |
download | frameworks_base-f9c5e0fe837a3090820da502ecaabc5accc00ace.zip frameworks_base-f9c5e0fe837a3090820da502ecaabc5accc00ace.tar.gz frameworks_base-f9c5e0fe837a3090820da502ecaabc5accc00ace.tar.bz2 |
Add new API to propagate contextual data to the assist action
When launching an assist, we have a new API allowing the
current foreground activity/application to provide additional
arbitrary contextual information that is stuffed in the
assist intent before it is launched.
Change-Id: I0b2a6f5a266dc42cc0175327fa76774f814af3b4
Diffstat (limited to 'policy')
4 files changed, 6 insertions, 6 deletions
diff --git a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java index b5cbdd1..35ff3d6 100644 --- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java +++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java @@ -2206,7 +2206,7 @@ public class PhoneWindowManager implements WindowManagerPolicy { private void launchAssistAction() { sendCloseSystemWindows(SYSTEM_DIALOG_REASON_ASSIST); Intent intent = ((SearchManager) mContext.getSystemService(Context.SEARCH_SERVICE)) - .getAssistIntent(mContext, UserHandle.USER_CURRENT); + .getAssistIntent(mContext, true, UserHandle.USER_CURRENT); if (intent != null) { intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_SINGLE_TOP diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java index 217e5d7..27d808b 100644 --- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java +++ b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java @@ -1567,7 +1567,7 @@ public class KeyguardHostView extends KeyguardViewBase { public void showAssistant() { final Intent intent = ((SearchManager) mContext.getSystemService(Context.SEARCH_SERVICE)) - .getAssistIntent(mContext, UserHandle.USER_CURRENT); + .getAssistIntent(mContext, true, UserHandle.USER_CURRENT); if (intent == null) return; diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardSelectorView.java b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardSelectorView.java index 76cbbd5..6859042 100644 --- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardSelectorView.java +++ b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardSelectorView.java @@ -61,7 +61,7 @@ public class KeyguardSelectorView extends LinearLayout implements KeyguardSecuri case com.android.internal.R.drawable.ic_action_assist_generic: Intent assistIntent = ((SearchManager) mContext.getSystemService(Context.SEARCH_SERVICE)) - .getAssistIntent(mContext, UserHandle.USER_CURRENT); + .getAssistIntent(mContext, true, UserHandle.USER_CURRENT); if (assistIntent != null) { mActivityLauncher.launchActivity(assistIntent, false, true, null, null); } else { @@ -195,7 +195,7 @@ public class KeyguardSelectorView extends LinearLayout implements KeyguardSecuri currentUserHandle); boolean searchActionAvailable = ((SearchManager) mContext.getSystemService(Context.SEARCH_SERVICE)) - .getAssistIntent(mContext, UserHandle.USER_CURRENT) != null; + .getAssistIntent(mContext, false, UserHandle.USER_CURRENT) != null; mCameraDisabled = cameraDisabledByAdmin || disabledBySimState || !cameraTargetPresent || !currentUserSetup; mSearchDisabled = disabledBySimState || !searchActionAvailable || !searchTargetPresent @@ -207,7 +207,7 @@ public class KeyguardSelectorView extends LinearLayout implements KeyguardSecuri // Update the search icon with drawable from the search .apk if (!mSearchDisabled) { Intent intent = ((SearchManager) mContext.getSystemService(Context.SEARCH_SERVICE)) - .getAssistIntent(mContext, UserHandle.USER_CURRENT); + .getAssistIntent(mContext, false, UserHandle.USER_CURRENT); if (intent != null) { // XXX Hack. We need to substitute the icon here but haven't formalized // the public API. The "_google" metadata will be going away, so diff --git a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewMediator.java b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewMediator.java index fef0613..8e10528 100644 --- a/policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewMediator.java +++ b/policy/src/com/android/internal/policy/impl/keyguard/KeyguardViewMediator.java @@ -1428,6 +1428,6 @@ public class KeyguardViewMediator { private boolean isAssistantAvailable() { return mSearchManager != null - && mSearchManager.getAssistIntent(mContext, UserHandle.USER_CURRENT) != null; + && mSearchManager.getAssistIntent(mContext, false, UserHandle.USER_CURRENT) != null; } } |