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

Commit ac82db46 authored by Nicolo' Mazzucato's avatar Nicolo' Mazzucato
Browse files

Fix sidefps on portrait large screens

This makes the side fps hint visible also in portrait. Beforehand, it was shown only with the split bouncer (so landscape only.

Bug: 239685478
Bug: 226610828
Test: atest KeyguardSecurityContainerControllerTest
Change-Id: If848de5a99ecba9e766382738ff7921c26637b26
parent 619befaa
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -40,4 +40,6 @@

    <bool name="config_use_large_screen_shade_header">true</bool>

    <!-- Whether to show the side fps hint while on bouncer -->
    <bool name="config_show_sidefps_hint_on_bouncer">true</bool>
</resources>
+3 −0
Original line number Diff line number Diff line
@@ -548,6 +548,9 @@
    <!-- Package name of the preferred system app to perform eSOS action -->
    <string name="config_preferredEmergencySosPackage" translatable="false"></string>

    <!-- Whether to show the side fps hint while on bouncer -->
    <bool name="config_show_sidefps_hint_on_bouncer">false</bool>

    <!-- Whether to use the split 2-column notification shade -->
    <bool name="config_use_split_notification_shade">false</bool>

+2 −1
Original line number Diff line number Diff line
@@ -343,7 +343,8 @@ public class KeyguardSecurityContainerController extends ViewController<Keyguard
        if (!mSidefpsController.isPresent()) {
            return;
        }
        if (mBouncerVisible && mView.isSidedSecurityMode()
        if (mBouncerVisible
                && getResources().getBoolean(R.bool.config_show_sidefps_hint_on_bouncer)
                && mUpdateMonitor.isFingerprintDetectionRunning()
                && !mUpdateMonitor.userNeedsStrongAuth()) {
            mSidefpsController.get().show();
+5 −4
Original line number Diff line number Diff line
@@ -318,7 +318,7 @@ public class KeyguardSecurityContainerControllerTest extends SysuiTestCase {
    @Test
    public void onBouncerVisibilityChanged_withoutSidedSecurity_sideFpsHintHidden() {
        setupConditionsToEnableSideFpsHint();
        setSidedSecurityMode(false);
        setSideFpsHintEnabledFromResources(false);
        reset(mSidefpsController);

        mKeyguardSecurityContainerController.onBouncerVisibilityChanged(View.VISIBLE);
@@ -383,7 +383,7 @@ public class KeyguardSecurityContainerControllerTest extends SysuiTestCase {

    private void setupConditionsToEnableSideFpsHint() {
        attachView();
        setSidedSecurityMode(true);
        setSideFpsHintEnabledFromResources(true);
        setFingerprintDetectionRunning(true);
        setNeedsStrongAuth(false);
    }
@@ -399,8 +399,9 @@ public class KeyguardSecurityContainerControllerTest extends SysuiTestCase {
                BiometricSourceType.FINGERPRINT);
    }

    private void setSidedSecurityMode(boolean sided) {
        when(mView.isSidedSecurityMode()).thenReturn(sided);
    private void setSideFpsHintEnabledFromResources(boolean enabled) {
        when(mResources.getBoolean(R.bool.config_show_sidefps_hint_on_bouncer)).thenReturn(
                enabled);
    }

    private void setNeedsStrongAuth(boolean needed) {