Loading packages/SystemUI/src/com/android/keyguard/KeyguardInputViewController.java +4 −1 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import android.annotation.Nullable; import android.content.res.ColorStateList; import android.content.res.Resources; import android.telephony.TelephonyManager; import android.text.TextUtils; import android.util.Log; import android.view.inputmethod.InputMethodManager; Loading Loading @@ -152,7 +153,9 @@ public abstract class KeyguardInputViewController<T extends KeyguardInputView> } public void startAppearAnimation() { if (TextUtils.isEmpty(mMessageAreaController.getMessage())) { mMessageAreaController.setMessage(getInitialMessageResId()); } mView.startAppearAnimation(); } Loading packages/SystemUI/src/com/android/keyguard/KeyguardMessageAreaController.java +5 −0 Original line number Diff line number Diff line Loading @@ -103,6 +103,11 @@ public class KeyguardMessageAreaController<T extends KeyguardMessageArea> mView.setNextMessageColor(colorState); } /** Returns the message of the underlying TextView. */ public CharSequence getMessage() { return mView.getText(); } /** * Reload colors from resources. **/ Loading packages/SystemUI/src/com/android/systemui/keyguard/data/repository/KeyguardBouncerRepository.kt +2 −22 Original line number Diff line number Diff line Loading @@ -16,9 +16,7 @@ package com.android.systemui.keyguard.data.repository import android.hardware.biometrics.BiometricSourceType import com.android.keyguard.KeyguardUpdateMonitor import com.android.keyguard.KeyguardUpdateMonitorCallback import com.android.keyguard.ViewMediatorCallback import com.android.systemui.dagger.SysUISingleton import com.android.systemui.keyguard.shared.model.BouncerShowMessageModel Loading Loading @@ -70,33 +68,15 @@ constructor( private val _keyguardAuthenticated = MutableStateFlow<Boolean?>(null) /** Determines if user is already unlocked */ val keyguardAuthenticated = _keyguardAuthenticated.asStateFlow() var bouncerPromptReason: Int? = null private val _showMessage = MutableStateFlow<BouncerShowMessageModel?>(null) val showMessage = _showMessage.asStateFlow() private val _resourceUpdateRequests = MutableStateFlow(false) val resourceUpdateRequests = _resourceUpdateRequests.asStateFlow() val bouncerPromptReason: Int get() = viewMediatorCallback.bouncerPromptReason val bouncerErrorMessage: CharSequence? get() = viewMediatorCallback.consumeCustomMessage() init { val callback = object : KeyguardUpdateMonitorCallback() { override fun onStrongAuthStateChanged(userId: Int) { bouncerPromptReason = viewMediatorCallback.bouncerPromptReason } override fun onLockedOutStateChanged(type: BiometricSourceType) { if (type == BiometricSourceType.FINGERPRINT) { bouncerPromptReason = viewMediatorCallback.bouncerPromptReason } } } keyguardUpdateMonitor.registerCallback(callback) } fun setPrimaryScrimmed(isScrimmed: Boolean) { _primaryBouncerScrimmed.value = isScrimmed } Loading packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardBouncerViewBinder.kt +4 −12 Original line number Diff line number Diff line Loading @@ -94,6 +94,10 @@ object KeyguardBouncerViewBinder { viewModel.setBouncerViewDelegate(delegate) launch { viewModel.show.collect { hostViewController.showPromptReason(it.promptReason) it.errorMessage?.let { errorMessage -> hostViewController.showErrorMessage(errorMessage) } hostViewController.showPrimarySecurityScreen() hostViewController.appear( SystemBarUtils.getStatusBarHeight(view.context) Loading @@ -101,18 +105,6 @@ object KeyguardBouncerViewBinder { } } launch { viewModel.showPromptReason.collect { prompt -> hostViewController.showPromptReason(prompt) } } launch { viewModel.showBouncerErrorMessage.collect { errorMessage -> hostViewController.showErrorMessage(errorMessage) } } launch { viewModel.showWithFullExpansion.collect { model -> hostViewController.resetSecurityContainer() Loading packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/KeyguardBouncerViewModel.kt +0 −8 Original line number Diff line number Diff line Loading @@ -26,7 +26,6 @@ import com.android.systemui.statusbar.phone.KeyguardBouncer.EXPANSION_VISIBLE import javax.inject.Inject import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.filter import kotlinx.coroutines.flow.filterNotNull import kotlinx.coroutines.flow.map /** Models UI state for the lock screen bouncer; handles user input. */ Loading @@ -45,13 +44,6 @@ constructor( /** Observe whether bouncer is showing. */ val show: Flow<KeyguardBouncerModel> = interactor.show /** Observe bouncer prompt when bouncer is showing. */ val showPromptReason: Flow<Int> = interactor.show.map { it.promptReason } /** Observe bouncer error message when bouncer is showing. */ val showBouncerErrorMessage: Flow<CharSequence> = interactor.show.map { it.errorMessage }.filterNotNull() /** Observe visible expansion when bouncer is showing. */ val showWithFullExpansion: Flow<KeyguardBouncerModel> = interactor.show.filter { it.expansionAmount == EXPANSION_VISIBLE } Loading Loading
packages/SystemUI/src/com/android/keyguard/KeyguardInputViewController.java +4 −1 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import android.annotation.Nullable; import android.content.res.ColorStateList; import android.content.res.Resources; import android.telephony.TelephonyManager; import android.text.TextUtils; import android.util.Log; import android.view.inputmethod.InputMethodManager; Loading Loading @@ -152,7 +153,9 @@ public abstract class KeyguardInputViewController<T extends KeyguardInputView> } public void startAppearAnimation() { if (TextUtils.isEmpty(mMessageAreaController.getMessage())) { mMessageAreaController.setMessage(getInitialMessageResId()); } mView.startAppearAnimation(); } Loading
packages/SystemUI/src/com/android/keyguard/KeyguardMessageAreaController.java +5 −0 Original line number Diff line number Diff line Loading @@ -103,6 +103,11 @@ public class KeyguardMessageAreaController<T extends KeyguardMessageArea> mView.setNextMessageColor(colorState); } /** Returns the message of the underlying TextView. */ public CharSequence getMessage() { return mView.getText(); } /** * Reload colors from resources. **/ Loading
packages/SystemUI/src/com/android/systemui/keyguard/data/repository/KeyguardBouncerRepository.kt +2 −22 Original line number Diff line number Diff line Loading @@ -16,9 +16,7 @@ package com.android.systemui.keyguard.data.repository import android.hardware.biometrics.BiometricSourceType import com.android.keyguard.KeyguardUpdateMonitor import com.android.keyguard.KeyguardUpdateMonitorCallback import com.android.keyguard.ViewMediatorCallback import com.android.systemui.dagger.SysUISingleton import com.android.systemui.keyguard.shared.model.BouncerShowMessageModel Loading Loading @@ -70,33 +68,15 @@ constructor( private val _keyguardAuthenticated = MutableStateFlow<Boolean?>(null) /** Determines if user is already unlocked */ val keyguardAuthenticated = _keyguardAuthenticated.asStateFlow() var bouncerPromptReason: Int? = null private val _showMessage = MutableStateFlow<BouncerShowMessageModel?>(null) val showMessage = _showMessage.asStateFlow() private val _resourceUpdateRequests = MutableStateFlow(false) val resourceUpdateRequests = _resourceUpdateRequests.asStateFlow() val bouncerPromptReason: Int get() = viewMediatorCallback.bouncerPromptReason val bouncerErrorMessage: CharSequence? get() = viewMediatorCallback.consumeCustomMessage() init { val callback = object : KeyguardUpdateMonitorCallback() { override fun onStrongAuthStateChanged(userId: Int) { bouncerPromptReason = viewMediatorCallback.bouncerPromptReason } override fun onLockedOutStateChanged(type: BiometricSourceType) { if (type == BiometricSourceType.FINGERPRINT) { bouncerPromptReason = viewMediatorCallback.bouncerPromptReason } } } keyguardUpdateMonitor.registerCallback(callback) } fun setPrimaryScrimmed(isScrimmed: Boolean) { _primaryBouncerScrimmed.value = isScrimmed } Loading
packages/SystemUI/src/com/android/systemui/keyguard/ui/binder/KeyguardBouncerViewBinder.kt +4 −12 Original line number Diff line number Diff line Loading @@ -94,6 +94,10 @@ object KeyguardBouncerViewBinder { viewModel.setBouncerViewDelegate(delegate) launch { viewModel.show.collect { hostViewController.showPromptReason(it.promptReason) it.errorMessage?.let { errorMessage -> hostViewController.showErrorMessage(errorMessage) } hostViewController.showPrimarySecurityScreen() hostViewController.appear( SystemBarUtils.getStatusBarHeight(view.context) Loading @@ -101,18 +105,6 @@ object KeyguardBouncerViewBinder { } } launch { viewModel.showPromptReason.collect { prompt -> hostViewController.showPromptReason(prompt) } } launch { viewModel.showBouncerErrorMessage.collect { errorMessage -> hostViewController.showErrorMessage(errorMessage) } } launch { viewModel.showWithFullExpansion.collect { model -> hostViewController.resetSecurityContainer() Loading
packages/SystemUI/src/com/android/systemui/keyguard/ui/viewmodel/KeyguardBouncerViewModel.kt +0 −8 Original line number Diff line number Diff line Loading @@ -26,7 +26,6 @@ import com.android.systemui.statusbar.phone.KeyguardBouncer.EXPANSION_VISIBLE import javax.inject.Inject import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.filter import kotlinx.coroutines.flow.filterNotNull import kotlinx.coroutines.flow.map /** Models UI state for the lock screen bouncer; handles user input. */ Loading @@ -45,13 +44,6 @@ constructor( /** Observe whether bouncer is showing. */ val show: Flow<KeyguardBouncerModel> = interactor.show /** Observe bouncer prompt when bouncer is showing. */ val showPromptReason: Flow<Int> = interactor.show.map { it.promptReason } /** Observe bouncer error message when bouncer is showing. */ val showBouncerErrorMessage: Flow<CharSequence> = interactor.show.map { it.errorMessage }.filterNotNull() /** Observe visible expansion when bouncer is showing. */ val showWithFullExpansion: Flow<KeyguardBouncerModel> = interactor.show.filter { it.expansionAmount == EXPANSION_VISIBLE } Loading