summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Eran Messeri <eranm@google.com> 2019-12-19 18:03:40 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2019-12-19 18:03:40 +0000
commit73b4b64be87b4fc1f1538e5f78eafd0c66e0bbc8 (patch)
treec8bd8d9f3bba30c4b1db1c7e3779e49b9faf37a1
parente1fa031cd1cb5ed1540562e57ae92dd60b37399c (diff)
parent53c777b2512e8753d4bacb6089689d6b4ac317a4 (diff)
Merge "Temporarily restore device identifiers access to Profile Owner"
-rw-r--r--services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
index 94338c8f34e4..8cd803c3f8eb 100644
--- a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
+++ b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
@@ -8701,9 +8701,15 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager {
// Allow access to the profile owner for the specified user, or delegate cert installer
// But only if this is an organization-owned device.
ComponentName profileOwner = getProfileOwnerAsUser(userId);
- if (profileOwner != null && canProfileOwnerAccessDeviceIds(userId)
+ final boolean isCallerProfileOwnerOrDelegate = profileOwner != null
&& (profileOwner.getPackageName().equals(packageName)
- || isCallerDelegate(packageName, uid, DELEGATION_CERT_INSTALL))) {
+ || isCallerDelegate(packageName, uid, DELEGATION_CERT_INSTALL));
+ if (isCallerProfileOwnerOrDelegate && canProfileOwnerAccessDeviceIds(userId)) {
+ return true;
+ }
+ //TODO(b/130844684): Temporarily allow profile owner on non-organization-owned devices
+ //to read device identifiers.
+ if (isCallerProfileOwnerOrDelegate) {
return true;
}