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

Commit 8d2faf0c authored by Fyodor Kupolov's avatar Fyodor Kupolov
Browse files

Remove user state in onUserRemoved

Test: manual
Bug: 67959359
Change-Id: I63b1afea9e32c9a102b5b45c1ca8ba1419a93696
parent 03057588
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -24741,6 +24741,7 @@ public class ActivityManagerService extends IActivityManager.Stub
                ActivityManagerService.this.onUserStoppedLocked(userId);
            }
            mBatteryStatsService.onUserRemoved(userId);
            mUserController.onUserRemoved(userId);
        }
        @Override
+14 −0
Original line number Diff line number Diff line
@@ -1762,6 +1762,20 @@ class UserController implements Handler.Callback {
        }
    }

    void onUserRemoved(int userId) {
        synchronized (mLock) {
            int size = mUserProfileGroupIds.size();
            for (int i = size - 1; i >= 0; i--) {
                if (mUserProfileGroupIds.keyAt(i) == userId
                        || mUserProfileGroupIds.valueAt(i) == userId) {
                    mUserProfileGroupIds.removeAt(i);

                }
            }
            mCurrentProfileIds = ArrayUtils.removeInt(mCurrentProfileIds, userId);
        }
    }

    /**
     * Returns whether the given user requires credential entry at this time. This is used to
     * intercept activity launches for work apps when the Work Challenge is present.