summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorDavid Sobreira Marques <dpsmarques@gmail.com>2012-01-15 00:29:42 -0500
committerSteve Kondik <shade@chemlab.org>2012-01-18 12:13:18 -0800
commit8f7e22980e4c354b40f0edf3e9c40c5e2a493dcc (patch)
tree5b6db5260812df2fe4d11ae206ccfec5cdfe2500 /media
parentc8e3afbaf1d2b07b9e2b52144632d893f4360c0b (diff)
downloadframeworks_base-8f7e22980e4c354b40f0edf3e9c40c5e2a493dcc.zip
frameworks_base-8f7e22980e4c354b40f0edf3e9c40c5e2a493dcc.tar.gz
frameworks_base-8f7e22980e4c354b40f0edf3e9c40c5e2a493dcc.tar.bz2
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: David Sobreira Marques <dpsmarques@gmail.com>
Diffstat (limited to 'media')
-rw-r--r--media/java/android/media/MediaScanner.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/media/java/android/media/MediaScanner.java b/media/java/android/media/MediaScanner.java
index 386986e..f8aa817 100644
--- a/media/java/android/media/MediaScanner.java
+++ b/media/java/android/media/MediaScanner.java
@@ -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;