Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0f742609 authored by Jeff Sharkey's avatar Jeff Sharkey Committed by android-build-merger
Browse files

Merge "Revert "Remove old FUSE bypass now that we have sdcardfs."" into nyc-dev

am: 8b704d44

* commit '8b704d44':
  Revert "Remove old FUSE bypass now that we have sdcardfs."

Change-Id: I65236959348e3a2781e82e9d56eecb58f5d7fcce
parents 790dd573 8b704d44
Loading
Loading
Loading
Loading
+17 −1
Original line number Diff line number Diff line
@@ -1184,7 +1184,23 @@ public class StorageManager {

    /** {@hide} */
    public static File maybeTranslateEmulatedPathToInternal(File path) {
        // Disabled now that FUSE has been replaced by sdcardfs
        final IMountService mountService = IMountService.Stub.asInterface(
                ServiceManager.getService("mount"));
        try {
            final VolumeInfo[] vols = mountService.getVolumes(0);
            for (VolumeInfo vol : vols) {
                if ((vol.getType() == VolumeInfo.TYPE_EMULATED
                        || vol.getType() == VolumeInfo.TYPE_PUBLIC) && vol.isMountedReadable()) {
                    final File internalPath = FileUtils.rewriteAfterRename(vol.getPath(),
                            vol.getInternalPath(), path);
                    if (internalPath != null && internalPath.exists()) {
                        return internalPath;
                    }
                }
            }
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
        return path;
    }