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

Commit 472e038e authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Clear user restriction for managed profiles when the user is deleted." into udc-dev

parents 81048dfd 859b914c
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -2237,6 +2237,16 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
            }
            isOrgOwned = mOwners.isProfileOwnerOfOrganizationOwnedDevice(userHandle);
            // Clear any restrictions set by the a profile owner and the parent admin.
            final ActiveAdmin admin = getProfileOwnerLocked(userHandle);
            if (admin != null) {
                admin.userRestrictions = null;
                final ActiveAdmin parentAdmin = admin.getParentActiveAdmin();
                if (parentAdmin != null) {
                    parentAdmin.userRestrictions = null;
                }
                pushUserRestrictions(userHandle);
            }
            mOwners.removeProfileOwner(userHandle);
            mOwners.writeProfileOwner(userHandle);
            pushScreenCapturePolicy(userHandle);