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

Commit 31291d92 authored by Svetoslav Ganov's avatar Svetoslav Ganov Committed by The Android Automerger
Browse files

Don't throw runtime exceptions for permission flags

We were thrwing undocumented runtime exception when
one gets the permission flags - now we just return
default result of the package is gone.

bug:28657926

Change-Id: I42554a86b9304ff83fe9385f3eea930b8ebf0c63
parent 5cb307fd
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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) {
+3 −3
Original line number Diff line number Diff line
@@ -4266,17 +4266,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();