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
This commit is contained in:
parent
ee76952f5e
commit
9886edc317
@ -505,8 +505,13 @@ int LocTimerDelegate::ranks(LocRankable& rankable) {
|
|||||||
LocTimerDelegate* timer = (LocTimerDelegate*)(&rankable);
|
LocTimerDelegate* timer = (LocTimerDelegate*)(&rankable);
|
||||||
if (timer) {
|
if (timer) {
|
||||||
// larger time ranks lower!!!
|
// 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;
|
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;
|
return rank;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user