diff options
author | 2025-03-17 16:43:58 -0700 | |
---|---|---|
committer | 2025-03-17 16:43:58 -0700 | |
commit | 6bfafc7265e172c746b3e724641f51a3258b1e7e (patch) | |
tree | 2b4b6dcd27b663ede7e35a52b9d7dc32d09adc02 | |
parent | 355655e6de2ec3a96785a525f68649a5c1545cb6 (diff) | |
parent | 20436002dd9ee018643dc74d3684222165b3a463 (diff) |
Merge "Fix early break bug in reliable message duplication check" into main
-rw-r--r-- | services/core/java/com/android/server/location/contexthub/ContextHubEndpointBroker.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/services/core/java/com/android/server/location/contexthub/ContextHubEndpointBroker.java b/services/core/java/com/android/server/location/contexthub/ContextHubEndpointBroker.java index 41fd29da64f1..bbf7732c9596 100644 --- a/services/core/java/com/android/server/location/contexthub/ContextHubEndpointBroker.java +++ b/services/core/java/com/android/server/location/contexthub/ContextHubEndpointBroker.java @@ -184,8 +184,11 @@ public class ContextHubEndpointBroker extends IContextHubEndpoint.Stub long expiryMillis = RELIABLE_MESSAGE_DUPLICATE_DETECTION_TIMEOUT.toMillis(); if (nowMillis >= nextEntry.getValue() + expiryMillis) { iterator.remove(); + } else { + // Safe to break since LinkedHashMap is insertion-ordered, so the next entry + // will have a later timestamp and will not be expired. + break; } - break; } return mRxMessageHistoryMap.containsKey(message.getMessageSequenceNumber()); |