summaryrefslogtreecommitdiffstats
path: root/services/core
diff options
context:
space:
mode:
authorAdnan Begovic <adnan@cyngn.com>2016-05-11 10:36:49 -0700
committerGerrit Code Review <gerrit@cyanogenmod.org>2016-05-11 16:33:35 -0700
commit25550fbafb788e2d98c45327c5e3bcc4563c5722 (patch)
tree68fd2a9cab0bd071dcd8647be149db2e1f80e7c0 /services/core
parent801a2348713d5ebb819127ee81b2f2cf95aa39e0 (diff)
downloadframeworks_base-25550fbafb788e2d98c45327c5e3bcc4563c5722.zip
frameworks_base-25550fbafb788e2d98c45327c5e3bcc4563c5722.tar.gz
frameworks_base-25550fbafb788e2d98c45327c5e3bcc4563c5722.tar.bz2
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
Diffstat (limited to 'services/core')
-rw-r--r--services/core/java/com/android/server/pm/PackageManagerService.java10
1 files changed, 2 insertions, 8 deletions
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);