Merge "Fix NPE in BootReceiver.addTombstoneToDropBox." into sc-qpr1-dev

This commit is contained in:
Elliott Hughes
2021-09-20 17:54:59 +00:00
committed by Android (Google) Code Review

View File

@@ -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) {
@@ -484,7 +488,7 @@ public class BootReceiver extends BroadcastReceiver {
} else {
final String headers = getBootHeadersToLogAndUpdate();
addFileToDropBox(db, timestamps, headers, tombstone.getPath(), LOG_SIZE,
TAG_TOMBSTONE);
TAG_TOMBSTONE);
}
} catch (IOException e) {
Slog.e(TAG, "Can't log tombstone", e);