I'm encountering a very strange problem while developing on android. My project is a bit unorthodox, so please bear with me.
I'm developing a game that uses an external controller that's connected to the phone using an OTG cable. All works OK, until the phone's temperature crosses a certain threshold, In which case the operating system shuts down the communication with the OTG and I'm unable to restart it in any way other then disconnecting the OTG cable, and reconnecting it, which is a process I would really like to avoid.
So my question is does anyone know what part of the operating system is the one performing this action of shutting down the USB input when the device gets overheated, and where can I control\reboot it?
Would very much appreciate your help, as I don't even know where to start looking, just please avoid answers like "just unplug and plug back the otg", or "just make sure your device doesn't overheat"
Much obliged