diff --git a/tests/framework/layer_validation_tests.cpp b/tests/framework/layer_validation_tests.cpp index 5f0d365a6b7..b86389ee065 100644 --- a/tests/framework/layer_validation_tests.cpp +++ b/tests/framework/layer_validation_tests.cpp @@ -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(&source)); + int result = ALooper_pollOnce(-1, nullptr, nullptr, reinterpret_cast(&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); @@ -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(&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); }