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
This commit is contained in:
Matt Pietal
2022-05-10 15:37:38 -04:00
parent 0547aacfd2
commit 2eeb2e73c5
2 changed files with 19 additions and 0 deletions

View File

@@ -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;
}

View File

@@ -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();
}
}