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

Commit 56ce9ed3 authored by Josh Gao's avatar Josh Gao
Browse files

Add proto tombstones to dropbox directly.

Avoid truncation and mangling the byte contents with a text header by
adding to the dropbox directly.

Bug: http://b/75261590
Test: `crasher; dumpsys dropbox --print`
Change-Id: I6de1c203d4723b1f9bb40a197b234f4b4b1e334e
parent 92c4b3d3
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -479,9 +479,13 @@ public class BootReceiver extends BroadcastReceiver {
        final String bootReason = SystemProperties.get("ro.boot.bootreason", null);
        HashMap<String, Long> timestamps = readTimestamps();
        try {
            if (proto) {
                db.addFile(TAG_TOMBSTONE_PROTO, tombstone, 0);
            } else {
                final String headers = getBootHeadersToLogAndUpdate();
                addFileToDropBox(db, timestamps, headers, tombstone.getPath(), LOG_SIZE,
                    proto ? TAG_TOMBSTONE_PROTO : TAG_TOMBSTONE);
                        TAG_TOMBSTONE);
            }
        } catch (IOException e) {
            Slog.e(TAG, "Can't log tombstone", e);
        }