Open file directly when external storage emulated.

For the special case where (1) a file lives on external storage,
(2) it's being opened for reading, and (3) external storage is
emulated, this change rewrites the path at the last moment to open
the file directly from internal storage.

This avoids the overhead of forcing I/O through the emulated storage
layer when we've already asserted the caller has permission. This is
only possible because MediaProvider is running with the media_rw GID.

Bug: 6539384
Change-Id: Ieda6b30e819340d46466f8db2e34b47bbf06ee08
1 file changed