Merge "Don\'t throw runtime exceptions for permission flags" into nyc-dev am: 01da140ace

am: eed1ea9541

* commit 'eed1ea95412baa2061669443cdd409b1cd62901f':
  Don't throw runtime exceptions for permission flags

Change-Id: I8c0b4730bf3473e99df3da28887280c928c0d453
This commit is contained in:
Svetoslav Ganov
2016-05-10 18:59:01 +00:00
committed by android-build-merger
2 changed files with 4 additions and 4 deletions

View File

@@ -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) {

View File

@@ -4271,17 +4271,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();