Only for some devices. You have to know if
<b><i>
su
setprop persist.sys.usb.config mass_storage,adb
echo DEVICE-POINT > LUN-FILE
exit<br/></br></br></br></br></i></b>
or
<b><i>
su
setprop persist.sys.usb.config mtp,adb
echo "" > LUN-FILE
vold
exit<br/></br></br></br></br></br></i></b>
works for your device.
* <b><i>requires root privileges</i></b>
* does'nt require BusyBox
1. when installing the widget on the homescreen confirm superuser rights
2. widget trys to find the LUN-file and the USB-device node
3. configure LUN-file and device-node
4. press backbutton
5. widget should show the current mode (USB or MTP)
6. tapping the widget should change the current mode
7. connect with USB-cable and enjoy ( hopefully )
8. disconnect USB-cable
9. switch back to MTP (otherwise, some apps may not work)
As USB-drive only mounts the external SD-card. With MTP are internal and external memory available.
Before uninstall MTPUSBSwitcher remove the icon from the homescreen dragging the icon into the trash. This will restore your original settings.
If you got trouble read this thread. A lot to read but interesting.
https://forum.xda-developers.com/showthread.php?t=2297888
positive list:
Samsung S4 GT-I 9505, 4.4.2. Kitkat Touchwiz
/sys/devices/platform/msm_hsusb/gadget/lun0/file
/dev/block/vold/179:33
Samsung SGS3 I9300, 4.1.2. (thanks Boris)
/sys/devices/platform/s3c-usbgadget/gadget/lun1/file
/dev/block/vold/179:17
Samsung S4, 5.01 Lollipop (thanks Boris)
/sys/devices/virtual/android_usb/android0/f_mass_storage/lun0/file
/dev/block/vold/179:34
ACER Z630 T03, 5.1 (thanks Michael)
/sys/devices/virtual/android_usb/android0/f_mass_storage/lun/file
/dev/block/vold/179:129
to complete the P O S I T I V E - list please review or email with:
+ phone type
+ Android version
+ lun file path
+ device node
Thanks to Mohammad Abu-Garbeyyeh for the app
https://play.google.com/store/apps/details?id=com.mohammadag.samsungusbmassstorageenabler
and Senior XDA Member MetaIIica for his helpful posts.</br></br>
</br></br></br></br>
</br></br>
</br></br>
</br></br>
</br></br></br>
</br></br></br></br></br></br></br></br>
</br>