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

Commit 04c7502a authored by Mike Lockwood's avatar Mike Lockwood Committed by Android Git Automerger
Browse files

am 8b1c74f9: DO NOT MERGE MediaScanner: Fix bug in "no media" handling logic

* commit '8b1c74f96f93195326907db1bb07a3787a1c1b45':
  DO NOT MERGE MediaScanner: Fix bug in "no media" handling logic
parents d2ca5614 5781662e
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -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;