Merge "Acquire lock before calling getDeviceOwnerAdminLocked" into pi-dev

am: b9ab72bf96

Change-Id: Id969235011d5d836b0f79640e07a2c5035b66fd8
This commit is contained in:
Pavel Grafov
2018-05-09 13:02:10 -07:00
committed by android-build-merger

View File

@@ -5525,9 +5525,11 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager {
// If there is a profile owner, redirect to that; otherwise query the device owner.
ComponentName aliasChooser = getProfileOwner(caller.getIdentifier());
if (aliasChooser == null && caller.isSystem()) {
ActiveAdmin deviceOwnerAdmin = getDeviceOwnerAdminLocked();
if (deviceOwnerAdmin != null) {
aliasChooser = deviceOwnerAdmin.info.getComponent();
synchronized (getLockObject()) {
final ActiveAdmin deviceOwnerAdmin = getDeviceOwnerAdminLocked();
if (deviceOwnerAdmin != null) {
aliasChooser = deviceOwnerAdmin.info.getComponent();
}
}
}
if (aliasChooser == null) {