Skip to content

Commit

Permalink
Revert "Switch PlatformViewsController from Activity ref to Applicati…
Browse files Browse the repository at this point in the history
…on ref. (flutter#9193)" (flutter#9211)

This reverts commit 5ea125e.
  • Loading branch information
amirh authored Jun 6, 2019
1 parent 1d4f337 commit 647a852
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public Registrar registrarFor(String pluginKey) {
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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public <T> T valuePublishedByPlugin(String pluginKey) {

//----- 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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ public PlatformViewsController() {
* 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.
Expand All @@ -239,7 +239,7 @@ public void attach(Context context, TextureRegistry textureRegistry, @NonNull Da
"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);
Expand Down

0 comments on commit 647a852

Please sign in to comment.