DO NOT MERGE 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
(cherry picked from commit c44e679611)
Change-Id: I74679abc26753585f302f3d52bca81fe21e2e668
This commit is contained in:
@@ -6049,6 +6049,7 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void clearDeviceOwnerLocked(ActiveAdmin admin, int userId) {
|
private void clearDeviceOwnerLocked(ActiveAdmin admin, int userId) {
|
||||||
|
disableDeviceOwnerManagedSingleUserFeaturesIfNeeded();
|
||||||
if (admin != null) {
|
if (admin != null) {
|
||||||
admin.disableCamera = false;
|
admin.disableCamera = false;
|
||||||
admin.userRestrictions = null;
|
admin.userRestrictions = null;
|
||||||
@@ -6060,7 +6061,6 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
|
|||||||
mOwners.clearDeviceOwner();
|
mOwners.clearDeviceOwner();
|
||||||
mOwners.writeDeviceOwner();
|
mOwners.writeDeviceOwner();
|
||||||
updateDeviceOwnerLocked();
|
updateDeviceOwnerLocked();
|
||||||
disableDeviceOwnerManagedSingleUserFeaturesIfNeeded();
|
|
||||||
try {
|
try {
|
||||||
if (mInjector.getIBackupManager() != null) {
|
if (mInjector.getIBackupManager() != null) {
|
||||||
// Reactivate backup service.
|
// Reactivate backup service.
|
||||||
|
|||||||
Reference in New Issue
Block a user