Skip to content

FlutterFragment's onTrimMemory doesn't appear to be wired correctly #105346

@xster

Description

@xster

Looking at https://github.com/flutter/engine/blob/1b9fb67c428f67be7900012464ed3047d642efca/shell/platform/android/io/flutter/embedding/android/FlutterFragment.java#L977, it seems like it's only overriding the ComponentCallbacks2 that it implements. But nothing seems to be using the ComponentCallbacks2 interface, so it's not entirely clear why it implements ComponentCallbacks2.

It likely needs to call getContext().registerComponentCallbacks(componentCallbacks) on itself and register a ComponentCallbacks2 instance on itself where it can respond to onTrimMemory and pass it onto the VM. This is a problem when the FlutterFragment is used by itself.

b/234889225

Metadata

Metadata

Assignees

Labels

P0Critical issues such as a build break or regressioncustomer: googleVarious Google teamsengineflutter/engine related. See also e: labels.perf: memoryPerformance issues related to memoryplatform-androidAndroid applications specificallywaiting for PR to land (fixed)A fix is in flight

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions