In ICS 4.0.3, I found the below comments in MediaScanner.java
- In summary:
- Java MediaScannerService calls
- Java MediaScanner scanDirectories, which calls
- Java MediaScanner processDirectory (native method), which calls
- native MediaScanner processDirectory, which calls
- native MyMediaScannerClient scanFile, which calls
- Java MyMediaScannerClient scanFile, which calls
- Java MediaScannerClient doScanFile, which calls
- Java MediaScanner processFile (native method), which calls
- native MediaScanner processFile, which calls
- native parseMP3, parseMP4, parseMidi, parseOgg or parseWMA, which calls
- native MyMediaScanner handleStringTag, which calls
- Java MyMediaScanner handleStringTag.
- Once MediaScanner processFile returns, an entry is inserted in to the database.
and media/java/android/media/IMediaScannerService.aidl, but have not found who implements the IMediaScannerService, I wonder who starts MediaScannerService?