Merge "Fix testScreenCaptureDisabled" into rvc-dev am: 20905ec041
Change-Id: I509b6d1568e2cba4d54a218a63509a6e9ffee418
This commit is contained in:
@@ -4674,22 +4674,24 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager {
|
|||||||
return getUserDataUnchecked(userHandle).mAdminList;
|
return getUserDataUnchecked(userHandle).mAdminList;
|
||||||
}
|
}
|
||||||
ArrayList<ActiveAdmin> admins = new ArrayList<>();
|
ArrayList<ActiveAdmin> admins = new ArrayList<>();
|
||||||
for (UserInfo userInfo : mUserManager.getProfiles(userHandle)) {
|
mInjector.binderWithCleanCallingIdentity(() -> {
|
||||||
DevicePolicyData policy = getUserDataUnchecked(userInfo.id);
|
for (UserInfo userInfo : mUserManager.getProfiles(userHandle)) {
|
||||||
if (userInfo.id == userHandle) {
|
DevicePolicyData policy = getUserDataUnchecked(userInfo.id);
|
||||||
admins.addAll(policy.mAdminList);
|
if (userInfo.id == userHandle) {
|
||||||
} else if (userInfo.isManagedProfile()) {
|
admins.addAll(policy.mAdminList);
|
||||||
// For managed profiles, policies set on the parent profile will be included
|
} else if (userInfo.isManagedProfile()) {
|
||||||
for (int i = 0; i < policy.mAdminList.size(); i++) {
|
// For managed profiles, policies set on the parent profile will be included
|
||||||
ActiveAdmin admin = policy.mAdminList.get(i);
|
for (int i = 0; i < policy.mAdminList.size(); i++) {
|
||||||
if (admin.hasParentActiveAdmin()) {
|
ActiveAdmin admin = policy.mAdminList.get(i);
|
||||||
admins.add(admin.getParentActiveAdmin());
|
if (admin.hasParentActiveAdmin()) {
|
||||||
|
admins.add(admin.getParentActiveAdmin());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
Slog.w(LOG_TAG, "Unknown user type: " + userInfo);
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
Slog.w(LOG_TAG, "Unknown user type: " + userInfo);
|
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
return admins;
|
return admins;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user