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

Commit 80d11a00 authored by Bookatz's avatar Bookatz
Browse files

Proto enum reference for App Transitions

App transitions, from ActivityManagerInternal, are now referenced via a
proto enum. This is also referenced by statsd's atoms.proto.

Bug: 69478930
Test: still compiles
Change-Id: Ifb5cb0120d4cd4e2464ce3b5a7455842cb55259c
parent a7070317
Loading
Loading
Loading
Loading
+1 −9
Original line number Diff line number Diff line
@@ -890,15 +890,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