Merge "Fix NPE in BootReceiver.addTombstoneToDropBox." into sc-qpr1-dev am: 94d3762fba am: a28c22fc1c
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15857254 Change-Id: Ica7b0d4e9692e5745906b35ab8e149bca6357f5e
This commit is contained in:
@@ -476,7 +476,11 @@ public class BootReceiver extends BroadcastReceiver {
|
|||||||
*/
|
*/
|
||||||
public static void addTombstoneToDropBox(Context ctx, File tombstone, boolean proto) {
|
public static void addTombstoneToDropBox(Context ctx, File tombstone, boolean proto) {
|
||||||
final DropBoxManager db = ctx.getSystemService(DropBoxManager.class);
|
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();
|
HashMap<String, Long> timestamps = readTimestamps();
|
||||||
try {
|
try {
|
||||||
if (proto) {
|
if (proto) {
|
||||||
@@ -484,7 +488,7 @@ public class BootReceiver extends BroadcastReceiver {
|
|||||||
} else {
|
} else {
|
||||||
final String headers = getBootHeadersToLogAndUpdate();
|
final String headers = getBootHeadersToLogAndUpdate();
|
||||||
addFileToDropBox(db, timestamps, headers, tombstone.getPath(), LOG_SIZE,
|
addFileToDropBox(db, timestamps, headers, tombstone.getPath(), LOG_SIZE,
|
||||||
TAG_TOMBSTONE);
|
TAG_TOMBSTONE);
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
Slog.e(TAG, "Can't log tombstone", e);
|
Slog.e(TAG, "Can't log tombstone", e);
|
||||||
|
|||||||
Reference in New Issue
Block a user