Skip to content

Commit f6e1e5c

Browse files
authored
Update Android test framework polling (#1888)
* Update Android test framework polling * Update android_app_framework.cc
1 parent 6c2d998 commit f6e1e5c

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

testing/sample_framework/src/android/android_app_framework.cc

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,14 @@ bool ProcessEvents(int msec) {
5656
do {
5757
struct android_poll_source* source = nullptr;
5858
int events;
59-
looperId = ALooper_pollAll(msec, nullptr, &events,
60-
reinterpret_cast<void**>(&source));
59+
looperId = ALooper_pollOnce(msec, nullptr, &events,
60+
reinterpret_cast<void**>(&source));
6161
if (looperId >= 0 && source) {
6262
source->process(g_app_state, source);
6363
}
64-
} while (looperId != ALOOPER_POLL_TIMEOUT && !g_destroy_requested &&
65-
!g_restarted);
64+
msec = 0;
65+
} while ((looperId >= 0 || looperId == ALOOPER_POLL_CALLBACK) &&
66+
!g_destroy_requested && !g_restarted);
6667
return g_destroy_requested | g_restarted;
6768
}
6869

0 commit comments

Comments
 (0)