projects
/
platform
/
core
/
system
/
sensord.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
sensord: enable rotation vector/orientation sensors
[platform/core/system/sensord.git]
/
src
/
sensor
/
gravity
/
gravity_sensor.cpp
diff --git
a/src/sensor/gravity/gravity_sensor.cpp
b/src/sensor/gravity/gravity_sensor.cpp
index
8b41fc5
..
e071226
100644
(file)
--- a/
src/sensor/gravity/gravity_sensor.cpp
+++ b/
src/sensor/gravity/gravity_sensor.cpp
@@
-161,7
+161,10
@@
void gravity_sensor::synthesize_rv(const sensor_event_t& event)
float rotation[4] = {x, y, z, w};
float rotation[4] = {x, y, z, w};
- rotation_to_gravity(rotation, gravity);
+ if (!rotation_to_gravity(rotation, gravity)) {
+ _D("Invalid rotation_vector: [%10f] [%10f] [%10f] [%10f]", x, y, z, w);
+ return;
+ }
gravity_event = (sensor_event_t *)malloc(sizeof(sensor_event_t));
if (!gravity_event) {
gravity_event = (sensor_event_t *)malloc(sizeof(sensor_event_t));
if (!gravity_event) {