Methods Summary |
---|
public void | doHapticKeyClick()
if (mEnableHaptics) {
performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY,
HapticFeedbackConstants.FLAG_IGNORE_VIEW_SETTING
| HapticFeedbackConstants.FLAG_IGNORE_GLOBAL_SETTING);
}
|
public KeyguardSecurityCallback | getCallback()
return mCallback;
|
protected abstract java.lang.String | getPasswordText()
|
protected abstract int | getPasswordTextViewId()
|
protected int | getWrongPasswordStringId()
return R.string.kg_wrong_password;
|
protected void | handleAttemptLockout(long elapsedRealtimeDeadline)
setPasswordEntryEnabled(false);
long elapsedRealtime = SystemClock.elapsedRealtime();
new CountDownTimer(elapsedRealtimeDeadline - elapsedRealtime, 1000) {
@Override
public void onTick(long millisUntilFinished) {
int secondsRemaining = (int) (millisUntilFinished / 1000);
mSecurityMessageDisplay.setMessage(
R.string.kg_too_many_failed_attempts_countdown, true, secondsRemaining);
}
@Override
public void onFinish() {
mSecurityMessageDisplay.setMessage("", false);
resetState();
}
}.start();
|
public void | hideBouncer(int duration)
KeyguardSecurityViewHelper.
hideBouncer(mSecurityMessageDisplay, mEcaView, mBouncerFrame, duration);
|
public boolean | needsInput()
return false;
|
protected void | onFinishInflate()
mLockPatternUtils = new LockPatternUtils(mContext);
mSecurityMessageDisplay = new KeyguardMessageArea.Helper(this);
mEcaView = findViewById(R.id.keyguard_selector_fade_container);
View bouncerFrameView = findViewById(R.id.keyguard_bouncer_frame);
if (bouncerFrameView != null) {
mBouncerFrame = bouncerFrameView.getBackground();
}
|
public boolean | onKeyDown(int keyCode, android.view.KeyEvent event)
mCallback.userActivity();
return false;
|
public void | onPause()
|
public void | onResume(int reason)
reset();
|
public void | reset()
// start fresh
resetPasswordText(false /* animate */);
// if the user is currently locked out, enforce it.
long deadline = mLockPatternUtils.getLockoutAttemptDeadline();
if (shouldLockout(deadline)) {
handleAttemptLockout(deadline);
} else {
resetState();
}
|
protected abstract void | resetPasswordText(boolean animate)
|
protected abstract void | resetState()
|
public void | setKeyguardCallback(KeyguardSecurityCallback callback)
mCallback = callback;
|
public void | setLockPatternUtils(com.android.internal.widget.LockPatternUtils utils)
mLockPatternUtils = utils;
mEnableHaptics = mLockPatternUtils.isTactileFeedbackEnabled();
|
protected abstract void | setPasswordEntryEnabled(boolean enabled)
|
protected boolean | shouldLockout(long deadline)
return deadline != 0;
|
public void | showBouncer(int duration)
KeyguardSecurityViewHelper.
showBouncer(mSecurityMessageDisplay, mEcaView, mBouncerFrame, duration);
|
public boolean | startDisappearAnimation(java.lang.Runnable finishRunnable)
return false;
|
protected void | verifyPasswordAndUnlock()
String entry = getPasswordText();
if (mLockPatternUtils.checkPassword(entry)) {
mCallback.reportUnlockAttempt(true);
mCallback.dismiss(true);
} else {
if (entry.length() > MINIMUM_PASSWORD_LENGTH_BEFORE_REPORT ) {
// to avoid accidental lockout, only count attempts that are long enough to be a
// real password. This may require some tweaking.
mCallback.reportUnlockAttempt(false);
int attempts = KeyguardUpdateMonitor.getInstance(mContext).getFailedUnlockAttempts();
if (0 == (attempts % LockPatternUtils.FAILED_ATTEMPTS_BEFORE_TIMEOUT)) {
long deadline = mLockPatternUtils.setLockoutAttemptDeadline();
handleAttemptLockout(deadline);
}
}
mSecurityMessageDisplay.setMessage(getWrongPasswordStringId(), true);
}
resetPasswordText(true /* animate */);
|