diff options
| author | Jeff Sharkey <jsharkey@android.com> | 2012-08-25 00:05:46 -0700 |
|---|---|---|
| committer | Jeff Sharkey <jsharkey@android.com> | 2012-08-27 12:35:05 -0700 |
| commit | 69ddab4575ff684c533c995e07ca15fe18543fc0 (patch) | |
| tree | dfae3a89b9027c33d47b58f80200af021bbe7426 /core/java/android | |
| parent | 080ca09c7f4c0033d0efece23687b71f7f8febc9 (diff) | |
Always-on VPN.
Adds support for always-on VPN profiles, also called "lockdown." When
enabled, LockdownVpnTracker manages the netd firewall to prevent
unencrypted traffic from leaving the device. It creates narrow rules
to only allow traffic to the selected VPN server. When an egress
network becomes available, LockdownVpnTracker will try bringing up
the VPN connection, and will reconnect if disconnected.
ConnectivityService augments any NetworkInfo based on the lockdown
VPN status to help apps wait until the VPN is connected.
This feature requires that VPN profiles use an IP address for both
VPN server and DNS. It also blocks non-default APN access when
enabled. Waits for USER_PRESENT after boot to check KeyStore status.
Bug: 5756357
Change-Id: If615f206b1634000d78a8350a17e88bfcac8e0d0
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/app/NotificationManager.java | 8 | ||||
| -rw-r--r-- | core/java/android/net/ConnectivityManager.java | 9 | ||||
| -rw-r--r-- | core/java/android/net/IConnectivityManager.aidl | 2 |
3 files changed, 17 insertions, 2 deletions
diff --git a/core/java/android/app/NotificationManager.java b/core/java/android/app/NotificationManager.java index bf83f5edc1bc..69c20b0a0648 100644 --- a/core/java/android/app/NotificationManager.java +++ b/core/java/android/app/NotificationManager.java @@ -17,10 +17,9 @@ package android.app; import android.content.Context; -import android.os.Binder; -import android.os.RemoteException; import android.os.Handler; import android.os.IBinder; +import android.os.RemoteException; import android.os.ServiceManager; import android.util.Log; @@ -88,6 +87,11 @@ public class NotificationManager mContext = context; } + /** {@hide} */ + public static NotificationManager from(Context context) { + return (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); + } + /** * Post a notification to be shown in the status bar. If a notification with * the same id has already been posted by your application and has not yet been canceled, it diff --git a/core/java/android/net/ConnectivityManager.java b/core/java/android/net/ConnectivityManager.java index d30ef04628b9..60bf4d6869fc 100644 --- a/core/java/android/net/ConnectivityManager.java +++ b/core/java/android/net/ConnectivityManager.java @@ -912,4 +912,13 @@ public class ConnectivityManager { return false; } } + + /** {@hide} */ + public boolean updateLockdownVpn() { + try { + return mService.updateLockdownVpn(); + } catch (RemoteException e) { + return false; + } + } } diff --git a/core/java/android/net/IConnectivityManager.aidl b/core/java/android/net/IConnectivityManager.aidl index dea25dd9ca63..3614045f42d0 100644 --- a/core/java/android/net/IConnectivityManager.aidl +++ b/core/java/android/net/IConnectivityManager.aidl @@ -122,4 +122,6 @@ interface IConnectivityManager void startLegacyVpn(in VpnProfile profile); LegacyVpnInfo getLegacyVpnInfo(); + + boolean updateLockdownVpn(); } |
