diff options
author | Nicolas Prevot <nprevot@google.com> | 2015-02-11 17:05:18 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-02-11 17:05:19 +0000 |
commit | 5cfd3d8b51b0e21c37d80e3cf5570bae8efe1bc1 (patch) | |
tree | cfaae93cc1b9c279ae27e5d86ed3cffa9a7e49ce /services/devicepolicy | |
parent | f54b42eace2bed3a4de08f815acaf7d40e3155c0 (diff) | |
parent | 637baaf0db76f9e1e51eeab077ffb85da0ff9308 (diff) | |
download | frameworks_base-5cfd3d8b51b0e21c37d80e3cf5570bae8efe1bc1.zip frameworks_base-5cfd3d8b51b0e21c37d80e3cf5570bae8efe1bc1.tar.gz frameworks_base-5cfd3d8b51b0e21c37d80e3cf5570bae8efe1bc1.tar.bz2 |
Merge "Avoid NullPointerException in enableSystemApp if the app is absent."
Diffstat (limited to 'services/devicepolicy')
-rw-r--r-- | services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java index 05c37d1..fbb6f7c 100644 --- a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +++ b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java @@ -5071,6 +5071,10 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { throws RemoteException { ApplicationInfo appInfo = pm.getApplicationInfo(packageName, GET_UNINSTALLED_PACKAGES, userId); + if (appInfo == null) { + throw new IllegalArgumentException("The application " + packageName + + " is not present on this device"); + } return (appInfo.flags & ApplicationInfo.FLAG_SYSTEM) != 0; } |