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

Commit 4964d990 authored by Elliott Hughes's avatar Elliott Hughes
Browse files

Fix NPE in BootReceiver.addTombstoneToDropBox.

If we have a native crash before the DropBoxManager starts, don't try to
send the tombstone.

Bug: http://b/199333694
Test: not obviously practical
Change-Id: I542fb9641bb4d699ca79caf9faca93412c236a44
parent 70e7dd44
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -476,7 +476,11 @@ public class BootReceiver extends BroadcastReceiver {
     */
    public static void addTombstoneToDropBox(Context ctx, File tombstone, boolean proto) {
        final DropBoxManager db = ctx.getSystemService(DropBoxManager.class);
        final String bootReason = SystemProperties.get("ro.boot.bootreason", null);
        if (db == null) {
            Slog.e(TAG, "Can't log tombstone: DropBoxManager not available");
            return;
        }

        HashMap<String, Long> timestamps = readTimestamps();
        try {
            if (proto) {