Merge "Fix inaccuracy in biometric timeout" am: 2f178de076 am: cf3c838d6d am: 27f0879140

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1991781

Change-Id: I96f18a7eec73dfc63d05f5c220ff207662d193fd
This commit is contained in:
Rubin Xu
2022-03-02 14:34:46 +00:00
committed by Automerger Merge Worker
2 changed files with 5 additions and 5 deletions

View File

@@ -262,7 +262,7 @@ public class LockSettingsStrongAuth {
long nextAlarmTime = strongAuthTime + dpm.getRequiredStrongAuthTimeout(null, userId);
// schedule a new alarm listener for the user
mAlarmManager.set(AlarmManager.ELAPSED_REALTIME, nextAlarmTime,
mAlarmManager.setExact(AlarmManager.ELAPSED_REALTIME_WAKEUP, nextAlarmTime,
STRONG_AUTH_TIMEOUT_ALARM_TAG, alarm, mHandler);
}
@@ -303,7 +303,7 @@ public class LockSettingsStrongAuth {
alarm = new NonStrongBiometricTimeoutAlarmListener(userId);
mNonStrongBiometricTimeoutAlarmListener.put(userId, alarm);
// schedule a new alarm listener for the user
mAlarmManager.set(AlarmManager.ELAPSED_REALTIME, nextAlarmTime,
mAlarmManager.setExact(AlarmManager.ELAPSED_REALTIME_WAKEUP, nextAlarmTime,
NON_STRONG_BIOMETRIC_TIMEOUT_ALARM_TAG, alarm, mHandler);
}
@@ -394,7 +394,7 @@ public class LockSettingsStrongAuth {
}
// schedule a new alarm listener for the user
if (DEBUG) Slog.d(TAG, "Schedule a new alarm for non-strong biometric idle timeout");
mAlarmManager.set(AlarmManager.ELAPSED_REALTIME, nextAlarmTime,
mAlarmManager.setExact(AlarmManager.ELAPSED_REALTIME_WAKEUP, nextAlarmTime,
NON_STRONG_BIOMETRIC_IDLE_TIMEOUT_ALARM_TAG, alarm, mHandler);
}

View File

@@ -229,8 +229,8 @@ public class LockSettingsStrongAuthTest {
}
private void verifyAlarm(long when, String tag, AlarmManager.OnAlarmListener alarm) {
verify(mAlarmManager).set(
eq(AlarmManager.ELAPSED_REALTIME),
verify(mAlarmManager).setExact(
eq(AlarmManager.ELAPSED_REALTIME_WAKEUP),
eq(when),
eq(tag),
eq(alarm),