Refresh screenlock UI after password verification failed

Bug: 28314264
Change-Id: Ibd715d70bbee728a887f779a24bb99ad32d8d2ed
This commit is contained in:
Ricky Wai
2016-06-27 11:10:09 +01:00
parent 742047f565
commit 9aa434cde6
3 changed files with 11 additions and 2 deletions

View File

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

View File

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