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

Commit 20d556e2 authored by Alex Buynytskyy's avatar Alex Buynytskyy Committed by Android (Google) Code Review
Browse files

Merge "Force save cached pages to file."

parents b773380d aafba6db
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -2694,10 +2694,15 @@ public final class Settings implements Watchable, Snappable {
                    FileUtils.S_IRUSR | FileUtils.S_IWUSR | FileUtils.S_IRGRP | FileUtils.S_IWGRP,
                    -1, -1);

            try {
                FileUtils.copy(mSettingsFilename, mSettingsReserveCopyFilename);
            try (FileInputStream in = new FileInputStream(mSettingsFilename);
                 FileOutputStream out = new FileOutputStream(mSettingsReserveCopyFilename)) {
                FileUtils.copy(in, out);
                out.flush();
                FileUtils.sync(out);
            } catch (IOException e) {
                Slog.e(TAG, "Failed to backup settings", e);
                Slog.e(TAG,
                        "Failed to write reserve copy of settings: " + mSettingsReserveCopyFilename,
                        e);
            }

            try {