Loading core/java/android/provider/Settings.java +7 −0 Original line number Diff line number Diff line Loading @@ -2051,6 +2051,13 @@ public final class Settings { */ public static final String TRACKBALL_UNLOCK_SCREEN = "trackball_unlock_screen"; /** * Whether to use the custom quick unlock screen control * @hide */ public static final String LOCKSCREEN_QUICK_UNLOCK_CONTROL = "lockscreen_quick_unlock_control"; /** * Pulse the Trackball with Screen On. The value is boolean (1 or 0). * @hide Loading policy/src/com/android/internal/policy/impl/PasswordUnlockScreen.java +28 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import com.android.internal.widget.PasswordEntryKeyboardView; import android.os.CountDownTimer; import android.os.SystemClock; import android.provider.Settings; import android.telephony.TelephonyManager; import android.text.method.DigitsKeyListener; import android.text.method.TextKeyListener; Loading Loading @@ -63,6 +64,7 @@ public class PasswordUnlockScreen extends LinearLayout implements KeyguardScreen private int mCreationHardKeyboardHidden; private CountDownTimer mCountdownTimer; private TextView mTitle; private boolean mQuickUnlockScreen; // To avoid accidental lockout due to events while the device in in the pocket, ignore // any passwords with length less than or equal to this length. Loading @@ -79,6 +81,9 @@ public class PasswordUnlockScreen extends LinearLayout implements KeyguardScreen mCallback = callback; mLockPatternUtils = lockPatternUtils; mQuickUnlockScreen = (Settings.System.getInt(mContext.getContentResolver(), Settings.System.LOCKSCREEN_QUICK_UNLOCK_CONTROL, 0) == 1); LayoutInflater layoutInflater = LayoutInflater.from(context); if (mCreationOrientation != Configuration.ORIENTATION_LANDSCAPE) { layoutInflater.inflate(R.layout.keyguard_screen_password_portrait, this, true); Loading Loading @@ -116,6 +121,29 @@ public class PasswordUnlockScreen extends LinearLayout implements KeyguardScreen mKeyboardHelper.setVibratePattern(mLockPatternUtils.isTactileFeedbackEnabled() ? com.android.internal.R.array.config_virtualKeyVibePattern : 0); if (mQuickUnlockScreen) { mPasswordEntry.setOnKeyListener(new View.OnKeyListener() { @Override public boolean onKey(View v, int keyCode, KeyEvent event) { mCallback.pokeWakelock(); String entry = mPasswordEntry.getText().toString(); if (keyCode != KeyEvent.KEYCODE_DEL) { if (mLockPatternUtils.checkPassword(entry)) { mCallback.keyguardDone(true); mCallback.reportSuccessfulUnlockAttempt(); } } else if (entry.length() > MINIMUM_PASSWORD_LENGTH_BEFORE_REPORT) { mCallback.reportFailedUnlockAttempt(); if (0 == (mUpdateMonitor.getFailedAttempts() % LockPatternUtils.FAILED_ATTEMPTS_BEFORE_TIMEOUT)) { long deadline = mLockPatternUtils.setLockoutAttemptDeadline(); handleAttemptLockout(deadline); } } return false; } }); } } @Override Loading Loading
core/java/android/provider/Settings.java +7 −0 Original line number Diff line number Diff line Loading @@ -2051,6 +2051,13 @@ public final class Settings { */ public static final String TRACKBALL_UNLOCK_SCREEN = "trackball_unlock_screen"; /** * Whether to use the custom quick unlock screen control * @hide */ public static final String LOCKSCREEN_QUICK_UNLOCK_CONTROL = "lockscreen_quick_unlock_control"; /** * Pulse the Trackball with Screen On. The value is boolean (1 or 0). * @hide Loading
policy/src/com/android/internal/policy/impl/PasswordUnlockScreen.java +28 −0 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import com.android.internal.widget.PasswordEntryKeyboardView; import android.os.CountDownTimer; import android.os.SystemClock; import android.provider.Settings; import android.telephony.TelephonyManager; import android.text.method.DigitsKeyListener; import android.text.method.TextKeyListener; Loading Loading @@ -63,6 +64,7 @@ public class PasswordUnlockScreen extends LinearLayout implements KeyguardScreen private int mCreationHardKeyboardHidden; private CountDownTimer mCountdownTimer; private TextView mTitle; private boolean mQuickUnlockScreen; // To avoid accidental lockout due to events while the device in in the pocket, ignore // any passwords with length less than or equal to this length. Loading @@ -79,6 +81,9 @@ public class PasswordUnlockScreen extends LinearLayout implements KeyguardScreen mCallback = callback; mLockPatternUtils = lockPatternUtils; mQuickUnlockScreen = (Settings.System.getInt(mContext.getContentResolver(), Settings.System.LOCKSCREEN_QUICK_UNLOCK_CONTROL, 0) == 1); LayoutInflater layoutInflater = LayoutInflater.from(context); if (mCreationOrientation != Configuration.ORIENTATION_LANDSCAPE) { layoutInflater.inflate(R.layout.keyguard_screen_password_portrait, this, true); Loading Loading @@ -116,6 +121,29 @@ public class PasswordUnlockScreen extends LinearLayout implements KeyguardScreen mKeyboardHelper.setVibratePattern(mLockPatternUtils.isTactileFeedbackEnabled() ? com.android.internal.R.array.config_virtualKeyVibePattern : 0); if (mQuickUnlockScreen) { mPasswordEntry.setOnKeyListener(new View.OnKeyListener() { @Override public boolean onKey(View v, int keyCode, KeyEvent event) { mCallback.pokeWakelock(); String entry = mPasswordEntry.getText().toString(); if (keyCode != KeyEvent.KEYCODE_DEL) { if (mLockPatternUtils.checkPassword(entry)) { mCallback.keyguardDone(true); mCallback.reportSuccessfulUnlockAttempt(); } } else if (entry.length() > MINIMUM_PASSWORD_LENGTH_BEFORE_REPORT) { mCallback.reportFailedUnlockAttempt(); if (0 == (mUpdateMonitor.getFailedAttempts() % LockPatternUtils.FAILED_ATTEMPTS_BEFORE_TIMEOUT)) { long deadline = mLockPatternUtils.setLockoutAttemptDeadline(); handleAttemptLockout(deadline); } } return false; } }); } } @Override Loading