diff options
author | rINanDO <drjisakh@gmail.com> | 2016-03-12 22:00:37 +0100 |
---|---|---|
committer | rINanDO <drjisakh@gmail.com> | 2016-03-14 14:07:44 +0100 |
commit | a967c34271a9a138047d3f7b50981a354bffd45a (patch) | |
tree | e25c00b54dadfd7d303219641d806fc0c95f673d | |
parent | ad7468b66cec447f60080f99a97781d5d797c916 (diff) | |
download | device_samsung_i9100-a967c34271a9a138047d3f7b50981a354bffd45a.zip device_samsung_i9100-a967c34271a9a138047d3f7b50981a354bffd45a.tar.gz device_samsung_i9100-a967c34271a9a138047d3f7b50981a354bffd45a.tar.bz2 |
i9100: libsensors: use CLOCK_BOOTTIME, not CLOCK_MONOTONIC.
This fixes rotation issues without using the hack 'config_useSystemClockforRotationSensor'.
Change-Id: I9b6afc46b4dfabc69e4d4ad215de7a9f2ea15347
-rw-r--r-- | libsensors/AkmSensor.cpp | 2 | ||||
-rw-r--r-- | libsensors/SensorBase.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/libsensors/AkmSensor.cpp b/libsensors/AkmSensor.cpp index e26e281..bab6f6c 100644 --- a/libsensors/AkmSensor.cpp +++ b/libsensors/AkmSensor.cpp @@ -253,7 +253,7 @@ int AkmSensor::readEvents(sensors_event_t* data, int count) processEvent(event->code, event->value); mInputReader.next(); } else if (type == EV_SYN) { - int64_t time = timevalToNano(event->time); + int64_t time = getTimestamp(); for (int j=0 ; count && mPendingMask && j<numSensors ; j++) { if (mPendingMask & (1<<j)) { mPendingMask &= ~(1<<j); diff --git a/libsensors/SensorBase.cpp b/libsensors/SensorBase.cpp index dcb3acc..d388db5 100644 --- a/libsensors/SensorBase.cpp +++ b/libsensors/SensorBase.cpp @@ -85,7 +85,7 @@ bool SensorBase::hasPendingEvents() const { int64_t SensorBase::getTimestamp() { struct timespec t; t.tv_sec = t.tv_nsec = 0; - clock_gettime(CLOCK_MONOTONIC, &t); + clock_gettime(CLOCK_BOOTTIME, &t); return int64_t(t.tv_sec)*1000000000LL + t.tv_nsec; } |