summaryrefslogtreecommitdiff
path: root/core/java/android/os/StatsLogEventWrapper.java
diff options
context:
space:
mode:
authorChenjie Yu <cjyu@google.com>2017-12-05 22:34:34 -0800
committerChenjie Yu <cjyu@google.com>2017-12-06 22:39:56 +0000
commit6842a8c66f4458d2da92c75da056287fa3931637 (patch)
tree7ea023c8e6fa0a977f63e4459126614cead4d03a /core/java/android/os/StatsLogEventWrapper.java
parent3383a8895564bd9cd8507d56787826ae12eef953 (diff)
bug fix for StatsLogEventWraper tag id
bug fix for ConfigManager fake config Test: cts test Change-Id: Ia07992dffb6520074c908151c96da1aa931f97f0
Diffstat (limited to 'core/java/android/os/StatsLogEventWrapper.java')
-rw-r--r--core/java/android/os/StatsLogEventWrapper.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/core/java/android/os/StatsLogEventWrapper.java b/core/java/android/os/StatsLogEventWrapper.java
index 9491bec6532c..3ec744dabb81 100644
--- a/core/java/android/os/StatsLogEventWrapper.java
+++ b/core/java/android/os/StatsLogEventWrapper.java
@@ -33,6 +33,8 @@ public final class StatsLogEventWrapper implements Parcelable {
private static final int EVENT_TYPE_LIST = 3;
private static final int EVENT_TYPE_FLOAT = 4;
+ // Keep this in sync with system/core/logcat/event.logtags
+ private static final int STATS_BUFFER_TAG_ID = 1937006964;
/**
* Creates a log_event that is binary-encoded as implemented in
* system/core/liblog/log_event_list.c; this allows us to use the same parsing logic in statsd
@@ -46,9 +48,14 @@ public final class StatsLogEventWrapper implements Parcelable {
*/
public StatsLogEventWrapper(int tag, int fields) {
// Write four bytes from tag, starting with least-significant bit.
- write4Bytes(tag);
+ // 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); // Indicate number of elements in this list.
+ mStorage.write(EVENT_TYPE_INT);
+ // The first element is the real atom tag number
+ write4Bytes(tag);
}
/**