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

Commit 20527a0f authored by Fyodor Kupolov's avatar Fyodor Kupolov Committed by android-build-merger
Browse files

Merge "Check VPN status when adding/removing restricted profiles" into nyc-dev

am: fa4f3f2f

* commit 'fa4f3f2f':
  Check VPN status when adding/removing restricted profiles
parents c730ee5c fa4f3f2f
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -718,7 +718,8 @@ public class Vpn {
    public void onUserAdded(int userHandle) {
        // If the user is restricted tie them to the parent user's VPN
        UserInfo user = UserManager.get(mContext).getUserInfo(userHandle);
        if (user.isRestricted() && user.restrictedProfileParentId == mUserHandle) {
        if (user.isRestricted() && user.restrictedProfileParentId == mUserHandle
                && mVpnUsers != null) {
            synchronized(Vpn.this) {
                try {
                    addVpnUserLocked(userHandle);
@@ -736,7 +737,8 @@ public class Vpn {
    public void onUserRemoved(int userHandle) {
        // clean up if restricted
        UserInfo user = UserManager.get(mContext).getUserInfo(userHandle);
        if (user.isRestricted() && user.restrictedProfileParentId == mUserHandle) {
        if (user.isRestricted() && user.restrictedProfileParentId == mUserHandle
                && mVpnUsers != null) {
            synchronized(Vpn.this) {
                try {
                    removeVpnUserLocked(userHandle);