From accc378c4b18037dba6f4a6f0ab698687fd192d8 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Thu, 6 Sep 2018 23:18:06 +0200 Subject: [PATCH] hasInternetConnection() will always return true if type=ethernet --- .../eu/siacs/conversations/services/XmppConnectionService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java index 25f230942..891229ce1 100644 --- a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java +++ b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java @@ -943,7 +943,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