Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/connectivity/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.4.6

* Fix a regression in 0.4.5 that requires the app to migrate to AndroidX to use the plugin.

## 0.4.5

* Support the v2 Android embedder.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
import android.net.wifi.WifiInfo;
import android.net.wifi.WifiManager;
import android.os.Build;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

/** Reports connectivity related information such as connectivity type and wifi information. */
class Connectivity {
Expand All @@ -24,7 +22,6 @@ class Connectivity {
this.wifiManager = wifiManager;
}

@NonNull
String getNetworkType() {
if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
Network network = connectivityManager.getActiveNetwork();
Expand All @@ -44,7 +41,6 @@ String getNetworkType() {
return getNetworkTypeLegacy();
}

@Nullable
String getWifiName() {
WifiInfo wifiInfo = getWifiInfo();
String ssid = null;
Expand All @@ -53,7 +49,6 @@ String getWifiName() {
return ssid;
}

@Nullable
String getWifiBSSID() {
WifiInfo wifiInfo = getWifiInfo();
String bssid = null;
Expand All @@ -63,7 +58,6 @@ String getWifiBSSID() {
return bssid;
}

@Nullable
String getWifiIPAddress() {
WifiInfo wifiInfo = null;
if (wifiManager != null) wifiInfo = wifiManager.getConnectionInfo();
Expand All @@ -81,7 +75,6 @@ String getWifiIPAddress() {
return ip;
}

@Nullable
private WifiInfo getWifiInfo() {
return wifiManager == null ? null : wifiManager.getConnectionInfo();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import android.content.Intent;
import android.content.IntentFilter;
import android.net.ConnectivityManager;
import androidx.annotation.NonNull;
import io.flutter.plugin.common.EventChannel;

/**
Expand All @@ -26,7 +25,7 @@ class ConnectivityBroadcastReceiver extends BroadcastReceiver
private Connectivity connectivity;
private EventChannel.EventSink events;

ConnectivityBroadcastReceiver(@NonNull Context context, @NonNull Connectivity connectivity) {
ConnectivityBroadcastReceiver(Context context, Connectivity connectivity) {
this.context = context;
this.connectivity = connectivity;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

package io.flutter.plugins.connectivity;

import androidx.annotation.NonNull;
import io.flutter.plugin.common.MethodCall;
import io.flutter.plugin.common.MethodChannel;

Expand All @@ -21,7 +20,7 @@ class ConnectivityMethodChannelHandler implements MethodChannel.MethodCallHandle
* Construct the ConnectivityMethodChannelHandler with a {@code connectivity}. The {@code
* connectivity} must not be null.
*/
ConnectivityMethodChannelHandler(@NonNull Connectivity connectivity) {
ConnectivityMethodChannelHandler(Connectivity connectivity) {
assert (connectivity != null);
this.connectivity = connectivity;
}
Expand Down
2 changes: 0 additions & 2 deletions packages/connectivity/example/android/app/gradle.properties

This file was deleted.

2 changes: 1 addition & 1 deletion packages/connectivity/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: Flutter plugin for discovering the state of the network (WiFi &
mobile/cellular) connectivity on Android and iOS.
author: Flutter Team <flutter-dev@googlegroups.com>
homepage: https://github.com/flutter/plugins/tree/master/packages/connectivity
version: 0.4.5
version: 0.4.6

flutter:
plugin:
Expand Down