How to make automatic connection of the usb device to the computer?

How to do that would be when you connect the device to the Android 4.2.2 via usb to the computer, no need to manually choose how to connect.That would automatically the phone can access the Internet?
Here is an example of what is done manually
Any suggestions will help,I would like to do it programmatically)
September 26th 19 at 06:16
1 answer
September 26th 19 at 06:18
Take regshot
1) remove the registry before put a check in the selection "how to connect"
2) put a check push as you need to connect and do a second the registry.

After he PackageKit the difference is that where we need to amend the registry.
and this software can be solved?In android studio, the code to implement what would I do with the registry to dig?) - Kelvin.Hilpe commented on September 26th 19 at 06:21

Find more questions by tags AndroidUSB