Merge "Fix sidefps on portrait large screens" into tm-qpr-dev

This commit is contained in:
Nicolò Mazzucato
2022-08-02 14:32:14 +00:00
committed by Android (Google) Code Review
4 changed files with 12 additions and 5 deletions

View File

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

View File

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

View File

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

View File

@@ -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) {