1

I've been working on an android TV with a nand flash of very small size. So all user apps and data are supposed to put on an external sd card.

I've got confused about external storage policy for multiple user. How should I config all those variables like EXTERNAL_STORAGE, EMULATED_STORAGE_SOURCE, EMULATED_STORAGE_TARGET

My current config as following:

init.rc

symlink /storage/emulated/legacy /sdcard
symlink /storage/emulated/legacy /mnt/sdcard
symlink /storage/emulated/legacy /storage/sdcard0
symlink /mnt/shell/emulated/0 /storage/emulated/legacy

export EXTERNAL_STORAGE /storage/emulated/legacy
export EMULATED_STORAGE_SOURCE /mnt/shell/emulated
export EMULATED_STORAGE_TARGET /storage/emulated

vold.fstab

dev_mount sdcard /mnt/shell/emulated auto /devices/platform/...

storage_list

<StorageList xmlns:android="http://schemas.android.com/apk/res/android">
    <!-- internal emulated storage -->
    <storage
        android:storageDescription="@string/storage_internal"
        android:emulated="true"
        android:mtpReserve="100" /> 
    <storage android:mountPoint="/mnt/shell/emulated"
             android:storageDescription="@string/storage_sd_card"
             android:removable="true"
             android:primary="true" />
</StorageList>

With this config working for an android-4.2 device, I found each time when I unplug sdcard and remount it, those running process will run into error on I/O operatins on the sdcard due to permission. But new zygote-forked process will work normally.

WinDsPeed
  • 11
  • 1
  • 5

0 Answers0