By inspecting the Android sources to find which module is generating the message (if the message is not prefixed with the module name). Once the module is known check if it provides some kind of notification that can be used.
The above code seems to be executed when activating and deactivating the host mode and calls the msm_otg_host_notify function when enabled by build configuration. So it might be useful to inspect this function.
But please understand that I don't have the time and interest to dig into this further (especially because it would also require to get the sources first).
I pointed you to directions that might help to solve the problem. But I'm not going to do the research for you.
Yes I tried but it only work when I plug in otg cable with usb device attached to it and enable manually otg inside app and enter app that detects it.Without usb device on otg cable it won't detect it!!!I used ACTION_USB_DEVICE_ATTACED with this app: How to Monitor USB Events on Android[^]
How to find modules that send messages inside kernel source?
I have found file called host_notifier.c inside /drivers/usb/otg/ inside kernel source!
There is also file called Kconfig which contains this:
# USB Host notify configuration
boolean "USB Host notify Driver"
depends on USB
Android framework needs uevents for usb host operation.
Host notify Driver serves uevent format
that is used by usb host or otg.
boolean "USB detailed log for debugging"
depends on USB
Add detailed log for debugging.
i need a remote android source code for make a project. i want to view my frnds android phn using my phne and i need to contol his phn. its my android project like remodroid. but i can't make such like app in android eclips. pllz help me to create such lyk app.. please provide the souce code for it
But remember, in any way, you will not be granted access to your friend's phone for any purpose. Android would still ask for request in order to let you execute any command on their device. So, the method will be simple only if your friends knows. If he is unaware, good luck.
Samsung has disabled OTG support on my S3 Neo I9301I and I have program that enables it.When I plug in otg cable inside phone and open app and enable switch,app writes "1" inside /sys/kernel/debug/regulator/8226_smbbp_otg/enable/ file and writes "0" inside it when I disable switch!When "1" otg is enabled,when "0" otg is disabled!
How to make that app automatically enables switch to write "1" when I plug in cable without going inside app and manually turning on switch?
Last Visit: 31-Dec-99 18:00 Last Update: 30-Sep-23 15:06