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

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

Merge "Show scrim state on systraces"

parents 5491881d 5866aafe
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -230,6 +230,7 @@ public class ScrimController implements ViewTreeObserver.OnPreDrawListener,

        final ScrimState oldState = mState;
        mState = state;
        Trace.traceCounter(Trace.TRACE_TAG_APP, "scrim_state", mState.getIndex());

        if (mCallback != null) {
            mCallback.onCancelled();
+16 −7
Original line number Diff line number Diff line
@@ -31,12 +31,12 @@ public enum ScrimState {
    /**
     * Initial state.
     */
    UNINITIALIZED,
    UNINITIALIZED(-1),

    /**
     * On the lock screen.
     */
    KEYGUARD {
    KEYGUARD(0) {

        @Override
        public void prepare(ScrimState previousState) {
@@ -61,7 +61,7 @@ public enum ScrimState {
    /**
     * Showing password challenge.
     */
    BOUNCER {
    BOUNCER(1) {
        @Override
        public void prepare(ScrimState previousState) {
            mCurrentBehindAlpha = ScrimController.SCRIM_BEHIND_ALPHA_UNLOCKING;
@@ -72,7 +72,7 @@ public enum ScrimState {
    /**
     * Changing screen brightness from quick settings.
     */
    BRIGHTNESS_MIRROR {
    BRIGHTNESS_MIRROR(2) {
        @Override
        public void prepare(ScrimState previousState) {
            mCurrentBehindAlpha = 0;
@@ -83,7 +83,7 @@ public enum ScrimState {
    /**
     * Always on display or screen off.
     */
    AOD {
    AOD(3) {
        @Override
        public void prepare(ScrimState previousState) {
            if (previousState == ScrimState.PULSING && !mCanControlScreenOff) {
@@ -106,7 +106,7 @@ public enum ScrimState {
    /**
     * When phone wakes up because you received a notification.
     */
    PULSING {
    PULSING(4) {
        @Override
        public void prepare(ScrimState previousState) {
            mCurrentInFrontAlpha = 0;
@@ -124,7 +124,7 @@ public enum ScrimState {
    /**
     * Unlocked on top of an app (launcher or any other activity.)
     */
    UNLOCKED {
    UNLOCKED(5) {
        @Override
        public void prepare(ScrimState previousState) {
            mCurrentBehindAlpha = 0;
@@ -164,6 +164,11 @@ public enum ScrimState {
    boolean mCanControlScreenOff;
    boolean mWallpaperSupportsAmbientMode;
    KeyguardUpdateMonitor mKeyguardUpdateMonitor;
    int mIndex;

    ScrimState(int index) {
        mIndex = index;
    }

    public void init(ScrimView scrimInFront, ScrimView scrimBehind, DozeParameters dozeParameters) {
        mScrimInFront = scrimInFront;
@@ -177,6 +182,10 @@ public enum ScrimState {
    public void prepare(ScrimState previousState) {
    }

    public int getIndex() {
        return mIndex;
    }

    public float getFrontAlpha() {
        return mCurrentInFrontAlpha;
    }