Loading core/java/android/app/admin/DevicePolicyManager.java +3 −1 Original line number Diff line number Diff line Loading @@ -4334,11 +4334,13 @@ public class DevicePolicyManager { */ @RequiresPermission(value = MANAGE_DEVICE_POLICY_CONTENT_PROTECTION, conditional = true) @FlaggedApi(android.view.contentprotection.flags.Flags.FLAG_MANAGE_DEVICE_POLICY_ENABLED) @UserHandleAware public @ContentProtectionPolicy int getContentProtectionPolicy(@Nullable ComponentName admin) { throwIfParentInstance("getContentProtectionPolicy"); if (mService != null) { try { return mService.getContentProtectionPolicy(admin, mContext.getPackageName()); return mService.getContentProtectionPolicy(admin, mContext.getPackageName(), myUserId()); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading core/java/android/app/admin/IDevicePolicyManager.aidl +1 −1 Original line number Diff line number Diff line Loading @@ -621,7 +621,7 @@ interface IDevicePolicyManager { void calculateHasIncompatibleAccounts(); void setContentProtectionPolicy(in ComponentName who, String callerPackageName, int policy); int getContentProtectionPolicy(in ComponentName who, String callerPackageName); int getContentProtectionPolicy(in ComponentName who, String callerPackageName, int userId); int[] getSubscriptionIds(String callerPackageName); Loading services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +3 −3 Original line number Diff line number Diff line Loading @@ -23501,6 +23501,8 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { MANAGE_DEVICE_POLICY_ACROSS_USERS); CROSS_USER_PERMISSIONS.put(MANAGE_DEVICE_POLICY_WIPE_DATA, MANAGE_DEVICE_POLICY_ACROSS_USERS); CROSS_USER_PERMISSIONS.put(MANAGE_DEVICE_POLICY_CONTENT_PROTECTION, MANAGE_DEVICE_POLICY_ACROSS_USERS); // These permissions may grant access to user data and therefore must be protected with // MANAGE_DEVICE_POLICY_ACROSS_USERS_FULL for cross-user calls. Loading Loading @@ -24136,15 +24138,13 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { @Override public @ContentProtectionPolicy int getContentProtectionPolicy( ComponentName who, String callerPackageName) { ComponentName who, String callerPackageName, int userId) { if (!android.view.contentprotection.flags.Flags.manageDevicePolicyEnabled()) { return CONTENT_PROTECTION_DISABLED; } CallerIdentity caller = getCallerIdentity(who, callerPackageName); int userId = caller.getUserId(); enforceCanQuery(MANAGE_DEVICE_POLICY_CONTENT_PROTECTION, callerPackageName, userId); Integer policy = mDevicePolicyEngine.getResolvedPolicy(PolicyDefinition.CONTENT_PROTECTION, userId); if (policy == null) { Loading
core/java/android/app/admin/DevicePolicyManager.java +3 −1 Original line number Diff line number Diff line Loading @@ -4334,11 +4334,13 @@ public class DevicePolicyManager { */ @RequiresPermission(value = MANAGE_DEVICE_POLICY_CONTENT_PROTECTION, conditional = true) @FlaggedApi(android.view.contentprotection.flags.Flags.FLAG_MANAGE_DEVICE_POLICY_ENABLED) @UserHandleAware public @ContentProtectionPolicy int getContentProtectionPolicy(@Nullable ComponentName admin) { throwIfParentInstance("getContentProtectionPolicy"); if (mService != null) { try { return mService.getContentProtectionPolicy(admin, mContext.getPackageName()); return mService.getContentProtectionPolicy(admin, mContext.getPackageName(), myUserId()); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading
core/java/android/app/admin/IDevicePolicyManager.aidl +1 −1 Original line number Diff line number Diff line Loading @@ -621,7 +621,7 @@ interface IDevicePolicyManager { void calculateHasIncompatibleAccounts(); void setContentProtectionPolicy(in ComponentName who, String callerPackageName, int policy); int getContentProtectionPolicy(in ComponentName who, String callerPackageName); int getContentProtectionPolicy(in ComponentName who, String callerPackageName, int userId); int[] getSubscriptionIds(String callerPackageName); Loading
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +3 −3 Original line number Diff line number Diff line Loading @@ -23501,6 +23501,8 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { MANAGE_DEVICE_POLICY_ACROSS_USERS); CROSS_USER_PERMISSIONS.put(MANAGE_DEVICE_POLICY_WIPE_DATA, MANAGE_DEVICE_POLICY_ACROSS_USERS); CROSS_USER_PERMISSIONS.put(MANAGE_DEVICE_POLICY_CONTENT_PROTECTION, MANAGE_DEVICE_POLICY_ACROSS_USERS); // These permissions may grant access to user data and therefore must be protected with // MANAGE_DEVICE_POLICY_ACROSS_USERS_FULL for cross-user calls. Loading Loading @@ -24136,15 +24138,13 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { @Override public @ContentProtectionPolicy int getContentProtectionPolicy( ComponentName who, String callerPackageName) { ComponentName who, String callerPackageName, int userId) { if (!android.view.contentprotection.flags.Flags.manageDevicePolicyEnabled()) { return CONTENT_PROTECTION_DISABLED; } CallerIdentity caller = getCallerIdentity(who, callerPackageName); int userId = caller.getUserId(); enforceCanQuery(MANAGE_DEVICE_POLICY_CONTENT_PROTECTION, callerPackageName, userId); Integer policy = mDevicePolicyEngine.getResolvedPolicy(PolicyDefinition.CONTENT_PROTECTION, userId); if (policy == null) {