I have a USB device with which I interact with an Android application using the USB host mode. The device sends some data about once every 10 seconds, but in some cases (high priority data) the data may arrive at any time. On the side of the Android application, I have a service that reads data using the USB host API. My android application processes the data and writes the data back to the USB device. Now everything works fine until the Android device falls asleep. The service goes into pause mode and all communication ends. I understand that I can use a partial tracking lock to keep the CPU running and communicate, and that this will have a huge impact on the battery. I have two questions:
Since the USB device can send data at any time, I really need the android service to be constantly supported, especially since data with a higher priority can appear at any time. This could potentially mean that I get a partial tracking lock and never let it go. Havent could be found in the documentation, if allowed, and if so, what are the consequences besides draining the battery?
Does the USB host API or any other API support a different and potentially better solution?
The application is a custom application with limited users, and therefore battery leakage is not a big problem. I just want to understand if there are other issues that I need to be careful about, or if there is a much better way to do this.