mirror of
https://github.com/syncthing/syncthing-android.git
synced 2024-11-30 00:01:19 +00:00
Ignore active network info for wifi state (fixes #235).
This commit is contained in:
parent
e43ca2adfc
commit
c90f35e395
1 changed files with 1 additions and 3 deletions
|
@ -22,9 +22,7 @@ public class NetworkReceiver extends BroadcastReceiver {
|
||||||
ConnectivityManager cm =
|
ConnectivityManager cm =
|
||||||
(ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
|
(ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
|
||||||
NetworkInfo wifiInfo = cm.getNetworkInfo(ConnectivityManager.TYPE_WIFI);
|
NetworkInfo wifiInfo = cm.getNetworkInfo(ConnectivityManager.TYPE_WIFI);
|
||||||
NetworkInfo activeNetworkInfo = cm.getActiveNetworkInfo();
|
boolean isWifiConnected = (wifiInfo != null && wifiInfo.isConnected());
|
||||||
boolean isWifiConnected = (wifiInfo != null && wifiInfo.isConnected()) ||
|
|
||||||
activeNetworkInfo == null;
|
|
||||||
Log.v(TAG, "Received wifi " + (isWifiConnected ? "connected" : "disconnected") + " event");
|
Log.v(TAG, "Received wifi " + (isWifiConnected ? "connected" : "disconnected") + " event");
|
||||||
Intent i = new Intent(context, SyncthingService.class);
|
Intent i = new Intent(context, SyncthingService.class);
|
||||||
i.putExtra(DeviceStateHolder.EXTRA_HAS_WIFI, isWifiConnected);
|
i.putExtra(DeviceStateHolder.EXTRA_HAS_WIFI, isWifiConnected);
|
||||||
|
|
Loading…
Reference in a new issue