diff options
author | Xavier Ducrohet <xav@android.com> | 2011-02-15 13:59:38 -0800 |
---|---|---|
committer | Android Code Review <code-review@android.com> | 2011-02-15 13:59:38 -0800 |
commit | 2f122ee6bb35f967031f4b8645486b180e2b42e0 (patch) | |
tree | fb9b9ee2da271e15da99ba7b4e0908c0a1349eb8 /android | |
parent | 1b0e2cf0d8b9b95ca2615adcc30dad4c481b88fc (diff) | |
parent | fa190d3c996f3f71977b2efaaec1c2e63d17a105 (diff) | |
download | external_qemu-2f122ee6bb35f967031f4b8645486b180e2b42e0.zip external_qemu-2f122ee6bb35f967031f4b8645486b180e2b42e0.tar.gz external_qemu-2f122ee6bb35f967031f4b8645486b180e2b42e0.tar.bz2 |
Merge "Merge 593d0ea0 into tools_r10. DO NOT MERGE." into tools_r10
Diffstat (limited to 'android')
-rw-r--r-- | android/hw-sensors.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/android/hw-sensors.c b/android/hw-sensors.c index d9f3a6f..e191f68 100644 --- a/android/hw-sensors.c +++ b/android/hw-sensors.c @@ -10,6 +10,7 @@ ** GNU General Public License for more details. */ +#include <math.h> #include "android/hw-sensors.h" #include "android/utils/debug.h" #include "android/utils/misc.h" @@ -210,7 +211,7 @@ _hwSensorClient_new( HwSensors* sensors ) cl->sensors = sensors; cl->enabledMask = 0; - cl->delay_ms = 1000; + cl->delay_ms = 800; cl->timer = qemu_new_timer(vm_clock, _hwSensorClient_tick, cl); cl->next = sensors->clients; @@ -625,16 +626,17 @@ _hwSensors_setCoarseOrientation( HwSensors* h, AndroidCoarseOrientation orient * If the phone is completely vertical, rotating it will not do anything ! */ const double g = 9.81; - const double cos_30 = 0.866025403784; - const double sin_30 = 0.5; + const double angle = 20.0; + const double cos_angle = cos(angle/M_PI); + const double sin_angle = sin(angle/M_PI); switch (orient) { case ANDROID_COARSE_PORTRAIT: - _hwSensors_setAcceleration( h, 0., g*cos_30, g*sin_30 ); + _hwSensors_setAcceleration( h, 0., g*cos_angle, g*sin_angle ); break; case ANDROID_COARSE_LANDSCAPE: - _hwSensors_setAcceleration( h, g*cos_30, 0., g*sin_30 ); + _hwSensors_setAcceleration( h, g*cos_angle, 0., g*sin_angle ); break; default: ; |