Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-10043

navigator.connection.type gives "unknown" when connection type is actually known

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 4.1.1
    • Fix Version/s: None
    • Labels:
      None
    • Environment:

      Android

      Description

      This bug affects release 1.1.0 of the network infomation plugin. Release 1.0.1 is not affected.

      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 commit 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

      type = info.getSubtypeName(); 
      

      should instead be

      type = info.getSubtypeName().toLowerCase(US);
      

      to compare correctly.

      By the way, in line 243

      else if (type.toLowerCase().equals(TYPE_ETHERNET)) {
      

      toLowerCase() can be omitted because type is already in lower case.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jcesarmobile jcesarmobile
                Reporter:
                demitsch@freenet.de Matthias Eichel
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 5m
                  5m
                  Remaining:
                  Remaining Estimate - 5m
                  5m
                  Logged:
                  Time Spent - Not Specified
                  Not Specified