You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "R de Wit (JIRA)" <ji...@apache.org> on 2017/11/03 04:48:00 UTC

[jira] [Commented] (CB-12325) navigator connection type none when connected to WiFi Android 7

    [ https://issues.apache.org/jira/browse/CB-12325?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16237086#comment-16237086 ] 

R de Wit commented on CB-12325:
-------------------------------

Thanks to [~nico.vandenhove@gmail.com], we managed to solve the issue for us. The doze functionality Nico was referring to is the following: https://developer.android.com/training/monitoring-device-state/doze-standby.html.

It is possible to reliably reproduce the behaviour with the following commands. It presumes you have a mobile data connection. It's possible to use commands to manage those connections or just manually disable / re-enable the connections in the steps below:

{{
export APP_ID=<com.example.your_app> # put your app id here
adb shell monkey -p ${APP_ID} -c android.intent.category.LAUNCHER 1  # launch it
sleep 10
adb shell input keyevent KEYCODE_HOME # send it to the background
sleep 2
adb shell svc data disable # disable mobile data or do this manually
sleep 5
adb shell dumpsys deviceidle force-idle # bring device in deep sleep
sleep 1
adb shell svc data enable # re-enable mobile data or do this manually
sleep 5
adb shell dumpsys deviceidle unforce # bring device back from deep sleep 
sleep 1
adb shell monkey -p ${APP_ID} -c android.intent.category.LAUNCHER 1 # bring app back
# navigator.onLine should now be false even though there is a network connection
}}



> navigator connection type none when connected to WiFi Android 7
> ---------------------------------------------------------------
>
>                 Key: CB-12325
>                 URL: https://issues.apache.org/jira/browse/CB-12325
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: cordova-plugin-network-information
>    Affects Versions: 6.1.1
>         Environment: Android 7, Nexus 5X
>            Reporter: Arne Misbaer
>            Priority: Major
>              Labels: triaged
>
> When resuming app after a day, the navigator.connection.type returns "none" even when the device has a stable wifi connection. 



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

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