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

Commit a6e5041a authored by Shubham Ajmera's avatar Shubham Ajmera Committed by Android (Google) Code Review
Browse files

Merge "Replace RandomAccessFile with BufferedInputStream"

parents 7607b0eb 274498e5
Loading
Loading
Loading
Loading
+19 −15
Original line number Diff line number Diff line
@@ -1515,10 +1515,14 @@ public class BackupManagerService {
                // This isn't the current journal, so it must be a leftover.  Read
                // out the package names mentioned there and schedule them for
                // backup.
                RandomAccessFile in = null;
                DataInputStream in = null;
                try {
                    Slog.i(TAG, "Found stale backup journal, scheduling");
                    in = new RandomAccessFile(f, "r");
                    // Journals will tend to be on the order of a few kilobytes(around 4k), hence,
                    // setting the buffer size to 8192.
                    InputStream bufferedInputStream = new BufferedInputStream(
                            new FileInputStream(f), 8192);
                    in = new DataInputStream(bufferedInputStream);
                    while (true) {
                        String packageName = in.readUTF();
                        if (MORE_DEBUG) Slog.i(TAG, "  " + packageName);