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

Commit d083daab authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Stop using ConnectivityManager for VPNs in DPMS." am: 6ec31401

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1594172

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ib00a87fe258f34f17d115fffa1e00217f0f4bed0
parents d5333b72 6ec31401
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -197,6 +197,7 @@ import android.net.ConnectivityManager;
import android.net.IIpConnectivityMetrics;
import android.net.ProxyInfo;
import android.net.Uri;
import android.net.VpnManager;
import android.net.metrics.IpConnectivityLog;
import android.net.wifi.WifiManager;
import android.os.Binder;
@@ -2245,6 +2246,10 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager {
            return mContext.getSystemService(ConnectivityManager.class);
        }
        VpnManager getVpnManager() {
            return mContext.getSystemService(VpnManager.class);
        }
        LocationManager getLocationManager() {
            return mContext.getSystemService(LocationManager.class);
        }
@@ -7090,7 +7095,7 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager {
                }
            }
            // If some package is uninstalled after the check above, it will be ignored by CM.
            if (!mInjector.getConnectivityManager().setAlwaysOnVpnPackageForUser(
            if (!mInjector.getVpnManager().setAlwaysOnVpnPackageForUser(
                    userId, vpnPackage, lockdown, lockdownAllowlist)) {
                throw new UnsupportedOperationException();
            }
@@ -7121,7 +7126,7 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager {
        final int userId = mInjector.userHandleGetCallingUserId();
        return mInjector.binderWithCleanCallingIdentity(
                () -> mInjector.getConnectivityManager().getAlwaysOnVpnPackageForUser(userId));
                () -> mInjector.getVpnManager().getAlwaysOnVpnPackageForUser(userId));
    }
    @Override
@@ -7139,7 +7144,7 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager {
        final int userId = mInjector.userHandleGetCallingUserId();
        return mInjector.binderWithCleanCallingIdentity(
                () -> mInjector.getConnectivityManager().isVpnLockdownEnabled(userId));
                () -> mInjector.getVpnManager().isVpnLockdownEnabled(userId));
    }
    @Override
@@ -7158,7 +7163,7 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager {
        final int userId = mInjector.userHandleGetCallingUserId();
        return mInjector.binderWithCleanCallingIdentity(
                () -> mInjector.getConnectivityManager().getVpnLockdownAllowlist(userId));
                () -> mInjector.getVpnManager().getVpnLockdownAllowlist(userId));
    }
    private void forceWipeDeviceNoLock(boolean wipeExtRequested, String reason, boolean wipeEuicc) {