Skip to content

Conversation

zanderso
Copy link
Member

@zanderso zanderso commented Dec 3, 2019

Description

We were failing to unforward ports for Android. The resident runner is calling Device.dispose() in the correct places, but AndroidDevice was inheriting a no-op dispose() method from the Device base class. This PR removes the no-op dispose from the Device base class (and a couple others). This requires implementers of Device to provide an implementation that makes sense. On Android, dispose() now unforwards ports.

Related Issues

Fixes #45948

Tests

I added the following tests:

Added a test to resident_runner_test.dart that ensures that the resident runner is calling dispose() on devices. Added tests to platform specific device tests that calling dispose() on the device results in a call to dispose() on the devices' port forwarders, where appropriate.

Breaking Change

Does your PR require Flutter developers to manually update their apps to accommodate your change?

  • No, this is not a breaking change.

@zanderso zanderso added tool Affects the "flutter" command-line tool. See also t: labels. work in progress; do not review labels Dec 3, 2019
@jonahwilliams
Copy link
Contributor

This will likely require a manual update in google3 that should be safe to land first.

@jonahwilliams
Copy link
Contributor

Does this change conflict or allow simplification of the port forwarding in attach? https://github.com/flutter/flutter/blob/master/packages/flutter_tools/lib/src/commands/attach.dart#L331

Copy link
Contributor

@jonahwilliams jonahwilliams left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@blasten
Copy link

blasten commented Dec 4, 2019

I filed #46114 to keep track of the flutter attach clean up.

Copy link

@blasten blasten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@fluttergithubbot fluttergithubbot merged commit 99684ce into flutter:master Dec 5, 2019
@zanderso zanderso deleted the run-unforward branch December 5, 2019 17:24
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
tool Affects the "flutter" command-line tool. See also t: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

flutter run doesn't unforward ports used for remote debugging.
5 participants