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

Commit c87a8984 authored by Dario Freni's avatar Dario Freni
Browse files

Fix the scanning on non-APEX devices.

On devices not supporting APEX the preInstalledApexPath is always equals
to "/system" with no trailing slash.

Test: atest ApkInApexTests; made non-APEX device boot
Merged-In: I238e88684f48981c44e7152f97b4ca16bed6d166
Change-Id: I238e88684f48981c44e7152f97b4ca16bed6d166
parent d76da0b6
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -21917,7 +21917,9 @@ public class PackageManagerService extends IPackageManager.Stub
            ApexManager.ActiveApexInfo apexInfo) {
        for (int i = 0, size = SYSTEM_PARTITIONS.size(); i < size; i++) {
            ScanPartition sp = SYSTEM_PARTITIONS.get(i);
            if (apexInfo.preInstalledApexPath.getAbsolutePath().startsWith(
            if (apexInfo.preInstalledApexPath.getAbsolutePath().equals(
                    sp.getFolder().getAbsolutePath())
                    || apexInfo.preInstalledApexPath.getAbsolutePath().startsWith(
                        sp.getFolder().getAbsolutePath() + File.separator)) {
                return new ScanPartition(apexInfo.apexDirectory, sp, SCAN_AS_APK_IN_APEX);
            }