Report total latency instead of average for jobs last run

Instead of computing the average on the device, upload the
total sum of the latencies. Server can divide by the event count
if it wants to get the average.

Also change the latency buckets to 1 hr, 2 hrs, 4 hrs, 8 hrs and
greater than 8 hrs.

Bug: 70297451
Test: launch an app
      dumpsys batterystats --checkin | grep jbd,
      Observe the dumped values for the app

Change-Id: Iecda808594fc960fb16fa0407e5875bbc47db43a
diff --git a/core/java/android/os/BatteryStats.java b/core/java/android/os/BatteryStats.java
index 5e9d39c..7500707 100644
--- a/core/java/android/os/BatteryStats.java
+++ b/core/java/android/os/BatteryStats.java
@@ -294,8 +294,8 @@
     /**
      * jbd line is:
      * BATTERY_STATS_CHECKIN_VERSION, uid, which, "jbd",
-     * jobsDeferredEventCount, jobsDeferredCount, averageLatencyMillis,
-     * count at latency < 1 hr, count at latency < 2 hrs, count at latency < 6 hrs, beyond 6 hrs
+     * jobsDeferredEventCount, jobsDeferredCount, totalLatencyMillis,
+     * count at latency < 1 hr, count at latency 1 to 2 hrs, 2 to 4 hrs, 4 to 8 hrs, and past 8 hrs
      * <p>
      * @see #JOB_FRESHNESS_BUCKETS
      */
@@ -364,13 +364,14 @@
     /**
      * These are the thresholds for bucketing last time since a job was run for an app
      * that just moved to ACTIVE due to a launch. So if the last time a job ran was less
-     * than 30 minutes ago, then it's reasonably fresh, 2 hours ago, not so fresh and so
+     * than 1 hour ago, then it's reasonably fresh, 2 hours ago, not so fresh and so
      * on.
      */
     public static final long[] JOB_FRESHNESS_BUCKETS = {
             1 * 60 * 60 * 1000L,
             2 * 60 * 60 * 1000L,
-            6 * 60 * 60 * 1000L,
+            4 * 60 * 60 * 1000L,
+            8 * 60 * 60 * 1000L,
             Long.MAX_VALUE
     };