Android: fix null array when requesting available providers


When requesting available positioning providers, the Java side can

  return new int[0];

in some cases. This is a perfectly valid way to return a zero-length
array in Java.
However, according to the linked bugreport, some JNI implementations
seem to convert it into nullptr, which later causes a crash when
passing a nullptr to GetIntArrayElements() JNI method.

Guard against it by explicitly checking that the array received from
the Java side is not nullptr.

Fixes: QTBUG-116645
Pick-to: 6.6 6.5 6.2
Change-Id: I657570ec5b0c62b994ed7d56c8142ab8992339b7
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
commit6148ae00cabca48def860970b48b2cb5dccdfff0
parentdaa8cca1837f515be909df81a7153a11266199cf
authorIvan Solovev <ivan.solovev@qt.io>
committerIvan Solovev <ivan.solovev@qt.io>
commit timeFri, 29 Sep 2023 12:28:29 +0200