Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android embedding refactor PR1: JNI Extraction to FlutterJNI.java #7098

5 changes: 5 additions & 0 deletions ci/licenses_golden/licenses_flutter
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,11 @@ FILE: ../../../flutter/shell/platform/android/io/flutter/app/FlutterActivityEven
FILE: ../../../flutter/shell/platform/android/io/flutter/app/FlutterApplication.java
FILE: ../../../flutter/shell/platform/android/io/flutter/app/FlutterFragmentActivity.java
FILE: ../../../flutter/shell/platform/android/io/flutter/app/FlutterPluginRegistry.java
FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/engine/FlutterEngine.java
FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/engine/FlutterJNI.java
FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/engine/dart/PlatformMessageHandler.java
FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/engine/renderer/FlutterRenderer.java
FILE: ../../../flutter/shell/platform/android/io/flutter/embedding/engine/renderer/OnFirstFrameRenderedListener.java
FILE: ../../../flutter/shell/platform/android/io/flutter/plugin/common/ActivityLifecycleListener.java
FILE: ../../../flutter/shell/platform/android/io/flutter/plugin/common/BasicMessageChannel.java
FILE: ../../../flutter/shell/platform/android/io/flutter/plugin/common/BinaryCodec.java
Expand Down
3 changes: 3 additions & 0 deletions shell/platform/android/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
# Generated by Intellij's Android plugin
gen
android.iml
out/

5 changes: 5 additions & 0 deletions shell/platform/android/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,11 @@ java_library("flutter_shell_java") {
"io/flutter/app/FlutterApplication.java",
"io/flutter/app/FlutterFragmentActivity.java",
"io/flutter/app/FlutterPluginRegistry.java",
"io/flutter/embedding/engine/FlutterEngine.java",
"io/flutter/embedding/engine/FlutterJNI.java",
"io/flutter/embedding/engine/dart/PlatformMessageHandler.java",
"io/flutter/embedding/engine/renderer/FlutterRenderer.java",
"io/flutter/embedding/engine/renderer/OnFirstFrameRenderedListener.java",
"io/flutter/plugin/common/ActivityLifecycleListener.java",
"io/flutter/plugin/common/BasicMessageChannel.java",
"io/flutter/plugin/common/BinaryCodec.java",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// Copyright 2013 The Flutter Authors. All rights reserved.
matthew-carroll marked this conversation as resolved.
Show resolved Hide resolved
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

package io.flutter.embedding.engine;

/**
* A single Flutter execution environment.
*
* WARNING: THIS CLASS IS EXPERIMENTAL. DO NOT SHIP A DEPENDENCY ON THIS CODE.
matthew-carroll marked this conversation as resolved.
Show resolved Hide resolved
* IF YOU USE IT, WE WILL BREAK YOU.
*
* A {@code FlutterEngine} can execute in the background, or it can be rendered to the screen by
* using the accompanying {@link FlutterRenderer}. Rendering can be started and stopped, thus
* allowing a {@code FlutterEngine} to move from UI interaction to data-only processing and then
* back to UI interaction.
*
* Multiple {@code FlutterEngine}s may exist, execute Dart code, and render UIs within a single
* Android app.
*
* To start running Flutter within this {@code FlutterEngine}, get a reference to this engine's
* {@link DartExecutor} and then use {@link DartExecutor#runFromBundle(FlutterRunArguments)}.
* The {@link DartExecutor#runFromBundle(FlutterRunArguments)} method must not be invoked twice on the same
* {@code FlutterEngine}.
*
* To start rendering Flutter content to the screen, use {@link #getRenderer()} to obtain a
* {@link FlutterRenderer} and then attach a {@link FlutterRenderer.RenderSurface}. Consider using
* a {@link io.flutter.embedding.android.FlutterView} as a {@link FlutterRenderer.RenderSurface}.
*/
matthew-carroll marked this conversation as resolved.
Show resolved Hide resolved
public class FlutterEngine {
matthew-carroll marked this conversation as resolved.
Show resolved Hide resolved
// TODO(mattcarroll): bring in FlutterEngine implementation in future PR

/**
* Lifecycle callbacks for Flutter engine lifecycle events.
*/
public interface EngineLifecycleListener {
/**
* Lifecycle callback invoked before a hot restart of the Flutter engine.
*/
void onPreEngineRestart();
matthew-carroll marked this conversation as resolved.
Show resolved Hide resolved
}
}
Loading