Allow sending of Administrator UIDs for *NETWORK_STACK
This change allows callers with the NETWORK_STACK or PERMISSION_NETWORK_STACK to receive administrator UIDs. This will be used by the VCN to ensure that administrator UIDs are accurately populated, ensuring that the ConnectivityDiagnostics are triggered for the VCN. Bug: 193204385 Test: atest ConnectivityServiceTest Change-Id: I3ecfbef6847dcc78adac05d0229719c97e3a220c
This commit is contained in:
parent
b643f2a356
commit
a5604ea50f
1 changed files with 34 additions and 1 deletions
|
|
@ -2253,7 +2253,10 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
|||
if (newNc.getNetworkSpecifier() != null) {
|
||||
newNc.setNetworkSpecifier(newNc.getNetworkSpecifier().redact());
|
||||
}
|
||||
newNc.setAdministratorUids(new int[0]);
|
||||
if (!checkAnyPermissionOf(callerPid, callerUid, android.Manifest.permission.NETWORK_STACK,
|
||||
NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK)) {
|
||||
newNc.setAdministratorUids(new int[0]);
|
||||
}
|
||||
if (!checkAnyPermissionOf(
|
||||
callerPid, callerUid, android.Manifest.permission.NETWORK_FACTORY)) {
|
||||
newNc.setAllowedUids(new ArraySet<>());
|
||||
|
|
|
|||
Loading…
Reference in a new issue