Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
shell
platform
android
io
flutter
embedding
engine
plugins
service
ServiceControlSurface.java
Go to the documentation of this file.
1
// Copyright 2013 The Flutter Authors. All rights reserved.
2
// Use of this source code is governed by a BSD-style license that can be
3
// found in the LICENSE file.
4
5
package
io.flutter.embedding.engine.plugins.service;
6
7
import
android
.app.Service;
8
import
androidx.annotation.NonNull;
9
import
androidx.annotation.Nullable;
10
import
androidx.lifecycle.Lifecycle;
11
12
/**
13
* Control surface through which a {@link Service} attaches to a {@link
14
* io.flutter.embedding.engine.FlutterEngine}.
15
*
16
* <p>A {@link Service} that contains a {@link io.flutter.embedding.engine.FlutterEngine} should
17
* coordinate itself with the {@link io.flutter.embedding.engine.FlutterEngine}'s {@code
18
* ServiceControlSurface}.
19
*/
20
public
interface
ServiceControlSurface
{
21
/**
22
* Call this method from the {@link Service} that is running the {@link
23
* io.flutter.embedding.engine.FlutterEngine} that is associated with this {@code
24
* ServiceControlSurface}.
25
*
26
* <p>Once a {@link Service} is created, and its associated {@link
27
* io.flutter.embedding.engine.FlutterEngine} is executing Dart code, the {@link Service} should
28
* invoke this method. At that point the {@link io.flutter.embedding.engine.FlutterEngine} is
29
* considered "attached" to the {@link Service} and all {@link ServiceAware} plugins are given
30
* access to the {@link Service}.
31
*
32
* <p>{@code isForeground} should be true if the given {@link Service} is running in the
33
* foreground, false otherwise.
34
*/
35
void
attachToService
(
36
@NonNull Service service, @Nullable Lifecycle lifecycle,
boolean
isForeground);
37
38
/**
39
* Call this method from the {@link Service} that is attached to this {@code
40
* ServiceControlSurfaces}'s {@link io.flutter.embedding.engine.FlutterEngine} when the {@link
41
* Service} is about to be destroyed.
42
*
43
* <p>This method gives each {@link ServiceAware} plugin an opportunity to clean up its references
44
* before the {@link Service is destroyed}.
45
*/
46
void
detachFromService
();
47
48
/**
49
* Call this method from the {@link Service} that is attached to this {@code
50
* ServiceControlSurface}'s {@link io.flutter.embedding.engine.FlutterEngine} when the {@link
51
* Service} goes from background to foreground.
52
*/
53
void
onMoveToForeground
();
54
55
/**
56
* Call this method from the {@link Service} that is attached to this {@code
57
* ServiceControlSurface}'s {@link io.flutter.embedding.engine.FlutterEngine} when the {@link
58
* Service} goes from foreground to background.
59
*/
60
void
onMoveToBackground
();
61
}
io.flutter.embedding.engine.plugins.service.ServiceControlSurface
Definition
ServiceControlSurface.java:20
io.flutter.embedding.engine.plugins.service.ServiceControlSurface.detachFromService
void detachFromService()
io.flutter.embedding.engine.plugins.service.ServiceControlSurface.onMoveToForeground
void onMoveToForeground()
io.flutter.embedding.engine.plugins.service.ServiceControlSurface.attachToService
void attachToService( @NonNull Service service, @Nullable Lifecycle lifecycle, boolean isForeground)
io.flutter.embedding.engine.plugins.service.ServiceControlSurface.onMoveToBackground
void onMoveToBackground()
android
Definition
BitmapRegionDecoder.cpp:14
Generated on Fri Apr 26 2024 06:14:20 for Flutter Engine by
1.9.8