Enable checks for MANAGE_TEST_NETWORKS in TestNetworkService
This commit re-enables enforcement of the MANAGE_TEST_NETWORK permission, which is only granted to the shell. CTS tests using this permission should use UiAutomation.adoptShellPermissionIdentity() to gain access. Bug: 72950854 Test: IPsec CTS tests using this passing Change-Id: I98573a5c68e45abbbaddef01f6ac74a6a18e26f9
This commit is contained in:
@@ -325,14 +325,10 @@ class TestNetworkService extends ITestNetworkManager.Stub {
|
|||||||
agent.teardown();
|
agent.teardown();
|
||||||
}
|
}
|
||||||
|
|
||||||
// STOPSHIP: Change this back to android.Manifest.permission.MANAGE_TEST_NETWORKS
|
private static final String PERMISSION_NAME =
|
||||||
private static final String PERMISSION_NAME = "dummy";
|
android.Manifest.permission.MANAGE_TEST_NETWORKS;
|
||||||
|
|
||||||
public static void enforceTestNetworkPermissions(@NonNull Context context) {
|
public static void enforceTestNetworkPermissions(@NonNull Context context) {
|
||||||
// STOPSHIP: Re-enable these checks. Disabled until adoptShellPermissionIdentity() can be
|
context.enforceCallingOrSelfPermission(PERMISSION_NAME, "TestNetworkService");
|
||||||
// called from CTS test code.
|
|
||||||
if (false) {
|
|
||||||
context.enforceCallingOrSelfPermission(PERMISSION_NAME, "TestNetworkService");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user