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
This commit is contained in:
Michal Karpinski
2016-11-15 17:22:34 +00:00
parent b53e048b92
commit c44e679611

View File

@@ -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.