book
Article ID: CTX286628
calendar_today
Updated On:
Description
After few minutes of user session being inactive on CWA for Android, they see the below error:
"We were unable to connect to the server. We were unable to tunnel through the proxy. "

This can be seen about 3-4 minutes after the user device enter lock screen. The lock screen can happen either manually or screen timeout, and followed by the session getting disconnected in the VDA.
Once the user unlocks the device, the Workspace App shows an error stating "Unable to reconnect".
Note: The only way to avoid disconnection is to keep the Android device under power supply.
Resolution
On the Android device, check into device and apps settings and completely disable ‘battery optimization’ for CWA.
This should do the trick, meaning that now the session don’t get disconnected even after hours of device inactivity.
Problem Cause
From the logcat logs, it is clear that the Doze mode is turned ON in the Android device.
11-20 09:51:07.377 1106 1421 D PowerManagerService: [api] setDeviceIdleMode: false (uid: 1000 pid: 1106)
11-20 09:51:07.377 1106 1421 D PowerManagerService: [api] setLightDeviceIdleMode: true (uid: 1000 pid: 1106)
11-20 09:51:07.413 988 1331 I netd : firewallReplaceUidChain("fw_dozable", "true", [1000,1001,1002,1068,2000,5004,5005,5006,5007,5010,5012,5013,5018,5022,5025,5027,5250,10011,10014,10020,10021,10026,10028,10030,10031,10038,10040,10047,10048,10052,10054,10056,10059,10063,10079,10082,10085,10086,10096,10097,10101,10102,10116,10119,10120,10121,10131,10133,10148,10157,10159,10213,10217]) -> {"true"} <31.81ms>
11-20 09:51:07.426 988 1331 I netd : firewallEnableChildChain(1, "true") <11.04ms>
11-20 09:51:07.428 988 1331 I netd : socketDestroy([1000,1001,1002,1068,2000,5004,5005,5006,5007,5010,5012,5013,5018,5022,5025,5027,5250,10011,10014,10020,10021,10026,10028,10030,10031,10038,10040,10047,10048,10052,10054,10056,10059,10063,10079,10082,10085,10086,10096,10097,10101,10102,10116,10119,10120,10121,10131,10133,10148,10157,10159,10213,10217]) <0.93ms>
setLightDeviceIdleMode: true
This kills all the active sockets, using socketDestroy.