Merge "Legacy VPN calls to require a userID" into mnc-dev

This commit is contained in:
Robin Lee
2015-07-10 19:05:36 +00:00
committed by Android (Google) Code Review
2 changed files with 4 additions and 4 deletions

View File

@@ -112,7 +112,7 @@ interface IConnectivityManager
void startLegacyVpn(in VpnProfile profile);
LegacyVpnInfo getLegacyVpnInfo();
LegacyVpnInfo getLegacyVpnInfo(int userId);
VpnInfo[] getAllVpnInfo();

View File

@@ -3031,11 +3031,11 @@ public class ConnectivityService extends IConnectivityManager.Stub
* are checked in Vpn class.
*/
@Override
public LegacyVpnInfo getLegacyVpnInfo() {
public LegacyVpnInfo getLegacyVpnInfo(int userId) {
enforceCrossUserPermission(userId);
throwIfLockdownEnabled();
int user = UserHandle.getUserId(Binder.getCallingUid());
synchronized(mVpns) {
return mVpns.get(user).getLegacyVpnInfo();
return mVpns.get(userId).getLegacyVpnInfo();
}
}