Skip to content

Commit

Permalink
tests: Use ALooper_pollOnce instead of ALooper_pollAll
Browse files Browse the repository at this point in the history
  • Loading branch information
spencer-lunarg committed Jun 6, 2024
1 parent 17f812b commit e1bac56
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions tests/framework/layer_validation_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -681,8 +681,10 @@ static void destroyActivity(struct android_app *app) {
// Wait for APP_CMD_DESTROY
while (app->destroyRequested == 0) {
struct android_poll_source *source = nullptr;
int events = 0;
int result = ALooper_pollAll(-1, nullptr, &events, reinterpret_cast<void **>(&source));
int result = ALooper_pollOnce(-1, nullptr, nullptr, reinterpret_cast<void **>(&source));
if (result == ALOOPER_POLL_ERROR) {
__android_log_print(ANDROID_LOG_ERROR, appTag, "ALooper_pollOnce returned an error");
}

if ((result >= 0) && (source)) {
source->process(app, source);
Expand All @@ -697,9 +699,19 @@ void android_main(struct android_app *app) {
app->onInputEvent = processInput;

while (1) {
int events;
struct android_poll_source *source;
while (ALooper_pollAll(active ? 0 : -1, NULL, &events, (void **)&source) >= 0) {

__android_log_print(ANDROID_LOG_ERROR, appTag, "POLLING <<<");
int result = ALooper_pollOnce(-1, nullptr, nullptr, reinterpret_cast<void **>(&source));
__android_log_print(ANDROID_LOG_ERROR, appTag, "POLLING >>>");
if (result == ALOOPER_POLL_ERROR) {
__android_log_print(ANDROID_LOG_ERROR, appTag, "ALooper_pollOnce returned an error");
VkTestFramework::Finish();
return;
}
__android_log_print(ANDROID_LOG_ERROR, appTag, "start %d", result);

if (result >= 0) {
if (source) {
source->process(app, source);
}
Expand Down

0 comments on commit e1bac56

Please sign in to comment.