diff options
Diffstat (limited to 'core/java/android/app/SearchManager.java')
| -rw-r--r-- | core/java/android/app/SearchManager.java | 33 |
1 files changed, 10 insertions, 23 deletions
diff --git a/core/java/android/app/SearchManager.java b/core/java/android/app/SearchManager.java index 93107ad4bfcb..95f55ab2fde9 100644 --- a/core/java/android/app/SearchManager.java +++ b/core/java/android/app/SearchManager.java @@ -16,6 +16,8 @@ package android.app; +import android.annotation.Nullable; +import android.annotation.SystemApi; import android.annotation.SystemService; import android.compat.annotation.UnsupportedAppUsage; import android.content.ActivityNotFoundException; @@ -973,37 +975,22 @@ public class SearchManager } /** - * Starts the assistant. + * Starts the {@link android.provider.Settings.Secure#ASSISTANT assistant}. * - * @param args the args to pass to the assistant + * @param args a {@code Bundle} that will be passed to the assistant's + * {@link android.service.voice.VoiceInteractionSession#onShow VoiceInteractionSession} + * (or as {@link Intent#getExtras() extras} along + * {@link Intent#ACTION_ASSIST ACTION_ASSIST} for legacy assistants) * * @hide */ - @UnsupportedAppUsage - public void launchAssist(Bundle args) { + @SystemApi + public void launchAssist(@Nullable Bundle args) { try { if (mService == null) { return; } - mService.launchAssist(args); - } catch (RemoteException re) { - throw re.rethrowFromSystemServer(); - } - } - - /** - * Starts the legacy assistant (i.e. the {@link Intent#ACTION_ASSIST}). - * - * @param args the args to pass to the assistant - * - * @hide - */ - public boolean launchLegacyAssist(String hint, int userHandle, Bundle args) { - try { - if (mService == null) { - return false; - } - return mService.launchLegacyAssist(hint, userHandle, args); + mService.launchAssist(mContext.getUserId(), args); } catch (RemoteException re) { throw re.rethrowFromSystemServer(); } |
