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

Commit d7a39f77 authored by Robin Lee's avatar Robin Lee Committed by Android (Google) Code Review
Browse files

Merge "Move writeWmSetKeyguardShown to a method" into main

parents eb306b9b d9d71487
Loading
Loading
Loading
Loading
+14 −24
Original line number Diff line number Diff line
@@ -197,14 +197,6 @@ class KeyguardController {
            setWakeTransitionReady();
            return;
        }
        EventLogTags.writeWmSetKeyguardShown(
                displayId,
                keyguardShowing ? 1 : 0,
                aodShowing ? 1 : 0,
                state.mKeyguardGoingAway ? 1 : 0,
                state.mOccluded ? 1 : 0,
                "setKeyguardShown");

        // Update the task snapshot if the screen will not be turned off. To make sure that the
        // unlocking animation can animate consistent content. The conditions are:
        // - Either AOD or keyguard changes to be showing. So if the states change individually,
@@ -223,6 +215,7 @@ class KeyguardController {

        state.mKeyguardShowing = keyguardShowing;
        state.mAodShowing = aodShowing;
        state.writeEventLog("setKeyguardShown");

        if (keyguardChanged) {
            // Irrelevant to AOD.
@@ -277,13 +270,7 @@ class KeyguardController {
        mService.deferWindowLayout();
        state.mKeyguardGoingAway = true;
        try {
            EventLogTags.writeWmSetKeyguardShown(
                    displayId,
                    state.mKeyguardShowing ? 1 : 0,
                    state.mAodShowing ? 1 : 0,
                    1 /* keyguardGoingAway */,
                    state.mOccluded ? 1 : 0,
                    "keyguardGoingAway");
            state.writeEventLog("keyguardGoingAway");
            final int transitFlags = convertTransitFlags(flags);
            final DisplayContent dc = mRootWindowContainer.getDefaultDisplay();
            dc.prepareAppTransition(TRANSIT_KEYGUARD_GOING_AWAY, transitFlags);
@@ -639,6 +626,16 @@ class KeyguardController {
            mSleepTokenAcquirer.release(mDisplayId);
        }

        void writeEventLog(String reason) {
            EventLogTags.writeWmSetKeyguardShown(
                    mDisplayId,
                    mKeyguardShowing ? 1 : 0,
                    mAodShowing ? 1 : 0,
                    mKeyguardGoingAway ? 1 : 0,
                    mOccluded ? 1 : 0,
                    reason);
        }

        /**
         * Updates keyguard status if the top task could be visible. The top task may occlude
         * keyguard, request to dismiss keyguard or make insecure keyguard go away based on its
@@ -709,18 +706,11 @@ class KeyguardController {

            boolean hasChange = false;
            if (lastOccluded != mOccluded) {
                if (mDisplayId == DEFAULT_DISPLAY) {
                    EventLogTags.writeWmSetKeyguardShown(
                            mDisplayId,
                            mKeyguardShowing ? 1 : 0,
                            mAodShowing ? 1 : 0,
                            mKeyguardGoingAway ? 1 : 0,
                            mOccluded ? 1 : 0,
                            "updateVisibility");
                }
                writeEventLog("updateVisibility");
                controller.handleOccludedChanged(mDisplayId, mTopOccludesActivity);
                hasChange = true;
            } else if (!lastKeyguardGoingAway && mKeyguardGoingAway) {
                writeEventLog("dismissIfInsecure");
                controller.handleKeyguardGoingAwayChanged(display);
                hasChange = true;
            }