
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.
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.
This KB addresses an issue where users of Citrix Workspace App for Android experience session disconnections after their device remains inactive for a few minutes or enters the lock screen state. Users may receive errors such as"We were unable to connect to the server" or"Unable to reconnect."