Loading packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java +6 −0 Original line number Diff line number Diff line Loading @@ -3428,6 +3428,12 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable, return; } if (mIsKeyguardExitAnimationCanceled) { Log.d(TAG, "Ignoring exitKeyguardAndFinishSurfaceBehindRemoteAnimation. " + "mIsKeyguardExitAnimationCanceled==true"); return; } // Block the panel from expanding, in case we were doing a swipe to dismiss gesture. mKeyguardViewControllerLazy.get().blockPanelExpansionFromCurrentTouch(); final boolean wasShowing = mShowing; Loading packages/SystemUI/tests/src/com/android/systemui/keyguard/KeyguardViewMediatorTest.java +28 −0 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ import static com.android.internal.widget.LockPatternUtils.StrongAuthTracker.STR import static com.android.internal.widget.LockPatternUtils.StrongAuthTracker.STRONG_AUTH_REQUIRED_AFTER_NON_STRONG_BIOMETRICS_TIMEOUT; import static com.android.internal.widget.LockPatternUtils.StrongAuthTracker.STRONG_AUTH_REQUIRED_AFTER_USER_LOCKDOWN; import static com.android.systemui.Flags.FLAG_KEYGUARD_WM_STATE_REFACTOR; import static com.android.systemui.Flags.FLAG_RELOCK_WITH_POWER_BUTTON_IMMEDIATELY; import static com.android.systemui.Flags.FLAG_SIM_PIN_BOUNCER_RESET; import static com.android.systemui.keyguard.KeyguardViewMediator.DELAYED_KEYGUARD_ACTION; import static com.android.systemui.keyguard.KeyguardViewMediator.KEYGUARD_LOCK_AFTER_DELAY_DEFAULT; Loading Loading @@ -63,6 +64,7 @@ import android.content.Context; import android.os.PowerManager; import android.os.PowerManager.WakeLock; import android.os.RemoteException; import android.platform.test.annotations.DisableFlags; import android.platform.test.annotations.EnableFlags; import android.telephony.TelephonyManager; import android.testing.AndroidTestingRunner; Loading Loading @@ -841,6 +843,32 @@ public class KeyguardViewMediatorTest extends SysuiTestCase { @Test @TestableLooper.RunWithLooper(setAsMainLooper = true) @EnableFlags(FLAG_RELOCK_WITH_POWER_BUTTON_IMMEDIATELY) public void testCancelKeyguardExitAnimationDueToSleep_withPendingLockAndRelockFlag_keyguardWillBeShowing() { startMockKeyguardExitAnimation(); mViewMediator.onStartedGoingToSleep(PowerManager.GO_TO_SLEEP_REASON_POWER_BUTTON); mViewMediator.onFinishedGoingToSleep(PowerManager.GO_TO_SLEEP_REASON_POWER_BUTTON, false); cancelMockKeyguardExitAnimation(); mViewMediator.maybeHandlePendingLock(); TestableLooper.get(this).processAllMessages(); assertTrue(mViewMediator.isShowingAndNotOccluded()); verify(mKeyguardUnlockAnimationController).notifyFinishedKeyguardExitAnimation(true); // Unlock animators call `exitKeyguardAndFinishSurfaceBehindRemoteAnimation` when canceled mViewMediator.exitKeyguardAndFinishSurfaceBehindRemoteAnimation(false); TestableLooper.get(this).processAllMessages(); verify(mUpdateMonitor, never()).dispatchKeyguardDismissAnimationFinished(); } @Test @TestableLooper.RunWithLooper(setAsMainLooper = true) @DisableFlags(FLAG_RELOCK_WITH_POWER_BUTTON_IMMEDIATELY) public void testCancelKeyguardExitAnimationDueToSleep_withPendingLock_keyguardWillBeShowing() { startMockKeyguardExitAnimation(); Loading Loading
packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java +6 −0 Original line number Diff line number Diff line Loading @@ -3428,6 +3428,12 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable, return; } if (mIsKeyguardExitAnimationCanceled) { Log.d(TAG, "Ignoring exitKeyguardAndFinishSurfaceBehindRemoteAnimation. " + "mIsKeyguardExitAnimationCanceled==true"); return; } // Block the panel from expanding, in case we were doing a swipe to dismiss gesture. mKeyguardViewControllerLazy.get().blockPanelExpansionFromCurrentTouch(); final boolean wasShowing = mShowing; Loading
packages/SystemUI/tests/src/com/android/systemui/keyguard/KeyguardViewMediatorTest.java +28 −0 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ import static com.android.internal.widget.LockPatternUtils.StrongAuthTracker.STR import static com.android.internal.widget.LockPatternUtils.StrongAuthTracker.STRONG_AUTH_REQUIRED_AFTER_NON_STRONG_BIOMETRICS_TIMEOUT; import static com.android.internal.widget.LockPatternUtils.StrongAuthTracker.STRONG_AUTH_REQUIRED_AFTER_USER_LOCKDOWN; import static com.android.systemui.Flags.FLAG_KEYGUARD_WM_STATE_REFACTOR; import static com.android.systemui.Flags.FLAG_RELOCK_WITH_POWER_BUTTON_IMMEDIATELY; import static com.android.systemui.Flags.FLAG_SIM_PIN_BOUNCER_RESET; import static com.android.systemui.keyguard.KeyguardViewMediator.DELAYED_KEYGUARD_ACTION; import static com.android.systemui.keyguard.KeyguardViewMediator.KEYGUARD_LOCK_AFTER_DELAY_DEFAULT; Loading Loading @@ -63,6 +64,7 @@ import android.content.Context; import android.os.PowerManager; import android.os.PowerManager.WakeLock; import android.os.RemoteException; import android.platform.test.annotations.DisableFlags; import android.platform.test.annotations.EnableFlags; import android.telephony.TelephonyManager; import android.testing.AndroidTestingRunner; Loading Loading @@ -841,6 +843,32 @@ public class KeyguardViewMediatorTest extends SysuiTestCase { @Test @TestableLooper.RunWithLooper(setAsMainLooper = true) @EnableFlags(FLAG_RELOCK_WITH_POWER_BUTTON_IMMEDIATELY) public void testCancelKeyguardExitAnimationDueToSleep_withPendingLockAndRelockFlag_keyguardWillBeShowing() { startMockKeyguardExitAnimation(); mViewMediator.onStartedGoingToSleep(PowerManager.GO_TO_SLEEP_REASON_POWER_BUTTON); mViewMediator.onFinishedGoingToSleep(PowerManager.GO_TO_SLEEP_REASON_POWER_BUTTON, false); cancelMockKeyguardExitAnimation(); mViewMediator.maybeHandlePendingLock(); TestableLooper.get(this).processAllMessages(); assertTrue(mViewMediator.isShowingAndNotOccluded()); verify(mKeyguardUnlockAnimationController).notifyFinishedKeyguardExitAnimation(true); // Unlock animators call `exitKeyguardAndFinishSurfaceBehindRemoteAnimation` when canceled mViewMediator.exitKeyguardAndFinishSurfaceBehindRemoteAnimation(false); TestableLooper.get(this).processAllMessages(); verify(mUpdateMonitor, never()).dispatchKeyguardDismissAnimationFinished(); } @Test @TestableLooper.RunWithLooper(setAsMainLooper = true) @DisableFlags(FLAG_RELOCK_WITH_POWER_BUTTON_IMMEDIATELY) public void testCancelKeyguardExitAnimationDueToSleep_withPendingLock_keyguardWillBeShowing() { startMockKeyguardExitAnimation(); Loading