summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Ayush Sharma <ayushsha@google.com> 2022-01-19 23:10:53 +0000
committer Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> 2022-01-19 23:10:53 +0000
commit8155ff9b98f1f50f51c6cbbd39ef70b635d28705 (patch)
treec9af417f42530c69e34ac50ee1a3a1d4564d6dba
parentcdcc08dc7485ac0e552fa5c52fd42556ad25304e (diff)
parent3c7c22f4d9c34168d2aaeab60e3988231a61f15c (diff)
Merge "Return PO or DO for POLICY_SUSPEND_PACKAGES" into sc-qpr1-dev am: 3c7c22f4d9
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16659231 Change-Id: I2cb17511834dc81357b6387ebc6289b24b69be4a
-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 774a485aac6b..d681f6985ea5 100644
--- a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
+++ b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
@@ -13184,12 +13184,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();