diff options
| author | 2024-07-16 22:03:30 +0000 | |
|---|---|---|
| committer | 2024-07-18 20:21:01 +0000 | |
| commit | 9dbf6b1b79bea4be46369d0fe95e291e1258af54 (patch) | |
| tree | b35e9b4bc183bb7fe0cec048932bebf30fd000bf | |
| parent | 13fd920f924838f23eec4635b945e77324dc5b7e (diff) | |
Increase the duplicate detection timeout for reliable messages to 3 seconds
Bug: 333567700
Change-Id: Ic36905f85e5639cd047a949e9945992320b8fd66
Flag: EXEMPT bugfix
Test: Presubmits
| -rw-r--r-- | services/core/java/com/android/server/location/contexthub/ContextHubService.java | 5 | ||||
| -rw-r--r-- | services/core/java/com/android/server/location/contexthub/ContextHubTransactionManager.java | 3 |
2 files changed, 7 insertions, 1 deletions
diff --git a/services/core/java/com/android/server/location/contexthub/ContextHubService.java b/services/core/java/com/android/server/location/contexthub/ContextHubService.java index ed451ff0c194..26d12f039b7a 100644 --- a/services/core/java/com/android/server/location/contexthub/ContextHubService.java +++ b/services/core/java/com/android/server/location/contexthub/ContextHubService.java @@ -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(); } } diff --git a/services/core/java/com/android/server/location/contexthub/ContextHubTransactionManager.java b/services/core/java/com/android/server/location/contexthub/ContextHubTransactionManager.java index e6d330f85dfc..cd69ebaba766 100644 --- a/services/core/java/com/android/server/location/contexthub/ContextHubTransactionManager.java +++ b/services/core/java/com/android/server/location/contexthub/ContextHubTransactionManager.java @@ -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; |