mirror of
https://github.com/syncthing/syncthing-android.git
synced 2024-12-27 13:21:30 +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) context.getSystemService(Context.CONNECTIVITY_SERVICE);
|
||||
NetworkInfo wifiInfo = cm.getNetworkInfo(ConnectivityManager.TYPE_WIFI);
|
||||
NetworkInfo activeNetworkInfo = cm.getActiveNetworkInfo();
|
||||
boolean isWifiConnected = (wifiInfo != null && wifiInfo.isConnected()) ||
|
||||
activeNetworkInfo == null;
|
||||
boolean isWifiConnected = (wifiInfo != null && wifiInfo.isConnected());
|
||||
Log.v(TAG, "Received wifi " + (isWifiConnected ? "connected" : "disconnected") + " event");
|
||||
Intent i = new Intent(context, SyncthingService.class);
|
||||
i.putExtra(DeviceStateHolder.EXTRA_HAS_WIFI, isWifiConnected);
|
||||
|
|
Loading…
Reference in a new issue