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

Commit b95d2e55 authored by Matthew Sedam's avatar Matthew Sedam Committed by Android (Google) Code Review
Browse files

Merge "Increase the duplicate detection timeout for reliable messages to 3 seconds" into main

parents 5eec7742 9dbf6b1b
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -297,7 +297,10 @@ public class ContextHubService extends IContextHubService.Stub {
        }

        public boolean isExpired() {
            return mTimestamp + ContextHubTransactionManager.RELIABLE_MESSAGE_TIMEOUT.toNanos()
            return mTimestamp
                            + ContextHubTransactionManager
                                    .RELIABLE_MESSAGE_DUPLICATE_DETECTION_TIMEOUT
                                    .toNanos()
                    < SystemClock.elapsedRealtimeNanos();
        }
    }
+3 −0
Original line number Diff line number Diff line
@@ -56,6 +56,9 @@ import java.util.concurrent.atomic.AtomicInteger;

    public static final Duration RELIABLE_MESSAGE_TIMEOUT = Duration.ofSeconds(1);

    public static final Duration RELIABLE_MESSAGE_DUPLICATE_DETECTION_TIMEOUT =
            RELIABLE_MESSAGE_TIMEOUT.multipliedBy(3);

    private static final int MAX_PENDING_REQUESTS = 10000;

    private static final int RELIABLE_MESSAGE_MAX_NUM_RETRY = 3;