@@ -60,19 +60,18 @@ public class PasswordUnlockScreen extends LinearLayout implements KeyguardScreen
6060 private final KeyguardUpdateMonitor mUpdateMonitor ;
6161 private final KeyguardScreenCallback mCallback ;
6262
63- private boolean mIsAlpha ;
63+ private final boolean mIsAlpha ;
6464
65- private EditText mPasswordEntry ;
66- private LockPatternUtils mLockPatternUtils ;
67- private PasswordEntryKeyboardView mKeyboardView ;
68- private PasswordEntryKeyboardHelper mKeyboardHelper ;
65+ private final EditText mPasswordEntry ;
66+ private final LockPatternUtils mLockPatternUtils ;
67+ private final PasswordEntryKeyboardView mKeyboardView ;
68+ private final PasswordEntryKeyboardHelper mKeyboardHelper ;
6969
70- private int mCreationOrientation ;
71- private int mCreationHardKeyboardHidden ;
72- private CountDownTimer mCountdownTimer ;
70+ private final int mCreationOrientation ;
71+ private final int mCreationHardKeyboardHidden ;
7372
74- private KeyguardStatusViewManager mStatusViewManager ;
75- private boolean mUseSystemIME = true ; // TODO: Make configurable
73+ private final KeyguardStatusViewManager mStatusViewManager ;
74+ private final boolean mUseSystemIME = true ; // TODO: Make configurable
7675 private boolean mResuming ; // used to prevent poking the wakelock during onResume()
7776
7877 // To avoid accidental lockout due to events while the device in in the pocket, ignore
@@ -119,6 +118,19 @@ public PasswordUnlockScreen(Context context, Configuration configuration,
119118 mKeyboardHelper .setKeyboardMode (PasswordEntryKeyboardHelper .KEYBOARD_MODE_NUMERIC );
120119 mKeyboardView .setVisibility (mCreationHardKeyboardHidden
121120 == Configuration .HARDKEYBOARDHIDDEN_NO ? View .INVISIBLE : View .VISIBLE );
121+
122+ // The delete button is of the PIN keyboard itself in some (e.g. tablet) layouts,
123+ // not a separate view
124+ View pinDelete = findViewById (R .id .pinDel );
125+ if (pinDelete != null ) {
126+ pinDelete .setVisibility (View .VISIBLE );
127+ pinDelete .setOnClickListener (new OnClickListener () {
128+ @ Override
129+ public void onClick (View v ) {
130+ mKeyboardHelper .handleBackspace ();
131+ }
132+ });
133+ }
122134 }
123135
124136 mPasswordEntry .requestFocus ();
@@ -293,7 +305,7 @@ private void handleAttemptLockout(long elapsedRealtimeDeadline) {
293305 mPasswordEntry .setEnabled (false );
294306 mKeyboardView .setEnabled (false );
295307 long elapsedRealtime = SystemClock .elapsedRealtime ();
296- mCountdownTimer = new CountDownTimer (elapsedRealtimeDeadline - elapsedRealtime , 1000 ) {
308+ new CountDownTimer (elapsedRealtimeDeadline - elapsedRealtime , 1000 ) {
297309
298310 @ Override
299311 public void onTick (long millisUntilFinished ) {
@@ -309,7 +321,6 @@ public void onFinish() {
309321 mPasswordEntry .setEnabled (true );
310322 mKeyboardView .setEnabled (true );
311323 mStatusViewManager .resetStatusInfo ();
312- mCountdownTimer = null ;
313324 }
314325 }.start ();
315326 }
0 commit comments