Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2ada856c authored by Nicolo' Mazzucato's avatar Nicolo' Mazzucato
Browse files

Fix sidefps not visible after home-control longpress

This updates the state of sidefps hint all times the KeyguardSecurityView is resumed.

Test: KeyguardSecurityContainerControllerTest
Bug: 241929405
Change-Id: I11b90a2c03d9b9b422eac33717cc40e77dd78581
parent ae817376
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -418,6 +418,7 @@ public class KeyguardSecurityContainerController extends ViewController<Keyguard
            SysUiStatsLog.write(SysUiStatsLog.KEYGUARD_BOUNCER_STATE_CHANGED, state);

            getCurrentSecurityController().onResume(reason);
            updateSideFpsVisibility();
        }
        mView.onResume(
                mSecurityModel.getSecurityMode(KeyguardUpdateMonitor.getCurrentUser()),
+27 −0
Original line number Diff line number Diff line
@@ -386,6 +386,33 @@ public class KeyguardSecurityContainerControllerTest extends SysuiTestCase {
        verify(mSidefpsController, never()).show();
    }

    @Test
    public void onResume_sideFpsHintShouldBeShown_sideFpsHintShown() {
        setupGetSecurityView();
        setupConditionsToEnableSideFpsHint();
        mKeyguardSecurityContainerController.onBouncerVisibilityChanged(View.VISIBLE);
        reset(mSidefpsController);

        mKeyguardSecurityContainerController.onResume(0);

        verify(mSidefpsController).show();
        verify(mSidefpsController, never()).hide();
    }

    @Test
    public void onResume_sideFpsHintShouldNotBeShown_sideFpsHintHidden() {
        setupGetSecurityView();
        setupConditionsToEnableSideFpsHint();
        setSideFpsHintEnabledFromResources(false);
        mKeyguardSecurityContainerController.onBouncerVisibilityChanged(View.VISIBLE);
        reset(mSidefpsController);

        mKeyguardSecurityContainerController.onResume(0);

        verify(mSidefpsController).hide();
        verify(mSidefpsController, never()).show();
    }

    @Test
    public void showNextSecurityScreenOrFinish_setsSecurityScreenToPinAfterSimPinUnlock() {
        // GIVEN the current security method is SimPin