Merge "Fixes incorrect array type comparison" into sc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
4fd129b588
@@ -18,6 +18,7 @@ package com.android.server.pm;
|
|||||||
|
|
||||||
import static android.os.Trace.TRACE_TAG_PACKAGE_MANAGER;
|
import static android.os.Trace.TRACE_TAG_PACKAGE_MANAGER;
|
||||||
import static android.os.UserHandle.USER_ALL;
|
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 android.provider.DeviceConfig.NAMESPACE_PACKAGE_MANAGER_SERVICE;
|
||||||
|
|
||||||
import static com.android.internal.annotations.VisibleForTesting.Visibility.PRIVATE;
|
import static com.android.internal.annotations.VisibleForTesting.Visibility.PRIVATE;
|
||||||
@@ -838,8 +839,14 @@ public class AppsFilter implements Watchable, Snappable {
|
|||||||
|
|
||||||
private void updateEntireShouldFilterCache(int subjectUserId) {
|
private void updateEntireShouldFilterCache(int subjectUserId) {
|
||||||
mStateProvider.runWithState((settings, users) -> {
|
mStateProvider.runWithState((settings, users) -> {
|
||||||
int userId = subjectUserId;
|
int userId = USER_NULL;
|
||||||
if (!ArrayUtils.contains(users, subjectUserId)) {
|
for (int u = 0; u < users.length; u++) {
|
||||||
|
if (subjectUserId == users[u].id) {
|
||||||
|
userId = subjectUserId;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (userId == USER_NULL) {
|
||||||
Slog.e(TAG, "We encountered a new user that isn't a member of known users, "
|
Slog.e(TAG, "We encountered a new user that isn't a member of known users, "
|
||||||
+ "updating the whole cache");
|
+ "updating the whole cache");
|
||||||
userId = USER_ALL;
|
userId = USER_ALL;
|
||||||
@@ -861,7 +868,7 @@ public class AppsFilter implements Watchable, Snappable {
|
|||||||
if (UserHandle.getUserId(uid2) == userId) {
|
if (UserHandle.getUserId(uid2) == userId) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
cache.setValueAt(uid1, uid2, mShouldFilterCache.valueAt(uid1, uid2));
|
cache.put(uid1, uid2, mShouldFilterCache.get(uid1, uid2));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user