S5PC11X: SENSOR: The status of orientation sensor show correcly when it is '0' (2)
When the status goes to '0', that event is ignored
because its event type is 'REL' which filters out number '0'.
So if the real status changes into '0' from '1, 2, 3',
the status on the display still remains '1, 2, 3' even though actual status is '0'.
Getting around this problem by reporting event as 4 instead of '0'.
If sensor HAL got '4', it retansforms it into '0'.
Signed-off-by: tim.sk.lee <firstname.lastname@example.org>
diff --git a/libsensors/AkmSensor.cpp b/libsensors/AkmSensor.cpp
index 32bdd6d..34a24f2 100644
@@ -296,9 +296,11 @@
mPendingEvents[Orientation].orientation.roll = value * CONVERT_O_R;
+ uint8_t status = uint8_t(value & SENSOR_STATE_MASK);
+ if (status == 4)
+ status = 0;
mPendingMask |= 1<<Orientation;
- mPendingEvents[Orientation].orientation.status =
- uint8_t(value & SENSOR_STATE_MASK);
+ mPendingEvents[Orientation].orientation.status = status;