Loading packages/SystemUI/src/com/android/keyguard/KeyguardAbsKeyInputViewController.java +7 −9 Original line number Original line Diff line number Diff line Loading @@ -107,15 +107,8 @@ public abstract class KeyguardAbsKeyInputViewController<T extends KeyguardAbsKey // start fresh // start fresh mDismissing = false; mDismissing = false; mView.resetPasswordText(false /* animate */, false /* announce */); mView.resetPasswordText(false /* animate */, false /* announce */); // if the user is currently locked out, enforce it. long deadline = mLockPatternUtils.getLockoutAttemptDeadline( KeyguardUpdateMonitor.getCurrentUser()); if (shouldLockout(deadline)) { handleAttemptLockout(deadline); } else { resetState(); resetState(); } } } @Override @Override public boolean needsInput() { public boolean needsInput() { Loading Loading @@ -277,7 +270,12 @@ public abstract class KeyguardAbsKeyInputViewController<T extends KeyguardAbsKey @Override @Override public void onResume(int reason) { public void onResume(int reason) { mResumed = true; mResumed = true; reset(); // if the user is currently locked out, enforce it. long deadline = mLockPatternUtils.getLockoutAttemptDeadline( KeyguardUpdateMonitor.getCurrentUser()); if (shouldLockout(deadline)) { handleAttemptLockout(deadline); } } } @Override @Override Loading packages/SystemUI/src/com/android/keyguard/KeyguardPatternViewController.java +18 −16 Original line number Original line Diff line number Diff line Loading @@ -260,20 +260,18 @@ public class KeyguardPatternViewController mLockPatternView.setEnabled(true); mLockPatternView.setEnabled(true); mLockPatternView.clearPattern(); mLockPatternView.clearPattern(); // if the user is currently locked out, enforce it. long deadline = mLockPatternUtils.getLockoutAttemptDeadline( KeyguardUpdateMonitor.getCurrentUser()); if (deadline != 0) { handleAttemptLockout(deadline); } else { displayDefaultSecurityMessage(); displayDefaultSecurityMessage(); } } } @Override @Override public void onResume(int reason) { public void onResume(int reason) { super.onResume(reason); super.onResume(reason); reset(); // if the user is currently locked out, enforce it. long deadline = mLockPatternUtils.getLockoutAttemptDeadline( KeyguardUpdateMonitor.getCurrentUser()); if (deadline != 0) { handleAttemptLockout(deadline); } } } @Override @Override Loading @@ -300,34 +298,38 @@ public class KeyguardPatternViewController @Override @Override public void showPromptReason(int reason) { public void showPromptReason(int reason) { /// TODO: move all this logic into the MessageAreaController? /// TODO: move all this logic into the MessageAreaController? int resId = 0; switch (reason) { switch (reason) { case PROMPT_REASON_RESTART: case PROMPT_REASON_RESTART: mMessageAreaController.setMessage(R.string.kg_prompt_reason_restart_pattern); resId = R.string.kg_prompt_reason_restart_pattern; break; break; case PROMPT_REASON_TIMEOUT: case PROMPT_REASON_TIMEOUT: mMessageAreaController.setMessage(R.string.kg_prompt_reason_timeout_pattern); resId = R.string.kg_prompt_reason_timeout_pattern; break; break; case PROMPT_REASON_DEVICE_ADMIN: case PROMPT_REASON_DEVICE_ADMIN: mMessageAreaController.setMessage(R.string.kg_prompt_reason_device_admin); resId = R.string.kg_prompt_reason_device_admin; break; break; case PROMPT_REASON_USER_REQUEST: case PROMPT_REASON_USER_REQUEST: mMessageAreaController.setMessage(R.string.kg_prompt_reason_user_request); resId = R.string.kg_prompt_reason_user_request; break; break; case PROMPT_REASON_PREPARE_FOR_UPDATE: case PROMPT_REASON_PREPARE_FOR_UPDATE: mMessageAreaController.setMessage(R.string.kg_prompt_reason_timeout_pattern); resId = R.string.kg_prompt_reason_timeout_pattern; break; break; case PROMPT_REASON_NON_STRONG_BIOMETRIC_TIMEOUT: case PROMPT_REASON_NON_STRONG_BIOMETRIC_TIMEOUT: mMessageAreaController.setMessage(R.string.kg_prompt_reason_timeout_pattern); resId = R.string.kg_prompt_reason_timeout_pattern; break; break; case PROMPT_REASON_TRUSTAGENT_EXPIRED: case PROMPT_REASON_TRUSTAGENT_EXPIRED: mMessageAreaController.setMessage(R.string.kg_prompt_reason_timeout_pattern); resId = R.string.kg_prompt_reason_timeout_pattern; break; break; case PROMPT_REASON_NONE: case PROMPT_REASON_NONE: break; break; default: default: mMessageAreaController.setMessage(R.string.kg_prompt_reason_timeout_pattern); resId = R.string.kg_prompt_reason_timeout_pattern; break; break; } } if (resId != 0) { mMessageAreaController.setMessage(getResources().getText(resId), /* animate= */ false); } } } @Override @Override Loading packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainerController.java +12 −0 Original line number Original line Diff line number Diff line Loading @@ -40,6 +40,7 @@ import android.metrics.LogMaker; import android.os.SystemClock; import android.os.SystemClock; import android.os.UserHandle; import android.os.UserHandle; import android.telephony.TelephonyManager; import android.telephony.TelephonyManager; import android.text.TextUtils; import android.util.Log; import android.util.Log; import android.util.MathUtils; import android.util.MathUtils; import android.util.Slog; import android.util.Slog; Loading @@ -64,6 +65,7 @@ import com.android.keyguard.KeyguardSecurityContainer.BouncerUiEvent; import com.android.keyguard.KeyguardSecurityContainer.SwipeListener; import com.android.keyguard.KeyguardSecurityContainer.SwipeListener; import com.android.keyguard.KeyguardSecurityModel.SecurityMode; import com.android.keyguard.KeyguardSecurityModel.SecurityMode; import com.android.keyguard.dagger.KeyguardBouncerScope; import com.android.keyguard.dagger.KeyguardBouncerScope; import com.android.settingslib.Utils; import com.android.settingslib.utils.ThreadUtils; import com.android.settingslib.utils.ThreadUtils; import com.android.systemui.Gefingerpoken; import com.android.systemui.Gefingerpoken; import com.android.systemui.R; import com.android.systemui.R; Loading Loading @@ -634,6 +636,16 @@ public class KeyguardSecurityContainerController extends ViewController<Keyguard mKeyguardStateController.isFaceAuthEnabled()); mKeyguardStateController.isFaceAuthEnabled()); } } /** Sets an initial message that would override the default message */ public void setInitialMessage() { CharSequence customMessage = mViewMediatorCallback.consumeCustomMessage(); if (!TextUtils.isEmpty(customMessage)) { showMessage(customMessage, Utils.getColorError(getContext())); return; } showPromptReason(mViewMediatorCallback.getBouncerPromptReason()); } /** /** * Show the bouncer and start appear animations. * Show the bouncer and start appear animations. * * Loading packages/SystemUI/src/com/android/systemui/keyguard/data/repository/KeyguardBouncerRepository.kt +0 −7 Original line number Original line Diff line number Diff line Loading @@ -65,8 +65,6 @@ interface KeyguardBouncerRepository { val keyguardAuthenticated: StateFlow<Boolean?> val keyguardAuthenticated: StateFlow<Boolean?> val showMessage: StateFlow<BouncerShowMessageModel?> val showMessage: StateFlow<BouncerShowMessageModel?> val resourceUpdateRequests: StateFlow<Boolean> val resourceUpdateRequests: StateFlow<Boolean> val bouncerPromptReason: Int val bouncerErrorMessage: CharSequence? val alternateBouncerVisible: StateFlow<Boolean> val alternateBouncerVisible: StateFlow<Boolean> val alternateBouncerUIAvailable: StateFlow<Boolean> val alternateBouncerUIAvailable: StateFlow<Boolean> val sideFpsShowing: StateFlow<Boolean> val sideFpsShowing: StateFlow<Boolean> Loading Loading @@ -145,11 +143,6 @@ constructor( override val showMessage = _showMessage.asStateFlow() override val showMessage = _showMessage.asStateFlow() private val _resourceUpdateRequests = MutableStateFlow(false) private val _resourceUpdateRequests = MutableStateFlow(false) override val resourceUpdateRequests = _resourceUpdateRequests.asStateFlow() override val resourceUpdateRequests = _resourceUpdateRequests.asStateFlow() override val bouncerPromptReason: Int get() = viewMediatorCallback.bouncerPromptReason override val bouncerErrorMessage: CharSequence? get() = viewMediatorCallback.consumeCustomMessage() /** Values associated with the AlternateBouncer */ /** Values associated with the AlternateBouncer */ private val _alternateBouncerVisible = MutableStateFlow(false) private val _alternateBouncerVisible = MutableStateFlow(false) override val alternateBouncerVisible = _alternateBouncerVisible.asStateFlow() override val alternateBouncerVisible = _alternateBouncerVisible.asStateFlow() Loading packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/PrimaryBouncerInteractor.kt +1 −8 Original line number Original line Diff line number Diff line Loading @@ -27,7 +27,6 @@ import com.android.keyguard.KeyguardConstants import com.android.keyguard.KeyguardSecurityModel import com.android.keyguard.KeyguardSecurityModel import com.android.keyguard.KeyguardUpdateMonitor import com.android.keyguard.KeyguardUpdateMonitor import com.android.keyguard.KeyguardUpdateMonitorCallback import com.android.keyguard.KeyguardUpdateMonitorCallback import com.android.settingslib.Utils import com.android.systemui.DejankUtils import com.android.systemui.DejankUtils import com.android.systemui.R import com.android.systemui.R import com.android.systemui.classifier.FalsingCollector import com.android.systemui.classifier.FalsingCollector Loading @@ -42,12 +41,12 @@ import com.android.systemui.plugins.ActivityStarter import com.android.systemui.shared.system.SysUiStatsLog import com.android.systemui.shared.system.SysUiStatsLog import com.android.systemui.statusbar.phone.KeyguardBypassController import com.android.systemui.statusbar.phone.KeyguardBypassController import com.android.systemui.statusbar.policy.KeyguardStateController import com.android.systemui.statusbar.policy.KeyguardStateController import javax.inject.Inject import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.combine import kotlinx.coroutines.flow.combine import kotlinx.coroutines.flow.filter import kotlinx.coroutines.flow.filter import kotlinx.coroutines.flow.filterNotNull import kotlinx.coroutines.flow.filterNotNull import kotlinx.coroutines.flow.map import kotlinx.coroutines.flow.map import javax.inject.Inject /** /** * Encapsulates business logic for interacting with the lock-screen primary (pin/pattern/password) * Encapsulates business logic for interacting with the lock-screen primary (pin/pattern/password) Loading Loading @@ -82,12 +81,6 @@ constructor( /** Runnable to show the primary bouncer. */ /** Runnable to show the primary bouncer. */ val showRunnable = Runnable { val showRunnable = Runnable { repository.setPrimaryShow(true) repository.setPrimaryShow(true) primaryBouncerView.delegate?.showPromptReason(repository.bouncerPromptReason) (repository.bouncerErrorMessage as? String)?.let { repository.setShowMessage( BouncerShowMessageModel(message = it, Utils.getColorError(context)) ) } repository.setPrimaryShowingSoon(false) repository.setPrimaryShowingSoon(false) primaryBouncerCallbackInteractor.dispatchVisibilityChanged(View.VISIBLE) primaryBouncerCallbackInteractor.dispatchVisibilityChanged(View.VISIBLE) } } Loading Loading
packages/SystemUI/src/com/android/keyguard/KeyguardAbsKeyInputViewController.java +7 −9 Original line number Original line Diff line number Diff line Loading @@ -107,15 +107,8 @@ public abstract class KeyguardAbsKeyInputViewController<T extends KeyguardAbsKey // start fresh // start fresh mDismissing = false; mDismissing = false; mView.resetPasswordText(false /* animate */, false /* announce */); mView.resetPasswordText(false /* animate */, false /* announce */); // if the user is currently locked out, enforce it. long deadline = mLockPatternUtils.getLockoutAttemptDeadline( KeyguardUpdateMonitor.getCurrentUser()); if (shouldLockout(deadline)) { handleAttemptLockout(deadline); } else { resetState(); resetState(); } } } @Override @Override public boolean needsInput() { public boolean needsInput() { Loading Loading @@ -277,7 +270,12 @@ public abstract class KeyguardAbsKeyInputViewController<T extends KeyguardAbsKey @Override @Override public void onResume(int reason) { public void onResume(int reason) { mResumed = true; mResumed = true; reset(); // if the user is currently locked out, enforce it. long deadline = mLockPatternUtils.getLockoutAttemptDeadline( KeyguardUpdateMonitor.getCurrentUser()); if (shouldLockout(deadline)) { handleAttemptLockout(deadline); } } } @Override @Override Loading
packages/SystemUI/src/com/android/keyguard/KeyguardPatternViewController.java +18 −16 Original line number Original line Diff line number Diff line Loading @@ -260,20 +260,18 @@ public class KeyguardPatternViewController mLockPatternView.setEnabled(true); mLockPatternView.setEnabled(true); mLockPatternView.clearPattern(); mLockPatternView.clearPattern(); // if the user is currently locked out, enforce it. long deadline = mLockPatternUtils.getLockoutAttemptDeadline( KeyguardUpdateMonitor.getCurrentUser()); if (deadline != 0) { handleAttemptLockout(deadline); } else { displayDefaultSecurityMessage(); displayDefaultSecurityMessage(); } } } @Override @Override public void onResume(int reason) { public void onResume(int reason) { super.onResume(reason); super.onResume(reason); reset(); // if the user is currently locked out, enforce it. long deadline = mLockPatternUtils.getLockoutAttemptDeadline( KeyguardUpdateMonitor.getCurrentUser()); if (deadline != 0) { handleAttemptLockout(deadline); } } } @Override @Override Loading @@ -300,34 +298,38 @@ public class KeyguardPatternViewController @Override @Override public void showPromptReason(int reason) { public void showPromptReason(int reason) { /// TODO: move all this logic into the MessageAreaController? /// TODO: move all this logic into the MessageAreaController? int resId = 0; switch (reason) { switch (reason) { case PROMPT_REASON_RESTART: case PROMPT_REASON_RESTART: mMessageAreaController.setMessage(R.string.kg_prompt_reason_restart_pattern); resId = R.string.kg_prompt_reason_restart_pattern; break; break; case PROMPT_REASON_TIMEOUT: case PROMPT_REASON_TIMEOUT: mMessageAreaController.setMessage(R.string.kg_prompt_reason_timeout_pattern); resId = R.string.kg_prompt_reason_timeout_pattern; break; break; case PROMPT_REASON_DEVICE_ADMIN: case PROMPT_REASON_DEVICE_ADMIN: mMessageAreaController.setMessage(R.string.kg_prompt_reason_device_admin); resId = R.string.kg_prompt_reason_device_admin; break; break; case PROMPT_REASON_USER_REQUEST: case PROMPT_REASON_USER_REQUEST: mMessageAreaController.setMessage(R.string.kg_prompt_reason_user_request); resId = R.string.kg_prompt_reason_user_request; break; break; case PROMPT_REASON_PREPARE_FOR_UPDATE: case PROMPT_REASON_PREPARE_FOR_UPDATE: mMessageAreaController.setMessage(R.string.kg_prompt_reason_timeout_pattern); resId = R.string.kg_prompt_reason_timeout_pattern; break; break; case PROMPT_REASON_NON_STRONG_BIOMETRIC_TIMEOUT: case PROMPT_REASON_NON_STRONG_BIOMETRIC_TIMEOUT: mMessageAreaController.setMessage(R.string.kg_prompt_reason_timeout_pattern); resId = R.string.kg_prompt_reason_timeout_pattern; break; break; case PROMPT_REASON_TRUSTAGENT_EXPIRED: case PROMPT_REASON_TRUSTAGENT_EXPIRED: mMessageAreaController.setMessage(R.string.kg_prompt_reason_timeout_pattern); resId = R.string.kg_prompt_reason_timeout_pattern; break; break; case PROMPT_REASON_NONE: case PROMPT_REASON_NONE: break; break; default: default: mMessageAreaController.setMessage(R.string.kg_prompt_reason_timeout_pattern); resId = R.string.kg_prompt_reason_timeout_pattern; break; break; } } if (resId != 0) { mMessageAreaController.setMessage(getResources().getText(resId), /* animate= */ false); } } } @Override @Override Loading
packages/SystemUI/src/com/android/keyguard/KeyguardSecurityContainerController.java +12 −0 Original line number Original line Diff line number Diff line Loading @@ -40,6 +40,7 @@ import android.metrics.LogMaker; import android.os.SystemClock; import android.os.SystemClock; import android.os.UserHandle; import android.os.UserHandle; import android.telephony.TelephonyManager; import android.telephony.TelephonyManager; import android.text.TextUtils; import android.util.Log; import android.util.Log; import android.util.MathUtils; import android.util.MathUtils; import android.util.Slog; import android.util.Slog; Loading @@ -64,6 +65,7 @@ import com.android.keyguard.KeyguardSecurityContainer.BouncerUiEvent; import com.android.keyguard.KeyguardSecurityContainer.SwipeListener; import com.android.keyguard.KeyguardSecurityContainer.SwipeListener; import com.android.keyguard.KeyguardSecurityModel.SecurityMode; import com.android.keyguard.KeyguardSecurityModel.SecurityMode; import com.android.keyguard.dagger.KeyguardBouncerScope; import com.android.keyguard.dagger.KeyguardBouncerScope; import com.android.settingslib.Utils; import com.android.settingslib.utils.ThreadUtils; import com.android.settingslib.utils.ThreadUtils; import com.android.systemui.Gefingerpoken; import com.android.systemui.Gefingerpoken; import com.android.systemui.R; import com.android.systemui.R; Loading Loading @@ -634,6 +636,16 @@ public class KeyguardSecurityContainerController extends ViewController<Keyguard mKeyguardStateController.isFaceAuthEnabled()); mKeyguardStateController.isFaceAuthEnabled()); } } /** Sets an initial message that would override the default message */ public void setInitialMessage() { CharSequence customMessage = mViewMediatorCallback.consumeCustomMessage(); if (!TextUtils.isEmpty(customMessage)) { showMessage(customMessage, Utils.getColorError(getContext())); return; } showPromptReason(mViewMediatorCallback.getBouncerPromptReason()); } /** /** * Show the bouncer and start appear animations. * Show the bouncer and start appear animations. * * Loading
packages/SystemUI/src/com/android/systemui/keyguard/data/repository/KeyguardBouncerRepository.kt +0 −7 Original line number Original line Diff line number Diff line Loading @@ -65,8 +65,6 @@ interface KeyguardBouncerRepository { val keyguardAuthenticated: StateFlow<Boolean?> val keyguardAuthenticated: StateFlow<Boolean?> val showMessage: StateFlow<BouncerShowMessageModel?> val showMessage: StateFlow<BouncerShowMessageModel?> val resourceUpdateRequests: StateFlow<Boolean> val resourceUpdateRequests: StateFlow<Boolean> val bouncerPromptReason: Int val bouncerErrorMessage: CharSequence? val alternateBouncerVisible: StateFlow<Boolean> val alternateBouncerVisible: StateFlow<Boolean> val alternateBouncerUIAvailable: StateFlow<Boolean> val alternateBouncerUIAvailable: StateFlow<Boolean> val sideFpsShowing: StateFlow<Boolean> val sideFpsShowing: StateFlow<Boolean> Loading Loading @@ -145,11 +143,6 @@ constructor( override val showMessage = _showMessage.asStateFlow() override val showMessage = _showMessage.asStateFlow() private val _resourceUpdateRequests = MutableStateFlow(false) private val _resourceUpdateRequests = MutableStateFlow(false) override val resourceUpdateRequests = _resourceUpdateRequests.asStateFlow() override val resourceUpdateRequests = _resourceUpdateRequests.asStateFlow() override val bouncerPromptReason: Int get() = viewMediatorCallback.bouncerPromptReason override val bouncerErrorMessage: CharSequence? get() = viewMediatorCallback.consumeCustomMessage() /** Values associated with the AlternateBouncer */ /** Values associated with the AlternateBouncer */ private val _alternateBouncerVisible = MutableStateFlow(false) private val _alternateBouncerVisible = MutableStateFlow(false) override val alternateBouncerVisible = _alternateBouncerVisible.asStateFlow() override val alternateBouncerVisible = _alternateBouncerVisible.asStateFlow() Loading
packages/SystemUI/src/com/android/systemui/keyguard/domain/interactor/PrimaryBouncerInteractor.kt +1 −8 Original line number Original line Diff line number Diff line Loading @@ -27,7 +27,6 @@ import com.android.keyguard.KeyguardConstants import com.android.keyguard.KeyguardSecurityModel import com.android.keyguard.KeyguardSecurityModel import com.android.keyguard.KeyguardUpdateMonitor import com.android.keyguard.KeyguardUpdateMonitor import com.android.keyguard.KeyguardUpdateMonitorCallback import com.android.keyguard.KeyguardUpdateMonitorCallback import com.android.settingslib.Utils import com.android.systemui.DejankUtils import com.android.systemui.DejankUtils import com.android.systemui.R import com.android.systemui.R import com.android.systemui.classifier.FalsingCollector import com.android.systemui.classifier.FalsingCollector Loading @@ -42,12 +41,12 @@ import com.android.systemui.plugins.ActivityStarter import com.android.systemui.shared.system.SysUiStatsLog import com.android.systemui.shared.system.SysUiStatsLog import com.android.systemui.statusbar.phone.KeyguardBypassController import com.android.systemui.statusbar.phone.KeyguardBypassController import com.android.systemui.statusbar.policy.KeyguardStateController import com.android.systemui.statusbar.policy.KeyguardStateController import javax.inject.Inject import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.combine import kotlinx.coroutines.flow.combine import kotlinx.coroutines.flow.filter import kotlinx.coroutines.flow.filter import kotlinx.coroutines.flow.filterNotNull import kotlinx.coroutines.flow.filterNotNull import kotlinx.coroutines.flow.map import kotlinx.coroutines.flow.map import javax.inject.Inject /** /** * Encapsulates business logic for interacting with the lock-screen primary (pin/pattern/password) * Encapsulates business logic for interacting with the lock-screen primary (pin/pattern/password) Loading Loading @@ -82,12 +81,6 @@ constructor( /** Runnable to show the primary bouncer. */ /** Runnable to show the primary bouncer. */ val showRunnable = Runnable { val showRunnable = Runnable { repository.setPrimaryShow(true) repository.setPrimaryShow(true) primaryBouncerView.delegate?.showPromptReason(repository.bouncerPromptReason) (repository.bouncerErrorMessage as? String)?.let { repository.setShowMessage( BouncerShowMessageModel(message = it, Utils.getColorError(context)) ) } repository.setPrimaryShowingSoon(false) repository.setPrimaryShowingSoon(false) primaryBouncerCallbackInteractor.dispatchVisibilityChanged(View.VISIBLE) primaryBouncerCallbackInteractor.dispatchVisibilityChanged(View.VISIBLE) } } Loading