mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Switch PlatformViewsController from Activity ref to Application ref. (flutter/engine#9193)
This commit is contained in:
parent
cb9441d98b
commit
ff4e1cc751
@ -80,7 +80,7 @@ public class FlutterPluginRegistry
|
||||
public void attach(FlutterView flutterView, Activity activity) {
|
||||
mFlutterView = flutterView;
|
||||
mActivity = activity;
|
||||
mPlatformViewsController.attach(activity, flutterView, flutterView.getDartExecutor());
|
||||
mPlatformViewsController.attach(activity.getApplicationContext(), flutterView, flutterView.getDartExecutor());
|
||||
}
|
||||
|
||||
public void detach() {
|
||||
|
||||
@ -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, flutterEngine.getRenderer(), flutterEngine.getDartExecutor());
|
||||
platformViewsController.attach(activity.getApplicationContext(), flutterEngine.getRenderer(), flutterEngine.getDartExecutor());
|
||||
}
|
||||
|
||||
public void detach() {
|
||||
|
||||
@ -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 context of the Activity hosting the Flutter application.
|
||||
* This should be the {@code Application} {@code Context}.
|
||||
* @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;
|
||||
this.context = context.getApplicationContext();
|
||||
this.textureRegistry = textureRegistry;
|
||||
platformViewsChannel = new PlatformViewsChannel(dartExecutor);
|
||||
platformViewsChannel.setPlatformViewsHandler(channelHandler);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user