[
https://issues.apache.org/jira/browse/CB-11300?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Santi Calvo updated CB-11300:
-----------------------------
Description:
My device returns "4g" as subtypename when checking the connection. Since this
string is not found the plugin returns "unknow" connection.
The Java plugin, NeworkManager.java line 246, does the bellow check where the
string "4g" doesn't match any of the constants:
else if (type.equals(MOBILE) || type.equals(CELLULAR)) {
type = info.getSubtypeName().toLowerCase(Locale.US);
if (type.equals(GSM) ||
type.equals(GPRS) ||
type.equals(EDGE)) {
return TYPE_2G;
}
else if (type.startsWith(CDMA) ||
type.equals(UMTS) ||
type.equals(ONEXRTT) ||
type.equals(EHRPD) ||
type.equals(HSUPA) ||
type.equals(HSDPA) ||
type.equals(HSPA)) {
return TYPE_3G;
}
else if (type.equals(LTE) ||
type.equals(UMB) ||
type.equals("4g") ||
type.equals(HSPA_PLUS)) {
return TYPE_4G;
}
}
was:
My device returns "4g" as subtypename when checking the connection.
The Java plugin, NeworkManager.java line 246, does the bellow check where the
string "4g" doesn't match any of the constants:
else if (type.equals(MOBILE) || type.equals(CELLULAR)) {
type = info.getSubtypeName().toLowerCase(Locale.US);
if (type.equals(GSM) ||
type.equals(GPRS) ||
type.equals(EDGE)) {
return TYPE_2G;
}
else if (type.startsWith(CDMA) ||
type.equals(UMTS) ||
type.equals(ONEXRTT) ||
type.equals(EHRPD) ||
type.equals(HSUPA) ||
type.equals(HSDPA) ||
type.equals(HSPA)) {
return TYPE_3G;
}
else if (type.equals(LTE) ||
type.equals(UMB) ||
type.equals("4g") ||
type.equals(HSPA_PLUS)) {
return TYPE_4G;
}
}
> Undetected 4g connection in cordova network information plugin
> --------------------------------------------------------------
>
> Key: CB-11300
> URL: https://issues.apache.org/jira/browse/CB-11300
> Project: Apache Cordova
> Issue Type: Bug
> Components: Plugin Network Information
> Environment: Android
> Reporter: Santi Calvo
> Priority: Minor
> Labels: android, network-information, network.connection
> Attachments: Captura de pantalla 2016-05-20 a las 9.29.14 (2).png
>
> Original Estimate: 24h
> Remaining Estimate: 24h
>
> My device returns "4g" as subtypename when checking the connection. Since
> this string is not found the plugin returns "unknow" connection.
> The Java plugin, NeworkManager.java line 246, does the bellow check where the
> string "4g" doesn't match any of the constants:
> else if (type.equals(MOBILE) || type.equals(CELLULAR)) {
> type = info.getSubtypeName().toLowerCase(Locale.US);
> if (type.equals(GSM) ||
> type.equals(GPRS) ||
> type.equals(EDGE)) {
> return TYPE_2G;
> }
> else if (type.startsWith(CDMA) ||
> type.equals(UMTS) ||
> type.equals(ONEXRTT) ||
> type.equals(EHRPD) ||
> type.equals(HSUPA) ||
> type.equals(HSDPA) ||
> type.equals(HSPA)) {
> return TYPE_3G;
> }
> else if (type.equals(LTE) ||
> type.equals(UMB) ||
> type.equals("4g") ||
> type.equals(HSPA_PLUS)) {
> return TYPE_4G;
> }
> }
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]