Android: Don't abort when null Java Sensor


SensorManager::description() and getMaximumRange() called
methods on the QJniObject returned by javaSensor() without
checking it. On some devices SensorManager.getDefaultSensor()
returns null for a type that the NDK sensor list reports, so
JNI aborted the process in GetMethodID() as soon as
QSensor::start() created the backend.

Return an invalid object from javaSensor() in that case, and
fall back to a description without the Java sensor version and
to a maximum range of 0, which the proximity backend already
handles.

Fixes: QTBUG-150277
Pick-to: 6.12 6.11 6.8 6.5
Change-Id: I771d8b2698e91274d4a4a7210c41a9845722c35d
Reviewed-by: Lorn Potter <lorn.potter@qt.io>
commit991d73240b34e398259168853996911155a320ed
parentf932a95c341830c856ceaa17b267a7d7d5a58d17
authorAssam Boudjelthia <assam.boudjelthia@qt.io>
committerAssam Boudjelthia <assam.boudjelthia@qt.io>
commit timeSun, 13 Sep 2026 18:33:40 +0000