Use appId for looking up allowed on restricted networks uids list

aosp/1770606 change uid to appId when filling allowed on
restricted networks uids list. So add UserHandle.getAppId() to
ensure that uses appId for looking up the list.

Bug: 192116643
Test: atest FrameworksNetTests
Change-Id: I04fe3a77464d4cb02e7d53026f8f9a10bd0829e1
This commit is contained in:
paulhu
2021-07-21 17:45:38 +08:00
parent 1004c23b35
commit 25094906ff

View File

@@ -310,7 +310,7 @@ public class PermissionMonitor {
if (appInfo == null) return false;
// Check whether package's uid is in allowed on restricted networks uid list. If so, this
// uid can have netd system permission.
return mUidsAllowedOnRestrictedNetworks.contains(appInfo.uid);
return mUidsAllowedOnRestrictedNetworks.contains(UserHandle.getAppId(appInfo.uid));
}
@VisibleForTesting