From a40e8f9fb0f0a254e111c02c01ed278b5609721c Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 4 Nov 2025 22:05:51 +0100 Subject: [PATCH] android: Fix incorrect usage of ALooper_pollOnce --- panda/src/android/android_main.cxx | 7 +++---- pandatool/src/deploy-stub/android_main.cxx | 7 +++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/panda/src/android/android_main.cxx b/panda/src/android/android_main.cxx index 55355533c3..177b9ec43d 100644 --- a/panda/src/android/android_main.cxx +++ b/panda/src/android/android_main.cxx @@ -271,10 +271,9 @@ void android_main(struct android_app* app) { // We still need to keep an event loop going until Android gives us leave // to end the process. while (!app->destroyRequested) { - int looper_id; - struct android_poll_source *source; - auto result = ALooper_pollOnce(-1, &looper_id, nullptr, (void **)&source); - if (looper_id == LOOPER_ID_MAIN) { + struct android_poll_source *source = nullptr; + int ident = ALooper_pollOnce(-1, nullptr, nullptr, (void **)&source); + if (ident == LOOPER_ID_MAIN) { int8_t cmd = android_app_read_cmd(app); android_app_pre_exec_cmd(app, cmd); android_app_post_exec_cmd(app, cmd); diff --git a/pandatool/src/deploy-stub/android_main.cxx b/pandatool/src/deploy-stub/android_main.cxx index d1e140c5f3..8134aa893a 100644 --- a/pandatool/src/deploy-stub/android_main.cxx +++ b/pandatool/src/deploy-stub/android_main.cxx @@ -299,10 +299,9 @@ void android_main(struct android_app *app) { // We still need to keep an event loop going until Android gives us leave // to end the process. while (!app->destroyRequested) { - int looper_id; - struct android_poll_source *source; - auto result = ALooper_pollOnce(-1, &looper_id, nullptr, (void **)&source); - if (looper_id == LOOPER_ID_MAIN) { + struct android_poll_source *source = nullptr; + int ident = ALooper_pollOnce(-1, nullptr, nullptr, (void **)&source); + if (ident == LOOPER_ID_MAIN) { int8_t cmd = android_app_read_cmd(app); android_app_pre_exec_cmd(app, cmd); android_app_post_exec_cmd(app, cmd);