Merge "DO NOT MERGE - Merge pie-platform-release (PPRL.190705.004) into master"
diff --git a/src/com/android/providers/media/MediaProvider.java b/src/com/android/providers/media/MediaProvider.java
index 5690b3c..122531c 100644
--- a/src/com/android/providers/media/MediaProvider.java
+++ b/src/com/android/providers/media/MediaProvider.java
@@ -4060,6 +4060,11 @@
         final int modeBits = ParcelFileDescriptor.parseMode(mode);
 
         File file = queryForDataFile(uri);
+        try {
+            file = file.getCanonicalFile();
+        } catch (IOException e) {
+            throw new FileNotFoundException("Failed to get cannonical path for " + uri);
+        }
 
         checkAccess(uri, file, modeBits);