The open source OpenXR runtime
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

d/android: Replace ALooper_pollAll with ALooper_pollOnce

Co-authored-by: Korcan Hussein <korcan.hussein@collabora.com>
Part-of: <https://gitlab.freedesktop.org/monado/monado/-/merge_requests/2260>

authored by

Meng Jiao
Korcan Hussein
and committed by
Korcan Hussein
988d5c69 fe8ecf0a

+5 -3
+3 -1
src/xrt/auxiliary/android/android_looper.cpp
··· 35 35 } 36 36 37 37 struct android_poll_source *source; 38 - while (ALooper_pollAll(1000, NULL, NULL, (void **)&source) >= 0) { 38 + while (ALooper_pollOnce(1000, NULL, NULL, (void **)&source) >= 0) { 39 39 if (source) { 40 40 // Let callback owner handle the event 41 41 source->process(source->app, source); 42 + if (source->app->destroyRequested != 0) 43 + break; 42 44 if (source->app->activityState == APP_CMD_RESUME && source->app->window) { 43 45 U_LOG_I("Activity is in resume state with window available now"); 44 46 break;
+2 -2
src/xrt/drivers/android/android_sensors.c
··· 143 143 ASensorEventQueue_setEventRate(event_queue, gyroscope, gyroscope_poll_rate_usec); 144 144 } 145 145 146 - while (d->oth.running) { 146 + while (os_thread_helper_is_running(&d->oth)) { 147 147 int num_events = 0; 148 - const int looper_id = ALooper_pollAll(max_wait_milliseconds, NULL, &num_events, NULL); 148 + const int looper_id = ALooper_pollOnce(max_wait_milliseconds, NULL, &num_events, NULL); 149 149 // The device may have enabled a power-saving policy, causing the sensor to sleep and return 150 150 // ALOOPER_POLL_ERROR. However, we want to continue reading data when it wakes up. 151 151 if (looper_id != LOOPER_ID_USER) {