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

Commit 7c481107 authored by Josh Tsuji's avatar Josh Tsuji Committed by Automerger Merge Worker
Browse files

Merge "Check isInteractive after traversal before hiding keyguard." into...

Merge "Check isInteractive after traversal before hiding keyguard." into udc-d1-dev am: 1592cec3 am: b7bfe91c

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/24548147



Change-Id: I3187c12862aeda8714df35b46cc257366666bff9
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 4c050349 b7bfe91c
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -3181,7 +3181,7 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable,
     *                        visible
     */
    public void exitKeyguardAndFinishSurfaceBehindRemoteAnimation(boolean showKeyguard) {
        Log.d(TAG, "onKeyguardExitRemoteAnimationFinished");
        Log.d(TAG, "exitKeyguardAndFinishSurfaceBehindRemoteAnimation");
        if (!mSurfaceBehindRemoteAnimationRunning && !mSurfaceBehindRemoteAnimationRequested) {
            Log.d(TAG, "skip onKeyguardExitRemoteAnimationFinished showKeyguard=" + showKeyguard
                    + " surfaceAnimationRunning=" + mSurfaceBehindRemoteAnimationRunning
@@ -3196,6 +3196,13 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable,

        // Post layout changes to the next frame, so we don't hang at the end of the animation.
        DejankUtils.postAfterTraversal(() -> {
            if (!mPM.isInteractive()) {
                Log.e(TAG, "exitKeyguardAndFinishSurfaceBehindRemoteAnimation#postAfterTraversal" +
                        "Not interactive after traversal. Don't hide the keyguard. This means we " +
                        "re-locked the device during unlock.");
                return;
            }

            onKeyguardExitFinished();

            if (mKeyguardStateController.isDismissingFromSwipe() || wasShowing) {
+1 −2
Original line number Diff line number Diff line
@@ -207,6 +207,7 @@ public class KeyguardViewMediatorTest extends SysuiTestCase {
        mSystemClock = new FakeSystemClock();
        when(mLockPatternUtils.getDevicePolicyManager()).thenReturn(mDevicePolicyManager);
        when(mPowerManager.newWakeLock(anyInt(), any())).thenReturn(mock(WakeLock.class));
        when(mPowerManager.isInteractive()).thenReturn(true);
        when(mInteractionJankMonitor.begin(any(), anyInt())).thenReturn(true);
        when(mInteractionJankMonitor.end(anyInt())).thenReturn(true);
        mContext.addMockSystemService(Context.ALARM_SERVICE, mAlarmManager);
@@ -821,8 +822,6 @@ public class KeyguardViewMediatorTest extends SysuiTestCase {
        when(mKeyguardStateController.isShowing()).thenReturn(true);
        TestableLooper.get(this).processAllMessages();

        when(mPowerManager.isInteractive()).thenReturn(true);

        mViewMediator.onSystemReady();
        TestableLooper.get(this).processAllMessages();