Skip to content

FlutterJNI should probably be a singleton, or at least injected, and be testable #66131

@dnfield

Description

@dnfield

Today, both FlutterEngine and InputConnectionAdapter (and via that, FlutterTextUtils) create new FlutterJNI instances.

I'm pretty sure that only FlutterEngine needs one. InputConnectionAdaptor doesn't need any state, it's only using native methods that are stateless.

The only thing that isn't clear to me is whether we'd ever actually need two instances of FlutterJNI - I think there's some case where we'd want that but not today. But we should also make it clearer about when that'd be necessary, which methods care about state, etc.

/cc @xster @jason-simmons

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listengineflutter/engine related. See also e: labels.platform-androidAndroid applications specificallyteam-androidOwned by Android platform teamtriaged-androidTriaged by Android platform team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions