You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Matthias Eichel (JIRA)" <ji...@apache.org> on 2015/11/19 16:42:11 UTC

[jira] [Created] (CB-10043) navigator.connection.type gives "unknown" when connection type is actually known

Matthias Eichel created CB-10043:
------------------------------------

             Summary: navigator.connection.type gives "unknown" when connection type is actually known
                 Key: CB-10043
                 URL: https://issues.apache.org/jira/browse/CB-10043
             Project: Apache Cordova
          Issue Type: Bug
          Components: Plugin Network Information
    Affects Versions: 1.1.0
         Environment: Android
            Reporter: Matthias Eichel


navigator.connection.type gives "unknown" as a result when connected via 3G. It probably gives "unknown" as a result in other cases. 

This bug, you can see easily, was introduced with commit 6550b937d0d437183984437deb452cbdd653ac18 of NetworkManager.java by SidFerreira's on 28 July ("Performance-related fix"). 

The cause of the bug introduced is that line 247 misses a conversion of the subtypename to lower case, so 
{code}
type = info.getSubtypeName(); 
{code}
should instead be 
{code}
type = info.getSubtypeName().toLowerCase(US);
{code}
to compare correctly.

By the way, in line 243
{code}
else if (type.toLowerCase().equals(TYPE_ETHERNET)) {
{code}
toLowerCase() can be omitted because type is already in lower case.





--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org