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

R de Wit edited comment on CB-12325 at 11/3/17 4:50 AM:
--------------------------------------------------------

Thanks to [~nico.vandenh...@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:

{quote}
adb shell monkey -p <com.example.your_app> -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 <com.example.your_app> -c android.intent.category.LAUNCHER 
1 # bring app back





was (Author: rdewit):
Thanks to [~nico.vandenh...@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:

{quote}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 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-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org

Reply via email to