Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | List of all members
io.flutter.embedding.engine.plugins.service.ServiceControlSurface Interface Reference

Public Member Functions

void attachToService ( @NonNull Service service, @Nullable Lifecycle lifecycle, boolean isForeground)
 
void detachFromService ()
 
void onMoveToForeground ()
 
void onMoveToBackground ()
 

Detailed Description

Control surface through which a Service attaches to a io.flutter.embedding.engine.FlutterEngine.

A Service that contains a io.flutter.embedding.engine.FlutterEngine should coordinate itself with the io.flutter.embedding.engine.FlutterEngine's
ServiceControlSurface
.

Definition at line 20 of file ServiceControlSurface.java.

Member Function Documentation

◆ attachToService()

void io.flutter.embedding.engine.plugins.service.ServiceControlSurface.attachToService ( @NonNull Service  service,
@Nullable Lifecycle  lifecycle,
boolean  isForeground 
)

Call this method from the Service that is running the io.flutter.embedding.engine.FlutterEngine that is associated with this
ServiceControlSurface
.

Once a Service is created, and its associated io.flutter.embedding.engine.FlutterEngine is executing Dart code, the Service should invoke this method. At that point the io.flutter.embedding.engine.FlutterEngine is considered "attached" to the Service and all ServiceAware plugins are given access to the Service.

isForeground should be true if the given Service is running in the foreground, false otherwise.

◆ detachFromService()

void io.flutter.embedding.engine.plugins.service.ServiceControlSurface.detachFromService ( )

Call this method from the Service that is attached to this
ServiceControlSurfaces
's io.flutter.embedding.engine.FlutterEngine when the Service is about to be destroyed.

This method gives each ServiceAware plugin an opportunity to clean up its references before the is destroyed.

◆ onMoveToBackground()

void io.flutter.embedding.engine.plugins.service.ServiceControlSurface.onMoveToBackground ( )

Call this method from the Service that is attached to this
ServiceControlSurface
's io.flutter.embedding.engine.FlutterEngine when the Service goes from foreground to background.

◆ onMoveToForeground()

void io.flutter.embedding.engine.plugins.service.ServiceControlSurface.onMoveToForeground ( )

Call this method from the Service that is attached to this
ServiceControlSurface
's io.flutter.embedding.engine.FlutterEngine when the Service goes from background to foreground.


The documentation for this interface was generated from the following file: