I've been trying to run a ssh and a http server on my non-rooted Android phone using Termux.
I've installed Termux:Boot and termux-services to run them.
The server processes run for a while after I release the wakelock but are then killed by the system:
09-23 13:25:21.592 4450 5008 I ActivityManager: KPU : put [com.termux] : 15433 K
09-23 13:25:21.592 4450 5008 I ActivityManager: Killing 25360:com.termux/u0a171 (adj 904): DHA:empty #17
I tried disabling the app power monitor (Setting -> Device maintenance -> Battery) but it doesn't seem to make any difference.
Save rooting the phone, or keeping a wakelock in place, is there any way I can stop the ActivityManager killing my processes?
Setup: Samsung Galaxy A5 with stock-rom (Android 8 / Samsung Experience 9)