diff --git a/tests/cts/net/src/android/net/cts/PacProxyManagerTest.java b/tests/cts/net/src/android/net/cts/PacProxyManagerTest.java index a20f1cc1d5..f0c876730d 100644 --- a/tests/cts/net/src/android/net/cts/PacProxyManagerTest.java +++ b/tests/cts/net/src/android/net/cts/PacProxyManagerTest.java @@ -16,6 +16,7 @@ package android.net.cts; +import static android.Manifest.permission.INTERACT_ACROSS_USERS_FULL; import static android.Manifest.permission.NETWORK_SETTINGS; import static com.android.testutils.TestPermissionUtil.runAsShell; @@ -168,7 +169,9 @@ public final class PacProxyManagerTest { mContext.registerReceiver(receiver, new IntentFilter(Proxy.PROXY_CHANGE_ACTION)); // Call setCurrentProxyScriptUrl with the URL of the pac file. - runAsShell(NETWORK_SETTINGS, () -> { + // Note that the proxy script is global to device, and setting it from a different user + // should require INTERACT_ACROSS_USERS_FULL permission which the Settings app has. + runAsShell(NETWORK_SETTINGS, INTERACT_ACROSS_USERS_FULL, () -> { mPacProxyManager.setCurrentProxyScriptUrl(proxy); });