Stop using ConnectivityManager for VPNs.

These methods have all moved to VpnManager.

Bug: 173331190
Test: atest SettingsRoboTests
Change-Id: I1dd57fa2213b1785a94ec9d6ab4cce3a5d2684ff
Merged-In: I1dd57fa2213b1785a94ec9d6ab4cce3a5d2684ff
This commit is contained in:
Lorenzo Colitti
2021-02-18 01:11:49 +09:00
parent ace5a90870
commit 1434c08600
9 changed files with 38 additions and 46 deletions

View File

@@ -20,7 +20,6 @@ import android.app.Dialog;
import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.DialogInterface;
import android.net.ConnectivityManager;
import android.net.VpnManager;
import android.os.Bundle;
import android.os.RemoteException;
@@ -177,9 +176,8 @@ public class ConfigDialogFragment extends InstrumentedDialogFragment implements
return;
}
final ConnectivityManager conn = ConnectivityManager.from(mContext);
conn.setAlwaysOnVpnPackageForUser(UserHandle.myUserId(), null,
/* lockdownEnabled */ false, /* lockdownWhitelist */ null);
mService.setAlwaysOnVpnPackageForUser(UserHandle.myUserId(), null,
/* lockdownEnabled */ false, /* lockdownAllowlist */ null);
VpnUtils.setLockdownVpn(mContext, profile.key);
} else {
// update only if lockdown vpn has been changed