From 2eeb2e73c522c77a184275100869b878292196fb Mon Sep 17 00:00:00 2001 From: Matt Pietal Date: Tue, 10 May 2022 15:37:38 -0400 Subject: [PATCH] SIM - Resume view controller On power off/on, the fullscreen bouncer gets paused but never resumed. Make sure the subsequent calls to show resume the view controllers. Fixes: 231530217 Test: atest KeyguardBouncerTest Change-Id: I4bfa0d7155f6e39666bf5c1e82ccc6464d5ee8ab --- .../systemui/statusbar/phone/KeyguardBouncer.java | 4 ++++ .../statusbar/phone/KeyguardBouncerTest.java | 15 +++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java index 0b721383e2d19..8792118fb9ef2 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBouncer.java @@ -188,6 +188,10 @@ public class KeyguardBouncer { } if (mContainer.getVisibility() == View.VISIBLE || mShowingSoon) { + // Calls to reset must resume the ViewControllers when in fullscreen mode + if (needsFullscreenBouncer()) { + mKeyguardViewController.onResume(); + } return; } diff --git a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardBouncerTest.java b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardBouncerTest.java index f43c2a1834657..9c02216722e2b 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardBouncerTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/statusbar/phone/KeyguardBouncerTest.java @@ -475,4 +475,19 @@ public class KeyguardBouncerTest extends SysuiTestCase { mBouncer.setExpansion(bouncerHideAmount); verify(callback, never()).onExpansionChanged(bouncerHideAmount); } + + @Test + public void testOnResumeCalledForFullscreenBouncerOnSecondShow() { + // GIVEN a security mode which requires fullscreen bouncer + when(mKeyguardSecurityModel.getSecurityMode(anyInt())) + .thenReturn(KeyguardSecurityModel.SecurityMode.SimPin); + mBouncer.show(true); + + // WHEN a second call to show occurs, the bouncer will already by visible + reset(mKeyguardHostViewController); + mBouncer.show(true); + + // THEN ensure the ViewController is told to resume + verify(mKeyguardHostViewController).onResume(); + } }