I have a USB device that I am interfacing with an android app using USB host mode. The device sends some data approximately once every 10 seconds but in some cases (high priority data) the data can come anytime. On the android app side I have a service that reads the data using USB host mode API. My android app processes the data and writes data back to the usb device. Now all works fine till the android device goes to sleep. The service goes to pause and all communication stops. I understand that I can use partial wake lock to keep the CPU running and the communication going and that it will have a huge impact on the battery. I though have two questions:
Since the USB device can send data anytime, I really need the android service to alive all the time especially since higher priority data can come anytime. This could potentially mean that I acquire the partial wake lock and never release it. Havent been able to find in documentation if this is allowed and if yes what are the ramifications besides draining the battery?
Does the USB Host mode API or any other API provide a different and potentially better solution?
The app is a custom app with limited users and so battery drain is not a big issue. I just want to understand if there are other issues I need to be careful about or if there is a much better way to do it.