diff --git a/src/sensor/android/SDL_androidsensor.c b/src/sensor/android/SDL_androidsensor.c index eb46dd5e0..7720ccc25 100644 --- a/src/sensor/android/SDL_androidsensor.c +++ b/src/sensor/android/SDL_androidsensor.c @@ -69,8 +69,10 @@ static int SDLCALL SDL_ANDROID_SensorThread(void *data) while (SDL_AtomicGet(&ctx->running)) { Uint64 timestamp = SDL_GetTicksNS(); + int poll_result; - if (ALooper_pollAll(-1, NULL, &events, (void **)&source) == LOOPER_ID_USER) { + poll_result = ALooper_pollOnce(-1, NULL, &events, (void **)&source); + if (poll_result == LOOPER_ID_USER) { SDL_LockSensors(); for (i = 0; i < SDL_sensors_count; ++i) { if (!SDL_sensors[i].event_queue) { diff --git a/test/android/cmake/AndroidManifest.xml.cmake b/test/android/cmake/AndroidManifest.xml.cmake index ae2ead0c2..a9fc3d568 100644 --- a/test/android/cmake/AndroidManifest.xml.cmake +++ b/test/android/cmake/AndroidManifest.xml.cmake @@ -33,6 +33,10 @@ + + + +