Some manufacturers of devices or firmwares add the function of automatically killing the application if it starts consuming too many resources. Unfortunately, this problem also affected the application Selfie Timelapse, for example, on the devices OnePlus.

xTo avoid this error, we recommend that you check the «Temperature control» box on the creation screen. After enabling this option, the application checks the current workload of the processor, and allows «to wait» for peak loads, thus avoiding a forced stop.

https://forums.oneplus.net/threads/oxygenos-3-bgdetect-killing-legitimate-background-processes.454330/

Google