commit | 4fa24c3e558fa41ded1732f413c3ae99a58ed4f6 | [log] [tgz] |
---|---|---|
author | Hsin-Yi Chen <hsinyichen@google.com> | Mon Sep 06 04:20:57 2021 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Mon Sep 06 04:20:57 2021 +0000 |
tree | f3b1e04477f9c10b054d863bf95f0ac37ec7da5a | |
parent | 42bbd8daf11ad4de660fd9d342ff6e21b1f91a25 [diff] | |
parent | 22069fae57da545e95b6b4b663880d4ec872962a [diff] |
Merge "Use CLOCK_BOOTTIME for default sensor implementation" am: bd0d99e730 am: 6bdfc478cf am: 22069fae57 Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1817938 Change-Id: Iceb3f1456a4f6d64590aecf3658f447bec42d50f
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;