summaryrefslogtreecommitdiff
path: root/core/java/android/os/StatsLogEventWrapper.java
diff options
context:
space:
mode:
authorYangster-mac <yanglu@google.com>2018-02-22 10:00:45 -0800
committerYangster-mac <yanglu@google.com>2018-02-23 10:56:03 -0800
commitc552b35316937827531a2b7efdfb8f4fc8dba3b0 (patch)
tree5baaeee4f5f2d192aece7f869ff5eabdfb0ed08c /core/java/android/os/StatsLogEventWrapper.java
parent2757d757805235d978e8cdc0ce6fdc2b26bc9cf8 (diff)
Add timestamp for events pulled by companision service.
Test: statsd cts test Change-Id: I2658dba747ff93a120c50b5294f696918588e9fe
Diffstat (limited to 'core/java/android/os/StatsLogEventWrapper.java')
-rw-r--r--core/java/android/os/StatsLogEventWrapper.java11
1 files changed, 6 insertions, 5 deletions
diff --git a/core/java/android/os/StatsLogEventWrapper.java b/core/java/android/os/StatsLogEventWrapper.java
index 3e8161f229c4..d4d3dc838d91 100644
--- a/core/java/android/os/StatsLogEventWrapper.java
+++ b/core/java/android/os/StatsLogEventWrapper.java
@@ -46,16 +46,17 @@ public final class StatsLogEventWrapper implements Parcelable {
* @param tag The integer representing the tag for this event.
* @param fields The number of fields specified in this event.
*/
- public StatsLogEventWrapper(int tag, int fields) {
+ public StatsLogEventWrapper(long elapsedNanos, int tag, int fields) {
// Write four bytes from tag, starting with least-significant bit.
// For pulled data, this tag number is not really used. We use the same tag number as
// pushed ones to be consistent.
write4Bytes(STATS_BUFFER_TAG_ID);
mStorage.write(EVENT_TYPE_LIST); // This is required to start the log entry.
- mStorage.write(fields + 1); // Indicate number of elements in this list. +1 for the tag
- mStorage.write(EVENT_TYPE_INT);
- // The first element is the real atom tag number
- write4Bytes(tag);
+ mStorage.write(fields + 2); // Indicate number of elements in this list. +1 for the tag
+ // The first element is the elapsed realtime.
+ writeLong(elapsedNanos);
+ // The second element is the real atom tag number
+ writeInt(tag);
}
/**