I am working on an app in which I have to get location after every few minutes. For this purpose I have implemented background service so that my app will not be killed. It is working fine.
But on some devices like Vivo/Oppo/Infinix etc, it is not working fine. For battery optimisation, these devices have different options. These devices killed the app/service if app is consuming battery continuously in the background.
Is there any way to detect or avoid such options.
One of Vivo device have options as I mentioned in the attached image. Some devices have such options in different ways. I am unable to detect such options.