Revert "Update user profiles on user unavailable"

This reverts commit ad1a153a63.

Reason for revert: Breaking 'Recently Dismissed' in notification history

Change-Id: I5393435e39bee2a41c9a48ea0f0d0bceacf45126
Fixes: 185581924
This commit is contained in:
Julia Reynolds
2021-04-20 20:18:16 +00:00
parent ad1a153a63
commit 36349f89a2
2 changed files with 2 additions and 11 deletions

View File

@@ -1770,17 +1770,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);
}
}

View File

@@ -1695,8 +1695,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);