From fa72addaaa1b12cbfbf3a6fb1a1d5e54a44ee017 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Sat, 18 May 2024 16:37:25 +0900 Subject: [PATCH] all: replace ALooper_pollAll with ALooper_pollOnce ALooper_pollAll is no longer available as of Android SDK 34. Fixes golang/go#67496 Change-Id: I1f781ef70d569df50d3059ce355a2f7d1edb435a Reviewed-on: https://go-review.googlesource.com/c/mobile/+/586595 Run-TryBot: Hajime Hoshi LUCI-TryBot-Result: Go LUCI Reviewed-by: Dmitri Shuralyov TryBot-Result: Gopher Robot Reviewed-by: Dmitri Shuralyov Reviewed-by: Hyang-Ah Hana Kim Auto-Submit: Hajime Hoshi --- app/android.go | 2 +- exp/sensor/android.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/android.go b/app/android.go index ebbd4b5..5ee5605 100644 --- a/app/android.go +++ b/app/android.go @@ -365,7 +365,7 @@ func runInputQueue(vm, jniEnv, ctx uintptr) error { var q *C.AInputQueue for { - if C.ALooper_pollAll(-1, nil, nil, nil) == C.ALOOPER_POLL_WAKE { + if C.ALooper_pollOnce(-1, nil, nil, nil) == C.ALOOPER_POLL_WAKE { select { default: case p := <-pending: diff --git a/exp/sensor/android.c b/exp/sensor/android.c index 1ac7223..1cf9340 100644 --- a/exp/sensor/android.c +++ b/exp/sensor/android.c @@ -61,7 +61,7 @@ int GoAndroid_readQueue(int n, int32_t* types, int64_t* timestamps, float* vecto // Try n times read from the event queue. // If anytime timeout occurs, don't retry to read and immediately return. // Consume the event queue entirely between polls. - while (i < n && (id = ALooper_pollAll(GO_ANDROID_READ_TIMEOUT_MS, NULL, &events, NULL)) >= 0) { + while (i < n && (id = ALooper_pollOnce(GO_ANDROID_READ_TIMEOUT_MS, NULL, &events, NULL)) >= 0) { if (id != GO_ANDROID_SENSOR_LOOPER_ID) { continue; }