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

Commit 0dae9f75 authored by Adnan Begovic's avatar Adnan Begovic
Browse files

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
(cherry picked from commit 25550fba)
parent 36a07909
Loading
Loading
Loading
Loading
+2 −8
Original line number Diff line number Diff line
@@ -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);