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

Commit 8575da1c authored by Jeff Sharkey's avatar Jeff Sharkey
Browse files

Revert "Remove old FUSE bypass now that we have sdcardfs."

This reverts commit feef8b62.

Change-Id: I90a3b8edf95cb5b631a85168671cf8b5a406d9ea
parent feef8b62
Loading
Loading
Loading
Loading
+17 −1
Original line number Original line Diff line number Diff line
@@ -1178,7 +1178,23 @@ public class StorageManager {


    /** {@hide} */
    /** {@hide} */
    public static File maybeTranslateEmulatedPathToInternal(File path) {
    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;
        return path;
    }
    }