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

Commit 7640aa04 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Revert "Update user profiles on user unavailable"" into sc-dev am: 0b4354de

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

Change-Id: I5ec7d7e273f3ae68cf588c8afa7ab2553246d557
parents 32f4845e 0b4354de
Loading
Loading
Loading
Loading
+2 −9
Original line number Diff line number Diff line
@@ -1769,17 +1769,10 @@ abstract public class ManagedServices {
            UserManager userManager = (UserManager) context.getSystemService(Context.USER_SERVICE);
            if (userManager != null) {
                int currentUserId = ActivityManager.getCurrentUser();
                List<UserInfo> unlockedProfiles = new ArrayList<>();
                for (UserInfo user : userManager.getProfiles(currentUserId)) {
                    // Dependencies throw if we call APIs on a locked user. Only include
                    // unlocked users.
                    if (userManager.isUserUnlocked(user.id)) {
                        unlockedProfiles.add(user);
                    }
                }
                List<UserInfo> profiles = userManager.getProfiles(currentUserId);
                synchronized (mCurrentProfiles) {
                    mCurrentProfiles.clear();
                    for (UserInfo user : unlockedProfiles) {
                    for (UserInfo user : profiles) {
                        mCurrentProfiles.put(user.id, user);
                    }
                }
+0 −2
Original line number Diff line number Diff line
@@ -1783,8 +1783,6 @@ public class NotificationManagerService extends SystemService {
                }
            } else if (action.equals(Intent.ACTION_MANAGED_PROFILE_UNAVAILABLE)) {
                int userHandle = intent.getIntExtra(Intent.EXTRA_USER_HANDLE, -1);
                // Work profile user may now be locked. Refresh cache.
                mUserProfiles.updateCache(context);
                if (userHandle >= 0) {
                    cancelAllNotificationsInt(MY_UID, MY_PID, null, null, 0, 0, true, userHandle,
                            REASON_PROFILE_TURNED_OFF, null);