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

Commit 17b2b93b authored by Dario Freni's avatar Dario Freni
Browse files

Detect system_ext provenance for APKs-in-APEX

The previous code mistakenly attributes APKs contained in an APEX loaded
to the system_ext partition as coming from the system partition. This
affects, for example, where PackageManager expects the permission
allowlist to be read from (e.g. /system_ext/etc/permissions/*.xml).

Test: atest ApkInApexTests (in
I4cec3fdf05f2ab1a3b5032870a74562aed53cb95)

Merged-In: I690618727ebf9a61f07b3925b30e7631d33c4e8e
Change-Id: I690618727ebf9a61f07b3925b30e7631d33c4e8e
parent 3494086c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -21918,7 +21918,7 @@ public class PackageManagerService extends IPackageManager.Stub
        for (int i = 0, size = SYSTEM_PARTITIONS.size(); i < size; i++) {
            ScanPartition sp = SYSTEM_PARTITIONS.get(i);
            if (apexInfo.preInstalledApexPath.getAbsolutePath().startsWith(
                    sp.getFolder().getAbsolutePath())) {
                    sp.getFolder().getAbsolutePath() + File.separator)) {
                return new ScanPartition(apexInfo.apexDirectory, sp, SCAN_AS_APK_IN_APEX);
            }
        }