Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 637baaf0 authored by Nicolas Prevot's avatar Nicolas Prevot
Browse files

Avoid NullPointerException in enableSystemApp if the app is absent.

In enableSystemApp: if the app is absent, throw a IllegalArgumentException
instead of failing with a NullPointerException.

BUG:19321306

Change-Id: I4ec09a0a77d29ca04e8d52f5546c1e4d0f8641e5
parent 8f6afec2
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -5072,6 +5072,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;
    }