diff options
author | Dave Mankoff <mankoff@google.com> | 2020-09-23 14:01:33 +0000 |
---|---|---|
committer | Dave Mankoff <mankoff@google.com> | 2020-09-24 11:04:52 -0400 |
commit | 9a80cc2ec8c627b0fc290ffc4b318382a758ed87 (patch) | |
tree | c73ab719bb01ebfeeea007134795f5c6ec4f0891 /packages/SystemUI/src/com/android/keyguard/KeyguardAbsKeyInputViewController.java | |
parent | 3b7e026c067af221f040ceea6da97cb354dad2a3 (diff) |
Revert^2 "9/N Clean Up Keyguard Class Structure"
b00c929394cb6bce158265af9606a8eb5a79e47a
Change-Id: I42d17262a789d2eb106a924b442a9d3debcc35e4
Diffstat (limited to 'packages/SystemUI/src/com/android/keyguard/KeyguardAbsKeyInputViewController.java')
-rw-r--r-- | packages/SystemUI/src/com/android/keyguard/KeyguardAbsKeyInputViewController.java | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardAbsKeyInputViewController.java b/packages/SystemUI/src/com/android/keyguard/KeyguardAbsKeyInputViewController.java index 261534e06f60..53f847434dcc 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardAbsKeyInputViewController.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardAbsKeyInputViewController.java @@ -20,6 +20,7 @@ import static com.android.internal.util.LatencyTracker.ACTION_CHECK_CREDENTIAL; import static com.android.internal.util.LatencyTracker.ACTION_CHECK_CREDENTIAL_UNLOCKED; import static com.android.keyguard.KeyguardAbsKeyInputView.MINIMUM_PASSWORD_LENGTH_BEFORE_REPORT; +import android.content.res.ColorStateList; import android.os.AsyncTask; import android.os.CountDownTimer; import android.os.SystemClock; @@ -38,7 +39,6 @@ public abstract class KeyguardAbsKeyInputViewController<T extends KeyguardAbsKey extends KeyguardInputViewController<T> { private final KeyguardUpdateMonitor mKeyguardUpdateMonitor; private final LockPatternUtils mLockPatternUtils; - protected final KeyguardSecurityCallback mKeyguardSecurityCallback; private final LatencyTracker mLatencyTracker; private CountDownTimer mCountdownTimer; protected KeyguardMessageAreaController mMessageAreaController; @@ -59,7 +59,7 @@ public abstract class KeyguardAbsKeyInputViewController<T extends KeyguardAbsKey private final EmergencyButtonCallback mEmergencyButtonCallback = new EmergencyButtonCallback() { @Override public void onEmergencyButtonClickedWhenInCall() { - mKeyguardSecurityCallback.reset(); + getKeyguardSecurityCallback().reset(); } }; @@ -73,7 +73,6 @@ public abstract class KeyguardAbsKeyInputViewController<T extends KeyguardAbsKey super(view, securityMode, keyguardSecurityCallback); mKeyguardUpdateMonitor = keyguardUpdateMonitor; mLockPatternUtils = lockPatternUtils; - mKeyguardSecurityCallback = keyguardSecurityCallback; mLatencyTracker = latencyTracker; KeyguardMessageArea kma = KeyguardMessageArea.findSecurityMessageDisplay(mView); mMessageAreaController = messageAreaControllerFactory.create(kma); @@ -112,6 +111,19 @@ public abstract class KeyguardAbsKeyInputViewController<T extends KeyguardAbsKey } } + @Override + public boolean needsInput() { + return false; + } + + @Override + public void showMessage(CharSequence message, ColorStateList colorState) { + if (colorState != null) { + mMessageAreaController.setNextMessageColor(colorState); + } + mMessageAreaController.setMessage(message); + } + // Allow subclasses to override this behavior protected boolean shouldLockout(long deadline) { return deadline != 0; @@ -144,14 +156,14 @@ public abstract class KeyguardAbsKeyInputViewController<T extends KeyguardAbsKey void onPasswordChecked(int userId, boolean matched, int timeoutMs, boolean isValidPassword) { boolean dismissKeyguard = KeyguardUpdateMonitor.getCurrentUser() == userId; if (matched) { - mKeyguardSecurityCallback.reportUnlockAttempt(userId, true, 0); + getKeyguardSecurityCallback().reportUnlockAttempt(userId, true, 0); if (dismissKeyguard) { mDismissing = true; - mKeyguardSecurityCallback.dismiss(true, userId); + getKeyguardSecurityCallback().dismiss(true, userId); } } else { if (isValidPassword) { - mKeyguardSecurityCallback.reportUnlockAttempt(userId, false, timeoutMs); + getKeyguardSecurityCallback().reportUnlockAttempt(userId, false, timeoutMs); if (timeoutMs > 0) { long deadline = mLockPatternUtils.setLockoutAttemptDeadline( userId, timeoutMs); @@ -236,8 +248,8 @@ public abstract class KeyguardAbsKeyInputViewController<T extends KeyguardAbsKey } protected void onUserInput() { - mKeyguardSecurityCallback.userActivity(); - mKeyguardSecurityCallback.onUserInput(); + getKeyguardSecurityCallback().userActivity(); + getKeyguardSecurityCallback().onUserInput(); mMessageAreaController.setMessage(""); } |