Is this not why my phone asks me what I want to do when I plug it into the computer? USB debugging mode, charge only, and another option or two that I can't remember right now. If I select "charge only" will I be secure in the same way?
This really varies from phone to phone, sadly. When I plug mine in I am only given a choice of which protocol to use to give the host computer access to all my files (and it connects using the default one as soon as you plug it in).