Merge "Fix inaccuracy in biometric timeout" am: 2f178de076

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

Change-Id: Icc2581bffaa49e085cc4e70182bab4b799bf7a24
This commit is contained in:
Rubin Xu
2022-03-02 13:49:59 +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); long nextAlarmTime = strongAuthTime + dpm.getRequiredStrongAuthTimeout(null, userId);
// schedule a new alarm listener for the user // 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); STRONG_AUTH_TIMEOUT_ALARM_TAG, alarm, mHandler);
} }
@@ -303,7 +303,7 @@ public class LockSettingsStrongAuth {
alarm = new NonStrongBiometricTimeoutAlarmListener(userId); alarm = new NonStrongBiometricTimeoutAlarmListener(userId);
mNonStrongBiometricTimeoutAlarmListener.put(userId, alarm); mNonStrongBiometricTimeoutAlarmListener.put(userId, alarm);
// schedule a new alarm listener for the user // 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); NON_STRONG_BIOMETRIC_TIMEOUT_ALARM_TAG, alarm, mHandler);
} }
@@ -394,7 +394,7 @@ public class LockSettingsStrongAuth {
} }
// schedule a new alarm listener for the user // schedule a new alarm listener for the user
if (DEBUG) Slog.d(TAG, "Schedule a new alarm for non-strong biometric idle timeout"); 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); 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) { private void verifyAlarm(long when, String tag, AlarmManager.OnAlarmListener alarm) {
verify(mAlarmManager).set( verify(mAlarmManager).setExact(
eq(AlarmManager.ELAPSED_REALTIME), eq(AlarmManager.ELAPSED_REALTIME_WAKEUP),
eq(when), eq(when),
eq(tag), eq(tag),
eq(alarm), eq(alarm),