diff options
| author | Geremy Condra <gcondra@google.com> | 2013-07-23 17:55:44 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2013-07-23 17:55:45 +0000 |
| commit | 1b6868cc4b8455e8660ba35ccdcc34abbaa43ffa (patch) | |
| tree | c04b66c71909dc7943969e4e402f0ee7e112205e /services/java/com/android/server | |
| parent | a874c6762d0ca381a1eb5788fee39bc1b807d877 (diff) | |
| parent | bf6ff2c025405a3af496fe558dfc4468a9b45cc8 (diff) | |
Merge "Support multiple Vpn ManageDialogs"
Diffstat (limited to 'services/java/com/android/server')
| -rw-r--r-- | services/java/com/android/server/ConnectivityService.java | 14 | ||||
| -rw-r--r-- | services/java/com/android/server/connectivity/Vpn.java | 10 |
2 files changed, 23 insertions, 1 deletions
diff --git a/services/java/com/android/server/ConnectivityService.java b/services/java/com/android/server/ConnectivityService.java index 0608b6a6f583..f66fa23d60fe 100644 --- a/services/java/com/android/server/ConnectivityService.java +++ b/services/java/com/android/server/ConnectivityService.java @@ -3447,6 +3447,20 @@ public class ConnectivityService extends IConnectivityManager.Stub { } /** + * Returns the information of the ongoing VPN. This method is used by VpnDialogs and + * not available in ConnectivityManager. + * Permissions are checked in Vpn class. + * @hide + */ + @Override + public VpnConfig getVpnConfig() { + int user = UserHandle.getUserId(Binder.getCallingUid()); + synchronized(mVpns) { + return mVpns.get(user).getVpnConfig(); + } + } + + /** * Callback for VPN subsystem. Currently VPN is not adapted to the service * through NetworkStateTracker since it works differently. For example, it * needs to override DNS servers but never takes the default routes. It diff --git a/services/java/com/android/server/connectivity/Vpn.java b/services/java/com/android/server/connectivity/Vpn.java index 3a2391f1abca..8cc5b4f69cd9 100644 --- a/services/java/com/android/server/connectivity/Vpn.java +++ b/services/java/com/android/server/connectivity/Vpn.java @@ -519,6 +519,14 @@ public class Vpn extends BaseNetworkStateTracker { } } + /** + * Return the configuration of the currently running VPN. + */ + public VpnConfig getVpnConfig() { + enforceControlPermission(); + return mConfig; + } + @Deprecated public synchronized void interfaceStatusChanged(String iface, boolean up) { try { @@ -610,7 +618,7 @@ public class Vpn extends BaseNetworkStateTracker { private void showNotification(String label, Bitmap icon, int user) { if (!mEnableNotif) return; - mStatusIntent = VpnConfig.getIntentForStatusPanel(mContext, mConfig); + mStatusIntent = VpnConfig.getIntentForStatusPanel(mContext); NotificationManager nm = (NotificationManager) mContext.getSystemService(Context.NOTIFICATION_SERVICE); |
