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

Commit c396cfaf authored by Eric Biggers's avatar Eric Biggers Committed by Automerger Merge Worker
Browse files

Merge changes from topic "locksettings-aosp-3" into main am: cf7db52d am:...

Merge changes from topic "locksettings-aosp-3" into main am: cf7db52d am: 9621fefc am: 32f8eb66

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



Change-Id: I895af46cf3c9fc2b7edb2cef7e76d73147c14565
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 7315f66b 32f8eb66
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));