diff options
| author | 2024-10-28 15:20:36 +0000 | |
|---|---|---|
| committer | 2024-10-28 15:26:14 +0000 | |
| commit | 59fe0c6fb56c5788ece1459e1e5190dec37efb0b (patch) | |
| tree | 90fea9a2e742186a3ac7a8fa8d84bd21892d4976 | |
| parent | a8ef53cc8b3318645ece18b249739d47587c41ab (diff) | |
Send "Unlock to continue" bouncer message
On the user switcher bouncer, when "Manage Users" is
tapped, ensure a secondary message is displayed to
prompt the user to unlock.
Fixes: 365574398
Test: manual, use bouncer user switcher and tap manager users
Flag: EXEMPT bugfix
Change-Id: I4d9c0072576dce80dc23a18140ba41c5350ab6d4
2 files changed, 37 insertions, 23 deletions
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainerController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainerController.java index a4082114cb79..e56462696a60 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainerController.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainerController.java @@ -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) { diff --git a/packages/SystemUI/src/com/android/systemui/bouncer/domain/interactor/BouncerMessageInteractor.kt b/packages/SystemUI/src/com/android/systemui/bouncer/domain/interactor/BouncerMessageInteractor.kt index d125c36cd8db..e52ddb2d143b 100644 --- a/packages/SystemUI/src/com/android/systemui/bouncer/domain/interactor/BouncerMessageInteractor.kt +++ b/packages/SystemUI/src/com/android/systemui/bouncer/domain/interactor/BouncerMessageInteractor.kt @@ -81,7 +81,7 @@ constructor( deviceEntryBiometricsAllowedInteractor.isFingerprintCurrentlyAllowedOnBouncer.stateIn( applicationScope, SharingStarted.Eagerly, - false + false, ) private val currentSecurityMode @@ -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() }, @@ -130,7 +130,7 @@ constructor( override fun onBiometricAcquired( biometricSourceType: BiometricSourceType?, - acquireInfo: Int + acquireInfo: Int, ) { if ( repository.getMessageSource() == BiometricSourceType.FACE && @@ -143,7 +143,7 @@ constructor( override fun onBiometricAuthenticated( userId: Int, biometricSourceType: BiometricSourceType?, - isStrongBiometric: Boolean + isStrongBiometric: Boolean, ) { repository.setMessage(defaultMessage, biometricSourceType) } @@ -169,7 +169,7 @@ constructor( deviceEntryBiometricsAllowedInteractor.isFingerprintLockedOut, deviceEntryBiometricsAllowedInteractor.isFaceLockedOut, isFingerprintAuthCurrentlyAllowedOnBouncer, - ::Septuple + ::Septuple, ) .map { (_, flags, _, biometricsEnrolledAndEnabled, fpLockedOut, faceLockedOut, _) -> val isTrustUsuallyManaged = trustRepository.isCurrentUserTrustUsuallyManaged.value @@ -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 ( @@ -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) { @@ -292,7 +292,7 @@ constructor( repository.setMessage( BouncerMessageStrings.incorrectSecurityInput( currentSecurityMode.toAuthModel(), - isFingerprintAuthCurrentlyAllowedOnBouncer.value + isFingerprintAuthCurrentlyAllowedOnBouncer.value, ) .toMessage() ) @@ -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, ) @@ -329,7 +340,7 @@ constructor( defaultMessage( currentSecurityMode, value, - isFingerprintAuthCurrentlyAllowedOnBouncer.value + isFingerprintAuthCurrentlyAllowedOnBouncer.value, ) ) } @@ -338,7 +349,7 @@ constructor( get() = BouncerMessageStrings.defaultMessage( currentSecurityMode.toAuthModel(), - isFingerprintAuthCurrentlyAllowedOnBouncer.value + isFingerprintAuthCurrentlyAllowedOnBouncer.value, ) .toMessage() @@ -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 = @@ -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), ) } |