Merge "Add INTERACT_ACROSS_USERS_FULL to test for setCurrentProxyScriptUrl"

This commit is contained in:
Aaron Huang
2021-07-29 11:24:54 +00:00
committed by Gerrit Code Review

View File

@@ -16,6 +16,7 @@
package android.net.cts; package android.net.cts;
import static android.Manifest.permission.INTERACT_ACROSS_USERS_FULL;
import static android.Manifest.permission.NETWORK_SETTINGS; import static android.Manifest.permission.NETWORK_SETTINGS;
import static com.android.testutils.TestPermissionUtil.runAsShell; import static com.android.testutils.TestPermissionUtil.runAsShell;
@@ -168,7 +169,9 @@ public final class PacProxyManagerTest {
mContext.registerReceiver(receiver, new IntentFilter(Proxy.PROXY_CHANGE_ACTION)); mContext.registerReceiver(receiver, new IntentFilter(Proxy.PROXY_CHANGE_ACTION));
// Call setCurrentProxyScriptUrl with the URL of the pac file. // 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); mPacProxyManager.setCurrentProxyScriptUrl(proxy);
}); });