From 595c164aa6d67d19799fbc37b3ddb972ad5041f6 Mon Sep 17 00:00:00 2001 From: Chandru Date: Thu, 16 Jun 2022 16:12:45 +0000 Subject: [PATCH] Reset the keyguardGoingAway flag when keyguard is not dismissed. LockIconViewController relies on KeyguardStateController#isKeyguardGoingAway() to determine whether keyguard is currently showing or not. This flag is set to true when the keyguard is almost completely dismissed by swiping up, but it is never reset to false when the swipe up is cancelled at the last minute. This change resets the flag if the lockscreen is not dismissed. Fixes: 233845417 Test: manually Test: atest com.android.keyguard Test: atest com.android.systemui.statusbar Change-Id: Ia36b6bb15de87a1b343e62772d52cbc6c760a504 --- .../src/com/android/keyguard/LockIconViewController.java | 2 -- .../android/systemui/keyguard/KeyguardViewMediator.java | 2 +- .../systemui/keyguard/KeyguardViewMediatorTest.java | 7 +++++++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/SystemUI/src/com/android/keyguard/LockIconViewController.java b/packages/SystemUI/src/com/android/keyguard/LockIconViewController.java index c1b2aba22b578..43e7378236922 100644 --- a/packages/SystemUI/src/com/android/keyguard/LockIconViewController.java +++ b/packages/SystemUI/src/com/android/keyguard/LockIconViewController.java @@ -23,7 +23,6 @@ import static com.android.keyguard.LockIconView.ICON_LOCK; import static com.android.keyguard.LockIconView.ICON_UNLOCK; import static com.android.systemui.classifier.Classifier.LOCK_ICON; import static com.android.systemui.doze.util.BurnInHelperKt.getBurnInOffset; -import static com.android.systemui.doze.util.BurnInHelperKt.getBurnInProgressOffset; import android.content.res.Configuration; import android.content.res.Resources; @@ -403,7 +402,6 @@ public class LockIconViewController extends ViewController impleme float offsetY = MathUtils.lerp(0f, getBurnInOffset(mMaxBurnInOffsetY * 2, false /* xAxis */) - mMaxBurnInOffsetY, mInterpolatedDarkAmount); - float progress = MathUtils.lerp(0f, getBurnInProgressOffset(), mInterpolatedDarkAmount); mView.setTranslationX(offsetX); mView.setTranslationY(offsetY); diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java index be1725b798e27..6cd065ee271b3 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java +++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java @@ -2706,7 +2706,7 @@ public class KeyguardViewMediator extends CoreStartable implements Dumpable, /** Hides the surface behind the keyguard by re-showing the keyguard/activity lock screen. */ public void hideSurfaceBehindKeyguard() { mSurfaceBehindRemoteAnimationRequested = false; - + mKeyguardStateController.notifyKeyguardGoingAway(false); if (mShowing) { setShowingLocked(true, true); } 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 a80aed7a6d187..9b665555562ad 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/keyguard/KeyguardViewMediatorTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/keyguard/KeyguardViewMediatorTest.java @@ -203,6 +203,13 @@ public class KeyguardViewMediatorTest extends SysuiTestCase { mViewMediator.mViewMediatorCallback.getBouncerPromptReason()); } + @Test + public void testHideSurfaceBehindKeyguardMarksKeyguardNotGoingAway() { + mViewMediator.hideSurfaceBehindKeyguard(); + + verify(mKeyguardStateController).notifyKeyguardGoingAway(false); + } + private void createAndStartViewMediator() { mViewMediator = new KeyguardViewMediator( mContext,