Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cfb61601 authored by Andres Morales's avatar Andres Morales
Browse files

Clear secure user ID and notify keystore when lock is cleared

Change-Id: Id5bbde81b83add09e8362d439b19f1febe451003
parent d0124294
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -69,4 +69,11 @@ interface IGateKeeperService {
     * @param uid the Android user id
     */
    long getSecureUserId(int uid);

    /**
     * Clears secure user id associated with the provided Android ID.
     * Must be called when password is set to NONE.
     * @param uid the Android user id.
     */
    void clearSecureUserId(int uid);
}
+4 −0
Original line number Diff line number Diff line
@@ -388,7 +388,9 @@ public class LockSettingsService extends ILockSettings.Stub {
        byte[] currentHandle = getCurrentHandle(userId);

        if (pattern == null) {
            getGateKeeperService().clearSecureUserId(userId);
            mStorage.writePatternHash(null, userId);
            maybeUpdateKeystore(null, userId);
            return;
        }

@@ -414,7 +416,9 @@ public class LockSettingsService extends ILockSettings.Stub {
        byte[] currentHandle = getCurrentHandle(userId);

        if (password == null) {
            getGateKeeperService().clearSecureUserId(userId);
            mStorage.writePasswordHash(null, userId);
            maybeUpdateKeystore(null, userId);
            return;
        }