summaryrefslogtreecommitdiffstats
path: root/libsensors
diff options
context:
space:
mode:
authortim.sk.lee <tim.sk.lee@samsung.com>2011-02-10 16:22:18 +0900
committerMike Lockwood <lockwood@android.com>2011-02-10 17:03:00 -0500
commita13f2d2eebfcea9d014cf792ef1c109ca3f63159 (patch)
tree68123541399bc571129511bcb93d41cb8bfb0059 /libsensors
parent2a5f3182f9ae77749a3048668b257be64724ba4d (diff)
downloaddevice_samsung_crespo-a13f2d2eebfcea9d014cf792ef1c109ca3f63159.tar.gz
device_samsung_crespo-a13f2d2eebfcea9d014cf792ef1c109ca3f63159.tar.bz2
device_samsung_crespo-a13f2d2eebfcea9d014cf792ef1c109ca3f63159.zip
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'. Change-Id: I41a92be60c0b0a96ac8dc9fba4fd4d21d8abc76c Signed-off-by: tim.sk.lee <tim.sk.lee@samsung.com>
Diffstat (limited to 'libsensors')
-rw-r--r--libsensors/AkmSensor.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/libsensors/AkmSensor.cpp b/libsensors/AkmSensor.cpp
index 32bdd6d..34a24f2 100644
--- a/libsensors/AkmSensor.cpp
+++ b/libsensors/AkmSensor.cpp
@@ -296,9 +296,11 @@ void AkmSensor::processEvent(int code, int value)
mPendingEvents[Orientation].orientation.roll = value * CONVERT_O_R;
break;
case EVENT_TYPE_ORIENT_STATUS:
+ 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;
break;
}
}