From 71e1f724f63fa31ff76ce83dfa36fd142d3e6e9e Mon Sep 17 00:00:00 2001 From: Olekoop Date: Fri, 5 Jul 2024 20:06:48 +0200 Subject: [PATCH] Android: Use ALooper_pollOnce instead of ALooper_pollAll ALooper_pollAll is deprecated and it will be removed in NDK r27 --- .../Android/src/main/cpp/ALooperEventLoopImplementation.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Ladybird/Android/src/main/cpp/ALooperEventLoopImplementation.cpp b/Ladybird/Android/src/main/cpp/ALooperEventLoopImplementation.cpp index 569f72d203c..40311bcefe0 100644 --- a/Ladybird/Android/src/main/cpp/ALooperEventLoopImplementation.cpp +++ b/Ladybird/Android/src/main/cpp/ALooperEventLoopImplementation.cpp @@ -170,7 +170,10 @@ size_t ALooperEventLoopImplementation::pump(Core::EventLoopImplementation::PumpM auto num_events = Core::ThreadEventQueue::current().process(); int timeout_ms = mode == Core::EventLoopImplementation::PumpMode::WaitForEvents ? -1 : 0; - auto ret = ALooper_pollAll(timeout_ms, nullptr, nullptr, nullptr); + int ret; + do { + ret = ALooper_pollOnce(timeout_ms, nullptr, nullptr, nullptr); + } while (ret == ALOOPER_POLL_CALLBACK); // We don't expect any non-callback FDs to be ready VERIFY(ret <= 0);