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

Commit cb37b042 authored by Manish Singh's avatar Manish Singh Committed by Android (Google) Code Review
Browse files

Merge "Fix the condition for hiding a user in the list" into main

parents ca8c8e6e cb5f5f0a
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -128,7 +128,7 @@ public class RecentAppOpsAccess {
        final long now = mClock.millis();
        final UserManager um = mContext.getSystemService(UserManager.class);
        final List<UserHandle> profiles = um.getUserProfiles();
        ArrayMap<UserHandle, Boolean> shouldIncludeAppsByUsers = new ArrayMap<>();
        ArrayMap<UserHandle, Boolean> shouldHideAppsByUsers = new ArrayMap<>();

        for (int i = 0; i < appOpsCount; ++i) {
            AppOpsManager.PackageOps ops = appOps.get(i);
@@ -136,13 +136,13 @@ public class RecentAppOpsAccess {
            int uid = ops.getUid();
            UserHandle user = UserHandle.getUserHandleForUid(uid);

            if (!shouldIncludeAppsByUsers.containsKey(user)) {
                shouldIncludeAppsByUsers.put(user, shouldHideUser(um, user));
            if (!shouldHideAppsByUsers.containsKey(user)) {
                shouldHideAppsByUsers.put(user, shouldHideUser(um, user));
            }

            // Don't show apps belonging to background users except for profiles that shouldn't
            // be shown in quiet mode.
            if (!profiles.contains(user) || !shouldIncludeAppsByUsers.get(user)) {
            if (!profiles.contains(user) || shouldHideAppsByUsers.get(user)) {
                continue;
            }