-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Description
It just sends the system channel notification, which the engine does not listen for specially.
We could fix this by either making the engine (i.e. in engine.cc) listen for this channel message like others and notify the shell when it hears the message (and then forward it along), or we could expose the shell call through the JNI bindings so that we can do it the way it's done on iOS and in the embedder API.
If we update the engine.cc for this, we should take out the iOS/embedder portions. If we update Android for it, we just have to make sure we're consistent.
One other possible issue that comes to mind is that we may want to try to call Dart_NotifyLowMemory after we send the channel message, on the off chance that the Dart code has enough time to actually free some caches to let the garbage collector pick up even more garbage.
References:
New embedding:
https://github.com/flutter/engine/blob/a6435210acaee2fcd4f0f049032c47c043cfd51f/shell/platform/android/io/flutter/embedding/android/FlutterActivityAndFragmentDelegate.java#L636
https://github.com/flutter/engine/blob/a6435210acaee2fcd4f0f049032c47c043cfd51f/shell/platform/android/io/flutter/embedding/android/FlutterActivityAndFragmentDelegate.java#L654
Old embedding:
Compare with Embedder API:
https://github.com/flutter/engine/blob/a6435210acaee2fcd4f0f049032c47c043cfd51f/shell/platform/embedder/embedder.cc#L1840-L1853
@xster @matthew-carroll @jason-simmons @chinmaygarde for input.