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

Commit 78646e58 authored by Michael Wachenschwanz's avatar Michael Wachenschwanz
Browse files

Add null check in usagestats dump

(also adjust the time stamp for easier parsing)

Change-Id: I708c9fe68aa85b4897e95cca6b9d53522eef0d29
Fixes: 73960916
Test: manual
parent 964f01b3
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -47,7 +47,7 @@ import java.util.List;
class UserUsageStatsService {
    private static final String TAG = "UsageStatsService";
    private static final boolean DEBUG = UsageStatsService.DEBUG;
    private static final SimpleDateFormat sDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    private static final SimpleDateFormat sDateFormat = new SimpleDateFormat("yyyy-MM-dd/HH:mm:ss");
    private static final int sDateFormatFlags =
            DateUtils.FORMAT_SHOW_DATE
            | DateUtils.FORMAT_SHOW_TIME
@@ -572,12 +572,14 @@ class UserUsageStatsService {
            pw.printPair("endTime", endTime);
        }
        pw.println(")");
        if (events != null) {
            pw.increaseIndent();
            for (UsageEvents.Event event : events) {
                printEvent(pw, event, prettyDates);
            }
            pw.decreaseIndent();
        }
    }

    void printIntervalStats(IndentingPrintWriter pw, IntervalStats stats,
            boolean checkin, String pkg) {