diff options
author | Rich Cannings <richc@google.com> | 2019-02-21 12:40:36 -0800 |
---|---|---|
committer | Rich Cannings <richc@google.com> | 2019-02-21 14:39:05 -0800 |
commit | f64ec63a027447d8e38dd3e0d05d127cf06dccfc (patch) | |
tree | b308f07e28dea17a30eb1e7a8cf59584f60a42a7 /packages/SystemUI/src/com/android/keyguard/KeyguardAbsKeyInputView.java | |
parent | 3b5741c5604f538aab7434eb746327dc0124ba74 (diff) |
Refactor passwords/pins/patterns to byte[]
Relating to frameworks/base
Bug: 120484642
Test: manual - test setting and unlocking passwords/pins/patterns.
automated - about 20 failing due to an issue in the test code.
Change-Id: I57aa530ca2db1a026c56b66f5b4c91172f2667f6
Diffstat (limited to 'packages/SystemUI/src/com/android/keyguard/KeyguardAbsKeyInputView.java')
-rw-r--r-- | packages/SystemUI/src/com/android/keyguard/KeyguardAbsKeyInputView.java | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardAbsKeyInputView.java b/packages/SystemUI/src/com/android/keyguard/KeyguardAbsKeyInputView.java index a055950a5522..4cb8d90927fd 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardAbsKeyInputView.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardAbsKeyInputView.java @@ -34,6 +34,8 @@ import com.android.internal.util.LatencyTracker; import com.android.internal.widget.LockPatternChecker; import com.android.internal.widget.LockPatternUtils; +import java.util.Arrays; + /** * Base class for PIN and password unlock screens. */ @@ -124,18 +126,19 @@ public abstract class KeyguardAbsKeyInputView extends LinearLayout protected void verifyPasswordAndUnlock() { if (mDismissing) return; // already verified but haven't been dismissed; don't do it again. - final String entry = getPasswordText(); + final byte[] entry = getPasswordText(); setPasswordEntryInputEnabled(false); if (mPendingLockCheck != null) { mPendingLockCheck.cancel(false); } final int userId = KeyguardUpdateMonitor.getCurrentUser(); - if (entry.length() <= MINIMUM_PASSWORD_LENGTH_BEFORE_REPORT) { + if (entry.length <= MINIMUM_PASSWORD_LENGTH_BEFORE_REPORT) { // to avoid accidental lockout, only count attempts that are long enough to be a // real password. This may require some tweaking. setPasswordEntryInputEnabled(true); onPasswordChecked(userId, false /* matched */, 0, false /* not valid - too short */); + Arrays.fill(entry, (byte) 0); return; } @@ -157,6 +160,7 @@ public abstract class KeyguardAbsKeyInputView extends LinearLayout } onPasswordChecked(userId, true /* matched */, 0 /* timeoutMs */, true /* isValidPassword */); + Arrays.fill(entry, (byte) 0); } @Override @@ -171,6 +175,7 @@ public abstract class KeyguardAbsKeyInputView extends LinearLayout onPasswordChecked(userId, false /* matched */, timeoutMs, true /* isValidPassword */); } + Arrays.fill(entry, (byte) 0); } @Override @@ -181,6 +186,7 @@ public abstract class KeyguardAbsKeyInputView extends LinearLayout LatencyTracker.getInstance(mContext).onActionEnd( ACTION_CHECK_CREDENTIAL_UNLOCKED); } + Arrays.fill(entry, (byte) 0); } }); } @@ -211,7 +217,7 @@ public abstract class KeyguardAbsKeyInputView extends LinearLayout } protected abstract void resetPasswordText(boolean animate, boolean announce); - protected abstract String getPasswordText(); + protected abstract byte[] getPasswordText(); protected abstract void setPasswordEntryEnabled(boolean enabled); protected abstract void setPasswordEntryInputEnabled(boolean enabled); |