diff options
author | Mike Lockwood <lockwood@android.com> | 2011-05-02 14:19:43 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-05-02 14:19:43 -0700 |
commit | 677cece131528d1edcaad247b87d1f989c3956c2 (patch) | |
tree | 14ed8256bf0d15721d51522bec634f1a1d87d97e | |
parent | d713683f9f5230d6a234ce8efbaf3c0959b81e22 (diff) | |
parent | 214f9db054620357c60db48e48339c647a31597f (diff) | |
download | frameworks_base-677cece131528d1edcaad247b87d1f989c3956c2.zip frameworks_base-677cece131528d1edcaad247b87d1f989c3956c2.tar.gz frameworks_base-677cece131528d1edcaad247b87d1f989c3956c2.tar.bz2 |
Merge "MediaScanner: Fix bug in "no media" handling logic"
-rw-r--r-- | media/libmedia/MediaScanner.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/media/libmedia/MediaScanner.cpp b/media/libmedia/MediaScanner.cpp index 4e22175..28c8642 100644 --- a/media/libmedia/MediaScanner.cpp +++ b/media/libmedia/MediaScanner.cpp @@ -135,20 +135,21 @@ status_t MediaScanner::doProcessDirectory( } if (type == DT_REG || type == DT_DIR) { if (type == DT_DIR) { + bool childNoMedia = noMedia; // set noMedia flag on directories with a name that starts with '.' // for example, the Mac ".Trashes" directory if (name[0] == '.') - noMedia = true; + childNoMedia = true; // report the directory to the client if (stat(path, &statbuf) == 0) { - client.scanFile(path, statbuf.st_mtime, 0, true, noMedia); + client.scanFile(path, statbuf.st_mtime, 0, true, childNoMedia); } // and now process its contents strcat(fileSpot, "/"); int err = doProcessDirectory(path, pathRemaining - nameLength - 1, client, - noMedia, exceptionCheck, exceptionEnv); + childNoMedia, exceptionCheck, exceptionEnv); if (err) { // pass exceptions up - ignore other errors if (exceptionCheck && exceptionCheck(exceptionEnv)) goto failure; |