Revert "Fix canonicalizing /sdcard"
This reverts commit 50e73370ca.
Reason for revert: ag/10112811 is better and more reliable fix
Change-Id: Ice0c0e7a033013b01156898cd58df14b999e700f
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user