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

Commit 10b373b5 authored by Jeff Sharkey's avatar Jeff Sharkey
Browse files

Canonicalize path before scanning.

Clients can pass paths like "/sdcard" which don't map directly to
a real storage volume.

Bug: 141837797
Test: none
Change-Id: Iec110472e224c381e33dc9f8e60e1b10e2fbfc0e
parent 8a505cde
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -197,7 +197,7 @@ public class MediaScannerConnection implements ServiceConnection {
    private static Uri scanFileQuietly(ContentProviderClient client, File file) {
        Uri uri = null;
        try {
            uri = MediaStore.scanFile(client, file);
            uri = MediaStore.scanFile(client, file.getCanonicalFile());
            Log.d(TAG, "Scanned " + file + " to " + uri);
        } catch (Exception e) {
            Log.w(TAG, "Failed to scan " + file + ": " + e);