diff options
author | Christian Schneppe <christian@pix-art.de> | 2018-09-13 19:25:13 +0200 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2018-09-13 19:25:13 +0200 |
commit | 7635a26e12c35e81600fd844ffd17fce4e913517 (patch) | |
tree | 82be7e15d2b90aeb46e6a2362c2f19784b0d6475 /src/main/java/de/pixart/messenger | |
parent | 5f10156bf99ed59d9200a79a75b09e42b954518e (diff) |
hasInternetConnection() will always return true if type=ethernet
Diffstat (limited to 'src/main/java/de/pixart/messenger')
-rw-r--r-- | src/main/java/de/pixart/messenger/services/XmppConnectionService.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java index c42d8d755..6b957a603 100644 --- a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java +++ b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java @@ -1026,7 +1026,7 @@ public class XmppConnectionService extends Service { final ConnectivityManager cm = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE); try { final NetworkInfo activeNetwork = cm == null ? null : cm.getActiveNetworkInfo(); - return activeNetwork != null && activeNetwork.isConnected(); + return activeNetwork != null && (activeNetwork.isConnected() || activeNetwork.getType() == ConnectivityManager.TYPE_ETHERNET); } catch (RuntimeException e) { Log.d(Config.LOGTAG, "unable to check for internet connection", e); return true; //if internet connection can not be checked it is probably best to just try |