From 9886edc317e34b88e5ceaa11b77c661699c72b45 Mon Sep 17 00:00:00 2001 From: Madhanraj Chelladurai Date: Tue, 15 Mar 2016 09:39:05 +0530 Subject: [PATCH] msm8974-common: gps: Consider nsec while ranking the timer objects We need to consider nsec as well while ranking timer objects Change-Id: Ieaad5dfa80b26b90e998618b3cbe1e590fc00839 CRs-Fixed: 991345 --- gps/utils/LocTimer.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gps/utils/LocTimer.cpp b/gps/utils/LocTimer.cpp index 70904b2..4de6b40 100644 --- a/gps/utils/LocTimer.cpp +++ b/gps/utils/LocTimer.cpp @@ -505,8 +505,13 @@ int LocTimerDelegate::ranks(LocRankable& rankable) { LocTimerDelegate* timer = (LocTimerDelegate*)(&rankable); if (timer) { // larger time ranks lower!!! - // IOW, if input obj has bigger tv_sec, this obj outRanks higher + // IOW, if input obj has bigger tv_sec/tv_nsec, this obj outRanks higher rank = timer->mFutureTime.tv_sec - mFutureTime.tv_sec; + if(0 == rank) + { + //rank against tv_nsec for msec accuracy + rank = (int)(timer->mFutureTime.tv_nsec - mFutureTime.tv_nsec); + } } return rank; }