Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 41d8bf1f authored by Rubin Xu's avatar Rubin Xu
Browse files

[DO NOT MERGE] Add permission check to setAllowOnlyVpnForUids

Bug: 63000005
Test: runtest frameworks-net -c com.android.server.connectivity.VpnTest
Test: cts-tradefed run cts-dev -m CtsDevicePolicyManagerTestCases -t com.android.cts.devicepolicy.MixedDeviceOwnerTest#testAlwaysOnVpnLockDown
Change-Id: Ia1a82ee73d8617f3124032986fe6c09c14bf7752
parent 28764528
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1852,6 +1852,8 @@ public class NetworkManagementService extends INetworkManagementService.Stub
    @Override
    public void setAllowOnlyVpnForUids(boolean add, UidRange[] uidRanges)
            throws ServiceSpecificException {
        mContext.enforceCallingOrSelfPermission(CONNECTIVITY_INTERNAL, TAG);

        try {
            mNetdService.networkRejectNonSecureVpn(add, uidRanges);
        } catch (ServiceSpecificException e) {