mirror of
https://gitee.com/shuto/cordova-plugin-network-information.git
synced 2025-01-18 21:52:48 +08:00
CB-7595: Android L changes the type from Mobile to Cellular, I'm pretty sure this isn't documented
This commit is contained in:
parent
3c9c2460be
commit
37c0e3ff75
@ -45,6 +45,9 @@ public class NetworkManager extends CordovaPlugin {
|
||||
public static final String WIMAX = "wimax";
|
||||
// mobile
|
||||
public static final String MOBILE = "mobile";
|
||||
|
||||
// Android L calls this Cellular, because I have no idea!
|
||||
public static final String CELLULAR = "cellular";
|
||||
// 2G network types
|
||||
public static final String GSM = "gsm";
|
||||
public static final String GPRS = "gprs";
|
||||
@ -241,7 +244,7 @@ public class NetworkManager extends CordovaPlugin {
|
||||
if (type.toLowerCase().equals(WIFI)) {
|
||||
return TYPE_WIFI;
|
||||
}
|
||||
else if (type.toLowerCase().equals(MOBILE)) {
|
||||
else if (type.toLowerCase().equals(MOBILE) || type.toLowerCase().equals(CELLULAR)) {
|
||||
type = info.getSubtypeName();
|
||||
if (type.toLowerCase().equals(GSM) ||
|
||||
type.toLowerCase().equals(GPRS) ||
|
||||
|
Loading…
Reference in New Issue
Block a user