Loading core/res/res/values/symbols.xml +1 −0 Original line number Diff line number Diff line Loading @@ -5129,4 +5129,5 @@ <java-symbol type="style" name="ThemeOverlay.DeviceDefault.Dark.ActionBar.Accent" /> <java-symbol type="drawable" name="focus_event_pressed_key_background" /> <java-symbol type="string" name="lockscreen_too_many_failed_attempts_countdown" /> </resources> packages/SystemUI/src/com/android/systemui/authentication/data/repository/AuthenticationRepository.kt +17 −0 Original line number Diff line number Diff line Loading @@ -51,6 +51,12 @@ interface AuthenticationRepository { */ val isBypassEnabled: StateFlow<Boolean> /** * Number of consecutively failed authentication attempts. This resets to `0` when * authentication succeeds. */ val failedAuthenticationAttempts: StateFlow<Int> /** See [isUnlocked]. */ fun setUnlocked(isUnlocked: Boolean) Loading @@ -59,6 +65,9 @@ interface AuthenticationRepository { /** See [isBypassEnabled]. */ fun setBypassEnabled(isBypassEnabled: Boolean) /** See [failedAuthenticationAttempts]. */ fun setFailedAuthenticationAttempts(failedAuthenticationAttempts: Int) } class AuthenticationRepositoryImpl @Inject constructor() : AuthenticationRepository { Loading @@ -75,6 +84,10 @@ class AuthenticationRepositoryImpl @Inject constructor() : AuthenticationReposit private val _isBypassEnabled = MutableStateFlow(false) override val isBypassEnabled: StateFlow<Boolean> = _isBypassEnabled.asStateFlow() private val _failedAuthenticationAttempts = MutableStateFlow(0) override val failedAuthenticationAttempts: StateFlow<Int> = _failedAuthenticationAttempts.asStateFlow() override fun setUnlocked(isUnlocked: Boolean) { _isUnlocked.value = isUnlocked } Loading @@ -86,6 +99,10 @@ class AuthenticationRepositoryImpl @Inject constructor() : AuthenticationReposit override fun setAuthenticationMethod(authenticationMethod: AuthenticationMethodModel) { _authenticationMethod.value = authenticationMethod } override fun setFailedAuthenticationAttempts(failedAuthenticationAttempts: Int) { _failedAuthenticationAttempts.value = failedAuthenticationAttempts } } @Module Loading packages/SystemUI/src/com/android/systemui/authentication/domain/interactor/AuthenticationInteractor.kt +11 −0 Original line number Diff line number Diff line Loading @@ -75,6 +75,12 @@ constructor( */ val isBypassEnabled: StateFlow<Boolean> = repository.isBypassEnabled /** * Number of consecutively failed authentication attempts. This resets to `0` when * authentication succeeds. */ val failedAuthenticationAttempts: StateFlow<Int> = repository.failedAuthenticationAttempts init { // UNLOCKS WHEN AUTH METHOD REMOVED. // Loading Loading @@ -130,7 +136,12 @@ constructor( } if (isSuccessful) { repository.setFailedAuthenticationAttempts(0) repository.setUnlocked(true) } else { repository.setFailedAuthenticationAttempts( repository.failedAuthenticationAttempts.value + 1 ) } return isSuccessful Loading packages/SystemUI/src/com/android/systemui/authentication/shared/model/AuthenticationMethodModel.kt +4 −2 Original line number Diff line number Diff line Loading @@ -36,8 +36,10 @@ sealed class AuthenticationMethodModel( data class Password(val password: String) : AuthenticationMethodModel(isSecure = true) data class Pattern(val coordinates: List<PatternCoordinate>) : AuthenticationMethodModel(isSecure = true) { data class Pattern( val coordinates: List<PatternCoordinate>, val isPatternVisible: Boolean = true, ) : AuthenticationMethodModel(isSecure = true) { data class PatternCoordinate( val x: Int, Loading packages/SystemUI/src/com/android/systemui/bouncer/data/repo/BouncerRepository.kt +9 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.systemui.bouncer.data.repo import com.android.systemui.bouncer.shared.model.AuthenticationThrottledModel import com.android.systemui.dagger.SysUISingleton import javax.inject.Inject import kotlinx.coroutines.flow.MutableStateFlow Loading @@ -29,7 +30,15 @@ class BouncerRepository @Inject constructor() { /** The user-facing message to show in the bouncer. */ val message: StateFlow<String?> = _message.asStateFlow() private val _throttling = MutableStateFlow<AuthenticationThrottledModel?>(null) /** The current authentication throttling state. If `null`, there's no throttling. */ val throttling: StateFlow<AuthenticationThrottledModel?> = _throttling.asStateFlow() fun setMessage(message: String?) { _message.value = message } fun setThrottling(throttling: AuthenticationThrottledModel?) { _throttling.value = throttling } } Loading
core/res/res/values/symbols.xml +1 −0 Original line number Diff line number Diff line Loading @@ -5129,4 +5129,5 @@ <java-symbol type="style" name="ThemeOverlay.DeviceDefault.Dark.ActionBar.Accent" /> <java-symbol type="drawable" name="focus_event_pressed_key_background" /> <java-symbol type="string" name="lockscreen_too_many_failed_attempts_countdown" /> </resources>
packages/SystemUI/src/com/android/systemui/authentication/data/repository/AuthenticationRepository.kt +17 −0 Original line number Diff line number Diff line Loading @@ -51,6 +51,12 @@ interface AuthenticationRepository { */ val isBypassEnabled: StateFlow<Boolean> /** * Number of consecutively failed authentication attempts. This resets to `0` when * authentication succeeds. */ val failedAuthenticationAttempts: StateFlow<Int> /** See [isUnlocked]. */ fun setUnlocked(isUnlocked: Boolean) Loading @@ -59,6 +65,9 @@ interface AuthenticationRepository { /** See [isBypassEnabled]. */ fun setBypassEnabled(isBypassEnabled: Boolean) /** See [failedAuthenticationAttempts]. */ fun setFailedAuthenticationAttempts(failedAuthenticationAttempts: Int) } class AuthenticationRepositoryImpl @Inject constructor() : AuthenticationRepository { Loading @@ -75,6 +84,10 @@ class AuthenticationRepositoryImpl @Inject constructor() : AuthenticationReposit private val _isBypassEnabled = MutableStateFlow(false) override val isBypassEnabled: StateFlow<Boolean> = _isBypassEnabled.asStateFlow() private val _failedAuthenticationAttempts = MutableStateFlow(0) override val failedAuthenticationAttempts: StateFlow<Int> = _failedAuthenticationAttempts.asStateFlow() override fun setUnlocked(isUnlocked: Boolean) { _isUnlocked.value = isUnlocked } Loading @@ -86,6 +99,10 @@ class AuthenticationRepositoryImpl @Inject constructor() : AuthenticationReposit override fun setAuthenticationMethod(authenticationMethod: AuthenticationMethodModel) { _authenticationMethod.value = authenticationMethod } override fun setFailedAuthenticationAttempts(failedAuthenticationAttempts: Int) { _failedAuthenticationAttempts.value = failedAuthenticationAttempts } } @Module Loading
packages/SystemUI/src/com/android/systemui/authentication/domain/interactor/AuthenticationInteractor.kt +11 −0 Original line number Diff line number Diff line Loading @@ -75,6 +75,12 @@ constructor( */ val isBypassEnabled: StateFlow<Boolean> = repository.isBypassEnabled /** * Number of consecutively failed authentication attempts. This resets to `0` when * authentication succeeds. */ val failedAuthenticationAttempts: StateFlow<Int> = repository.failedAuthenticationAttempts init { // UNLOCKS WHEN AUTH METHOD REMOVED. // Loading Loading @@ -130,7 +136,12 @@ constructor( } if (isSuccessful) { repository.setFailedAuthenticationAttempts(0) repository.setUnlocked(true) } else { repository.setFailedAuthenticationAttempts( repository.failedAuthenticationAttempts.value + 1 ) } return isSuccessful Loading
packages/SystemUI/src/com/android/systemui/authentication/shared/model/AuthenticationMethodModel.kt +4 −2 Original line number Diff line number Diff line Loading @@ -36,8 +36,10 @@ sealed class AuthenticationMethodModel( data class Password(val password: String) : AuthenticationMethodModel(isSecure = true) data class Pattern(val coordinates: List<PatternCoordinate>) : AuthenticationMethodModel(isSecure = true) { data class Pattern( val coordinates: List<PatternCoordinate>, val isPatternVisible: Boolean = true, ) : AuthenticationMethodModel(isSecure = true) { data class PatternCoordinate( val x: Int, Loading
packages/SystemUI/src/com/android/systemui/bouncer/data/repo/BouncerRepository.kt +9 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.systemui.bouncer.data.repo import com.android.systemui.bouncer.shared.model.AuthenticationThrottledModel import com.android.systemui.dagger.SysUISingleton import javax.inject.Inject import kotlinx.coroutines.flow.MutableStateFlow Loading @@ -29,7 +30,15 @@ class BouncerRepository @Inject constructor() { /** The user-facing message to show in the bouncer. */ val message: StateFlow<String?> = _message.asStateFlow() private val _throttling = MutableStateFlow<AuthenticationThrottledModel?>(null) /** The current authentication throttling state. If `null`, there's no throttling. */ val throttling: StateFlow<AuthenticationThrottledModel?> = _throttling.asStateFlow() fun setMessage(message: String?) { _message.value = message } fun setThrottling(throttling: AuthenticationThrottledModel?) { _throttling.value = throttling } }