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 <hajimehoshi@gmail.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Auto-Submit: Hajime Hoshi <hajimehoshi@gmail.com>
This commit is contained in:
Hajime Hoshi
2024-05-20 17:46:38 +00:00
committed by Gopher Robot
parent a1a533f289
commit fa72addaaa
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -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:
+1 -1
View File
@@ -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;
}