Currently the media scanner does not create database entries for directories
unless they contain a file that is scanned.
Fixing this so we provide a consistent view of the world to MTP.
Change-Id: Ia776acfeae23192183e7192d63cdc34d830ea889
Signed-off-by: Mike Lockwood <lockwood@android.com>
The native media scanner no longer filters files based on file extension.
Audio, video, image and playlist files are handled as before, but non-media
files are now inserted into the "files" table, which was originally added
to support MTP.
Change-Id: I9053218fb6d2671a3bb181405c34442b94678afc
Signed-off-by: Mike Lockwood <lockwood@android.com>
strchr and strrchr now return const char* instead of char*
Change-Id: I5ca831b8951af7e6306eb9d9d6f78ed2ec13d649
Signed-off-by: Mike Lockwood <lockwood@android.com>
The previous code was calling stat() on the parent directory rather than the actual file.
Change-Id: If64552cb37552c77618a81ae4333307a018efe13
Signed-off-by: Mike Lockwood <lockwood@android.com>
Previous range-checking fix removed an inequality check. This change
restores it.
Offending change was I5eb310ced58c3c64a7af2d11b80326efe5adbcab
Change-Id: Ic952c3ba5a4f7e5ab2148ec623b6f083cb7495fb
Make sure we don't have an empty string before checking if it's a
directory since this string is tainted.
Change-Id: I5eb310ced58c3c64a7af2d11b80326efe5adbcab