Merge "Merge "Add lockdownEnabled parameter to always-on VPN API" into nyc-dev am: fb0faa494e am: 78d0888e8c" into nyc-mr1-dev-plus-aosp
am: 062a28b6a4 * commit '062a28b6a403a48d6f5f88e109a899c9c60581c1': Add lockdownEnabled parameter to always-on VPN API Change-Id: I9ebd6221451ee10649a1f340031d62c6483832f1
This commit is contained in:
@@ -797,14 +797,16 @@ public class ConnectivityManager {
|
|||||||
* @param userId The identifier of the user to set an always-on VPN for.
|
* @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}
|
* @param vpnPackage The package name for an installed VPN app on the device, or {@code null}
|
||||||
* to remove an existing always-on VPN configuration.
|
* 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;
|
* @return {@code true} if the package is set as always-on VPN controller;
|
||||||
* {@code false} otherwise.
|
* {@code false} otherwise.
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
public boolean setAlwaysOnVpnPackageForUser(int userId, @Nullable String vpnPackage) {
|
public boolean setAlwaysOnVpnPackageForUser(int userId, @Nullable String vpnPackage,
|
||||||
|
boolean lockdownEnabled) {
|
||||||
try {
|
try {
|
||||||
return mService.setAlwaysOnVpnPackage(userId, vpnPackage);
|
return mService.setAlwaysOnVpnPackage(userId, vpnPackage, lockdownEnabled);
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
throw e.rethrowFromSystemServer();
|
throw e.rethrowFromSystemServer();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -122,7 +122,7 @@ interface IConnectivityManager
|
|||||||
VpnInfo[] getAllVpnInfo();
|
VpnInfo[] getAllVpnInfo();
|
||||||
|
|
||||||
boolean updateLockdownVpn();
|
boolean updateLockdownVpn();
|
||||||
boolean setAlwaysOnVpnPackage(int userId, String packageName);
|
boolean setAlwaysOnVpnPackage(int userId, String packageName, boolean lockdown);
|
||||||
String getAlwaysOnVpnPackage(int userId);
|
String getAlwaysOnVpnPackage(int userId);
|
||||||
|
|
||||||
int checkMobileProvisioning(int suggestedTimeOutMs);
|
int checkMobileProvisioning(int suggestedTimeOutMs);
|
||||||
|
|||||||
@@ -3350,7 +3350,7 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean setAlwaysOnVpnPackage(int userId, String packageName) {
|
public boolean setAlwaysOnVpnPackage(int userId, String packageName, boolean lockdown) {
|
||||||
enforceConnectivityInternalPermission();
|
enforceConnectivityInternalPermission();
|
||||||
enforceCrossUserPermission(userId);
|
enforceCrossUserPermission(userId);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user