summaryrefslogtreecommitdiffstats
path: root/services/devicepolicy
diff options
context:
space:
mode:
authorNicolas Prevot <nprevot@google.com>2015-02-11 17:05:18 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-02-11 17:05:19 +0000
commit5cfd3d8b51b0e21c37d80e3cf5570bae8efe1bc1 (patch)
treecfaae93cc1b9c279ae27e5d86ed3cffa9a7e49ce /services/devicepolicy
parentf54b42eace2bed3a4de08f815acaf7d40e3155c0 (diff)
parent637baaf0db76f9e1e51eeab077ffb85da0ff9308 (diff)
downloadframeworks_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.java4
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;
}