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

Commit 129771a0 authored by Winson Chung's avatar Winson Chung
Browse files

Fix NPE when getting managed profile info.

- There can be a race condition where the cached profile user ids
  aren't yet updated but the actual user has already been removed.
  Ignore these users when computing the quiet profile users.

Bug: 67932220
Test: Add/remove a work profile and launch an app
Change-Id: I8888d30e431ca4ffdacc28cc15a80a2deaa23d10
parent 5cd47c90
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -914,7 +914,7 @@ class RecentTasks {
        mTmpQuietProfileUserIds.clear();
        for (int userId : profileUserIds) {
            final UserInfo userInfo = mUserController.getUserInfo(userId);
            if (userInfo.isManagedProfile() && userInfo.isQuietModeEnabled()) {
            if (userInfo != null && userInfo.isManagedProfile() && userInfo.isQuietModeEnabled()) {
                mTmpQuietProfileUserIds.put(userId, true);
            }
            if (DEBUG_RECENTS_TRIM_TASKS) Slog.d(TAG, "User: " + userInfo