Revert "Switch PlatformViewsController from Activity ref to Application ref. (#9193)" (flutter/engine#9211)

This reverts commit ff4e1cc751f66f87de0b9277a8aa1ffacc68809c.
This commit is contained in:
Amir Hardon 2019-06-06 09:29:10 -07:00 committed by GitHub
parent e3d0c9a584
commit a7c1f0c283
3 changed files with 4 additions and 4 deletions

View File

@ -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() {

View File

@ -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() {

View File

@ -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);