Update NetworkManager.java

I tried to use Ethernet link to my Android tablet using this cable

http://www.amazon.co.uk/Smays-Micro-USB-Ethernet-Computer-Notebook/dp/B009XU6N54

I noticed my app returned Network = None.

So I added this little patch so the app now works over Ethernet link.
This commit is contained in:
VinuL 2015-08-27 13:04:32 +01:00
parent 7caab2543a
commit 82fed3f0b5

View File

@ -45,6 +45,7 @@ public class NetworkManager extends CordovaPlugin {
public static final String WIFI = "wifi"; public static final String WIFI = "wifi";
public static final String WIMAX = "wimax"; public static final String WIMAX = "wimax";
public static final String ETHERNET = "ethernet";
// mobile // mobile
public static final String MOBILE = "mobile"; public static final String MOBILE = "mobile";
@ -240,6 +241,9 @@ public class NetworkManager extends CordovaPlugin {
if (type.equals(WIFI)) { if (type.equals(WIFI)) {
return TYPE_WIFI; return TYPE_WIFI;
} }
else if (type.toLowerCase().equals(ETHERNET)) {
return TYPE_ETHERNET;
}
else if (type.equals(MOBILE) || type.equals(CELLULAR)) { else if (type.equals(MOBILE) || type.equals(CELLULAR)) {
type = info.getSubtypeName(); type = info.getSubtypeName();
if (type.equals(GSM) || if (type.equals(GSM) ||