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

Commit d0b211ed authored by Patrick Baumann's avatar Patrick Baumann Committed by Automerger Merge Worker
Browse files

Revert "Fixes incorrect array type comparison" am: 2c593f65

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

Change-Id: I57b3abfe0d0976bfeebe98851cc76ad01b5b5fba
parents 8f08e5c9 2c593f65
Loading
Loading
Loading
Loading
+3 −10
Original line number Diff line number Diff line
@@ -18,7 +18,6 @@ package com.android.server.pm;

import static android.os.Trace.TRACE_TAG_PACKAGE_MANAGER;
import static android.os.UserHandle.USER_ALL;
import static android.os.UserHandle.USER_NULL;
import static android.provider.DeviceConfig.NAMESPACE_PACKAGE_MANAGER_SERVICE;

import static com.android.internal.annotations.VisibleForTesting.Visibility.PRIVATE;
@@ -839,14 +838,8 @@ public class AppsFilter implements Watchable, Snappable {

    private void updateEntireShouldFilterCache(int subjectUserId) {
        mStateProvider.runWithState((settings, users) -> {
            int userId = USER_NULL;
            for (int u = 0; u < users.length; u++) {
                if (subjectUserId == users[u].id) {
                    userId = subjectUserId;
                    break;
                }
            }
            if (userId == USER_NULL) {
            int userId = subjectUserId;
            if (!ArrayUtils.contains(users, subjectUserId)) {
                Slog.e(TAG, "We encountered a new user that isn't a member of known users, "
                        + "updating the whole cache");
                userId = USER_ALL;
@@ -868,7 +861,7 @@ public class AppsFilter implements Watchable, Snappable {
                            if (UserHandle.getUserId(uid2) == userId) {
                                continue;
                            }
                            cache.put(uid1, uid2, mShouldFilterCache.get(uid1, uid2));
                            cache.setValueAt(uid1, uid2, mShouldFilterCache.valueAt(uid1, uid2));
                        }
                    }
                }