summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java11
1 files changed, 8 insertions, 3 deletions
diff --git a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
index 99e28d101496..99c1ff1bc2d5 100644
--- a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
+++ b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
@@ -13023,12 +13023,17 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager {
/**
* @param restriction The restriction enforced by admin. It could be any user restriction or
- * policy like {@link DevicePolicyManager#POLICY_DISABLE_CAMERA} and
- * {@link DevicePolicyManager#POLICY_DISABLE_SCREEN_CAPTURE}.
+ * policy like {@link DevicePolicyManager#POLICY_DISABLE_CAMERA},
+ * {@link DevicePolicyManager#POLICY_DISABLE_SCREEN_CAPTURE} and {@link
+ * DevicePolicyManager#POLICY_SUSPEND_PACKAGES}.
*/
private Bundle getEnforcingAdminAndUserDetailsInternal(int userId, String restriction) {
Bundle result = null;
- if (restriction == null) {
+
+ // For POLICY_SUSPEND_PACKAGES return PO or DO to keep the behavior same as
+ // before the bug fix for b/192245204.
+ if (restriction == null || DevicePolicyManager.POLICY_SUSPEND_PACKAGES.equals(
+ restriction)) {
ComponentName profileOwner = mOwners.getProfileOwnerComponent(userId);
if (profileOwner != null) {
result = new Bundle();