Merge \"Don\'t show repeated fingerprint error messages on bouncer\" into nyc-mr1-dev
am: a3724775a4
Change-Id: I7d888edff3fb7bb0ba7c52dcec698e346a002524
This commit is contained in:
@@ -225,6 +225,8 @@ public class KeyguardIndicationController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
KeyguardUpdateMonitorCallback mUpdateMonitor = new KeyguardUpdateMonitorCallback() {
|
KeyguardUpdateMonitorCallback mUpdateMonitor = new KeyguardUpdateMonitorCallback() {
|
||||||
|
public int mLastSuccessiveErrorMessage = -1;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onRefreshBatteryInfo(KeyguardUpdateMonitor.BatteryStatus status) {
|
public void onRefreshBatteryInfo(KeyguardUpdateMonitor.BatteryStatus status) {
|
||||||
boolean isChargingOrFull = status.status == BatteryManager.BATTERY_STATUS_CHARGING
|
boolean isChargingOrFull = status.status == BatteryManager.BATTERY_STATUS_CHARGING
|
||||||
@@ -252,6 +254,9 @@ public class KeyguardIndicationController {
|
|||||||
mHandler.sendMessageDelayed(mHandler.obtainMessage(MSG_CLEAR_FP_MSG),
|
mHandler.sendMessageDelayed(mHandler.obtainMessage(MSG_CLEAR_FP_MSG),
|
||||||
TRANSIENT_FP_ERROR_TIMEOUT);
|
TRANSIENT_FP_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
|
||||||
@@ -263,15 +268,22 @@ public class KeyguardIndicationController {
|
|||||||
}
|
}
|
||||||
int errorColor = mContext.getResources().getColor(R.color.system_warning_color, null);
|
int errorColor = mContext.getResources().getColor(R.color.system_warning_color, null);
|
||||||
if (mStatusBarKeyguardViewManager.isBouncerShowing()) {
|
if (mStatusBarKeyguardViewManager.isBouncerShowing()) {
|
||||||
mStatusBarKeyguardViewManager.showBouncerMessage(errString, errorColor);
|
// When swiping up right after receiving a fingerprint error, the bouncer calls
|
||||||
|
// 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, errorColor);
|
||||||
|
}
|
||||||
} else if (updateMonitor.isDeviceInteractive()) {
|
} else if (updateMonitor.isDeviceInteractive()) {
|
||||||
showTransientIndication(errString, errorColor);
|
showTransientIndication(errString, errorColor);
|
||||||
// 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
|
||||||
mHandler.removeMessages(MSG_HIDE_TRANSIENT);
|
mHandler.removeMessages(MSG_HIDE_TRANSIENT);
|
||||||
hideTransientIndicationDelayed(5000);
|
hideTransientIndicationDelayed(5000);
|
||||||
} else {
|
} else {
|
||||||
mMessageToShowOnScreenOn = errString;
|
mMessageToShowOnScreenOn = errString;
|
||||||
}
|
}
|
||||||
|
mLastSuccessiveErrorMessage = msgId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -293,6 +305,18 @@ public class KeyguardIndicationController {
|
|||||||
mMessageToShowOnScreenOn = null;
|
mMessageToShowOnScreenOn = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFingerprintAuthenticated(int userId) {
|
||||||
|
super.onFingerprintAuthenticated(userId);
|
||||||
|
mLastSuccessiveErrorMessage = -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFingerprintAuthFailed() {
|
||||||
|
super.onFingerprintAuthFailed();
|
||||||
|
mLastSuccessiveErrorMessage = -1;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
BroadcastReceiver mReceiver = new BroadcastReceiver() {
|
BroadcastReceiver mReceiver = new BroadcastReceiver() {
|
||||||
|
|||||||
Reference in New Issue
Block a user