public interface BroadcastReceiverControlSurface
BroadcastReceiver
attaches to a FlutterEngine
.
A BroadcastReceiver
that contains a FlutterEngine
should coordinate itself
with the FlutterEngine
's BroadcastReceiverControlSurface
.
Modifier and Type | Method and Description |
---|---|
void |
attachToBroadcastReceiver(BroadcastReceiver broadcastReceiver,
androidx.lifecycle.Lifecycle lifecycle)
Call this method from the
BroadcastReceiver that is running the FlutterEngine
that is associated with this BroadcastReceiverControlSurface . |
void |
detachFromBroadcastReceiver()
Call this method from the
BroadcastReceiver that is attached to this BroadcastReceiverControlSurfaces 's FlutterEngine when the BroadcastReceiver is
about to be destroyed. |
void attachToBroadcastReceiver(@NonNull BroadcastReceiver broadcastReceiver, @NonNull androidx.lifecycle.Lifecycle lifecycle)
BroadcastReceiver
that is running the FlutterEngine
that is associated with this BroadcastReceiverControlSurface
.
Once a BroadcastReceiver
is created, and its associated FlutterEngine
is
executing Dart code, the BroadcastReceiver
should invoke this method. At that point the
FlutterEngine
is considered "attached" to the BroadcastReceiver
and all BroadcastReceiverAware
plugins are given access to the BroadcastReceiver
.
void detachFromBroadcastReceiver()
BroadcastReceiver
that is attached to this BroadcastReceiverControlSurfaces
's FlutterEngine
when the BroadcastReceiver
is
about to be destroyed.
This method gives each BroadcastReceiverAware
plugin an opportunity to clean up its
references before the is destroyed
.