From 25550fbafb788e2d98c45327c5e3bcc4563c5722 Mon Sep 17 00:00:00 2001 From: Adnan Begovic Date: Wed, 11 May 2016 10:36:49 -0700 Subject: pm: Don't throw if invalid package setting or classname. Since an application could be updating in the background while the query for isComponentProtected occurs, the package setting for it can be null. Instead of throwing here, return false. Change-Id: Idb8f11785961ddf2b567e93977a9ca4650ab2119 TICKET: CYNGNOS-2689 --- .../core/java/com/android/server/pm/PackageManagerService.java | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'services/core') diff --git a/services/core/java/com/android/server/pm/PackageManagerService.java b/services/core/java/com/android/server/pm/PackageManagerService.java index dfdf6c7..068df4b 100644 --- a/services/core/java/com/android/server/pm/PackageManagerService.java +++ b/services/core/java/com/android/server/pm/PackageManagerService.java @@ -17299,14 +17299,8 @@ public class PackageManagerService extends IPackageManager.Stub { synchronized (mPackages) { pkgSetting = mSettings.mPackages.get(packageName); - if (pkgSetting == null) { - if (className == null) { - throw new IllegalArgumentException( - "Unknown package: " + packageName); - } - throw new IllegalArgumentException( - "Unknown component: " + packageName - + "/" + className); + if (pkgSetting == null || className == null) { + return false; } // Get all the protected components components = pkgSetting.getProtectedComponents(userId); -- cgit v1.1