summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--media/libmedia/MediaScanner.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/media/libmedia/MediaScanner.cpp b/media/libmedia/MediaScanner.cpp
index 28b5aa7..6ea5b7e 100644
--- a/media/libmedia/MediaScanner.cpp
+++ b/media/libmedia/MediaScanner.cpp
@@ -139,6 +139,18 @@ MediaScanResult MediaScanner::doProcessDirectory(
return MEDIA_SCAN_RESULT_OK;
}
+ // Completely skip all directories containing a ".noscanandnomtp" file
+ if (pathRemaining >= 15 /* strlen(".noscanandnomtp") */ ) {
+ strcpy(fileSpot, ".noscanandnomtp");
+ if (access(path, F_OK) == 0) {
+ ALOGV("found .noscanandnomtp, completely skipping");
+ return MEDIA_SCAN_RESULT_SKIPPED;
+ }
+
+ // restore path
+ fileSpot[0] = 0;
+ }
+
// Treat all files as non-media in directories that contain a ".nomedia" file
if (pathRemaining >= 8 /* strlen(".nomedia") */ ) {
strcpy(fileSpot, ".nomedia");