Android Intent to open "Mass Storage Activity"
Asked Answered
K

1

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))

Kure answered 28/12, 2011 at 7:5 Comment(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?Power
C
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();
}
Cluj answered 23/8, 2013 at 11:33 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.