Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3eed5eca authored by Robin Lee's avatar Robin Lee
Browse files

Legacy VPN calls to require a userID

This way, system applications with INTERACT_ACROSS_USERS permission will
be able to fetch the information they need.

Pre-requisite for bug 21499103

Change-Id: I7e759d5039ae6e85abc6435049016b1dcaabc834
parent 13c25290
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -114,7 +114,7 @@ interface IConnectivityManager

    void startLegacyVpn(in VpnProfile profile);

    LegacyVpnInfo getLegacyVpnInfo();
    LegacyVpnInfo getLegacyVpnInfo(int userId);

    VpnInfo[] getAllVpnInfo();

+3 −3
Original line number Diff line number Diff line
@@ -3112,11 +3112,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();
        }
    }