The good news is that in order to not kill itself or others, Huawei/Honor’s services, before killing an app, hwPfwService looks at the tag of the wakelock and if the tag is one the hard-coded whitelisted tags, it does not kill the app. The whitelisted wakelock tags are: “AudioMix”, “AudioIn”, “AudioDup”, “AudioDirectOut”, “AudioOffload” and “LocationManagerService”.
Here is how you can workaround this in code: