Merge "Fix the scanning on non-APEX devices." am: 6589fd106d

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1889637

Change-Id: I96575cfdec30d5b9e7183d6559fc223c359b34d7
This commit is contained in:
Treehugger Robot
2021-11-15 22:57:09 +00:00
committed by Automerger Merge Worker

View File

@ -21917,8 +21917,10 @@ 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(
sp.getFolder().getAbsolutePath() + File.separator)) {
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);
}
}