Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6bfafc72 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix early break bug in reliable message duplication check" into main

parents 355655e6 20436002
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -184,9 +184,12 @@ 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;
                }
            }

            return mRxMessageHistoryMap.containsKey(message.getMessageSequenceNumber());
        }