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

Commit 2665fdfd authored by Nicolas Prevot's avatar Nicolas Prevot Committed by Android (Google) Code Review
Browse files

Merge "Fetch DISALLOW_CONFIG_VPN for the current user." into mnc-dev

parents 4862e973 95778ffc
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -488,7 +488,8 @@ public class Vpn {
        try {
            // Restricted users are not allowed to create VPNs, they are tied to Owner
            UserInfo user = mgr.getUserInfo(mUserHandle);
            if (user.isRestricted() || mgr.hasUserRestriction(UserManager.DISALLOW_CONFIG_VPN)) {
            if (user.isRestricted() || mgr.hasUserRestriction(UserManager.DISALLOW_CONFIG_VPN,
                    new UserHandle(mUserHandle))) {
                throw new SecurityException("Restricted users cannot establish VPNs");
            }

@@ -896,7 +897,8 @@ public class Vpn {
        }
        UserManager mgr = UserManager.get(mContext);
        UserInfo user = mgr.getUserInfo(mUserHandle);
        if (user.isRestricted() || mgr.hasUserRestriction(UserManager.DISALLOW_CONFIG_VPN)) {
        if (user.isRestricted() || mgr.hasUserRestriction(UserManager.DISALLOW_CONFIG_VPN,
                    new UserHandle(mUserHandle))) {
            throw new SecurityException("Restricted users cannot establish VPNs");
        }