I'd like to know in which mode a USB-OTG-supporting Android device is by default, - in the USB host mode or USB slave mode ?
I guess, if the device is in slave mode, then there's no point of using API described on link below ? https://developer.android.com/guide/topics/connectivity/usb/host.html
Is there a way to programmatically switch from host to slave mode and vice versa ?
As you know, a USB OTG (On the go) device automatically switches to host or slave mode, depending on which end of an OTG-specific cable has been inserted into device
And the second question is, in case if a device has necessary OTG ports, but the kernel does not support OTG yet, which parts of the kernel should be modified in order to be able to set host-slave mode, based on cable end detection ? (no need to implement HNP)