Merge "Refresh screenlock UI after password verification failed" into nyc-mr1-dev

This commit is contained in:
Ricky Wai
2016-06-28 10:36:19 +00:00
committed by Android (Google) Code Review
3 changed files with 11 additions and 2 deletions

View File

@@ -142,8 +142,16 @@ public abstract class ConfirmDeviceCredentialBaseFragment extends OptionsMenuFra
@Override @Override
public void onResume() { public void onResume() {
super.onResume(); super.onResume();
refreshLockScreen();
}
protected void refreshLockScreen() {
if (mAllowFpAuthentication) { if (mAllowFpAuthentication) {
mFingerprintHelper.startListening(); mFingerprintHelper.startListening();
} else {
if (mFingerprintHelper.isListening()) {
mFingerprintHelper.stopListening();
}
} }
if (isProfileChallenge()) { if (isProfileChallenge()) {
updateErrorMessage(mLockPatternUtils.getCurrentFailedPasswordAttempts( updateErrorMessage(mLockPatternUtils.getCurrentFailedPasswordAttempts(
@@ -168,7 +176,7 @@ public abstract class ConfirmDeviceCredentialBaseFragment extends OptionsMenuFra
@Override @Override
public void onPause() { public void onPause() {
super.onPause(); super.onPause();
if (mAllowFpAuthentication) { if (mFingerprintHelper.isListening()) {
mFingerprintHelper.stopListening(); mFingerprintHelper.stopListening();
} }
} }

View File

@@ -498,6 +498,7 @@ public class ConfirmLockPattern extends ConfirmDeviceCredentialBaseActivity {
checkForPendingIntent(); checkForPendingIntent();
} else { } else {
if (timeoutMs > 0) { if (timeoutMs > 0) {
refreshLockScreen();
long deadline = mLockPatternUtils.setLockoutAttemptDeadline( long deadline = mLockPatternUtils.setLockoutAttemptDeadline(
effectiveUserId, timeoutMs); effectiveUserId, timeoutMs);
handleAttemptLockout(deadline); handleAttemptLockout(deadline);

View File

@@ -67,7 +67,7 @@ public class FingerprintUiHelper extends FingerprintManager.AuthenticationCallba
} }
} }
private boolean isListening() { public boolean isListening() {
return mCancellationSignal != null && !mCancellationSignal.isCanceled(); return mCancellationSignal != null && !mCancellationSignal.isCanceled();
} }