I developed an application with my app accessibility service.
When the user turns it on, the accessibility service runs in the background and helps him.
The problem is that on Xiaomi devices the process of my app is destroyed when the user cleans up all tasks in the task manager. As well as the accessibility service is destroyed together.
The service doesn’t receive new events (I don’t see anything in logs). As well as on the destroy, I don’t receive any callbacks in the lifecycle methods available in the Accessibility service.
What is the most annoying, the service is marked as working in the system settings. And just turning it off and back on doesn’t fix the issue. The only reboot of the device helps, accessibility service is turned back on automatically.
So the question is: how I can separate the task of my app from the task of the accessibility service of my app. So if the user closes my app, the service continues to work. Is there a way to create separate process for it?
(I couldn’t select any category else than CWAC, but it is more likely about accessibility Service and Services, processes