Add INTERACT_ACROSS_USERS_FULL to test for setCurrentProxyScriptUrl

If the test passes uid from another user which requires
INTERACT_ACROSS_USERS_FULL permission to bind service.

Bug: 192114565
Test: atest CtsNetTestCases:PacProxyManagerTest
Change-Id: I2ddff09b4c9cda1e7c5f3566662ba9cc07fffaae
This commit is contained in:
Aaron Huang
2021-07-02 16:36:00 +08:00
parent 93bda73970
commit ac8c47eef6

View File

@@ -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);
});