Merge "Fix lock held error when setting DO for AAOS" into tm-dev am: 8e052e35ea
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17041007 Change-Id: I97e9d451fd1ec1d5bd47b5a011ce777226bfb11f
This commit is contained in:
@@ -8610,20 +8610,23 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager {
|
|||||||
admin.getPackageName(), userId, "set-device-owner");
|
admin.getPackageName(), userId, "set-device-owner");
|
||||||
|
|
||||||
Slogf.i(LOG_TAG, "Device owner set: " + admin + " on user " + userId);
|
Slogf.i(LOG_TAG, "Device owner set: " + admin + " on user " + userId);
|
||||||
|
|
||||||
if (setProfileOwnerOnCurrentUserIfNecessary
|
|
||||||
&& mInjector.userManagerIsHeadlessSystemUserMode()) {
|
|
||||||
int currentForegroundUser = getCurrentForegroundUserId();
|
|
||||||
Slogf.i(LOG_TAG, "setDeviceOwner(): setting " + admin
|
|
||||||
+ " as profile owner on user " + currentForegroundUser);
|
|
||||||
// Sets profile owner on current foreground user since
|
|
||||||
// the human user will complete the DO setup workflow from there.
|
|
||||||
manageUserUnchecked(/* deviceOwner= */ admin, /* profileOwner= */ admin,
|
|
||||||
/* managedUser= */ currentForegroundUser, /* adminExtras= */ null,
|
|
||||||
/* showDisclaimer= */ false);
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (setProfileOwnerOnCurrentUserIfNecessary
|
||||||
|
&& mInjector.userManagerIsHeadlessSystemUserMode()) {
|
||||||
|
int currentForegroundUser;
|
||||||
|
synchronized (getLockObject()) {
|
||||||
|
currentForegroundUser = getCurrentForegroundUserId();
|
||||||
|
}
|
||||||
|
Slogf.i(LOG_TAG, "setDeviceOwner(): setting " + admin
|
||||||
|
+ " as profile owner on user " + currentForegroundUser);
|
||||||
|
// Sets profile owner on current foreground user since
|
||||||
|
// the human user will complete the DO setup workflow from there.
|
||||||
|
manageUserUnchecked(/* deviceOwner= */ admin, /* profileOwner= */ admin,
|
||||||
|
/* managedUser= */ currentForegroundUser, /* adminExtras= */ null,
|
||||||
|
/* showDisclaimer= */ false);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user