diff --git a/core/api/current.txt b/core/api/current.txt index 9e4c958737704..b3b7c6dfe65df 100644 --- a/core/api/current.txt +++ b/core/api/current.txt @@ -40563,7 +40563,6 @@ package android.service.voice { method public void setDisabledShowContext(int); method public final void setUiHints(@NonNull android.os.Bundle); method public void showSession(android.os.Bundle, int); - field public static final String KEY_SHOW_SESSION_ID = "android.service.voice.SHOW_SESSION_ID"; field public static final String SERVICE_INTERFACE = "android.service.voice.VoiceInteractionService"; field public static final String SERVICE_META_DATA = "android.voice_interaction"; } @@ -40624,6 +40623,7 @@ package android.service.voice { method public void startAssistantActivity(android.content.Intent); method public void startVoiceActivity(android.content.Intent); method public final void unregisterVisibleActivityCallback(@NonNull android.service.voice.VoiceInteractionSession.VisibleActivityCallback); + field public static final String KEY_SHOW_SESSION_ID = "android.service.voice.SHOW_SESSION_ID"; field public static final int SHOW_SOURCE_ACTIVITY = 16; // 0x10 field public static final int SHOW_SOURCE_APPLICATION = 8; // 0x8 field public static final int SHOW_SOURCE_ASSIST_GESTURE = 4; // 0x4 diff --git a/core/java/android/service/voice/VoiceInteractionService.java b/core/java/android/service/voice/VoiceInteractionService.java index df739e3571444..ca4716bacc2f2 100644 --- a/core/java/android/service/voice/VoiceInteractionService.java +++ b/core/java/android/service/voice/VoiceInteractionService.java @@ -94,20 +94,6 @@ public class VoiceInteractionService extends Service { */ public static final String SERVICE_META_DATA = "android.voice_interaction"; - /** - * Bundle key used to specify the id when the system prepares to show session. It increases for - * each request. - *

- * Type: int - *

- * @see #showSession(Bundle, int) - * @see #onPrepareToShowSession(Bundle, int) - * @see #onShowSessionFailed(Bundle) - * @see VoiceInteractionSession#onShow(Bundle, int) - * @see VoiceInteractionSession#show(Bundle, int) - */ - public static final String KEY_SHOW_SESSION_ID = "android.service.voice.SHOW_SESSION_ID"; - /** * For apps targeting Build.VERSION_CODES.TRAMISU and above, implementors of this * service can create multiple AlwaysOnHotwordDetector instances in parallel. They will @@ -219,7 +205,7 @@ public class VoiceInteractionService extends Service { * bind the session service. * * @param args The arguments that were supplied to {@link #showSession(Bundle, int)}. - * It always includes {@link #KEY_SHOW_SESSION_ID}. + * It always includes {@link VoiceInteractionSession#KEY_SHOW_SESSION_ID}. * @param flags The show flags originally provided to {@link #showSession(Bundle, int)}. * @see #showSession(Bundle, int) * @see #onShowSessionFailed(Bundle) @@ -233,7 +219,7 @@ public class VoiceInteractionService extends Service { * Called when the show session failed. E.g. When the system bound the session service failed. * * @param args Additional info about the show session attempt that failed. For now, includes - * {@link #KEY_SHOW_SESSION_ID}. + * {@link VoiceInteractionSession#KEY_SHOW_SESSION_ID}. * @see #showSession(Bundle, int) * @see #onPrepareToShowSession(Bundle, int) * @see VoiceInteractionSession#onShow(Bundle, int) diff --git a/core/java/android/service/voice/VoiceInteractionSession.java b/core/java/android/service/voice/VoiceInteractionSession.java index d55fedefb5cbb..0d513951a4a7c 100644 --- a/core/java/android/service/voice/VoiceInteractionSession.java +++ b/core/java/android/service/voice/VoiceInteractionSession.java @@ -169,6 +169,20 @@ public class VoiceInteractionSession implements KeyEvent.Callback, ComponentCall @Retention(RetentionPolicy.SOURCE) public @interface VoiceInteractionActivityEventType{} + /** + * Bundle key used to specify the id when the system prepares to show session. It increases for + * each request. + *

+ * Type: int + *

+ * @see VoiceInteractionService#showSession(Bundle, int) + * @see VoiceInteractionService#onPrepareToShowSession(Bundle, int) + * @see VoiceInteractionService#onShowSessionFailed(Bundle) + * @see #onShow(Bundle, int) + * @see #show(Bundle, int) + */ + public static final String KEY_SHOW_SESSION_ID = "android.service.voice.SHOW_SESSION_ID"; + final Context mContext; final HandlerCaller mHandlerCaller; @@ -1763,7 +1777,7 @@ public class VoiceInteractionSession implements KeyEvent.Callback, ComponentCall * @param args The arguments that were supplied to * {@link VoiceInteractionService#showSession VoiceInteractionService.showSession}. * Some example keys include : "invocation_type", "invocation_phone_state", - * {@link VoiceInteractionService#KEY_SHOW_SESSION_ID}, "invocation_time_ms", + * {@link #KEY_SHOW_SESSION_ID}, "invocation_time_ms", * Intent.EXTRA_TIME ("android.intent.extra.TIME") indicating timing * in milliseconds of the KeyEvent that triggered Assistant and * Intent.EXTRA_ASSIST_INPUT_DEVICE_ID (android.intent.extra.ASSIST_INPUT_DEVICE_ID) diff --git a/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerServiceImpl.java b/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerServiceImpl.java index 04c8f8f31bc28..127195c4f9d3c 100644 --- a/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerServiceImpl.java +++ b/services/voiceinteraction/java/com/android/server/voiceinteraction/VoiceInteractionManagerServiceImpl.java @@ -21,7 +21,7 @@ import static android.app.ActivityManager.START_ASSISTANT_NOT_ACTIVE_SESSION; import static android.app.ActivityManager.START_VOICE_HIDDEN_SESSION; import static android.app.ActivityManager.START_VOICE_NOT_ACTIVE_SESSION; import static android.app.WindowConfiguration.ACTIVITY_TYPE_ASSISTANT; -import static android.service.voice.VoiceInteractionService.KEY_SHOW_SESSION_ID; +import static android.service.voice.VoiceInteractionSession.KEY_SHOW_SESSION_ID; import static com.android.server.policy.PhoneWindowManager.SYSTEM_DIALOG_REASON_ASSIST;