Flutter Engine
The Flutter Engine
ServiceAware.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
5package io.flutter.embedding.engine.plugins.service;
6
7import androidx.annotation.NonNull;
8
9/**
10 * A {@link io.flutter.embedding.engine.plugins.FlutterPlugin} that wants to know when it is running
11 * within a {@link android.app.Service}.
12 */
13public interface ServiceAware {
14 /**
15 * Callback triggered when a {@code ServiceAware} {@link
16 * io.flutter.embedding.engine.plugins.FlutterPlugin} is associated with a {@link
17 * android.app.Service}.
18 */
20
21 /**
22 * Callback triggered when a {@code ServiceAware} {@link
23 * io.flutter.embedding.engine.plugins.FlutterPlugin} is detached from a {@link
24 * android.app.Service}.
25 *
26 * <p>Any {@code Lifecycle} listeners that were registered in {@link
27 * #onAttachedToService(ServicePluginBinding)} should be deregistered here to avoid a possible
28 * memory leak and other side effects.
29 */
31
33 /**
34 * Callback triggered when the associated {@link android.app.Service} goes from background
35 * execution to foreground execution.
36 */
38
39 /**
40 * Callback triggered when the associated {@link android.app.Service} goes from foreground
41 * execution to background execution.
42 */
44 }
45}
void onAttachedToService(@NonNull ServicePluginBinding binding)