Flutter Engine
The Flutter Engine
ContentProviderControlSurface.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.contentprovider;
6
7import android.content.ContentProvider;
8import androidx.annotation.NonNull;
9import androidx.lifecycle.Lifecycle;
10
11/**
12 * Control surface through which a {@link ContentProvider} attaches to a {@link
13 * io.flutter.embedding.engine.FlutterEngine}.
14 *
15 * <p>A {@link ContentProvider} that contains a {@link io.flutter.embedding.engine.FlutterEngine}
16 * should coordinate itself with the {@link io.flutter.embedding.engine.FlutterEngine}'s {@code
17 * ContentProviderControlSurface}.
18 */
20 /**
21 * Call this method from the {@link ContentProvider} that is running the {@link
22 * io.flutter.embedding.engine.FlutterEngine} that is associated with this {@code
23 * ContentProviderControlSurface}.
24 *
25 * <p>Once a {@link ContentProvider} is created, and its associated {@link
26 * io.flutter.embedding.engine.FlutterEngine} is executing Dart code, the {@link ContentProvider}
27 * should invoke this method. At that point the {@link io.flutter.embedding.engine.FlutterEngine}
28 * is considered "attached" to the {@link ContentProvider} and all {@link ContentProviderAware}
29 * plugins are given access to the {@link ContentProvider}.
30 */
32 @NonNull ContentProvider contentProvider, @NonNull Lifecycle lifecycle);
33
34 /**
35 * Call this method from the {@link ContentProvider} that is attached to this {@code
36 * ContentProviderControlSurfaces}'s {@link io.flutter.embedding.engine.FlutterEngine} when the
37 * {@link ContentProvider} is about to be destroyed.
38 *
39 * <p>This method gives each {@link ContentProviderAware} plugin an opportunity to clean up its
40 * references before the {@link ContentProvider is destroyed}.
41 */
43}
void attachToContentProvider( @NonNull ContentProvider contentProvider, @NonNull Lifecycle lifecycle)