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:
Madhanraj Chelladurai 2016-03-15 09:39:05 +05:30 committed by Kevin F. Haggerty
parent ee76952f5e
commit 9886edc317
No known key found for this signature in database
GPG Key ID: 6D95512933112729

View File

@ -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;
}