Merge "Merge "Calculate apk size multiple times" am: 223579af1e am: 89cc942af5 am: 9615331f71"

This commit is contained in:
Automerger Merge Worker
2023-01-04 18:29:14 +00:00
committed by Android (Google) Code Review

View File

@@ -614,11 +614,14 @@ public final class BackgroundDexOptService {
size += getDirectorySize(path);
if (!ArrayUtils.isEmpty(info.applicationInfo.splitSourceDirs)) {
for (String splitSourceDir : info.applicationInfo.splitSourceDirs) {
path = Paths.get(splitSourceDir).toFile();
if (path.isFile()) {
path = path.getParentFile();
File pathSplitSourceDir = Paths.get(splitSourceDir).toFile();
if (pathSplitSourceDir.isFile()) {
pathSplitSourceDir = pathSplitSourceDir.getParentFile();
}
size += getDirectorySize(path);
if (path.getAbsolutePath().equals(pathSplitSourceDir.getAbsolutePath())) {
continue;
}
size += getDirectorySize(pathSplitSourceDir);
}
}
return size;