diff --git a/packages/SystemUI/src/com/android/systemui/deviceentry/domain/interactor/BiometricMessageInteractor.kt b/packages/SystemUI/src/com/android/systemui/deviceentry/domain/interactor/BiometricMessageInteractor.kt index 6bfe8d91b5fcecfbd75d38fc101b12110d683bc7..846013cef326ca7611f963896aa7c4379aff1d6f 100644 --- a/packages/SystemUI/src/com/android/systemui/deviceentry/domain/interactor/BiometricMessageInteractor.kt +++ b/packages/SystemUI/src/com/android/systemui/deviceentry/domain/interactor/BiometricMessageInteractor.kt @@ -21,9 +21,12 @@ import com.android.systemui.biometrics.domain.interactor.FingerprintPropertyInte import com.android.systemui.dagger.SysUISingleton import com.android.systemui.dagger.qualifiers.Main import com.android.systemui.deviceentry.shared.model.ErrorFaceAuthenticationStatus +import com.android.systemui.deviceentry.shared.model.FaceFailureMessage +import com.android.systemui.deviceentry.shared.model.FaceLockoutMessage import com.android.systemui.deviceentry.shared.model.FaceMessage import com.android.systemui.deviceentry.shared.model.FaceTimeoutMessage import com.android.systemui.deviceentry.shared.model.FailedFaceAuthenticationStatus +import com.android.systemui.deviceentry.shared.model.FingerprintFailureMessage import com.android.systemui.deviceentry.shared.model.FingerprintLockoutMessage import com.android.systemui.deviceentry.shared.model.FingerprintMessage import com.android.systemui.deviceentry.shared.model.HelpFaceAuthenticationStatus @@ -97,11 +100,7 @@ constructor( fingerprintAuthInteractor.fingerprintHelp .sample(biometricSettingsInteractor.fingerprintAuthCurrentlyAllowed, ::Pair) .filter { (_, fingerprintAuthAllowed) -> fingerprintAuthAllowed } - .map { (helpStatus, _) -> - FingerprintMessage( - helpStatus.msg, - ) - } + .map { (helpStatus, _) -> FingerprintMessage(helpStatus.msg) } private val fingerprintFailMessage: Flow<FingerprintMessage> = fingerprintPropertyInteractor.isUdfps.flatMapLatest { isUdfps -> @@ -109,7 +108,7 @@ constructor( .sample(biometricSettingsInteractor.fingerprintAuthCurrentlyAllowed) .filter { fingerprintAuthAllowed -> fingerprintAuthAllowed } .map { - FingerprintMessage( + FingerprintFailureMessage( if (isUdfps) { resources.getString( com.android.internal.R.string.fingerprint_udfps_error_not_match @@ -118,7 +117,7 @@ constructor( resources.getString( com.android.internal.R.string.fingerprint_error_not_match ) - }, + } ) } } @@ -154,7 +153,7 @@ constructor( faceFailure .sample(biometricSettingsInteractor.faceAuthCurrentlyAllowed) .filter { faceAuthCurrentlyAllowed -> faceAuthCurrentlyAllowed } - .map { FaceMessage(resources.getString(R.string.keyguard_face_failed)) } + .map { FaceFailureMessage(resources.getString(R.string.keyguard_face_failed)) } private val faceErrorMessage: Flow<FaceMessage> = faceError @@ -173,6 +172,7 @@ constructor( FaceTimeoutMessage(status.msg) } } + status.isLockoutError() -> FaceLockoutMessage(status.msg) else -> FaceMessage(status.msg) } } diff --git a/packages/SystemUI/src/com/android/systemui/deviceentry/shared/model/BiometricMessageModels.kt b/packages/SystemUI/src/com/android/systemui/deviceentry/shared/model/BiometricMessageModels.kt index 59c3f7f8aded3515444b033fb8075461867928dc..2ced8c41713f154e467f554f73e4ad9dd499a352 100644 --- a/packages/SystemUI/src/com/android/systemui/deviceentry/shared/model/BiometricMessageModels.kt +++ b/packages/SystemUI/src/com/android/systemui/deviceentry/shared/model/BiometricMessageModels.kt @@ -32,9 +32,15 @@ data class FaceTimeoutMessage( private val faceTimeoutMessage: String?, ) : FaceMessage(faceTimeoutMessage) +data class FaceLockoutMessage(private val msg: String?) : FaceMessage(msg) + +data class FaceFailureMessage(private val msg: String) : FaceMessage(msg) + /** Fingerprint biometric message */ open class FingerprintMessage(fingerprintMessage: String?) : BiometricMessage(fingerprintMessage) data class FingerprintLockoutMessage( private val fingerprintLockoutMessage: String?, ) : FingerprintMessage(fingerprintLockoutMessage) + +data class FingerprintFailureMessage(private val msg: String?) : FingerprintMessage(msg)