Merge "Use CLOCK_BOOTTIME for default sensor implementation" am: bd0d99e730
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1817938 Change-Id: Ib02ef91ee0f8e60fcbb3d95a8ad5e1eb0530286e
This commit is contained in:
commit
6bdfc478cf
2 changed files with 2 additions and 2 deletions
|
@ -114,7 +114,7 @@ void Sensor::run() {
|
|||
});
|
||||
} else {
|
||||
timespec curTime;
|
||||
clock_gettime(CLOCK_REALTIME, &curTime);
|
||||
clock_gettime(CLOCK_BOOTTIME, &curTime);
|
||||
int64_t now = (curTime.tv_sec * kNanosecondsInSeconds) + curTime.tv_nsec;
|
||||
int64_t nextSampleTime = mLastSampleTimeNs + mSamplingPeriodNs;
|
||||
|
||||
|
|
|
@ -125,7 +125,7 @@ void Sensor::run() {
|
|||
});
|
||||
} else {
|
||||
timespec curTime;
|
||||
clock_gettime(CLOCK_REALTIME, &curTime);
|
||||
clock_gettime(CLOCK_BOOTTIME, &curTime);
|
||||
int64_t now = (curTime.tv_sec * kNanosecondsInSeconds) + curTime.tv_nsec;
|
||||
int64_t nextSampleTime = mLastSampleTimeNs + mSamplingPeriodNs;
|
||||
|
||||
|
|
Loading…
Reference in a new issue