From 4d942d11e17c3e0c29011892a7105998a9cf7acf Mon Sep 17 00:00:00 2001 From: jonahwilliams Date: Mon, 26 Feb 2024 13:50:06 -0800 Subject: [PATCH 1/2] [scenario] trigger firstFrameLatch on exception. --- .../flutter/scenarios/ExternalTextureFlutterActivity.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/testing/scenario_app/android/app/src/main/java/dev/flutter/scenarios/ExternalTextureFlutterActivity.java b/testing/scenario_app/android/app/src/main/java/dev/flutter/scenarios/ExternalTextureFlutterActivity.java index 7a30a865fc856..cd7d723586888 100644 --- a/testing/scenario_app/android/app/src/main/java/dev/flutter/scenarios/ExternalTextureFlutterActivity.java +++ b/testing/scenario_app/android/app/src/main/java/dev/flutter/scenarios/ExternalTextureFlutterActivity.java @@ -417,6 +417,11 @@ private void onImageAvailable(ImageReader reader) { // IllegalStateException. // Simply log and return. Log.i(TAG, "Surface disconnected from ImageWriter", e); + + if (onFirstFrame != null) { + onFirstFrame.countDown(); + onFirstFrame = null; + } image.close(); return; } From f74167760f8758f74d7d9c26c0c935e7f6d0a269 Mon Sep 17 00:00:00 2001 From: jonahwilliams Date: Mon, 26 Feb 2024 14:28:16 -0800 Subject: [PATCH 2/2] just dont return. --- .../flutter/scenarios/ExternalTextureFlutterActivity.java | 6 ------ 1 file changed, 6 deletions(-) diff --git a/testing/scenario_app/android/app/src/main/java/dev/flutter/scenarios/ExternalTextureFlutterActivity.java b/testing/scenario_app/android/app/src/main/java/dev/flutter/scenarios/ExternalTextureFlutterActivity.java index cd7d723586888..f06f75fcd801b 100644 --- a/testing/scenario_app/android/app/src/main/java/dev/flutter/scenarios/ExternalTextureFlutterActivity.java +++ b/testing/scenario_app/android/app/src/main/java/dev/flutter/scenarios/ExternalTextureFlutterActivity.java @@ -417,13 +417,7 @@ private void onImageAvailable(ImageReader reader) { // IllegalStateException. // Simply log and return. Log.i(TAG, "Surface disconnected from ImageWriter", e); - - if (onFirstFrame != null) { - onFirstFrame.countDown(); - onFirstFrame = null; - } image.close(); - return; } Log.v(TAG, "Output image");