summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHsin-Yi Chen <hsinyichen@google.com>2021-09-06 03:47:58 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2021-09-06 03:47:58 +0000
commitbd0d99e730383b54605f2522d6f83556e0fe9bd3 (patch)
treefc9d9fba2272d4f8fb75b67374aaf1c717d3687c
parent7a76cd7f45bb202c09b5763a7273949d87a81211 (diff)
parentadac97fa08e515d50f3205d0cde5bfa4dddd9423 (diff)
downloadplatform_hardware_interfaces-bd0d99e730383b54605f2522d6f83556e0fe9bd3.tar.gz
platform_hardware_interfaces-bd0d99e730383b54605f2522d6f83556e0fe9bd3.tar.bz2
platform_hardware_interfaces-bd0d99e730383b54605f2522d6f83556e0fe9bd3.zip
Merge "Use CLOCK_BOOTTIME for default sensor implementation"
-rw-r--r--sensors/common/default/2.X/Sensor.cpp2
-rw-r--r--sensors/common/default/2.X/multihal/tests/fake_subhal/Sensor.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/sensors/common/default/2.X/Sensor.cpp b/sensors/common/default/2.X/Sensor.cpp
index 1a7c62853f..23c98032d1 100644
--- a/sensors/common/default/2.X/Sensor.cpp
+++ b/sensors/common/default/2.X/Sensor.cpp
@@ -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;
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 69debb6885..f5745c5793 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 @@ 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;