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

Commit 4d28739c authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Added additional check on bouncer to check if valid PIN length is...

Merge "Added additional check on bouncer to check if valid PIN length is stored on device or not" into udc-qpr-dev am: 020d55ea

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/23989103



Change-Id: Ifc6ff0b390fd596d944479da65361c78ed7920cf
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents d8703421 020d55ea
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -165,15 +165,18 @@ public class KeyguardPinViewController
     * Responsible for identifying if PIN hinting is to be enabled or not
     */
    private boolean isPinHinting() {
        return mLockPatternUtils.getPinLength(KeyguardUpdateMonitor.getCurrentUser())
                == DEFAULT_PIN_LENGTH;
        return mPinLength == DEFAULT_PIN_LENGTH;
    }

    /**
     * Responsible for identifying if auto confirm is enabled or not in Settings
     * Responsible for identifying if auto confirm is enabled or not in Settings and
     * a valid PIN_LENGTH is stored on the device (though the latter check is only to make it more
     * robust since we only allow enabling PIN confirmation if the user has a valid PIN length
     * saved on device)
     */
    private boolean isAutoPinConfirmEnabledInSettings() {
        //Checks if user has enabled the auto confirm in Settings
        return mLockPatternUtils.isAutoPinConfirmEnabled(KeyguardUpdateMonitor.getCurrentUser());
        return mLockPatternUtils.isAutoPinConfirmEnabled(KeyguardUpdateMonitor.getCurrentUser())
                && mPinLength != LockPatternUtils.PIN_LENGTH_UNAVAILABLE;
    }
}
+1 −2
Original line number Diff line number Diff line
@@ -105,6 +105,7 @@ class KeyguardPinViewControllerTest : SysuiTestCase() {
        `when`(keyguardPinView.findViewById<View>(R.id.key_enter)).thenReturn(enterButton)
        // For posture tests:
        `when`(keyguardPinView.buttons).thenReturn(arrayOf())
        `when`(lockPatternUtils.getPinLength(anyInt())).thenReturn(6)

        pinViewController =
            KeyguardPinViewController(
@@ -167,7 +168,6 @@ class KeyguardPinViewControllerTest : SysuiTestCase() {
    @Test
    fun startAppearAnimation_withAutoPinConfirmationFailedPasswordAttemptsLessThan5() {
        `when`(featureFlags.isEnabled(Flags.AUTO_PIN_CONFIRMATION)).thenReturn(true)
        `when`(lockPatternUtils.getPinLength(anyInt())).thenReturn(6)
        `when`(lockPatternUtils.isAutoPinConfirmEnabled(anyInt())).thenReturn(true)
        `when`(lockPatternUtils.getCurrentFailedPasswordAttempts(anyInt())).thenReturn(3)
        `when`(passwordTextView.text).thenReturn("")
@@ -182,7 +182,6 @@ class KeyguardPinViewControllerTest : SysuiTestCase() {
    @Test
    fun startAppearAnimation_withAutoPinConfirmationFailedPasswordAttemptsMoreThan5() {
        `when`(featureFlags.isEnabled(Flags.AUTO_PIN_CONFIRMATION)).thenReturn(true)
        `when`(lockPatternUtils.getPinLength(anyInt())).thenReturn(6)
        `when`(lockPatternUtils.isAutoPinConfirmEnabled(anyInt())).thenReturn(true)
        `when`(lockPatternUtils.getCurrentFailedPasswordAttempts(anyInt())).thenReturn(6)
        `when`(passwordTextView.text).thenReturn("")