Merge "Add API for VPN apps to query always-on and lockdown."
am: 479c0769f1
Change-Id: Icb11cdd5c7384eacf1df9b7a0c42e451641f0e04
This commit is contained in:
@@ -187,4 +187,6 @@ interface IConnectivityManager
|
||||
byte[] getNetworkWatchlistConfigHash();
|
||||
|
||||
int getConnectionOwnerUid(in ConnectionInfo connectionInfo);
|
||||
boolean isCallerCurrentAlwaysOnVpnApp();
|
||||
boolean isCallerCurrentAlwaysOnVpnLockdownApp();
|
||||
}
|
||||
|
||||
@@ -367,6 +367,29 @@ public class VpnService extends Service {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether the service is running in always-on VPN mode.
|
||||
*/
|
||||
public final boolean isAlwaysOn() {
|
||||
try {
|
||||
return getService().isCallerCurrentAlwaysOnVpnApp();
|
||||
} catch (RemoteException e) {
|
||||
throw e.rethrowFromSystemServer();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether the service is running in always-on VPN mode blocking connections without
|
||||
* VPN.
|
||||
*/
|
||||
public final boolean isLockdownEnabled() {
|
||||
try {
|
||||
return getService().isCallerCurrentAlwaysOnVpnLockdownApp();
|
||||
} catch (RemoteException e) {
|
||||
throw e.rethrowFromSystemServer();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the communication interface to the service. This method returns
|
||||
* {@code null} on {@link Intent}s other than {@link #SERVICE_INTERFACE}
|
||||
|
||||
Reference in New Issue
Block a user