Loading packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainerController.java +5 −2 Original line number Diff line number Diff line Loading @@ -1102,8 +1102,11 @@ public class KeyguardSecurityContainerController extends ViewController<Keyguard } mView.initMode(mode, mGlobalSettings, mFalsingManager, mUserSwitcherController, () -> showMessage(getContext().getString(R.string.keyguard_unlock_to_continue), /* colorState= */ null, /* animated= */ true), mFalsingA11yDelegate); () -> { String msg = getContext().getString(R.string.keyguard_unlock_to_continue); showMessage(msg, /* colorState= */ null, /* animated= */ true); mBouncerMessageInteractor.setUnlockToContinueMessage(msg); }, mFalsingA11yDelegate); } public void reportFailedUnlockAttempt(int userId, int timeoutMs) { Loading packages/SystemUI/src/com/android/systemui/bouncer/domain/interactor/BouncerMessageInteractor.kt +32 −21 Original line number Diff line number Diff line Loading @@ -81,7 +81,7 @@ constructor( deviceEntryBiometricsAllowedInteractor.isFingerprintCurrentlyAllowedOnBouncer.stateIn( applicationScope, SharingStarted.Eagerly, false false, ) private val currentSecurityMode Loading Loading @@ -114,13 +114,13 @@ constructor( BiometricSourceType.FACE -> BouncerMessageStrings.incorrectFaceInput( currentSecurityMode.toAuthModel(), isFingerprintAuthCurrentlyAllowedOnBouncer.value isFingerprintAuthCurrentlyAllowedOnBouncer.value, ) .toMessage() else -> BouncerMessageStrings.defaultMessage( currentSecurityMode.toAuthModel(), isFingerprintAuthCurrentlyAllowedOnBouncer.value isFingerprintAuthCurrentlyAllowedOnBouncer.value, ) .toMessage() }, Loading @@ -130,7 +130,7 @@ constructor( override fun onBiometricAcquired( biometricSourceType: BiometricSourceType?, acquireInfo: Int acquireInfo: Int, ) { if ( repository.getMessageSource() == BiometricSourceType.FACE && Loading @@ -143,7 +143,7 @@ constructor( override fun onBiometricAuthenticated( userId: Int, biometricSourceType: BiometricSourceType?, isStrongBiometric: Boolean isStrongBiometric: Boolean, ) { repository.setMessage(defaultMessage, biometricSourceType) } Loading @@ -169,7 +169,7 @@ constructor( deviceEntryBiometricsAllowedInteractor.isFingerprintLockedOut, deviceEntryBiometricsAllowedInteractor.isFaceLockedOut, isFingerprintAuthCurrentlyAllowedOnBouncer, ::Septuple ::Septuple, ) .map { (_, flags, _, biometricsEnrolledAndEnabled, fpLockedOut, faceLockedOut, _) -> val isTrustUsuallyManaged = trustRepository.isCurrentUserTrustUsuallyManaged.value Loading Loading @@ -220,14 +220,14 @@ constructor( } else { BouncerMessageStrings.faceLockedOut( currentSecurityMode.toAuthModel(), isFingerprintAuthCurrentlyAllowedOnBouncer.value isFingerprintAuthCurrentlyAllowedOnBouncer.value, ) .toMessage() } } else if (flags.isSomeAuthRequiredAfterAdaptiveAuthRequest) { BouncerMessageStrings.authRequiredAfterAdaptiveAuthRequest( currentSecurityMode.toAuthModel(), isFingerprintAuthCurrentlyAllowedOnBouncer.value isFingerprintAuthCurrentlyAllowedOnBouncer.value, ) .toMessage() } else if ( Loading @@ -236,19 +236,19 @@ constructor( ) { BouncerMessageStrings.nonStrongAuthTimeout( currentSecurityMode.toAuthModel(), isFingerprintAuthCurrentlyAllowedOnBouncer.value isFingerprintAuthCurrentlyAllowedOnBouncer.value, ) .toMessage() } else if (isTrustUsuallyManaged && flags.someAuthRequiredAfterUserRequest) { BouncerMessageStrings.trustAgentDisabled( currentSecurityMode.toAuthModel(), isFingerprintAuthCurrentlyAllowedOnBouncer.value isFingerprintAuthCurrentlyAllowedOnBouncer.value, ) .toMessage() } else if (isTrustUsuallyManaged && flags.someAuthRequiredAfterTrustAgentExpired) { BouncerMessageStrings.trustAgentDisabled( currentSecurityMode.toAuthModel(), isFingerprintAuthCurrentlyAllowedOnBouncer.value isFingerprintAuthCurrentlyAllowedOnBouncer.value, ) .toMessage() } else if (trustOrBiometricsAvailable && flags.isInUserLockdown) { Loading Loading @@ -292,7 +292,7 @@ constructor( repository.setMessage( BouncerMessageStrings.incorrectSecurityInput( currentSecurityMode.toAuthModel(), isFingerprintAuthCurrentlyAllowedOnBouncer.value isFingerprintAuthCurrentlyAllowedOnBouncer.value, ) .toMessage() ) Loading @@ -304,19 +304,30 @@ constructor( defaultMessage( currentSecurityMode, value, isFingerprintAuthCurrentlyAllowedOnBouncer.value isFingerprintAuthCurrentlyAllowedOnBouncer.value, ), BiometricSourceType.FINGERPRINT, ) } fun setUnlockToContinueMessage(value: String) { if (!Flags.revampedBouncerMessages()) return repository.setMessage( defaultMessage( currentSecurityMode, value, isFingerprintAuthCurrentlyAllowedOnBouncer.value, ) ) } fun setFaceAcquisitionMessage(value: String?) { if (!Flags.revampedBouncerMessages()) return repository.setMessage( defaultMessage( currentSecurityMode, value, isFingerprintAuthCurrentlyAllowedOnBouncer.value isFingerprintAuthCurrentlyAllowedOnBouncer.value, ), BiometricSourceType.FACE, ) Loading @@ -329,7 +340,7 @@ constructor( defaultMessage( currentSecurityMode, value, isFingerprintAuthCurrentlyAllowedOnBouncer.value isFingerprintAuthCurrentlyAllowedOnBouncer.value, ) ) } Loading @@ -338,7 +349,7 @@ constructor( get() = BouncerMessageStrings.defaultMessage( currentSecurityMode.toAuthModel(), isFingerprintAuthCurrentlyAllowedOnBouncer.value isFingerprintAuthCurrentlyAllowedOnBouncer.value, ) .toMessage() Loading Loading @@ -400,7 +411,7 @@ private fun Flow<Boolean>.or(anotherFlow: Flow<Boolean>) = private fun defaultMessage( securityMode: SecurityMode, secondaryMessage: String?, fpAuthIsAllowed: Boolean fpAuthIsAllowed: Boolean, ): BouncerMessageModel { return BouncerMessageModel( message = Loading @@ -408,21 +419,21 @@ private fun defaultMessage( messageResId = BouncerMessageStrings.defaultMessage( securityMode.toAuthModel(), fpAuthIsAllowed fpAuthIsAllowed, ) .toMessage() .message ?.messageResId, animate = false animate = false, ), secondaryMessage = Message(message = secondaryMessage, animate = false) secondaryMessage = Message(message = secondaryMessage, animate = false), ) } private fun Pair<Int, Int>.toMessage(): BouncerMessageModel { return BouncerMessageModel( message = Message(messageResId = this.first, animate = false), secondaryMessage = Message(messageResId = this.second, animate = false) secondaryMessage = Message(messageResId = this.second, animate = false), ) } Loading Loading
packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainerController.java +5 −2 Original line number Diff line number Diff line Loading @@ -1102,8 +1102,11 @@ public class KeyguardSecurityContainerController extends ViewController<Keyguard } mView.initMode(mode, mGlobalSettings, mFalsingManager, mUserSwitcherController, () -> showMessage(getContext().getString(R.string.keyguard_unlock_to_continue), /* colorState= */ null, /* animated= */ true), mFalsingA11yDelegate); () -> { String msg = getContext().getString(R.string.keyguard_unlock_to_continue); showMessage(msg, /* colorState= */ null, /* animated= */ true); mBouncerMessageInteractor.setUnlockToContinueMessage(msg); }, mFalsingA11yDelegate); } public void reportFailedUnlockAttempt(int userId, int timeoutMs) { Loading
packages/SystemUI/src/com/android/systemui/bouncer/domain/interactor/BouncerMessageInteractor.kt +32 −21 Original line number Diff line number Diff line Loading @@ -81,7 +81,7 @@ constructor( deviceEntryBiometricsAllowedInteractor.isFingerprintCurrentlyAllowedOnBouncer.stateIn( applicationScope, SharingStarted.Eagerly, false false, ) private val currentSecurityMode Loading Loading @@ -114,13 +114,13 @@ constructor( BiometricSourceType.FACE -> BouncerMessageStrings.incorrectFaceInput( currentSecurityMode.toAuthModel(), isFingerprintAuthCurrentlyAllowedOnBouncer.value isFingerprintAuthCurrentlyAllowedOnBouncer.value, ) .toMessage() else -> BouncerMessageStrings.defaultMessage( currentSecurityMode.toAuthModel(), isFingerprintAuthCurrentlyAllowedOnBouncer.value isFingerprintAuthCurrentlyAllowedOnBouncer.value, ) .toMessage() }, Loading @@ -130,7 +130,7 @@ constructor( override fun onBiometricAcquired( biometricSourceType: BiometricSourceType?, acquireInfo: Int acquireInfo: Int, ) { if ( repository.getMessageSource() == BiometricSourceType.FACE && Loading @@ -143,7 +143,7 @@ constructor( override fun onBiometricAuthenticated( userId: Int, biometricSourceType: BiometricSourceType?, isStrongBiometric: Boolean isStrongBiometric: Boolean, ) { repository.setMessage(defaultMessage, biometricSourceType) } Loading @@ -169,7 +169,7 @@ constructor( deviceEntryBiometricsAllowedInteractor.isFingerprintLockedOut, deviceEntryBiometricsAllowedInteractor.isFaceLockedOut, isFingerprintAuthCurrentlyAllowedOnBouncer, ::Septuple ::Septuple, ) .map { (_, flags, _, biometricsEnrolledAndEnabled, fpLockedOut, faceLockedOut, _) -> val isTrustUsuallyManaged = trustRepository.isCurrentUserTrustUsuallyManaged.value Loading Loading @@ -220,14 +220,14 @@ constructor( } else { BouncerMessageStrings.faceLockedOut( currentSecurityMode.toAuthModel(), isFingerprintAuthCurrentlyAllowedOnBouncer.value isFingerprintAuthCurrentlyAllowedOnBouncer.value, ) .toMessage() } } else if (flags.isSomeAuthRequiredAfterAdaptiveAuthRequest) { BouncerMessageStrings.authRequiredAfterAdaptiveAuthRequest( currentSecurityMode.toAuthModel(), isFingerprintAuthCurrentlyAllowedOnBouncer.value isFingerprintAuthCurrentlyAllowedOnBouncer.value, ) .toMessage() } else if ( Loading @@ -236,19 +236,19 @@ constructor( ) { BouncerMessageStrings.nonStrongAuthTimeout( currentSecurityMode.toAuthModel(), isFingerprintAuthCurrentlyAllowedOnBouncer.value isFingerprintAuthCurrentlyAllowedOnBouncer.value, ) .toMessage() } else if (isTrustUsuallyManaged && flags.someAuthRequiredAfterUserRequest) { BouncerMessageStrings.trustAgentDisabled( currentSecurityMode.toAuthModel(), isFingerprintAuthCurrentlyAllowedOnBouncer.value isFingerprintAuthCurrentlyAllowedOnBouncer.value, ) .toMessage() } else if (isTrustUsuallyManaged && flags.someAuthRequiredAfterTrustAgentExpired) { BouncerMessageStrings.trustAgentDisabled( currentSecurityMode.toAuthModel(), isFingerprintAuthCurrentlyAllowedOnBouncer.value isFingerprintAuthCurrentlyAllowedOnBouncer.value, ) .toMessage() } else if (trustOrBiometricsAvailable && flags.isInUserLockdown) { Loading Loading @@ -292,7 +292,7 @@ constructor( repository.setMessage( BouncerMessageStrings.incorrectSecurityInput( currentSecurityMode.toAuthModel(), isFingerprintAuthCurrentlyAllowedOnBouncer.value isFingerprintAuthCurrentlyAllowedOnBouncer.value, ) .toMessage() ) Loading @@ -304,19 +304,30 @@ constructor( defaultMessage( currentSecurityMode, value, isFingerprintAuthCurrentlyAllowedOnBouncer.value isFingerprintAuthCurrentlyAllowedOnBouncer.value, ), BiometricSourceType.FINGERPRINT, ) } fun setUnlockToContinueMessage(value: String) { if (!Flags.revampedBouncerMessages()) return repository.setMessage( defaultMessage( currentSecurityMode, value, isFingerprintAuthCurrentlyAllowedOnBouncer.value, ) ) } fun setFaceAcquisitionMessage(value: String?) { if (!Flags.revampedBouncerMessages()) return repository.setMessage( defaultMessage( currentSecurityMode, value, isFingerprintAuthCurrentlyAllowedOnBouncer.value isFingerprintAuthCurrentlyAllowedOnBouncer.value, ), BiometricSourceType.FACE, ) Loading @@ -329,7 +340,7 @@ constructor( defaultMessage( currentSecurityMode, value, isFingerprintAuthCurrentlyAllowedOnBouncer.value isFingerprintAuthCurrentlyAllowedOnBouncer.value, ) ) } Loading @@ -338,7 +349,7 @@ constructor( get() = BouncerMessageStrings.defaultMessage( currentSecurityMode.toAuthModel(), isFingerprintAuthCurrentlyAllowedOnBouncer.value isFingerprintAuthCurrentlyAllowedOnBouncer.value, ) .toMessage() Loading Loading @@ -400,7 +411,7 @@ private fun Flow<Boolean>.or(anotherFlow: Flow<Boolean>) = private fun defaultMessage( securityMode: SecurityMode, secondaryMessage: String?, fpAuthIsAllowed: Boolean fpAuthIsAllowed: Boolean, ): BouncerMessageModel { return BouncerMessageModel( message = Loading @@ -408,21 +419,21 @@ private fun defaultMessage( messageResId = BouncerMessageStrings.defaultMessage( securityMode.toAuthModel(), fpAuthIsAllowed fpAuthIsAllowed, ) .toMessage() .message ?.messageResId, animate = false animate = false, ), secondaryMessage = Message(message = secondaryMessage, animate = false) secondaryMessage = Message(message = secondaryMessage, animate = false), ) } private fun Pair<Int, Int>.toMessage(): BouncerMessageModel { return BouncerMessageModel( message = Message(messageResId = this.first, animate = false), secondaryMessage = Message(messageResId = this.second, animate = false) secondaryMessage = Message(messageResId = this.second, animate = false), ) } Loading