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 all 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.5+1

* Android: Use android.arch.lifecycle instead of androidx.lifecycle:lifecycle in `build.gradle` to support apps that has not been migrated to AndroidX.

## 0.4.5

* Support the v2 Android embedder.
Expand Down
7 changes: 4 additions & 3 deletions packages/connectivity/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,10 @@ afterEvaluate {
if (!containsEmbeddingDependencies) {
android {
dependencies {
def lifecycle_version = "2.1.0"
api "androidx.lifecycle:lifecycle-common-java8:$lifecycle_version"
api "androidx.lifecycle:lifecycle-runtime:$lifecycle_version"
def lifecycle_version = "1.1.1"
api "android.arch.lifecycle:runtime:$lifecycle_version"
api "android.arch.lifecycle:common:$lifecycle_version"
api "android.arch.lifecycle:common-java8:$lifecycle_version"
}
}
}
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.5+1

flutter:
plugin:
Expand Down