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

Commit 8a06d26a authored by Zimuzo Ezeozue's avatar Zimuzo Ezeozue Committed by Android (Google) Code Review
Browse files

Merge "Revert "Fix canonicalizing /sdcard""

parents c6eeb791 85f83ff2
Loading
Loading
Loading
Loading
+1 −8
Original line number Diff line number Diff line
@@ -876,14 +876,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;
        }