Merge "Temporarily change uid to appId" into sc-dev am: 9bcaabb91c

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/15328205

Change-Id: Ibbf30fffc0e70dec84b8ed10bbf719267313b820
This commit is contained in:
Paul Hu
2021-07-26 08:13:42 +00:00
committed by Automerger Merge Worker

View File

@@ -281,7 +281,14 @@ public class PermissionMonitor {
@VisibleForTesting
synchronized void updateUidsAllowedOnRestrictedNetworks(final Set<Integer> uids) {
mUidsAllowedOnRestrictedNetworks.clear();
mUidsAllowedOnRestrictedNetworks.addAll(uids);
// This is necessary for the app id to match in isUidAllowedOnRestrictedNetworks, and will
// grant the permission to all uids associated with the app ID. This is safe even if the app
// is only installed on some users because the uid cannot match some other app this uid is
// in effect not installed and can't be run.
// TODO (b/192431153): Change appIds back to uids.
for (int uid : uids) {
mUidsAllowedOnRestrictedNetworks.add(UserHandle.getAppId(uid));
}
}
@VisibleForTesting