From 3d14e32aa6b01d04f18322c4c5ae26360d022f62 Mon Sep 17 00:00:00 2001 From: Sooraj Sasindran Date: Fri, 18 Mar 2022 14:08:06 -0700 Subject: [PATCH] Get device owner app admin Get device owner app admin when prefentialNetworkService is configured by device owner Bug: 219651203 Test: cts Change-Id: Ic748227e8d12896361216f6ea67776660b752e4e --- .../server/devicepolicy/DevicePolicyManagerService.java | 5 +++-- 1 file changed, 3 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 c5bb1bfb46638..fb206c1b4e92d 100644 --- a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +++ b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java @@ -12269,7 +12269,7 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager { + " only profile owner or device owner may control the preferential" + " network service"); synchronized (getLockObject()) { - final ActiveAdmin requiredAdmin = getProfileOwnerAdminLocked( + final ActiveAdmin requiredAdmin = getDeviceOrProfileOwnerAdminLocked( caller.getUserId()); if (!requiredAdmin.mPreferentialNetworkServiceConfigs.equals( preferentialNetworkServiceConfigs)) { @@ -12299,7 +12299,8 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager { + " only profile owner or device owner may retrieve the preferential" + " network service configurations"); synchronized (getLockObject()) { - final ActiveAdmin requiredAdmin = getProfileOwnerAdminLocked(caller.getUserId()); + final ActiveAdmin requiredAdmin = getDeviceOrProfileOwnerAdminLocked( + caller.getUserId()); return requiredAdmin.mPreferentialNetworkServiceConfigs; } }