statsd atom: add WallClockTimeShifted
In ag/4888395 we get rid of wall-clock time from EventMetrics because it
is very RAM-costly. If someone needs the wall-clock time, they can get
it from this atom instead. This way, the wall-clock time is only stored
when interesting, instead of every single event!
Bug: 113072343
Test: manual confirmation that it works
Change-Id: I10c26a4fc9c73b29233108ef1fc0e9797382a8df
diff --git a/services/core/java/com/android/server/AlarmManagerService.java b/services/core/java/com/android/server/AlarmManagerService.java
index 26ef42f..93faa62 100644
--- a/services/core/java/com/android/server/AlarmManagerService.java
+++ b/services/core/java/com/android/server/AlarmManagerService.java
@@ -80,6 +80,7 @@
import android.util.SparseArray;
import android.util.SparseBooleanArray;
import android.util.SparseLongArray;
+import android.util.StatsLog;
import android.util.TimeUtils;
import android.util.proto.ProtoOutputStream;
@@ -3560,6 +3561,8 @@
if (DEBUG_BATCH) {
Slog.v(TAG, "Time changed notification from kernel; rebatching");
}
+ // StatsLog requires currentTimeMillis(), which == nowRTC to within usecs.
+ StatsLog.write(StatsLog.WALL_CLOCK_TIME_SHIFTED, nowRTC);
removeImpl(mTimeTickSender);
removeImpl(mDateChangeSender);
rebatchAllAlarms();