Android: don't crash if Gravity is not supported stable
authorPaul Olav Tvete <paul.tvete@digia.com>
Mon, 2 Jun 2014 10:46:45 +0000 (12:46 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Mon, 2 Jun 2014 11:34:04 +0000 (13:34 +0200)
commit87b569ccc4df161e33d41f7a5f1f25eced6f65c3
tree8149378e060c1bfbc32748e0bb187ed7705506e9
parent9efc5bea41e7acbce55c37b49b167092b71114a9
Android: don't crash if Gravity is not supported

The QtSensors documentation says that if Gravity mode is not available,
we should silently fall back to the default Combined mode.

In addition, add null pointer checks in case we try to ask for non-existent
sensors in the future.

Task-number: QTBUG-39335
Change-Id: I6c18622d081db4e3a7d07c744bb0b746e3f5c6ff
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
src/plugins/sensors/android/jar/src/org/qtproject/qt5/android/sensors/QtSensors.java
src/plugins/sensors/android/src/androidaccelerometer.cpp
src/plugins/sensors/android/src/androidjnisensors.cpp