~~~~UPDATED WITH RESULTS - READ BELOW ORIGINAL POST~~~~
So here's the story. I'm going to put a tablet in my car to accommodate my many desired functions. Of these functions is a backup camera. I plan on using a Logitech webcam that I had around for the camera. The webcam uses USB, so I was going to get an OTG Y adapter so that I could charge the tablet and get data from the camera to the tablet at the same time. This would require a Kernel Update, but that's already lined up.
I plan on wiring the power for the webcam into the reverse light wire (either using a relay or a DC-DC converter), and then wiring the data cables to the front of the car to the tablet. This way, the camera would turn on only when the car was in reverse, and then I would have Tasker launch a video viewing app once it detected that the USB had been plugged in, which would be initiated by the webcam receiving power and sending data.
This is based off of the assumption that Android recognizes a USB device being "plugged in" as the transfer of data being initiated, or power transfer being initiated.
What I want to know is, which one is it? Is USB detected by whether or not power can flow from the host to the client, or whether or not the tablet is receiving data? Because the tablet would only be doing the latter, and power of the webcam would be completely separate of the tablet.
I suppose I could test this, but I wanted to check here first before I murdered several USB cables in the process.
Thanks for any input.
The short version: The Android device does detect a USB device based on power and data flow, but my experimentation did not conclusively prove this.
The long version: To start, I soldered in an automotive relay into the wire for the webcam. If you don't know, this now switched circuit would be dependent on whether or not another circuit going into the relay was hot or not. First, I plugged the webcam with the relay into the tablet just using an OTG cable. Using Tasker to detect when USB was plugged in and open an app, I got nothing. I looked in settings, and, on the custom ROM I have installed (Timur's Nexus 7 USB Host ROM), it said that the tablet was in USB host mode, and that it was powering the slave device. Obviously, this implies that the USB device had been detected, but no data had been transmitted, since the camera itself was still off, or at least not receiving enough power. Interestingly, when I completed the control circuit on the relay, thus allowing power to the camera, still nothing happened. It was sort of in this limbo state between being detected and actually being able to be detected by Tasker. The conclusion that can be drawn from this is that true USB detection relies on data transfer, and since data transfer will require the device to be powered, power transfer as well.
As an interesting note, the ROM give me the ability to prevent the tablet from powering the slave device. In this case, I plugged the camera into a POWERED USB hub, and plugged the hub into the tablet, which was also being powered by a charging cable with this OTG Y Cable. In this case, when everything was hooked up, and I activated the control circuit on the relay, tasker immediately recognized that something was plugged in and launched the app.
This wasn't exactly a scientific study or anything, but based on the qualitative data gathered, it seems that true USB connectivity relies both on data and Power.
Feel free to leave any comments or responses with questions or something you want me to test specifically. I'll monitor the thread.