diff options
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/app/ISearchManager.aidl | 4 | ||||
| -rw-r--r-- | core/java/android/app/SearchManager.java | 49 |
2 files changed, 28 insertions, 25 deletions
diff --git a/core/java/android/app/ISearchManager.aidl b/core/java/android/app/ISearchManager.aidl index 6094012db0f8..0d09e4a92d7b 100644 --- a/core/java/android/app/ISearchManager.aidl +++ b/core/java/android/app/ISearchManager.aidl @@ -30,6 +30,6 @@ interface ISearchManager { List<ResolveInfo> getGlobalSearchActivities(); ComponentName getGlobalSearchActivity(); ComponentName getWebSearchActivity(); - ComponentName getAssistIntent(int userHandle); - boolean launchAssistAction(String hint, int userHandle, in Bundle args); + void launchAssist(in Bundle args); + boolean launchLegacyAssist(String hint, int userHandle, in Bundle args); } diff --git a/core/java/android/app/SearchManager.java b/core/java/android/app/SearchManager.java index 45799a1e44ce..9e321644c902 100644 --- a/core/java/android/app/SearchManager.java +++ b/core/java/android/app/SearchManager.java @@ -946,27 +946,9 @@ public class SearchManager * * @hide */ - public Intent getAssistIntent(Context context, boolean inclContext) { - return getAssistIntent(context, inclContext, UserHandle.myUserId()); - } - - /** - * Gets an intent for launching installed assistant activity, or null if not available. - * @return The assist intent. - * - * @hide - */ - public Intent getAssistIntent(Context context, boolean inclContext, int userHandle) { + public Intent getAssistIntent(boolean inclContext) { try { - if (mService == null) { - return null; - } - ComponentName comp = mService.getAssistIntent(userHandle); - if (comp == null) { - return null; - } Intent intent = new Intent(Intent.ACTION_ASSIST); - intent.setComponent(comp); if (inclContext) { IActivityManager am = ActivityManagerNative.getDefault(); Bundle extras = am.getAssistContextExtras(ActivityManager.ASSIST_CONTEXT_BASIC); @@ -982,17 +964,38 @@ public class SearchManager } /** - * Launch an assist action for the current top activity. + * Starts the assistant. + * + * @param args the args to pass to the assistant + * + * @hide + */ + public void launchAssist(Bundle args) { + try { + if (mService == null) { + return; + } + mService.launchAssist(args); + } catch (RemoteException re) { + Log.e(TAG, "launchAssist() failed: " + re); + } + } + + /** + * Starts the legacy assistant (i.e. the {@link Intent#ACTION_ASSIST}). + * + * @param args the args to pass to the assistant + * * @hide */ - public boolean launchAssistAction(String hint, int userHandle, Bundle args) { + public boolean launchLegacyAssist(String hint, int userHandle, Bundle args) { try { if (mService == null) { return false; } - return mService.launchAssistAction(hint, userHandle, args); + return mService.launchLegacyAssist(hint, userHandle, args); } catch (RemoteException re) { - Log.e(TAG, "launchAssistAction() failed: " + re); + Log.e(TAG, "launchAssist() failed: " + re); return false; } } |
