Skip to content

Commit

Permalink
all: replace ALooper_pollAll with ALooper_pollOnce
Browse files Browse the repository at this point in the history
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 <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
Reviewed-by: Dmitri Shuralyov <[email protected]>
TryBot-Result: Gopher Robot <[email protected]>
Reviewed-by: Dmitri Shuralyov <[email protected]>
Reviewed-by: Hyang-Ah Hana Kim <[email protected]>
Auto-Submit: Hajime Hoshi <[email protected]>
  • Loading branch information
hajimehoshi authored and gopherbot committed May 20, 2024
1 parent a1a533f commit fa72add
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/android.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion exp/sensor/android.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit fa72add

Please sign in to comment.