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

Commit 66dfcd46 authored by Marco Nelissen's avatar Marco Nelissen
Browse files

When scanning a single file, take .nomedia into account

Make scanSingleFile behave the same way as scanMtpFile, by taking into
account whether there's a .nomedia file guarding the file being scanned.
Without this, downloaded (or otherwise explicitly scanned) images/video/music
will appear in Gallery and Music even if a .nomedia file is hiding them.

Change-Id: Ib9ad4bda1b9a942f79a37ccd8e6a54d57710f528
parent d041e476
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1359,7 +1359,7 @@ public class MediaScanner

            // always scan the file, so we can return the content://media Uri for existing files
            return mClient.doScanFile(path, mimeType, lastModifiedSeconds, file.length(),
                    false, true, false);
                    false, true, MediaScanner.isNoMediaPath(path));
        } catch (RemoteException e) {
            Log.e(TAG, "RemoteException in MediaScanner.scanFile()", e);
            return null;