summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Josh Tsuji <tsuji@google.com> 2023-08-27 02:08:33 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2023-08-27 02:08:33 +0000
commit1592cec32d37cb5e66509fbaf9cdb7508ae2c06e (patch)
treec0e0c3d2ab9b1140752dfcd3e3360750f2913f90
parent3ebea2bc2e78196c7b3a2fa55a1e7bced32d5f03 (diff)
parent960185865090a85706d9225613aa0a4fbf76fdf1 (diff)
Merge "Check isInteractive after traversal before hiding keyguard." into udc-d1-dev
-rw-r--r--packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java9
-rw-r--r--packages/SystemUI/tests/src/com/android/systemui/keyguard/KeyguardViewMediatorTest.java3
2 files changed, 9 insertions, 3 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
index 49ae876b677e..00b300a0816f 100644
--- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
+++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java
@@ -3107,7 +3107,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
@@ -3122,6 +3122,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) {
diff --git a/packages/SystemUI/tests/src/com/android/systemui/keyguard/KeyguardViewMediatorTest.java b/packages/SystemUI/tests/src/com/android/systemui/keyguard/KeyguardViewMediatorTest.java
index cb2daca1fe97..6b23fbadfa44 100644
--- a/packages/SystemUI/tests/src/com/android/systemui/keyguard/KeyguardViewMediatorTest.java
+++ b/packages/SystemUI/tests/src/com/android/systemui/keyguard/KeyguardViewMediatorTest.java
@@ -182,6 +182,7 @@ public class KeyguardViewMediatorTest extends SysuiTestCase {
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);
final ViewRootImpl testViewRoot = mock(ViewRootImpl.class);
@@ -708,8 +709,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();