Support multiple Vpn ManageDialogs

Move away from storing the configs in the Intent to prevent issues with
PendingIntents and multiple configs.

The Dialog now queries ConnectivityService for the configuration to
display in the management dialog.

Change-Id: I0e0ef52db840152914d117a24f776d8106e836ff
This commit is contained in:
Chad Brubaker
2013-07-16 18:59:12 -07:00
parent dc7e3ee3ad
commit 94f3c8c66d
2 changed files with 16 additions and 0 deletions

View File

@@ -3425,6 +3425,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