commit | 3f8b186bec506ab13c004ab007673e348606412f | [log] [tgz] |
---|---|---|
author | Hsin-Yi Chen <hsinyichen@google.com> | Mon Sep 06 04:42:17 2021 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Mon Sep 06 04:42:17 2021 +0000 |
tree | cbc49fd58465f23c31480e543f56deb96907d646 | |
parent | 2c412c5a060540bd1198229fd4602882e7ebaa29 [diff] | |
parent | 57f866657bfd3574e70ca66278b9624e7f192880 [diff] |
Merge "Use CLOCK_BOOTTIME for default sensor implementation" am: bd0d99e730 am: 6bdfc478cf am: 22069fae57 am: 4fa24c3e55 am: 57f866657b Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1817938 Change-Id: Id00369f8075b9717cd95175a50533083cf9f23ae
diff --git a/sensors/common/default/2.X/Sensor.cpp b/sensors/common/default/2.X/Sensor.cpp index 1a7c628..23c9803 100644 --- a/sensors/common/default/2.X/Sensor.cpp +++ b/sensors/common/default/2.X/Sensor.cpp
@@ -114,7 +114,7 @@ }); } 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;
diff --git a/sensors/common/default/2.X/multihal/tests/fake_subhal/Sensor.cpp b/sensors/common/default/2.X/multihal/tests/fake_subhal/Sensor.cpp index 69debb6..f5745c5 100644 --- a/sensors/common/default/2.X/multihal/tests/fake_subhal/Sensor.cpp +++ b/sensors/common/default/2.X/multihal/tests/fake_subhal/Sensor.cpp
@@ -125,7 +125,7 @@ }); } 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;