Merge "Always show error messages on bouncer" into qt-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
c8d2c71723
@@ -539,7 +539,6 @@ public class KeyguardIndicationController implements StateListener {
|
|||||||
|
|
||||||
protected class BaseKeyguardCallback extends KeyguardUpdateMonitorCallback {
|
protected class BaseKeyguardCallback extends KeyguardUpdateMonitorCallback {
|
||||||
public static final int HIDE_DELAY_MS = 5000;
|
public static final int HIDE_DELAY_MS = 5000;
|
||||||
private int mLastSuccessiveErrorMessage = -1;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onRefreshBatteryInfo(KeyguardUpdateMonitor.BatteryStatus status) {
|
public void onRefreshBatteryInfo(KeyguardUpdateMonitor.BatteryStatus status) {
|
||||||
@@ -577,20 +576,14 @@ public class KeyguardIndicationController implements StateListener {
|
|||||||
if (!updateMonitor.isUnlockingWithBiometricAllowed()) {
|
if (!updateMonitor.isUnlockingWithBiometricAllowed()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
animatePadlockError();
|
||||||
if (mStatusBarKeyguardViewManager.isBouncerShowing()) {
|
if (mStatusBarKeyguardViewManager.isBouncerShowing()) {
|
||||||
mStatusBarKeyguardViewManager.showBouncerMessage(helpString,
|
mStatusBarKeyguardViewManager.showBouncerMessage(helpString,
|
||||||
mInitialTextColorState);
|
mInitialTextColorState);
|
||||||
} else if (updateMonitor.isScreenOn()) {
|
} else if (updateMonitor.isScreenOn()) {
|
||||||
mLockIcon.setTransientBiometricsError(true);
|
|
||||||
showTransientIndication(helpString);
|
showTransientIndication(helpString);
|
||||||
hideTransientIndicationDelayed(TRANSIENT_BIOMETRIC_ERROR_TIMEOUT);
|
hideTransientIndicationDelayed(TRANSIENT_BIOMETRIC_ERROR_TIMEOUT);
|
||||||
mHandler.removeMessages(MSG_CLEAR_BIOMETRIC_MSG);
|
|
||||||
mHandler.sendMessageDelayed(mHandler.obtainMessage(MSG_CLEAR_BIOMETRIC_MSG),
|
|
||||||
TRANSIENT_BIOMETRIC_ERROR_TIMEOUT);
|
|
||||||
}
|
}
|
||||||
// Help messages indicate that there was actually a try since the last error, so those
|
|
||||||
// are not two successive error messages anymore.
|
|
||||||
mLastSuccessiveErrorMessage = -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -600,15 +593,9 @@ public class KeyguardIndicationController implements StateListener {
|
|||||||
if (shouldSuppressBiometricError(msgId, biometricSourceType, updateMonitor)) {
|
if (shouldSuppressBiometricError(msgId, biometricSourceType, updateMonitor)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
animatePadlockError();
|
||||||
if (mStatusBarKeyguardViewManager.isBouncerShowing()) {
|
if (mStatusBarKeyguardViewManager.isBouncerShowing()) {
|
||||||
// When swiping up right after receiving a biometric error, the bouncer calls
|
mStatusBarKeyguardViewManager.showBouncerMessage(errString, mInitialTextColorState);
|
||||||
// authenticate leading to the same message being shown again on the bouncer.
|
|
||||||
// We want to avoid this, as it may confuse the user when the message is too
|
|
||||||
// generic.
|
|
||||||
if (mLastSuccessiveErrorMessage != msgId) {
|
|
||||||
mStatusBarKeyguardViewManager.showBouncerMessage(errString,
|
|
||||||
mInitialTextColorState);
|
|
||||||
}
|
|
||||||
} else if (updateMonitor.isScreenOn()) {
|
} else if (updateMonitor.isScreenOn()) {
|
||||||
showTransientIndication(errString);
|
showTransientIndication(errString);
|
||||||
// We want to keep this message around in case the screen was off
|
// We want to keep this message around in case the screen was off
|
||||||
@@ -616,7 +603,13 @@ public class KeyguardIndicationController implements StateListener {
|
|||||||
} else {
|
} else {
|
||||||
mMessageToShowOnScreenOn = errString;
|
mMessageToShowOnScreenOn = errString;
|
||||||
}
|
}
|
||||||
mLastSuccessiveErrorMessage = msgId;
|
}
|
||||||
|
|
||||||
|
private void animatePadlockError() {
|
||||||
|
mLockIcon.setTransientBiometricsError(true);
|
||||||
|
mHandler.removeMessages(MSG_CLEAR_BIOMETRIC_MSG);
|
||||||
|
mHandler.sendMessageDelayed(mHandler.obtainMessage(MSG_CLEAR_BIOMETRIC_MSG),
|
||||||
|
TRANSIENT_BIOMETRIC_ERROR_TIMEOUT);
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean shouldSuppressBiometricError(int msgId,
|
private boolean shouldSuppressBiometricError(int msgId,
|
||||||
@@ -670,16 +663,9 @@ public class KeyguardIndicationController implements StateListener {
|
|||||||
@Override
|
@Override
|
||||||
public void onBiometricAuthenticated(int userId, BiometricSourceType biometricSourceType) {
|
public void onBiometricAuthenticated(int userId, BiometricSourceType biometricSourceType) {
|
||||||
super.onBiometricAuthenticated(userId, biometricSourceType);
|
super.onBiometricAuthenticated(userId, biometricSourceType);
|
||||||
mLastSuccessiveErrorMessage = -1;
|
|
||||||
mHandler.sendEmptyMessage(MSG_HIDE_TRANSIENT);
|
mHandler.sendEmptyMessage(MSG_HIDE_TRANSIENT);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onBiometricAuthFailed(BiometricSourceType biometricSourceType) {
|
|
||||||
super.onBiometricAuthFailed(biometricSourceType);
|
|
||||||
mLastSuccessiveErrorMessage = -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onUserUnlocked() {
|
public void onUserUnlocked() {
|
||||||
if (mVisible) {
|
if (mVisible) {
|
||||||
|
|||||||
Reference in New Issue
Block a user