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

Commit 85f83ff2 authored by Zimuzo Ezeozue's avatar Zimuzo Ezeozue
Browse files

Revert "Fix canonicalizing /sdcard"

This reverts commit 50e73370.

Reason for revert: ag/10112811 is better and more reliable fix

Change-Id: Ice0c0e7a033013b01156898cd58df14b999e700f
parent 50e73370
Loading
Loading
Loading
Loading
+1 −8
Original line number Diff line number Diff line
@@ -829,14 +829,7 @@ public class StorageManager {
     */
    public @NonNull UUID getUuidForPath(@NonNull File path) throws IOException {
        Preconditions.checkNotNull(path);
        String pathString = path.getCanonicalPath();
        if (path.getPath().startsWith("/sdcard")) {
            // On FUSE enabled devices, realpath(2) /sdcard is /mnt/user/<userid>/emulated/<userid>
            // as opposed to /storage/emulated/<userid>.
            // And vol.path below expects to match with a path starting with /storage
            pathString = pathString.replaceFirst("^/mnt/user/[0-9]+/", "/storage/");
        }

        final String pathString = path.getCanonicalPath();
        if (FileUtils.contains(Environment.getDataDirectory().getAbsolutePath(), pathString)) {
            return UUID_DEFAULT;
        }