Merge "Fix keyguard timeout dialog messages" into jb-mr1-dev
This commit is contained in:
@@ -348,6 +348,7 @@ public class KeyguardHostView extends KeyguardViewBase {
|
|||||||
(failedAttemptsBeforeWipe - failedAttempts)
|
(failedAttemptsBeforeWipe - failedAttempts)
|
||||||
: Integer.MAX_VALUE; // because DPM returns 0 if no restriction
|
: Integer.MAX_VALUE; // because DPM returns 0 if no restriction
|
||||||
|
|
||||||
|
boolean showTimeout = false;
|
||||||
if (remainingBeforeWipe < LockPatternUtils.FAILED_ATTEMPTS_BEFORE_WIPE_GRACE) {
|
if (remainingBeforeWipe < LockPatternUtils.FAILED_ATTEMPTS_BEFORE_WIPE_GRACE) {
|
||||||
// If we reach this code, it means the user has installed a DevicePolicyManager
|
// If we reach this code, it means the user has installed a DevicePolicyManager
|
||||||
// that requests device wipe after N attempts. Once we get below the grace
|
// that requests device wipe after N attempts. Once we get below the grace
|
||||||
@@ -361,7 +362,7 @@ public class KeyguardHostView extends KeyguardViewBase {
|
|||||||
showWipeDialog(failedAttempts);
|
showWipeDialog(failedAttempts);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
boolean showTimeout =
|
showTimeout =
|
||||||
(failedAttempts % LockPatternUtils.FAILED_ATTEMPTS_BEFORE_TIMEOUT) == 0;
|
(failedAttempts % LockPatternUtils.FAILED_ATTEMPTS_BEFORE_TIMEOUT) == 0;
|
||||||
if (usingPattern && mEnableFallback) {
|
if (usingPattern && mEnableFallback) {
|
||||||
if (failedAttempts == failedAttemptWarning) {
|
if (failedAttempts == failedAttemptWarning) {
|
||||||
@@ -374,12 +375,12 @@ public class KeyguardHostView extends KeyguardViewBase {
|
|||||||
showTimeout = false;
|
showTimeout = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (showTimeout) {
|
|
||||||
showTimeoutDialog();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
monitor.reportFailedUnlockAttempt();
|
monitor.reportFailedUnlockAttempt();
|
||||||
mLockPatternUtils.reportFailedPasswordAttempt();
|
mLockPatternUtils.reportFailedPasswordAttempt();
|
||||||
|
if (showTimeout) {
|
||||||
|
showTimeoutDialog();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -97,11 +97,17 @@ public class KeyguardPasswordView extends LinearLayout
|
|||||||
if (deadline != 0) {
|
if (deadline != 0) {
|
||||||
handleAttemptLockout(deadline);
|
handleAttemptLockout(deadline);
|
||||||
} else {
|
} else {
|
||||||
mNavigationManager.setMessage(
|
resetState();
|
||||||
mIsAlpha ? R.string.kg_password_instructions : R.string.kg_pin_instructions);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void resetState() {
|
||||||
|
mNavigationManager.setMessage(
|
||||||
|
mIsAlpha ? R.string.kg_password_instructions : R.string.kg_pin_instructions);
|
||||||
|
mPasswordEntry.setEnabled(true);
|
||||||
|
mKeyboardView.setEnabled(true);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onFinishInflate() {
|
protected void onFinishInflate() {
|
||||||
mLockPatternUtils = new LockPatternUtils(mContext); // TODO: use common one
|
mLockPatternUtils = new LockPatternUtils(mContext); // TODO: use common one
|
||||||
@@ -297,8 +303,7 @@ public class KeyguardPasswordView extends LinearLayout
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFinish() {
|
public void onFinish() {
|
||||||
mPasswordEntry.setEnabled(true);
|
resetState();
|
||||||
mKeyboardView.setEnabled(true);
|
|
||||||
}
|
}
|
||||||
}.start();
|
}.start();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ class KeyguardStatusViewManager {
|
|||||||
private static final int BATTERY_INFO = 15;
|
private static final int BATTERY_INFO = 15;
|
||||||
|
|
||||||
private StatusMode mStatus;
|
private StatusMode mStatus;
|
||||||
private String mDateFormatString;
|
private CharSequence mDateFormatString;
|
||||||
|
|
||||||
// Views that this class controls.
|
// Views that this class controls.
|
||||||
// NOTE: These may be null in some LockScreen screens and should protect from NPE
|
// NOTE: These may be null in some LockScreen screens and should protect from NPE
|
||||||
@@ -101,7 +101,8 @@ class KeyguardStatusViewManager {
|
|||||||
public KeyguardStatusViewManager(View view) {
|
public KeyguardStatusViewManager(View view) {
|
||||||
if (DEBUG) Log.v(TAG, "KeyguardStatusViewManager()");
|
if (DEBUG) Log.v(TAG, "KeyguardStatusViewManager()");
|
||||||
mContainer = view;
|
mContainer = view;
|
||||||
mDateFormatString = getContext().getString(R.string.abbrev_wday_month_day_no_year);
|
mDateFormatString = getContext().getResources()
|
||||||
|
.getText(R.string.abbrev_wday_month_day_no_year);
|
||||||
mLockPatternUtils = new LockPatternUtils(view.getContext());
|
mLockPatternUtils = new LockPatternUtils(view.getContext());
|
||||||
mUpdateMonitor = KeyguardUpdateMonitor.getInstance(view.getContext());
|
mUpdateMonitor = KeyguardUpdateMonitor.getInstance(view.getContext());
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user