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

Commit 08718c4e authored by lpeter's avatar lpeter Committed by Peter Li
Browse files

Fix the command problem "adb shell pm list permissions -f"

After using the command adb shell pm list permissions -f,
it will break the list when dealing with a malformed APEX.

We think that we should not break the list. We should print
the error and continue to list all permissions.

Bug: 300268371
Bug: 301211657
Test: Manual by using adb shell pm list permissions -f
Change-Id: I8322900989385d360e3d0a7be66a334ffc1091cf
parent 8433b368
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -4126,6 +4126,10 @@ class PackageManagerShellCommand extends ShellCommand {
                PackageManager.MATCH_DISABLED_COMPONENTS
                        | PackageManager.MATCH_HIDDEN_UNTIL_INSTALLED_COMPONENTS
                        | PackageManager.MATCH_DISABLED_UNTIL_USED_COMPONENTS, 0);
        if (ai == null) {
            Slog.e(TAG, "Failed to get ApplicationInfo for package name(" + pii.packageName + ").");
            return null;
        }
        AssetManager am = new AssetManager();
        am.addAssetPath(ai.publicSourceDir);
        res = new Resources(am, null, null);