summaryrefslogtreecommitdiff
path: root/core/java/android/util/EventLog.java
diff options
context:
space:
mode:
authorPavel Grafov <pgrafov@google.com>2017-02-25 19:45:43 +0000
committerPavel Grafov <pgrafov@google.com>2017-03-21 14:52:32 +0000
commit4ce59d45a779cea662dbd56e61a98ba2a966b09b (patch)
treede86961de0392c696051c74b6ba4e709e0923a81 /core/java/android/util/EventLog.java
parentd9263306d56bf4c5c9c2e3a62bd44f82dacc0863 (diff)
Request logs from logd with 3s overlap to avoid missing events.
Example: If we got a batch with timestamps [1, 4, 8] and an event with timestamp 7 was delayed and was added to the buffer later, if we request the next batch starting from timestamp 8 or 9 that event will be lost. The last 3 seconds of events are kept and checked against the next batch. Test: afw-test-tradefed-ci run afw-do-security-logging Change-Id: I55727cfc6143c172edc7dabfd995776f9a0f7eab Bug: 35373582 Bug: 35026180 Bug: 35648675
Diffstat (limited to 'core/java/android/util/EventLog.java')
-rw-r--r--core/java/android/util/EventLog.java23
1 files changed, 23 insertions, 0 deletions
diff --git a/core/java/android/util/EventLog.java b/core/java/android/util/EventLog.java
index 92c70bde5bb2..6d4281b9e0f7 100644
--- a/core/java/android/util/EventLog.java
+++ b/core/java/android/util/EventLog.java
@@ -201,6 +201,29 @@ public class EventLog {
public void clearError() {
mLastWtf = null;
}
+
+ /**
+ * @hide
+ */
+ @Override
+ public boolean equals(Object o) {
+ // Not using ByteBuffer.equals since it takes buffer position into account and we
+ // always use absolute positions here.
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+ Event other = (Event) o;
+ return Arrays.equals(mBuffer.array(), other.mBuffer.array());
+ }
+
+ /**
+ * @hide
+ */
+ @Override
+ public int hashCode() {
+ // Not using ByteBuffer.hashCode since it takes buffer position into account and we
+ // always use absolute positions here.
+ return Arrays.hashCode(mBuffer.array());
+ }
}
// We assume that the native methods deal with any concurrency issues.