[VoiceInteraction] Move KEY_SHOW_SESSION_ID to VoiceInteractionSession
Bug: 265879545 Test: atest VoiceInteractionServiceNoSessionServiceTest Test: atest VoiceInteractionServiceTest Change-Id: Ibbbbfab55c696a7a57628c0ca30beab48e19a7f5
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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.
|
||||
* <p>
|
||||
* Type: int
|
||||
* </p>
|
||||
* @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)
|
||||
|
||||
@@ -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.
|
||||
* <p>
|
||||
* Type: int
|
||||
* </p>
|
||||
* @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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user