summaryrefslogtreecommitdiffstats
path: root/services/devicepolicy
diff options
context:
space:
mode:
authorRubin Xu <rubinxu@google.com>2014-11-19 00:24:13 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-11-19 00:24:13 +0000
commit4221126b95db7fc81e4735a18a92aa40621bd2af (patch)
treea54d6f786725a4d19c93c636b20f4ff2eea7c12a /services/devicepolicy
parentdbf32fe93a4fa59961a83dfdc30c281978d22121 (diff)
parent3c1d5e2f9d0724f0a10313244d0ef47957d855f2 (diff)
downloadframeworks_base-4221126b95db7fc81e4735a18a92aa40621bd2af.zip
frameworks_base-4221126b95db7fc81e4735a18a92aa40621bd2af.tar.gz
frameworks_base-4221126b95db7fc81e4735a18a92aa40621bd2af.tar.bz2
am 3c1d5e2f: am 40603baa: am 735f2285: Merge "Remove permission check in DevicePolicyManager.isUninstallBlocked()" into lmp-mr1-dev
* commit '3c1d5e2f9d0724f0a10313244d0ef47957d855f2': Remove permission check in DevicePolicyManager.isUninstallBlocked()
Diffstat (limited to 'services/devicepolicy')
-rw-r--r--services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java8
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 55c05d2..87a37c3 100644
--- a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
+++ b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java
@@ -5029,13 +5029,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 {