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

Commit ed646156 authored by Todd Poynor's avatar Todd Poynor Committed by Ethan Chen
Browse files

Add previous console on pstore to DropBox

Change-Id: I23c0213fe3d52280d7338ca62cb7e79b80a16cc6
parent 9bb2da13
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -124,6 +124,8 @@ public class BootReceiver extends BroadcastReceiver {
            // Negative sizes mean to take the *tail* of the file (see FileUtils.readTextFile())
            addFileToDropBox(db, prefs, headers, "/proc/last_kmsg",
                    -LOG_SIZE, "SYSTEM_LAST_KMSG");
            addFileToDropBox(db, prefs, headers, "/sys/fs/pstore/console-ramoops",
                    -LOG_SIZE, "SYSTEM_LAST_KMSG");
            addFileToDropBox(db, prefs, headers, "/cache/recovery/log",
                    -LOG_SIZE, "SYSTEM_RECOVERY_LOG");
            addFileToDropBox(db, prefs, headers, "/data/dontpanic/apanic_console",
@@ -189,6 +191,11 @@ public class BootReceiver extends BroadcastReceiver {

        File file = new File("/proc/last_kmsg");
        long fileTime = file.lastModified();
        if (fileTime <= 0) {
            file = new File("/sys/fs/pstore/console-ramoops");
            fileTime = file.lastModified();
        }

        if (fileTime <= 0) return;  // File does not exist

        if (prefs != null) {