Merge "Fix the scanning on non-APEX devices."

This commit is contained in:
Treehugger Robot
2021-11-15 22:36:44 +00:00
committed by Gerrit Code Review

View File

@@ -21917,8 +21917,10 @@ public class PackageManagerService extends IPackageManager.Stub
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() + File.separator)) { 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);
} }
} }