diff options
Diffstat (limited to 'packages/SystemUI/src/com/android/keyguard/KeyguardPinBasedInputView.java')
-rw-r--r-- | packages/SystemUI/src/com/android/keyguard/KeyguardPinBasedInputView.java | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardPinBasedInputView.java b/packages/SystemUI/src/com/android/keyguard/KeyguardPinBasedInputView.java index 274f739d8c29..c67deccb1f62 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardPinBasedInputView.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardPinBasedInputView.java @@ -23,6 +23,7 @@ import android.view.KeyEvent; import android.view.MotionEvent; import android.view.View; +import com.android.internal.widget.LockscreenCredential; import com.android.systemui.R; /** @@ -167,8 +168,8 @@ public abstract class KeyguardPinBasedInputView extends KeyguardAbsKeyInputView } @Override - protected byte[] getPasswordText() { - return charSequenceToByteArray(mPasswordEntry.getText()); + protected LockscreenCredential getEnteredCredential() { + return LockscreenCredential.createPinOrNone(mPasswordEntry.getText()); } @Override @@ -266,18 +267,4 @@ public abstract class KeyguardPinBasedInputView extends KeyguardAbsKeyInputView return getContext().getString( com.android.internal.R.string.keyguard_accessibility_pin_unlock); } - - /* - * This method avoids creating a new string when getting a byte array from EditView#getText(). - */ - private static byte[] charSequenceToByteArray(CharSequence chars) { - if (chars == null) { - return null; - } - byte[] bytes = new byte[chars.length()]; - for (int i = 0; i < chars.length(); i++) { - bytes[i] = (byte) chars.charAt(i); - } - return bytes; - } } |