diff options
| -rw-r--r-- | core/java/android/app/admin/SecurityLog.java | 5 | ||||
| -rw-r--r-- | services/devicepolicy/java/com/android/server/devicepolicy/SecurityLogMonitor.java | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/core/java/android/app/admin/SecurityLog.java b/core/java/android/app/admin/SecurityLog.java index 19f4335893cb..972762152d3a 100644 --- a/core/java/android/app/admin/SecurityLog.java +++ b/core/java/android/app/admin/SecurityLog.java @@ -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. diff --git a/services/devicepolicy/java/com/android/server/devicepolicy/SecurityLogMonitor.java b/services/devicepolicy/java/com/android/server/devicepolicy/SecurityLogMonitor.java index fb34913a5606..1ab3b98ae78d 100644 --- a/services/devicepolicy/java/com/android/server/devicepolicy/SecurityLogMonitor.java +++ b/services/devicepolicy/java/com/android/server/devicepolicy/SecurityLogMonitor.java @@ -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 { |