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

Commit e4c41c75 authored by Chandru S's avatar Chandru S Committed by Automerger Merge Worker
Browse files

Merge "Do not run device entry face auth when keyguard is not showing ...

Merge "Do not run device entry face auth when keyguard is not showing                                                                                                                                                                    Other changes:  - Reduce hardware error retry count to 5 (unresolved comment in another CL)" into udc-qpr-dev am: 5c5d1ab9

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



Change-Id: I726b58fae52c902857fac91755b76fc04bb62924
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents fba46092 5c5d1ab9
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -335,6 +335,11 @@ constructor(
                    biometricSettingsRepository.isCurrentUserInLockdown.isFalse(),
                    "userHasNotLockedDownDevice",
                    tableLogBuffer
                ),
                logAndObserve(
                    keyguardRepository.isKeyguardShowing,
                    "isKeyguardShowing",
                    tableLogBuffer
                )
            )
            .reduce(::and)
@@ -598,7 +603,7 @@ constructor(
        const val DEFAULT_CANCEL_SIGNAL_TIMEOUT = 3000L

        /** Number of allowed retries whenever there is a face hardware error */
        const val HAL_ERROR_RETRY_MAX = 20
        const val HAL_ERROR_RETRY_MAX = 5

        /** Timeout before retries whenever there is a HAL error. */
        const val HAL_ERROR_RETRY_TIMEOUT = 500L // ms
+17 −0
Original line number Diff line number Diff line
@@ -506,6 +506,18 @@ class DeviceEntryFaceAuthRepositoryTest : SysuiTestCase() {
            testGatingCheckForFaceAuth { fakeUserRepository.setUserSwitching(true) }
        }

    @Test
    fun authenticateDoesNotRunIfKeyguardIsNotShowing() =
        testScope.runTest {
            testGatingCheckForFaceAuth { keyguardRepository.setKeyguardShowing(false) }
        }

    @Test
    fun detectDoesNotRunIfKeyguardIsNotShowing() =
        testScope.runTest {
            testGatingCheckForDetect { keyguardRepository.setKeyguardShowing(false) }
        }

    @Test
    fun authenticateDoesNotRunWhenFpIsLockedOut() =
        testScope.runTest {
@@ -565,6 +577,8 @@ class DeviceEntryFaceAuthRepositoryTest : SysuiTestCase() {
        testScope.runTest {
            testGatingCheckForFaceAuth {
                bouncerRepository.setAlternateVisible(false)
                // Keyguard is occluded when secure camera is active.
                keyguardRepository.setKeyguardOccluded(true)
                fakeCommandQueue.doForEachCallback {
                    it.onCameraLaunchGestureDetected(CAMERA_LAUNCH_SOURCE_POWER_DOUBLE_TAP)
                }
@@ -774,6 +788,8 @@ class DeviceEntryFaceAuthRepositoryTest : SysuiTestCase() {
        testScope.runTest {
            testGatingCheckForDetect {
                bouncerRepository.setAlternateVisible(false)
                // Keyguard is occluded when secure camera is active.
                keyguardRepository.setKeyguardOccluded(true)
                fakeCommandQueue.doForEachCallback {
                    it.onCameraLaunchGestureDetected(CAMERA_LAUNCH_SOURCE_POWER_DOUBLE_TAP)
                }
@@ -1011,6 +1027,7 @@ class DeviceEntryFaceAuthRepositoryTest : SysuiTestCase() {
        fakeUserRepository.setSelectedUserInfo(primaryUser)
        biometricSettingsRepository.setIsFaceAuthSupportedInCurrentPosture(true)
        bouncerRepository.setAlternateVisible(true)
        keyguardRepository.setKeyguardShowing(true)
        runCurrent()
    }