From c8aeef6ae6469c1db5e7a67eb2e968d29c84e908 Mon Sep 17 00:00:00 2001 From: Edman Anjos Date: Mon, 20 Mar 2017 19:40:22 +0100 Subject: Remove leftover DO/PO check in isPackageSuspended We already check if the caller is a DO, PO, or a delegate in enforceCanManageScope, the additional call to getActiveAdminForCallerLocked makes this function inaccessible to delegate applications and was removed. Test: cts-tradefed run cts-dev --module CtsDevicePolicyManagerTestCases --test com.android.cts.devicepolicy.MixedDeviceOwnerTest#testDelegation Change-Id: I5df0f19a017a3b6e130329940c79b12cbb95ec9e --- .../java/com/android/server/devicepolicy/DevicePolicyManagerService.java | 1 - 1 file changed, 1 deletion(-) diff --git a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java index a916672f8cb1..536d454cb179 100644 --- a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +++ b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java @@ -8192,7 +8192,6 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { // Ensure the caller is a DO/PO or a package access delegate. enforceCanManageScope(who, callerPackage, DeviceAdminInfo.USES_POLICY_PROFILE_OWNER, DELEGATION_PACKAGE_ACCESS); - getActiveAdminForCallerLocked(who, DeviceAdminInfo.USES_POLICY_PROFILE_OWNER); long id = mInjector.binderClearCallingIdentity(); try { -- cgit v1.2.3-59-g8ed1b