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

Commit c921193e authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Remove user state in onUserRemoved"

parents 91e028dc 8d2faf0c
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -24748,6 +24748,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.