Skip to content

Commit

Permalink
Android embedding refactor PR1: JNI Extraction to FlutterJNI.java (fl…
Browse files Browse the repository at this point in the history
…utter#7098)

Android embedding refactor: JNI Extraction to FlutterJNI.java
  • Loading branch information
matthew-carroll authored Dec 21, 2018
1 parent 3969f82 commit 6b85ed3
Show file tree
Hide file tree
Showing 11 changed files with 1,118 additions and 261 deletions.
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.
// 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.
* 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}.
*/
public class FlutterEngine {
// 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();
}
}
Loading

0 comments on commit 6b85ed3

Please sign in to comment.