Flutter Engine
The Flutter Engine
shell
platform
android
io
flutter
embedding
engine
plugins
service
ServicePluginBinding.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
11
/** Binding that gives {@link ServiceAware} plugins access to an associated {@link Service}. */
12
public
interface
ServicePluginBinding
{
13
14
/**
15
* Returns the {@link Service} that is currently attached to the {@link
16
* io.flutter.embedding.engine.FlutterEngine} that owns this {@code ServicePluginBinding}.
17
*/
18
@NonNull
19
Service
getService
();
20
21
/**
22
* Returns the {@code Lifecycle} associated with the attached {@code Service}.
23
*
24
* <p>Use the flutter_plugin_android_lifecycle plugin to turn the returned {@code Object} into a
25
* {@code Lifecycle} object. See
26
* (https://github.com/flutter/plugins/tree/master/packages/flutter_plugin_android_lifecycle).
27
* Flutter plugins that rely on {@code Lifecycle} are forced to use the
28
* flutter_plugin_android_lifecycle plugin so that the version of the Android Lifecycle library is
29
* exposed to pub, which allows Flutter to manage different versions library over time.
30
*/
31
@Nullable
32
Object
getLifecycle
();
33
34
/**
35
* Adds the given {@code listener} to be notified when the associated {@link Service} goes from
36
* background to foreground, or foreground to background.
37
*/
38
void
addOnModeChangeListener
(@NonNull
ServiceAware
.
OnModeChangeListener
listener);
39
40
/**
41
* Removes the given {@code listener}, which was previously added with {@link
42
* #addOnModeChangeListener(ServiceAware.OnModeChangeListener)}.
43
*/
44
void
removeOnModeChangeListener
(@NonNull
ServiceAware
.
OnModeChangeListener
listener);
45
}
io.flutter.embedding.engine.plugins.service.ServiceAware.OnModeChangeListener
Definition:
ServiceAware.java:32
io.flutter.embedding.engine.plugins.service.ServiceAware
Definition:
ServiceAware.java:13
io.flutter.embedding.engine.plugins.service.ServicePluginBinding
Definition:
ServicePluginBinding.java:12
io.flutter.embedding.engine.plugins.service.ServicePluginBinding.removeOnModeChangeListener
void removeOnModeChangeListener(@NonNull ServiceAware.OnModeChangeListener listener)
io.flutter.embedding.engine.plugins.service.ServicePluginBinding.getLifecycle
Object getLifecycle()
io.flutter.embedding.engine.plugins.service.ServicePluginBinding.addOnModeChangeListener
void addOnModeChangeListener(@NonNull ServiceAware.OnModeChangeListener listener)
io.flutter.embedding.engine.plugins.service.ServicePluginBinding.getService
Service getService()
android
Definition:
BitmapRegionDecoder.cpp:14
Generated on Sun Jun 23 2024 21:55:09 for Flutter Engine by
1.9.4