···3535 }
36363737 struct android_poll_source *source;
3838- while (ALooper_pollAll(1000, NULL, NULL, (void **)&source) >= 0) {
3838+ while (ALooper_pollOnce(1000, NULL, NULL, (void **)&source) >= 0) {
3939 if (source) {
4040 // Let callback owner handle the event
4141 source->process(source->app, source);
4242+ if (source->app->destroyRequested != 0)
4343+ break;
4244 if (source->app->activityState == APP_CMD_RESUME && source->app->window) {
4345 U_LOG_I("Activity is in resume state with window available now");
4446 break;
+2-2
src/xrt/drivers/android/android_sensors.c
···143143 ASensorEventQueue_setEventRate(event_queue, gyroscope, gyroscope_poll_rate_usec);
144144 }
145145146146- while (d->oth.running) {
146146+ while (os_thread_helper_is_running(&d->oth)) {
147147 int num_events = 0;
148148- const int looper_id = ALooper_pollAll(max_wait_milliseconds, NULL, &num_events, NULL);
148148+ const int looper_id = ALooper_pollOnce(max_wait_milliseconds, NULL, &num_events, NULL);
149149 // The device may have enabled a power-saving policy, causing the sensor to sleep and return
150150 // ALOOPER_POLL_ERROR. However, we want to continue reading data when it wakes up.
151151 if (looper_id != LOOPER_ID_USER) {