Merge "Do not compare ID when deduplicating SecurityEvent" into qt-dev

This commit is contained in:
Rubin Xu
2019-05-16 11:17:48 +00:00
committed by Android (Google) Code Review
2 changed files with 6 additions and 1 deletions

View File

@@ -636,6 +636,11 @@ public class SecurityLog {
public int hashCode() {
return Objects.hash(mEvent, mId);
}
/** @hide */
public boolean eventEquals(SecurityEvent other) {
return other != null && mEvent.equals(other.mEvent);
}
}
/**
* Retrieve all security logs and return immediately.

View File

@@ -349,7 +349,7 @@ class SecurityLogMonitor implements Runnable {
lastPos++;
} else {
// Two events have the same timestamp, check if they are the same.
if (lastEvent.equals(curEvent)) {
if (lastEvent.eventEquals(curEvent)) {
// Actual overlap, just skip the event.
if (DEBUG) Slog.d(TAG, "Skipped dup event with timestamp: " + lastNanos);
} else {