Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d2e16289 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Proto enum reference for App Transitions"

parents c110e17b 80d11a00
Loading
Loading
Loading
Loading
+1 −9
Original line number Diff line number Diff line
@@ -837,15 +837,7 @@ message AppStartChanged {
    // Device uptime when activity started.
    optional int64 activity_start_msec = 7;

    // TODO: Update android/app/ActivityManagerInternal.java constants to depend on our proto enum.
    enum TransitionReason {
        APP_START_TRANSITION_REASON_UNKNOWN = 0;
        SPLASH_SCREEN = 1;
        WINDOWS_DRAWN = 2;
        TIMEOUT = 3;
        SNAPSHOT = 4;
    }
    optional TransitionReason reason = 8;
    optional android.app.AppTransitionReasonEnum reason = 8;

    optional int32 transition_delay_msec = 9;
    // -1 if not set.
+8 −4
Original line number Diff line number Diff line
@@ -43,25 +43,29 @@ public abstract class ActivityManagerInternal {
     * Type for {@link #notifyAppTransitionStarting}: The transition was started because we drew
     * the splash screen.
     */
    public static final int APP_TRANSITION_SPLASH_SCREEN = 1;
    public static final int APP_TRANSITION_SPLASH_SCREEN =
              AppProtoEnums.APP_TRANSITION_SPLASH_SCREEN; // 1

    /**
     * Type for {@link #notifyAppTransitionStarting}: The transition was started because we all
     * app windows were drawn
     */
    public static final int APP_TRANSITION_WINDOWS_DRAWN = 2;
    public static final int APP_TRANSITION_WINDOWS_DRAWN =
              AppProtoEnums.APP_TRANSITION_WINDOWS_DRAWN; // 2

    /**
     * Type for {@link #notifyAppTransitionStarting}: The transition was started because of a
     * timeout.
     */
    public static final int APP_TRANSITION_TIMEOUT = 3;
    public static final int APP_TRANSITION_TIMEOUT =
              AppProtoEnums.APP_TRANSITION_TIMEOUT; // 3

    /**
     * Type for {@link #notifyAppTransitionStarting}: The transition was started because of a
     * we drew a task snapshot.
     */
    public static final int APP_TRANSITION_SNAPSHOT = 4;
    public static final int APP_TRANSITION_SNAPSHOT =
              AppProtoEnums.APP_TRANSITION_SNAPSHOT; // 4

    /**
     * The bundle key to extract the assist data.
+13 −0
Original line number Diff line number Diff line
@@ -21,6 +21,19 @@ package android.app;
option java_outer_classname = "AppProtoEnums";
option java_multiple_files = true;

// ActivityManagerInternal.java's APP_TRANSITION reasons.
enum AppTransitionReasonEnum {
    APP_TRANSITION_REASON_UNKNOWN = 0;
    // The transition was started because we drew the splash screen.
    APP_TRANSITION_SPLASH_SCREEN = 1;
    // The transition was started because we all app windows were drawn.
    APP_TRANSITION_WINDOWS_DRAWN = 2;
    // The transition was started because of a timeout.
    APP_TRANSITION_TIMEOUT = 3;
    // The transition was started because of a we drew a task snapshot.
    APP_TRANSITION_SNAPSHOT = 4;
}

// ActivityManager.java PROCESS_STATEs
enum ProcessStateEnum {
    // Unlike the ActivityManager PROCESS_STATE values, the ordering and numerical values