Revert "Revert "Detect system_ext provenance for APKs-in-APEX""

This reverts commit 0f467cc8ff.

Reason for revert: Including a fix for non-APEX-enabled devices.

Change-Id: I238e88684f48981c44e7152f97b4ca16bed6d166
This commit is contained in:
Dario Freni
2021-11-11 20:38:44 +00:00
parent 0f467cc8ff
commit ac67508fcf

View File

@@ -151,8 +151,10 @@ final class InitAndSystemPackageHelper {
ApexManager.ActiveApexInfo apexInfo) { ApexManager.ActiveApexInfo apexInfo) {
for (int i = 0, size = SYSTEM_PARTITIONS.size(); i < size; i++) { for (int i = 0, size = SYSTEM_PARTITIONS.size(); i < size; i++) {
ScanPartition sp = SYSTEM_PARTITIONS.get(i); ScanPartition sp = SYSTEM_PARTITIONS.get(i);
if (apexInfo.preInstalledApexPath.getAbsolutePath().startsWith( if (apexInfo.preInstalledApexPath.getAbsolutePath().equals(
sp.getFolder().getAbsolutePath())) { sp.getFolder().getAbsolutePath())
|| apexInfo.preInstalledApexPath.getAbsolutePath().startsWith(
sp.getFolder().getAbsolutePath() + File.separator)) {
return new ScanPartition(apexInfo.apexDirectory, sp, SCAN_AS_APK_IN_APEX); return new ScanPartition(apexInfo.apexDirectory, sp, SCAN_AS_APK_IN_APEX);
} }
} }