diff --git a/engine/src/flutter/shell/platform/android/io/flutter/plugin/platform/PlatformViewsController.java b/engine/src/flutter/shell/platform/android/io/flutter/plugin/platform/PlatformViewsController.java index f9500cdf00..0df81363ca 100644 --- a/engine/src/flutter/shell/platform/android/io/flutter/plugin/platform/PlatformViewsController.java +++ b/engine/src/flutter/shell/platform/android/io/flutter/plugin/platform/PlatformViewsController.java @@ -968,11 +968,12 @@ public class PlatformViewsController implements PlatformViewsAccessibilityDelega private static PlatformViewRenderTarget makePlatformViewRenderTarget( TextureRegistry textureRegistry) { - // TODO(johnmccutchan): Enable ImageReaderPlatformViewRenderTarget for public use. - if (false) { + if (Build.VERSION.SDK_INT >= 29) { + // Prefer ImageReader-based backend on versions >= 29. final TextureRegistry.ImageTextureEntry textureEntry = textureRegistry.createImageTexture(); return new ImageReaderPlatformViewRenderTarget(textureEntry); } + // Fallback to SurfaceTexture support on old phones. final TextureRegistry.SurfaceTextureEntry textureEntry = textureRegistry.createSurfaceTexture(); return new SurfaceTexturePlatformViewRenderTarget(textureEntry); }