Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 50fe52ef authored by Jiakai Zhang's avatar Jiakai Zhang Committed by Android (Google) Code Review
Browse files

Merge "Ignore I/O errors in the new code path of calculateInstalledSize." into main

parents 690a5c86 69f51063
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -452,12 +452,12 @@ public class InstallLocationUtils {
        if (android.content.pm.Flags.alternativeForDexoptCleanup()) {
            Path path = pkg.getPath() != null ? Paths.get(pkg.getPath()) : null;
            if (path == null || !Files.isDirectory(path)) { // monolithic
                sizeBytes += Files.size(Paths.get(pkg.getBaseApkPath()));
                sizeBytes += new File(pkg.getBaseApkPath()).length();
            } else { // cluster
                try (DirectoryStream<Path> stream = Files.newDirectoryStream(path)) {
                    for (Path child : stream) {
                        if (!Files.isDirectory(child)) {
                            sizeBytes += Files.size(child);
                            sizeBytes += child.toFile().length();
                        }
                    }
                }