Add support for fuse based SD card emulation

On devices with no SD card we emulate external storage with a directory
on the internal data partition.  For backward compatibility purposes
(mainly emulating file system permissions), the internal directory is
mirrored at the /mnt/sdcard mount point via FUSE.

The problem now is that files can exist in two places on the device's
file system.  To avoid the performance penalty of the FUSE emulation,
the media provider and MTP will use paths to real files in the /data/media
directory.  To support applications that use the legacy location,
all paths that begin with /mnt/sdcard will be remapped to the real location
in /data/media internally within the media provider.

Change-Id: I81cada1bf65a3d4b28c7178214116d4a78208ed0
Signed-off-by: Mike Lockwood <lockwood@android.com>
3 files changed