After I changed internal SD card to emulated (previous was on it's own partition) I cannot enable USB mass storage of internal card. I got inspired by section "Emulated primary only (like Nexus 4)" in https://source.android.com/devices/storage/config-example.html.
I'm trying to figure out what to change in
vold.fstab to be able to enable USB mass storage.
I'm working on Allwinner A31s, on Android 4.2.2 Jelly Bean.
vold.fstab before my changes was (internal card was
dev_mount sdcard /mnt/sdcard auto /devices/virtual/block/nandk dev_mount extsd /mnt/extsd auto /devices/platform/sunxi-mmc.1/mmc_host /devices/platform/sunxi-mmc.0/mmc_host dev_mount usbhost1 /mnt/usbhost1 auto /devices/platform/sw-ehci.1 /devices/platform/sw_hcd_host0 /devices/platform/sw-ehci.2 /devices/platform/sw-ohci.1 /devices/platform/sw-ohci.2
I removed the first line (for
/mnt/sdcard). I also tried to add line:
dev_mount sdcard /mnt/shell/emulated auto /devices/platform/sw-ehci.1 /devices/platform/sw_hcd_host0 /devices/platform/sw-ehci.2 /devices/platform/sw-ohci.1 /devices/platform/sw-ohci.2
but it didn't help.
I suppose it needs to be entry in
vold.fstab for emulated devices as well. How to find correct
I also changed attribute
UPDATE: The change in partition layout was to remove partition for internal SD card (
/mnt/sdcard) and resize
/data partition – add this free space to it. Internal SD card is mounted into
/data partition (as
It's done with
sdcard service (defined in rc script):
service sdcard /system/bin/sdcard /data/media /mnt/shell/emulated 1023 1023 class late_start
I have probably some misconfiguration in
UsbStorageActivity is shown, but after clicking to enable button does not finish enabling. But this is a minor problem, the main issue is the inability to set UMS.
When I watch
vdc monitor it does nothing, prior to previous version when it worked as expected - unmounting device and changing it's state). This happens also if there is also external SD card presented.
logcat shows that in case of emulated SD card:
- PackageManager is not called
- Vold is not called
- MediaScannerReceiver is not called
- MountService (runned in thread by UsbStorageActivity) skips both internal and partition (doesn't umount either of them) and progress indicator keeps running.