From ca111f9e4453bcfc3cdae49b7829d31fc4cdf3d1 Mon Sep 17 00:00:00 2001 From: Selim Cinek Date: Fri, 7 May 2021 18:56:25 +0200 Subject: Fixed an issue where the shade wouldn't stay open on unlock We shouldn't hide the keyguard if the shade should stay open Test: adb shell setprop persist.wm.enable_remote_keyguard_animation 1 Bug: 187516764 Change-Id: I0a14e4973ea8d228ba687372719d05d1ab588ef8 --- .../systemui/keyguard/KeyguardViewMediator.java | 23 +++++++++++----------- .../systemui/keyguard/dagger/KeyguardModule.java | 3 ++- .../keyguard/KeyguardViewMediatorTest.java | 4 ++-- 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java index 48f9a58d7d1a..36a0acc6fb4c 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java +++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java @@ -104,6 +104,7 @@ import com.android.systemui.keyguard.dagger.KeyguardModule; import com.android.systemui.navigationbar.NavigationModeController; import com.android.systemui.plugins.statusbar.StatusBarStateController; import com.android.systemui.shared.system.QuickStepContract; +import com.android.systemui.statusbar.SysuiStatusBarStateController; import com.android.systemui.statusbar.phone.BiometricUnlockController; import com.android.systemui.statusbar.phone.DozeParameters; import com.android.systemui.statusbar.phone.KeyguardBypassController; @@ -229,6 +230,7 @@ public class KeyguardViewMediator extends SystemUI implements Dumpable, private AlarmManager mAlarmManager; private AudioManager mAudioManager; private StatusBarManager mStatusBarManager; + private final SysuiStatusBarStateController mStatusBarStateController; private final Executor mUiBgExecutor; private boolean mSystemReady; @@ -779,7 +781,7 @@ public class KeyguardViewMediator extends SystemUI implements Dumpable, NavigationModeController navigationModeController, KeyguardDisplayManager keyguardDisplayManager, DozeParameters dozeParameters, - StatusBarStateController statusBarStateController, + SysuiStatusBarStateController statusBarStateController, KeyguardStateController keyguardStateController, Lazy keyguardUnlockAnimationControllerLazy) { super(context); @@ -808,6 +810,7 @@ public class KeyguardViewMediator extends SystemUI implements Dumpable, mInGestureNavigationMode = QuickStepContract.isGesturalMode(mode); })); mDozeParameters = dozeParameters; + mStatusBarStateController = statusBarStateController; statusBarStateController.addCallback(this); mKeyguardStateController = keyguardStateController; @@ -2100,19 +2103,17 @@ public class KeyguardViewMediator extends SystemUI implements Dumpable, playSounds(false); } - if (KeyguardService.sEnableRemoteKeyguardAnimation) { + // When remaining on the shade, there's no need to do a fancy remote animation, + // it will dismiss the panel in that case. + if (KeyguardService.sEnableRemoteKeyguardAnimation + && !mStatusBarStateController.leaveOpenOnKeyguardHide() + && apps != null && apps.length > 0) { mSurfaceBehindRemoteAnimationFinishedCallback = finishedCallback; mSurfaceBehindRemoteAnimationRunning = true; - if (apps != null && apps.length > 0) { - // Pass the surface and metadata to the unlock animation controller. - mKeyguardUnlockAnimationControllerLazy.get().notifyStartKeyguardExitAnimation( - apps[0], startTime, mSurfaceBehindRemoteAnimationRequested); - } else { - // We weren't given any surfaces to animate, so just finish. - onKeyguardExitRemoteAnimationFinished(); - return; - } + // Pass the surface and metadata to the unlock animation controller. + mKeyguardUnlockAnimationControllerLazy.get().notifyStartKeyguardExitAnimation( + apps[0], startTime, mSurfaceBehindRemoteAnimationRequested); } else { setShowingLocked(false); mWakeAndUnlocking = false; diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/dagger/KeyguardModule.java b/packages/SystemUI/src/com/android/systemui/keyguard/dagger/KeyguardModule.java index ecee1b508ce0..119e9c433f67 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/dagger/KeyguardModule.java +++ b/packages/SystemUI/src/com/android/systemui/keyguard/dagger/KeyguardModule.java @@ -47,6 +47,7 @@ import com.android.systemui.keyguard.KeyguardViewMediator; import com.android.systemui.navigationbar.NavigationModeController; import com.android.systemui.plugins.statusbar.StatusBarStateController; import com.android.systemui.statusbar.NotificationShadeWindowController; +import com.android.systemui.statusbar.SysuiStatusBarStateController; import com.android.systemui.statusbar.phone.DozeParameters; import com.android.systemui.statusbar.phone.KeyguardLiftController; import com.android.systemui.statusbar.phone.StatusBar; @@ -94,7 +95,7 @@ public class KeyguardModule { NavigationModeController navigationModeController, KeyguardDisplayManager keyguardDisplayManager, DozeParameters dozeParameters, - StatusBarStateController statusBarStateController, + SysuiStatusBarStateController statusBarStateController, KeyguardStateController keyguardStateController, Lazy keyguardUnlockAnimationController) { return new KeyguardViewMediator( 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 5c87741b8883..6f03f5d975d0 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/keyguard/KeyguardViewMediatorTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/keyguard/KeyguardViewMediatorTest.java @@ -46,7 +46,7 @@ import com.android.systemui.broadcast.BroadcastDispatcher; import com.android.systemui.classifier.FalsingCollectorFake; import com.android.systemui.dump.DumpManager; import com.android.systemui.navigationbar.NavigationModeController; -import com.android.systemui.plugins.statusbar.StatusBarStateController; +import com.android.systemui.statusbar.SysuiStatusBarStateController; import com.android.systemui.statusbar.phone.DozeParameters; import com.android.systemui.statusbar.phone.StatusBarKeyguardViewManager; import com.android.systemui.statusbar.policy.KeyguardStateController; @@ -79,7 +79,7 @@ public class KeyguardViewMediatorTest extends SysuiTestCase { private @Mock NavigationModeController mNavigationModeController; private @Mock KeyguardDisplayManager mKeyguardDisplayManager; private @Mock DozeParameters mDozeParameters; - private @Mock StatusBarStateController mStatusBarStateController; + private @Mock SysuiStatusBarStateController mStatusBarStateController; private @Mock KeyguardStateController mKeyguardStateController; private @Mock KeyguardUnlockAnimationController mKeyguardUnlockAnimationController; private DeviceConfigProxy mDeviceConfig = new DeviceConfigProxyFake(); -- cgit v1.2.3-59-g8ed1b