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

Commit c44e6796 authored by Michal Karpinski's avatar Michal Karpinski
Browse files

Fix disabling DO single user features when clearDeviceOwner() is called

We should disable those features before the DO is actually cleared.

Bug: 32901196
Bug: 29748723
Change-Id: I3cf24636feb1715af10fb874d4fecd7a4e32495d
parent b53e048b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -6031,6 +6031,7 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
    }

    private void clearDeviceOwnerLocked(ActiveAdmin admin, int userId) {
        disableDeviceOwnerManagedSingleUserFeaturesIfNeeded();
        if (admin != null) {
            admin.disableCamera = false;
            admin.userRestrictions = null;
@@ -6042,7 +6043,6 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
        mOwners.clearDeviceOwner();
        mOwners.writeDeviceOwner();
        updateDeviceOwnerLocked();
        disableDeviceOwnerManagedSingleUserFeaturesIfNeeded();
        try {
            if (mInjector.getIBackupManager() != null) {
                // Reactivate backup service.