summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packages/SettingsLib/src/com/android/settingslib/applications/ApplicationsState.java2
-rw-r--r--services/core/java/com/android/server/pm/PackageManagerService.java6
2 files changed, 4 insertions, 4 deletions
diff --git a/packages/SettingsLib/src/com/android/settingslib/applications/ApplicationsState.java b/packages/SettingsLib/src/com/android/settingslib/applications/ApplicationsState.java
index 9aaddaa66cfa..6d6a4b55bd93 100644
--- a/packages/SettingsLib/src/com/android/settingslib/applications/ApplicationsState.java
+++ b/packages/SettingsLib/src/com/android/settingslib/applications/ApplicationsState.java
@@ -646,7 +646,7 @@ public class ApplicationsState {
if (DEBUG) Log.i(TAG, "Rebuilding...");
for (int i=0; i<apps.size(); i++) {
AppEntry entry = apps.get(i);
- if (filter == null || filter.filterApp(entry)) {
+ if (entry != null && (filter == null || filter.filterApp(entry))) {
synchronized (mEntriesMap) {
if (DEBUG_LOCKING) Log.v(TAG, "rebuild acquired lock");
if (comparator != null) {
diff --git a/services/core/java/com/android/server/pm/PackageManagerService.java b/services/core/java/com/android/server/pm/PackageManagerService.java
index 311876dc1684..4e48e4d7f6d6 100644
--- a/services/core/java/com/android/server/pm/PackageManagerService.java
+++ b/services/core/java/com/android/server/pm/PackageManagerService.java
@@ -4265,17 +4265,17 @@ public class PackageManagerService extends IPackageManager.Stub {
synchronized (mPackages) {
final PackageParser.Package pkg = mPackages.get(packageName);
if (pkg == null) {
- throw new IllegalArgumentException("Unknown package: " + packageName);
+ return 0;
}
final BasePermission bp = mSettings.mPermissions.get(name);
if (bp == null) {
- throw new IllegalArgumentException("Unknown permission: " + name);
+ return 0;
}
SettingBase sb = (SettingBase) pkg.mExtras;
if (sb == null) {
- throw new IllegalArgumentException("Unknown package: " + packageName);
+ return 0;
}
PermissionsState permissionsState = sb.getPermissionsState();