[flutter_tool] Make Device.dispose() abstract#46006
Merged
fluttergithubbot merged 1 commit intoflutter:masterfrom Dec 5, 2019
zanderso:run-unforward
Merged
[flutter_tool] Make Device.dispose() abstract#46006fluttergithubbot merged 1 commit intoflutter:masterfrom zanderso:run-unforward
fluttergithubbot merged 1 commit intoflutter:masterfrom
zanderso:run-unforward
Conversation
Contributor
|
This will likely require a manual update in google3 that should be safe to land first. |
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 |
|
I filed #46114 to keep track of the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
We were failing to unforward ports for Android. The resident runner is calling
Device.dispose()in the correct places, butAndroidDevicewas inheriting a no-opdispose()method from theDevicebase class. This PR removes the no-opdisposefrom theDevicebase class (and a couple others). This requires implementers ofDeviceto 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?