This repository was archived by the owner on Feb 25, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6k
Android embedding refactor PR1: JNI Extraction to FlutterJNI.java #7098
Merged
matthew-carroll
merged 10 commits into
flutter:master
from
matthew-carroll:android_embedding_refactor_pr1_jni_extraction
Dec 21, 2018
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
26b7e87
Android embedding refactor PR1: JNI Extraction to FlutterJNI.java
2e2c657
Added JavaDoc to FlutterEngine and FlutterJNI, refactored FlutterJNI …
22adcc7
Removed comment saying we should make FlutterRenderer#createSurfaceTe…
9ca9b80
Added JavaDoc for FlutterJNI#setPlatformMessageHandler(...)
1e28b72
Added JavaDoc for FlutterJNI#setRenderSurface(...)
65b378b
Merge branch 'master' into android_embedding_refactor_pr1_jni_extraction
785be70
Specified @UiThread for public JNI methods, added GitHub issues for T…
691ad35
PR Updates: added and clarified JavaDocs.
cb00a5e
PR Updates: Added blank lines at end of files.
42bc546
PR Updates: Added TODO for cbracken to expand javadoc.
matthew-carroll File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,5 @@ | ||
| # Generated by Intellij's Android plugin | ||
| gen | ||
| android.iml | ||
| out/ | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
shell/platform/android/io/flutter/embedding/engine/FlutterEngine.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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. | ||
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
|
||
| } | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.