6

I need to open USB Mass Storage Activity from my application.

Is there any Intent to do this?

something like

startActivity(new Intent(Settings.ACTION_APPLICATION_DEVELOPMENT_SETTINGS))

HitOdessit
  • 7,198
  • 4
  • 36
  • 59
Fresher
  • 269
  • 5
  • 16
  • 1
    What do you mean by the "Mass Storage Activity"? Do you mean the USB computer connection subsettings page that lets you select between MTP and PTP on ICS+ devices? – NPike May 06 '13 at 15:57

1 Answers1

0

You can try to use following:

su -c setprop sys.usb.config <command>

Full list of can be found by this one command:
cat init.usb.rc

Function to be able to run command from app:

   public void RunAsRoot(String[] cmds){
            Process p = Runtime.getRuntime().exec("su");
            DataOutputStream os = new DataOutputStream(p.getOutputStream());            
            for (String tmpCmd : cmds) {
                    os.writeBytes(tmpCmd+"\n");
            }           
            os.writeBytes("exit\n");  
            os.flush();
}
Laser
  • 6,652
  • 8
  • 54
  • 85