Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(connectivity_plus): vpn support for android and linux #1174

Merged

Conversation

werainkhatri
Copy link
Contributor

@werainkhatri werainkhatri commented Oct 6, 2022

Description

adds support for vpn as ConnectivityResult to android and linux.

for android - added it as there is a parameter for it, but haven't tested it on device as i don't have a VPN.
for linux - again, added it (taking the word of the issue author) but can't test it on device.
for macos / ios - i suppose they don't support knowing if a vpn is active as i wasn't able to find any doc supporting it. the APIs currently use don't have such a parameter.
for windows, web - tried searching for something, but not an expert so will leave it to them / a feature request to come up.

Related Issues

Fixes #1166

Checklist

Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]).
This will ensure a smooth and quick review process.

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • My PR includes unit or integration tests for all changed/updated/fixed behaviors (See Contributor Guide).
  • All existing and new tests are passing.
  • I haven't updated the version in pubspec.yaml and CHANGELOG.md.
  • I updated/added relevant documentation (doc comments with ///).
  • The analyzer (flutter analyze) does not report any problems on my PR. (melos analyze fails locally but not related to my PR).
  • I read and followed the Flutter Style Guide.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Does your PR require plugin users to manually update their apps to accommodate your change?

  • Yes, this is a breaking change (please indicate a breaking change in CHANGELOG.md and increment major revision).
  • No, this is not a breaking change.

@miquelbeltran
Copy link
Member

Hey! Due to changes in our contributor guidelines, all PRs should now:

  • Have a title that follows the Conventional Commits format. e.g. feat(package_name)!: feature description
  • DO NOT modify the CHANGELOG.md or the version in the pubspec.yaml. This is going to be an automated process now.

We would ask you kindly to update the PR following these changes.

Thanks!

@werainkhatri werainkhatri changed the title add vpn connectivity support to android and linux feat(connectivity_plus): vpn support for android and linux Oct 7, 2022
@werainkhatri
Copy link
Contributor Author

werainkhatri commented Oct 7, 2022

  • Have a title that follows the Conventional Commits format. e.g. feat(package_name)!: feature description

done ✅

  • DO NOT modify the CHANGELOG.md or the version in the pubspec.yaml. This is going to be an automated process now.

ya i got to know. i haven't modified these files, instead have added the checkbox stating i "haven't" done that.

@@ -56,12 +60,14 @@ private String getNetworkTypeLegacy() {
int type = info.getType();
switch (type) {
case ConnectivityManager.TYPE_BLUETOOTH:
return "bluetooth";
return CONNECTIVITY_BLUETOOTH;
Copy link
Member

Choose a reason for hiding this comment

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

Thanks for the improvement!

completion(equals(ConnectivityResult.vpn)),
);
});

Copy link
Member

Choose a reason for hiding this comment

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

thanks for including tests!

Copy link
Member

@miquelbeltran miquelbeltran left a comment

Choose a reason for hiding this comment

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

Thanks for another great contribution!

@miquelbeltran miquelbeltran added Hacktoberfest Issues taking part in Hacktoberfest hacktoberfest-accepted labels Oct 7, 2022
@miquelbeltran miquelbeltran merged commit 6009f7b into fluttercommunity:main Oct 7, 2022
@werainkhatri werainkhatri deleted the connectivity-vpn-support branch October 7, 2022 18:44
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Hacktoberfest Issues taking part in Hacktoberfest hacktoberfest-accepted
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: on Linux an active VPN connection yields ConnectivityResult.mobile
2 participants