|
9 | 9 | import android.content.res.AssetManager;
|
10 | 10 | import androidx.annotation.NonNull;
|
11 | 11 | import androidx.annotation.Nullable;
|
| 12 | +import androidx.annotation.VisibleForTesting; |
12 | 13 | import io.flutter.FlutterInjector;
|
13 | 14 | import io.flutter.Log;
|
14 | 15 | import io.flutter.embedding.engine.dart.DartExecutor;
|
@@ -279,6 +280,27 @@ public FlutterEngine(
|
279 | 280 | @Nullable String[] dartVmArgs,
|
280 | 281 | boolean automaticallyRegisterPlugins,
|
281 | 282 | boolean waitForRestorationData) {
|
| 283 | + this( |
| 284 | + context, |
| 285 | + flutterLoader, |
| 286 | + flutterJNI, |
| 287 | + platformViewsController, |
| 288 | + dartVmArgs, |
| 289 | + automaticallyRegisterPlugins, |
| 290 | + waitForRestorationData, |
| 291 | + null); |
| 292 | + } |
| 293 | + |
| 294 | + @VisibleForTesting(otherwise = VisibleForTesting.PACKAGE_PRIVATE) |
| 295 | + public FlutterEngine( |
| 296 | + @NonNull Context context, |
| 297 | + @Nullable FlutterLoader flutterLoader, |
| 298 | + @NonNull FlutterJNI flutterJNI, |
| 299 | + @NonNull PlatformViewsController platformViewsController, |
| 300 | + @Nullable String[] dartVmArgs, |
| 301 | + boolean automaticallyRegisterPlugins, |
| 302 | + boolean waitForRestorationData, |
| 303 | + @Nullable FlutterEngineGroup group) { |
282 | 304 | AssetManager assetManager;
|
283 | 305 | try {
|
284 | 306 | assetManager = context.createPackageContext(context.getPackageName(), 0).getAssets();
|
@@ -347,7 +369,8 @@ public FlutterEngine(
|
347 | 369 | this.platformViewsController.onAttachedToJNI();
|
348 | 370 |
|
349 | 371 | this.pluginRegistry =
|
350 |
| - new FlutterEngineConnectionRegistry(context.getApplicationContext(), this, flutterLoader); |
| 372 | + new FlutterEngineConnectionRegistry( |
| 373 | + context.getApplicationContext(), this, flutterLoader, group); |
351 | 374 |
|
352 | 375 | localizationPlugin.sendLocalesToFlutter(context.getResources().getConfiguration());
|
353 | 376 |
|
|
0 commit comments