locksettings: clean up logging of cached GK password expiration

When a cached GK password expires, use a much clearer log message.
Also, don't log anything if the GK password was already explicitly
removed by LockSettingsService.removeGatekeeperPasswordHandle().

Bug: 268526331
Change-Id: I734c9115bd8ea0a44ed6c03754e87341848a00f5
This commit is contained in:
Eric Biggers
2023-02-27 19:20:44 +00:00
parent 61729d86ba
commit 070e3d6ce3

View File

@@ -2717,8 +2717,11 @@ public class LockSettingsService extends ILockSettings.Stub {
final long finalHandle = handle;
mHandler.postDelayed(() -> {
synchronized (mGatekeeperPasswords) {
Slog.d(TAG, "Removing handle: " + finalHandle);
mGatekeeperPasswords.remove(finalHandle);
if (mGatekeeperPasswords.get(finalHandle) != null) {
Slogf.d(TAG, "Cached Gatekeeper password with handle %016x has expired",
finalHandle);
mGatekeeperPasswords.remove(finalHandle);
}
}
}, GK_PW_HANDLE_STORE_DURATION_MS);