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

Commit 8f7e2298 authored by David Sobreira Marques's avatar David Sobreira Marques Committed by Steve Kondik
Browse files

Hiding media from folder with .nomedia file.

This patch allows media files present in a folder with
a .nomedia file to be hidden after these files have been
previously indexed.

Bug: http://code.google.com/p/android/issues/detail?id=24162



Change-Id: Ia42133d0a7b119c76b5eaaffabd054aa1a739817
Signed-off-by: default avatarDavid Sobreira Marques <dpsmarques@gmail.com>
parent c8e3afba
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -475,6 +475,16 @@ public class MediaScanner
                key = path.toLowerCase();
            }
            FileCacheEntry entry = mFileCache.get(key);
            if (noMedia) {
                // In case the file is known and now is under a
                // .nomedia folder mark as not seen in order to
                // be removed from files table in the post scan.
                if (entry != null) {
                    entry.mSeenInFileSystem = false;
                }
                return null;
            }

            // add some slack to avoid a rounding error
            long delta = (entry != null) ? (lastModified - entry.mLastModified) : 0;
            boolean wasModified = delta > 1 || delta < -1;