Hi, the Avast Mobile Security (AMS) doesn't kill other apps because it considers them to be viruses, but to boost RAM. It happens when your users use Avast Battery Saver (ABS) or the "Boost RAM" feature in AMS (though we have not been able to reproduce the situation with your app so far).
It is not possible to whitelist an app to the extent it becomes "immortal" - that would a kind of defeat the purpose of our app.
Whitelisting in ABS:
- open Avast Battery Saver app in your mobile device
- roll right to "TOOLS" screen
- tap on Allowed apps
- right in this menu you may add/remove apps that should be ignored by the "Stop apps" feature
Another option is that your app doesn't actually get killed by AMS, but the device system itself. Samsung, Lenovo, Huawei, Xiaomi and many others have their own "maintenance", which also kills apps running in the background.