summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhaohuang <haohuang@codeaurora.org>2021-01-04 17:41:31 +0800
committerhaohuang <haohuang@codeaurora.org>2021-01-04 17:41:31 +0800
commit7cd16d52eb210a6efbbbd9d51d4adcd8c048d746 (patch)
treef70a47a2a46ce710ab5620b21d7c272549ddfaae
parent5c0b4cdce579822ba1b9cee31eca8a14e0a0124d (diff)
Fix one mul-overflow issue
When minInterval is set to 5s or larger, mul-overflow will happen when we convert minInterval from second to nano second in getElapsedRealtimeEstimateNanos function. Change the type of time between fix parameter to int64_t. Change-Id: Ifbe180b35298b78099daf496354086d5e3403e7b CRs-Fixed: 2848319
-rw-r--r--core/LocApiBase.cpp2
-rw-r--r--core/LocApiBase.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/core/LocApiBase.cpp b/core/LocApiBase.cpp
index 2413d05..ebd46d6 100644
--- a/core/LocApiBase.cpp
+++ b/core/LocApiBase.cpp
@@ -930,7 +930,7 @@ void LocApiBase::
DEFAULT_IMPL()
int64_t ElapsedRealtimeEstimator::getElapsedRealtimeEstimateNanos(int64_t curDataTimeNanos,
- bool isCurDataTimeTrustable, uint32_t tbf) {
+ bool isCurDataTimeTrustable, int64_t tbf) {
//The algorithm works follow below steps:
//When isCurDataTimeTrustable is meet (means Modem timestamp is already stable),
//1, Wait for mFixTimeStablizationThreshold fixes; While waiting for modem time
diff --git a/core/LocApiBase.h b/core/LocApiBase.h
index b58e60d..121f795 100644
--- a/core/LocApiBase.h
+++ b/core/LocApiBase.h
@@ -359,7 +359,7 @@ public:
ElapsedRealtimeEstimator(int64_t travelTimeNanosEstimate):
mInitialTravelTime(travelTimeNanosEstimate) {reset();}
int64_t getElapsedRealtimeEstimateNanos(int64_t curDataTimeNanos,
- bool isCurDataTimeTrustable, uint32_t tbf);
+ bool isCurDataTimeTrustable, int64_t tbf);
inline int64_t getElapsedRealtimeUncNanos() { return 5000000;}
void reset();