summaryrefslogtreecommitdiff
path: root/packages/SystemUI/src/com/android/keyguard/KeyguardPinBasedInputView.java
diff options
context:
space:
mode:
authorSteven Laver <lavers@google.com>2019-11-05 13:42:59 -0800
committerSteven Laver <lavers@google.com>2019-11-09 01:16:30 +0000
commit7c6cc72e18cc1df5205fd2bc47664e6cc2534ad2 (patch)
treefc34e4ad6037cf231cccc3b56ccd13e82917520a /packages/SystemUI/src/com/android/keyguard/KeyguardPinBasedInputView.java
parent8f4f93bf3ba75d8e83cb0a8618cb80f226ada5ac (diff)
parentda5e1bd24a9a0ca24e7e49fad9e604409e573376 (diff)
Merge RP1A.191024.001
Change-Id: I5cda3bba276e99d948b752be87d4599e9f882e0f
Diffstat (limited to 'packages/SystemUI/src/com/android/keyguard/KeyguardPinBasedInputView.java')
-rw-r--r--packages/SystemUI/src/com/android/keyguard/KeyguardPinBasedInputView.java19
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;
- }
}