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

Commit 37ae2d50 authored by Eric Biggers's avatar Eric Biggers
Browse files

LockSettingsService: fix names of user lifecycle methods

Rename some methods to avoid confusion.  No change in behavior.

Test: presubmit
Change-Id: I9885c934be4f99cf556aa6fcfadb6f65faf30e52
Merged-In: I9885c934be4f99cf556aa6fcfadb6f65faf30e52
(cherry picked from commit decb4ee3)
parent 0ed52ac4
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -346,17 +346,17 @@ public class LockSettingsService extends ILockSettings.Stub {

        @Override
        public void onUserStarting(@NonNull TargetUser user) {
            mLockSettingsService.onStartUser(user.getUserIdentifier());
            mLockSettingsService.onUserStarting(user.getUserIdentifier());
        }

        @Override
        public void onUserUnlocking(@NonNull TargetUser user) {
            mLockSettingsService.onUnlockUser(user.getUserIdentifier());
            mLockSettingsService.onUserUnlocking(user.getUserIdentifier());
        }

        @Override
        public void onUserStopped(@NonNull TargetUser user) {
            mLockSettingsService.onCleanupUser(user.getUserIdentifier());
            mLockSettingsService.onUserStopped(user.getUserIdentifier());
        }
    }

@@ -778,7 +778,7 @@ public class LockSettingsService extends ILockSettings.Stub {
    }

    @VisibleForTesting
    void onCleanupUser(int userId) {
    void onUserStopped(int userId) {
        hideEncryptionNotification(new UserHandle(userId));
        // User is stopped with its CE key evicted. Restore strong auth requirement to the default
        // flags after boot since stopping and restarting a user later is equivalent to rebooting
@@ -790,7 +790,7 @@ public class LockSettingsService extends ILockSettings.Stub {
        }
    }

    private void onStartUser(final int userId) {
    private void onUserStarting(final int userId) {
        maybeShowEncryptionNotificationForUser(userId, "user started");
    }

@@ -826,7 +826,7 @@ public class LockSettingsService extends ILockSettings.Stub {
        }
    }

    private void onUnlockUser(final int userId) {
    private void onUserUnlocking(final int userId) {
        // Perform tasks which require locks in LSS on a handler, as we are callbacks from
        // ActivityManager.unlockUser()
        mHandler.post(new Runnable() {
+1 −1
Original line number Diff line number Diff line
@@ -781,7 +781,7 @@ public class SyntheticPasswordTests extends BaseLockSettingsServiceTests {
                password, PRIMARY_USER_ID, 0 /* flags */).getResponseCode());
        assertTrue(mLocalService.isEscrowTokenActive(handle, PRIMARY_USER_ID));

        mService.onCleanupUser(PRIMARY_USER_ID);
        mService.onUserStopped(PRIMARY_USER_ID);
        assertNull(mLocalService.getUserPasswordMetrics(PRIMARY_USER_ID));

        assertTrue(mLocalService.unlockUserWithToken(handle, token, PRIMARY_USER_ID));
+1 −1
Original line number Diff line number Diff line
@@ -169,7 +169,7 @@ public class WeakEscrowTokenTests extends BaseLockSettingsServiceTests{
        assertTrue(mService.isWeakEscrowTokenActive(handle, PRIMARY_USER_ID));
        assertTrue(mService.isWeakEscrowTokenValid(handle, token, PRIMARY_USER_ID));

        mService.onCleanupUser(PRIMARY_USER_ID);
        mService.onUserStopped(PRIMARY_USER_ID);
        assertNull(mLocalService.getUserPasswordMetrics(PRIMARY_USER_ID));

        assertTrue(mLocalService.unlockUserWithToken(handle, token, PRIMARY_USER_ID));