Commit 6e85312e authored by justin's avatar justin

Merge branch 'master' into v1.12.13-hotfixes

parent d0a89f4e
...@@ -18,12 +18,10 @@ import io.flutter.embedding.engine.dart.DartExecutor; ...@@ -18,12 +18,10 @@ import io.flutter.embedding.engine.dart.DartExecutor;
import io.flutter.embedding.engine.loader.FlutterLoader; import io.flutter.embedding.engine.loader.FlutterLoader;
import io.flutter.view.FlutterMain; import io.flutter.view.FlutterMain;
import java.lang.reflect.Method;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
public class FlutterBoost { public class FlutterBoost {
private Platform mPlatform; private Platform mPlatform;
private FlutterViewContainerManager mManager; private FlutterViewContainerManager mManager;
...@@ -72,7 +70,6 @@ public class FlutterBoost { ...@@ -72,7 +70,6 @@ public class FlutterBoost {
if (mPlatform.whenEngineStart() == ConfigBuilder.ANY_ACTIVITY_CREATED) { if (mPlatform.whenEngineStart() == ConfigBuilder.ANY_ACTIVITY_CREATED) {
doInitialFlutter(); doInitialFlutter();
} }
} }
@Override @Override
...@@ -83,7 +80,7 @@ public class FlutterBoost { ...@@ -83,7 +80,7 @@ public class FlutterBoost {
if (mCurrentActiveActivity == null) { if (mCurrentActiveActivity == null) {
Debuger.log("Application entry foreground"); Debuger.log("Application entry foreground");
if (createEngine() != null) { if (mEngine != null) {
HashMap<String, String> map = new HashMap<>(); HashMap<String, String> map = new HashMap<>();
map.put("type", "foreground"); map.put("type", "foreground");
channel().sendEvent("lifecycle", map); channel().sendEvent("lifecycle", map);
...@@ -115,7 +112,7 @@ public class FlutterBoost { ...@@ -115,7 +112,7 @@ public class FlutterBoost {
if (mCurrentActiveActivity == activity) { if (mCurrentActiveActivity == activity) {
Debuger.log("Application entry background"); Debuger.log("Application entry background");
if (createEngine() != null) { if (mEngine != null) {
HashMap<String, String> map = new HashMap<>(); HashMap<String, String> map = new HashMap<>();
map.put("type", "background"); map.put("type", "background");
channel().sendEvent("lifecycle", map); channel().sendEvent("lifecycle", map);
...@@ -139,7 +136,7 @@ public class FlutterBoost { ...@@ -139,7 +136,7 @@ public class FlutterBoost {
if (mCurrentActiveActivity == activity) { if (mCurrentActiveActivity == activity) {
Debuger.log("Application entry background"); Debuger.log("Application entry background");
if (createEngine() != null) { if (mEngine != null) {
HashMap<String, String> map = new HashMap<>(); HashMap<String, String> map = new HashMap<>();
map.put("type", "background"); map.put("type", "background");
channel().sendEvent("lifecycle", map); channel().sendEvent("lifecycle", map);
...@@ -160,9 +157,9 @@ public class FlutterBoost { ...@@ -160,9 +157,9 @@ public class FlutterBoost {
} }
public void doInitialFlutter() { public void doInitialFlutter() {
if (mEngine != null) {
return;
if (mEngine != null) return; }
if (mPlatform.lifecycleListener != null) { if (mPlatform.lifecycleListener != null) {
mPlatform.lifecycleListener.beforeCreateEngine(); mPlatform.lifecycleListener.beforeCreateEngine();
...@@ -184,7 +181,6 @@ public class FlutterBoost { ...@@ -184,7 +181,6 @@ public class FlutterBoost {
); );
flutterEngine.getDartExecutor().executeDartEntrypoint(entrypoint); flutterEngine.getDartExecutor().executeDartEntrypoint(entrypoint);
} }
...@@ -320,7 +316,6 @@ public class FlutterBoost { ...@@ -320,7 +316,6 @@ public class FlutterBoost {
private FlutterEngine createEngine() { private FlutterEngine createEngine() {
if (mEngine == null) { if (mEngine == null) {
FlutterMain.startInitialization(mPlatform.getApplication()); FlutterMain.startInitialization(mPlatform.getApplication());
FlutterShellArgs flutterShellArgs = new FlutterShellArgs(new String[0]); FlutterShellArgs flutterShellArgs = new FlutterShellArgs(new String[0]);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment