Merge "Calculate apk size multiple times" am: 223579af1e

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

Change-Id: I0cd3b05fb3321274c2944fd25ee1cefee1cdfaba
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Jiakai Zhang
2023-01-04 17:00:22 +00:00
committed by Automerger Merge Worker

View File

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