Add lockdownEnabled parameter to always-on VPN API
Allows callers to opt-out of blockading network traffic during boot and on VPN app failure. Bug: 26694104 Change-Id: Ibfbd43ad09a25f2e38053fcd6306df3711f8bde2
This commit is contained in:
@@ -792,14 +792,16 @@ public class ConnectivityManager {
|
||||
* @param userId The identifier of the user to set an always-on VPN for.
|
||||
* @param vpnPackage The package name for an installed VPN app on the device, or {@code null}
|
||||
* to remove an existing always-on VPN configuration.
|
||||
|
||||
* @param lockdownEnabled {@code true} to disallow networking when the VPN is not connected or
|
||||
* {@code false} otherwise.
|
||||
* @return {@code true} if the package is set as always-on VPN controller;
|
||||
* {@code false} otherwise.
|
||||
* @hide
|
||||
*/
|
||||
public boolean setAlwaysOnVpnPackageForUser(int userId, @Nullable String vpnPackage) {
|
||||
public boolean setAlwaysOnVpnPackageForUser(int userId, @Nullable String vpnPackage,
|
||||
boolean lockdownEnabled) {
|
||||
try {
|
||||
return mService.setAlwaysOnVpnPackage(userId, vpnPackage);
|
||||
return mService.setAlwaysOnVpnPackage(userId, vpnPackage, lockdownEnabled);
|
||||
} catch (RemoteException e) {
|
||||
throw e.rethrowFromSystemServer();
|
||||
}
|
||||
|
||||
@@ -122,7 +122,7 @@ interface IConnectivityManager
|
||||
VpnInfo[] getAllVpnInfo();
|
||||
|
||||
boolean updateLockdownVpn();
|
||||
boolean setAlwaysOnVpnPackage(int userId, String packageName);
|
||||
boolean setAlwaysOnVpnPackage(int userId, String packageName, boolean lockdown);
|
||||
String getAlwaysOnVpnPackage(int userId);
|
||||
|
||||
int checkMobileProvisioning(int suggestedTimeOutMs);
|
||||
|
||||
Reference in New Issue
Block a user