Skip to content
This repository has been archived by the owner on May 15, 2024. It is now read-only.

Fixes #512 - Implement the new ConnectivityManager.NetworkCallback for N+ #1568

Merged
merged 3 commits into from
Jan 18, 2022

Conversation

jamesmontemagno
Copy link
Collaborator

Description of Change

Implement the new ConnectivityManager.NetworkCallback for N+

Inspired by : https://stackoverflow.com/questions/27144026/how-can-i-receive-a-notification-when-the-device-loses-network-connectivity-in-a

Bugs Fixed

Provide links to issues here. Ensure that a GitHub issue was created for your feature or bug fix before sending PR.

API Changes

No API changes, just some core under the hood work. Tested on my Pixel 2Xl running Android 10

Behavioral Changes

Describe any non-bug related behavioral changes that may change how users app behaves when upgrading to this version of the codebase.

PR Checklist

  • Has tests (if omitted, state reason in description)
  • Has samples (if omitted, state reason in description)
  • Rebased on top of main at time of PR
  • Changes adhere to coding standard
  • Updated documentation (see walkthrough)

@jamesmontemagno jamesmontemagno added the android This issue impacts Android label Dec 3, 2020
@jamesmontemagno jamesmontemagno added this to the 1.7.0 milestone Dec 3, 2020
Copy link
Contributor

@mattleibow mattleibow left a comment

Choose a reason for hiding this comment

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

Very nice

@@ -11,22 +11,46 @@ namespace Xamarin.Essentials
public partial class Connectivity
{
static ConnectivityBroadcastReceiver conectivityReceiver;
static Intent connectivityIntent = new Intent(Platform.EssentialsConnectivityChanged);
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this safe to reuse? I think it is mostly immutable, but any other info on this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

hmmmm we could probably create a new Intent each time....?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
android This issue impacts Android awaiting-review This PR needs to have a set of eyes on it ready-to-merge Review completed, Ready for API review and merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants