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

Commit bff6d910 authored by Android Build Merger (Role)'s avatar Android Build Merger (Role) Committed by Android (Google) Code Review
Browse files

Merge "Merge "Call unlockUserKey in a synchronized section" into nyc-dev am:...

Merge "Merge "Call unlockUserKey in a synchronized section" into nyc-dev am: 735fa433 am: 56ecc059 am: e8a71e9b"
parents 2a028ede 45c0279a
Loading
Loading
Loading
Loading
+12 −14
Original line number Diff line number Diff line
@@ -927,19 +927,18 @@ final class UserController {

    boolean unlockUserCleared(final int userId, byte[] token, byte[] secret,
            IProgressListener listener) {
        final UserState uss;
        synchronized (mService) {
            // Bail if user isn't actually running, otherwise register the given
            // listener to watch for unlock progress
            uss = mStartedUsers.get(userId);
            final UserState uss = mStartedUsers.get(userId);
            if (uss == null) {
                notifyFinished(userId, listener);
                return false;
            } else {
                uss.mUnlockProgress.addListener(listener);
            }
        }

            // TODO Move this block outside of synchronized if it causes lock contention
            if (!StorageManager.isUserKeyUnlocked(userId)) {
                final UserInfo userInfo = getUserInfo(userId);
                final IMountService mountService = getMountService();
@@ -952,7 +951,6 @@ final class UserController {
                }
            }

        synchronized (mService) {
            finishUserUnlocking(uss);

            // We just unlocked a user, so let's now attempt to unlock any