Skip to content

ImageReaderSurfaceProducer interacts poorly with (some) plugins due to ensureRunningOnMainThread #146465

@matanlurey

Description

@matanlurey

Some plugins may execute their Android code on another thread, i.e. not the main thread.

As a result, ImageReaderSurfaceProducer will fail at runtime, because some methods, like FlutterJNI.scheduleFrame, "must be executed on the main thread". This is blocking the migration of the camera plugin to SurfaceProducer (flutter/packages#6461). There is an example failure on Firebase Test Lab, though, sort of scarily, nowhere else (maybe this is a good candidate test for scenario_app).

Possible options:

  • This check is out of date, and we could remove it (would have to be thoroughly tested)
  • We need to make sure tasks are posted in the UI thread, instead of the current thread/handler

/cc @jonahwilliams @johnmccutchan @gmackall

Metadata

Metadata

Assignees

Labels

P1High-priority issues at the top of the work liste: impellerImpeller rendering backend issues and features requestsplatform-androidAndroid applications specificallyteam-engineOwned by Engine team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions