Further optimize media scanner.
Inserts of directories can be done in bulk as long as they're inserted before
the files contained within. Extend MediaInserter to accommodate giving priority
treatment to directories.
Bulk deleting of entries can be further sped up (by a factor of ~3 in my tests)
by deleting entries in database order. Switch the file cache to use
LinkedHashMap instead of HashMap to allow iterating over the cache in database
order. Also use bindArgs to allow for better caching of sql statements.
Change-Id: Ieb9ffc4e866c6cd505bf795eb80ff5d03ffc56bd
2 files changed