diff --git a/core/java/com/android/internal/widget/PasswordEntryKeyboardHelper.java b/core/java/com/android/internal/widget/PasswordEntryKeyboardHelper.java index 366b983c39239..01df48acd1440 100644 --- a/core/java/com/android/internal/widget/PasswordEntryKeyboardHelper.java +++ b/core/java/com/android/internal/widget/PasswordEntryKeyboardHelper.java @@ -48,11 +48,11 @@ public class PasswordEntryKeyboardHelper implements OnKeyboardActionListener { private PasswordEntryKeyboard mSymbolsKeyboard; private PasswordEntryKeyboard mSymbolsKeyboardShifted; private PasswordEntryKeyboard mNumericKeyboard; - private Context mContext; - private View mTargetView; - private KeyboardView mKeyboardView; + private final Context mContext; + private final View mTargetView; + private final KeyboardView mKeyboardView; private long[] mVibratePattern; - private Vibrator mVibrator; + private final Vibrator mVibrator; public PasswordEntryKeyboardHelper(Context context, KeyboardView keyboardView, View targetView) { this(context, keyboardView, targetView, true); @@ -228,7 +228,7 @@ public class PasswordEntryKeyboardHelper implements OnKeyboardActionListener { } } - private void handleBackspace() { + public void handleBackspace() { sendDownUpKeyEvents(KeyEvent.KEYCODE_DEL); } diff --git a/core/res/res/layout/keyguard_screen_password_landscape.xml b/core/res/res/layout/keyguard_screen_password_landscape.xml index 8bc5f34a84a63..e34822d2f7c7b 100644 --- a/core/res/res/layout/keyguard_screen_password_landscape.xml +++ b/core/res/res/layout/keyguard_screen_password_landscape.xml @@ -135,7 +135,8 @@ + android:layout_gravity="center_vertical" + android:background="@drawable/lockscreen_password_field_dark"> + + + + @@ -110,12 +113,24 @@ android:textStyle="normal" android:inputType="textPassword" android:textSize="36sp" - android:background="@drawable/lockscreen_password_field_dark" + android:background="@null" android:textAppearance="?android:attr/textAppearanceMedium" android:textColor="#ffffffff" android:imeOptions="actionDone" /> + + + + - - + android:keyEdgeFlags="right"/> diff --git a/policy/src/com/android/internal/policy/impl/PasswordUnlockScreen.java b/policy/src/com/android/internal/policy/impl/PasswordUnlockScreen.java index 6d2f2f29fc057..ec0072c3c2103 100644 --- a/policy/src/com/android/internal/policy/impl/PasswordUnlockScreen.java +++ b/policy/src/com/android/internal/policy/impl/PasswordUnlockScreen.java @@ -60,19 +60,18 @@ public class PasswordUnlockScreen extends LinearLayout implements KeyguardScreen private final KeyguardUpdateMonitor mUpdateMonitor; private final KeyguardScreenCallback mCallback; - private boolean mIsAlpha; + private final boolean mIsAlpha; - private EditText mPasswordEntry; - private LockPatternUtils mLockPatternUtils; - private PasswordEntryKeyboardView mKeyboardView; - private PasswordEntryKeyboardHelper mKeyboardHelper; + private final EditText mPasswordEntry; + private final LockPatternUtils mLockPatternUtils; + private final PasswordEntryKeyboardView mKeyboardView; + private final PasswordEntryKeyboardHelper mKeyboardHelper; - private int mCreationOrientation; - private int mCreationHardKeyboardHidden; - private CountDownTimer mCountdownTimer; + private final int mCreationOrientation; + private final int mCreationHardKeyboardHidden; - private KeyguardStatusViewManager mStatusViewManager; - private boolean mUseSystemIME = true; // TODO: Make configurable + private final KeyguardStatusViewManager mStatusViewManager; + private final boolean mUseSystemIME = true; // TODO: Make configurable private boolean mResuming; // used to prevent poking the wakelock during onResume() // To avoid accidental lockout due to events while the device in in the pocket, ignore @@ -119,6 +118,19 @@ public class PasswordUnlockScreen extends LinearLayout implements KeyguardScreen mKeyboardHelper.setKeyboardMode(PasswordEntryKeyboardHelper.KEYBOARD_MODE_NUMERIC); mKeyboardView.setVisibility(mCreationHardKeyboardHidden == Configuration.HARDKEYBOARDHIDDEN_NO ? View.INVISIBLE : View.VISIBLE); + + // The delete button is of the PIN keyboard itself in some (e.g. tablet) layouts, + // not a separate view + View pinDelete = findViewById(R.id.pinDel); + if (pinDelete != null) { + pinDelete.setVisibility(View.VISIBLE); + pinDelete.setOnClickListener(new OnClickListener() { + @Override + public void onClick(View v) { + mKeyboardHelper.handleBackspace(); + } + }); + } } mPasswordEntry.requestFocus(); @@ -293,7 +305,7 @@ public class PasswordUnlockScreen extends LinearLayout implements KeyguardScreen mPasswordEntry.setEnabled(false); mKeyboardView.setEnabled(false); long elapsedRealtime = SystemClock.elapsedRealtime(); - mCountdownTimer = new CountDownTimer(elapsedRealtimeDeadline - elapsedRealtime, 1000) { + new CountDownTimer(elapsedRealtimeDeadline - elapsedRealtime, 1000) { @Override public void onTick(long millisUntilFinished) { @@ -309,7 +321,6 @@ public class PasswordUnlockScreen extends LinearLayout implements KeyguardScreen mPasswordEntry.setEnabled(true); mKeyboardView.setEnabled(true); mStatusViewManager.resetStatusInfo(); - mCountdownTimer = null; } }.start(); }