diff options
author | Rubin Xu <rubinxu@google.com> | 2014-11-07 05:41:00 +0000 |
---|---|---|
committer | Rubin Xu <rubinxu@google.com> | 2014-11-18 17:53:46 +0000 |
commit | a97855b784243c00b99dfcb6595164ab4a88d05c (patch) | |
tree | 9ac43d104a4241cf1ab9afca39219550e506a19b /services/devicepolicy/java/com/android/server | |
parent | 68ced89949fc1cce198f25e09bf9bdb12616a98c (diff) | |
download | frameworks_base-a97855b784243c00b99dfcb6595164ab4a88d05c.zip frameworks_base-a97855b784243c00b99dfcb6595164ab4a88d05c.tar.gz frameworks_base-a97855b784243c00b99dfcb6595164ab4a88d05c.tar.bz2 |
Remove permission check in DevicePolicyManager.isUninstallBlocked()
This is to allow Play to use this API to find out whether a package
is uninstallable due to profile or device owner policy's restriction.
Bug: 17914630
Change-Id: I4ce2963884ecdf3306805f36db80ed1ebf04d88f
Diffstat (limited to 'services/devicepolicy/java/com/android/server')
-rw-r--r-- | services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java | 8 |
1 files changed, 5 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 0713772..23052a6 100644 --- a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +++ b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java @@ -5038,13 +5038,15 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { @Override public boolean isUninstallBlocked(ComponentName who, String packageName) { + // This function should return true if and only if the package is blocked by + // setUninstallBlocked(). It should still return false for other cases of blocks, such as + // when the package is a system app, or when it is an active device admin. final int userId = UserHandle.getCallingUserId(); synchronized (this) { - if (who == null) { - throw new NullPointerException("ComponentName is null"); + if (who != null) { + getActiveAdminForCallerLocked(who, DeviceAdminInfo.USES_POLICY_PROFILE_OWNER); } - getActiveAdminForCallerLocked(who, DeviceAdminInfo.USES_POLICY_PROFILE_OWNER); long id = Binder.clearCallingIdentity(); try { |