diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-10-05 19:06:45 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-10-05 19:06:45 +0000 |
commit | eec01732751bfc8b8caac4bb8a2869bf48b480d8 (patch) | |
tree | 20ed9f2b6472b0d649395c537931e34d4dec9228 | |
parent | 7930dad08a3700107b55e1483e0d398b4ef024ce (diff) | |
parent | 68f0e3c1b96b3fde4ef2872cda2c603fb64e4511 (diff) | |
download | base-eec01732751bfc8b8caac4bb8a2869bf48b480d8.tar.gz |
Merge cherrypicks of [20089250] into tm-qpr1-release.
Change-Id: Ia7590bcabebad1db56ad91cab3367d25a7c207d6
2 files changed, 29 insertions, 0 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java index 9d5392af3127..a0578fac2033 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManager.java @@ -733,6 +733,11 @@ public class StatusBarKeyguardViewManager implements RemoteInputController.Callb if (dozing || mBouncer.needsFullscreenBouncer() || mOccluded) { reset(dozing /* hideBouncerWhenShowing */); } + + if (bouncerIsOrWillBeShowing()) { + // Ensure bouncer is not shown when dozing state changes. + hideBouncer(false); + } updateStates(); if (!dozing) { diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManagerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManagerTest.java index dcce61b86ced..f52bfcaaaa44 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManagerTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/StatusBarKeyguardViewManagerTest.java @@ -23,9 +23,11 @@ import static org.mockito.ArgumentMatchers.anyFloat; import static org.mockito.ArgumentMatchers.anyInt; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.clearInvocations; +import static org.mockito.Mockito.doAnswer; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.never; import static org.mockito.Mockito.reset; +import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; @@ -525,4 +527,26 @@ public class StatusBarKeyguardViewManagerTest extends SysuiTestCase { mBouncerExpansionCallback.onVisibilityChanged(false); verify(mCentralSurfaces).setBouncerShowingOverDream(false); } + + + @Test + public void testSetDozing_bouncerShowing_Dozing() { + clearInvocations(mBouncer); + when(mBouncer.isShowing()).thenReturn(true); + doAnswer(invocation -> { + when(mBouncer.isShowing()).thenReturn(false); + return null; + }).when(mBouncer).hide(false); + mStatusBarKeyguardViewManager.onDozingChanged(true); + verify(mBouncer, times(1)).hide(false); + } + + @Test + public void testSetDozing_bouncerShowing_notDozing() { + mStatusBarKeyguardViewManager.onDozingChanged(true); + when(mBouncer.isShowing()).thenReturn(true); + clearInvocations(mBouncer); + mStatusBarKeyguardViewManager.onDozingChanged(false); + verify(mBouncer, times(1)).hide(false); + } } |