mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-06 03:18:13 +00:00
Fixed bug #9792 - Android: build failure with ndk 27-beta1 due to use of deprecated ALooper_pollAll
replace ALooper_pollAll by ALooper_pollOnce
This commit is contained in:
@@ -69,8 +69,13 @@ static int SDLCALL SDL_ANDROID_SensorThread(void *data)
|
||||
|
||||
while (SDL_AtomicGet(&ctx->running)) {
|
||||
Uint64 timestamp = SDL_GetTicksNS();
|
||||
SDL_bool done = SDL_FALSE;
|
||||
|
||||
if (ALooper_pollAll(-1, NULL, &events, (void **)&source) == LOOPER_ID_USER) {
|
||||
while (!done) {
|
||||
int result;
|
||||
|
||||
result = ALooper_pollOnce(-1, NULL, &events, (void **)&source);
|
||||
if (result == LOOPER_ID_USER) {
|
||||
SDL_LockSensors();
|
||||
for (i = 0; i < SDL_sensors_count; ++i) {
|
||||
if (!SDL_sensors[i].event_queue) {
|
||||
@@ -84,6 +89,11 @@ static int SDLCALL SDL_ANDROID_SensorThread(void *data)
|
||||
}
|
||||
SDL_UnlockSensors();
|
||||
}
|
||||
|
||||
if (result < 0) {
|
||||
done = SDL_TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SDL_sensor_looper = NULL;
|
||||
|
Reference in New Issue
Block a user