Add SDK level check to adding sandbox UIDs.
ConnectivityServiceTest builds against the latest Vpn framework code, but when run on an older base image (eg 'S'), said framework code might run into runtime errors calling new APIs. Until the test is decoupled, do the SDK level check here. Bug: 230548427 Bug: 232420362 Test: Build Change-Id: If453e16e680f46cf2b9eb769e5607fb5513b32ac
This commit is contained in:
@@ -1629,7 +1629,9 @@ public class Vpn {
|
||||
for (String app : packageNames) {
|
||||
int uid = getAppUid(app, userId);
|
||||
if (uid != -1) uids.add(uid);
|
||||
if (Process.isApplicationUid(uid)) {
|
||||
// TODO(b/230548427): Remove SDK check once VPN related stuff are decoupled from
|
||||
// ConnectivityServiceTest.
|
||||
if (Process.isApplicationUid(uid) && SdkLevel.isAtLeastT()) {
|
||||
uids.add(Process.toSdkSandboxUid(uid));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user