diff --git a/engine/src/flutter/shell/platform/android/io/flutter/app/FlutterPluginRegistry.java b/engine/src/flutter/shell/platform/android/io/flutter/app/FlutterPluginRegistry.java index 5a9e7360502..d146db360f9 100644 --- a/engine/src/flutter/shell/platform/android/io/flutter/app/FlutterPluginRegistry.java +++ b/engine/src/flutter/shell/platform/android/io/flutter/app/FlutterPluginRegistry.java @@ -80,7 +80,7 @@ public class FlutterPluginRegistry public void attach(FlutterView flutterView, Activity activity) { mFlutterView = flutterView; mActivity = activity; - mPlatformViewsController.attach(activity.getApplicationContext(), flutterView, flutterView.getDartExecutor()); + mPlatformViewsController.attach(activity, flutterView, flutterView.getDartExecutor()); } public void detach() { diff --git a/engine/src/flutter/shell/platform/android/io/flutter/embedding/engine/plugins/shim/ShimPluginRegistry.java b/engine/src/flutter/shell/platform/android/io/flutter/embedding/engine/plugins/shim/ShimPluginRegistry.java index f9f8612d75b..18c45df9862 100644 --- a/engine/src/flutter/shell/platform/android/io/flutter/embedding/engine/plugins/shim/ShimPluginRegistry.java +++ b/engine/src/flutter/shell/platform/android/io/flutter/embedding/engine/plugins/shim/ShimPluginRegistry.java @@ -75,7 +75,7 @@ public class ShimPluginRegistry implements PluginRegistry { //----- From FlutterPluginRegistry that aren't in the PluginRegistry interface ----// public void attach(FlutterView flutterView, Activity activity) { - platformViewsController.attach(activity.getApplicationContext(), flutterEngine.getRenderer(), flutterEngine.getDartExecutor()); + platformViewsController.attach(activity, flutterEngine.getRenderer(), flutterEngine.getDartExecutor()); } public void detach() { diff --git a/engine/src/flutter/shell/platform/android/io/flutter/plugin/platform/PlatformViewsController.java b/engine/src/flutter/shell/platform/android/io/flutter/plugin/platform/PlatformViewsController.java index a3dd131f1f0..2e2b621c7bf 100644 --- a/engine/src/flutter/shell/platform/android/io/flutter/plugin/platform/PlatformViewsController.java +++ b/engine/src/flutter/shell/platform/android/io/flutter/plugin/platform/PlatformViewsController.java @@ -227,7 +227,7 @@ public class PlatformViewsController implements PlatformViewsAccessibilityDelega * Attaches this platform views controller to its input and output channels. * * @param context The base context that will be passed to embedded views created by this controller. - * This should be the {@code Application} {@code Context}. + * This should be the context of the Activity hosting the Flutter application. * @param textureRegistry The texture registry which provides the output textures into which the embedded views * will be rendered. * @param dartExecutor The dart execution context, which is used to setup a system channel. @@ -239,7 +239,7 @@ public class PlatformViewsController implements PlatformViewsAccessibilityDelega "attach was called while the PlatformViewsController was already attached." ); } - this.context = context.getApplicationContext(); + this.context = context; this.textureRegistry = textureRegistry; platformViewsChannel = new PlatformViewsChannel(dartExecutor); platformViewsChannel.setPlatformViewsHandler(channelHandler);