Wednesday 13 March 2013

Disable Media Scanner, Screenshots and Default Notification Sounds

I've been having problems with battery life on my i9100 over the last few weeks/months when I transitioned from CM9 to CM10.1. I chalked it up to the beta-nature of running nightly builds but it's a bit more than that. I did some reading around (this thread is a pretty good spot to start). One of the changes I implemented was to disable the media scanner (see here). This saves power as well as shaves off boot-up time but it has some additional issues/caveats.




Default Notification Sounds
I use a fairly unobtrusive notification sound (Facebook pop if you must know) so one of the first changes I noticed was the obnoxious default default-notification sound. So when I checked Settings>Sounds>Default Notification Sound, it had changed to "Unknown Ringtone". I'm constantly flashing things on my phone, I figured it was something that got lost during one of my flash attempts.

Trying to set it back to my custom sound, I noticed two things. Firstly, I like to use the built in Media Storage for managing my ringtones because I tend to want to keep things simple and don't want to start pointing my themes all over. I'm not much for big fancy themes anyway so this suits me well enough. When listing all the available notification sounds, the built in storage listed all of the notification sounds except for the one I was using! This didn't strike me as too big of a deal as the file I was using was from a different location (put there by default). I thought that it was only populating audio files from \system\media\audio\notifications and if I copied the file there (and set the permissions), that would be the end of it. Nope. When I rebooted the phone, list of notification sounds was shown, again, without my that clip. To further aggravate, even selecting one of the existing clips does nothing - it gets saved as Unknown Ringtone.

To fix this, turn the media scanner back on. After rebooting, the list of notifications will have both copies of the audio clip (one from the original location as per usual and the other being the copy you made and places in the notifications folder). Select the second one (i.e. the copy). Reboot the phone. Your default notification  sound should remain in tact. Now you can disable the media scanning.

Screenshots
Something I do a lot is take screenshots with my phone, so I was routinely doing this and I noticed that my screenshot failed to save: something about media access. This problem goes away immediately if I re-enable the media scanning. Luckily, the media scan disable tool that I use automatically performs a one-time media scan upon launching and can be configured to disable the scanner when you quit it. In theory, you'll have to do this once per reboot (if you want to take a screenshot during that boot).


Conclusion
So it's a bit of an additional work but for doing screenshots (pictures taken with camera aren't affected so that should be good for 99% of people). I think it's ultimately worth the reduction in boot time and, for me at least, the reduction in number of wakelocks and battery draining from the media scanner.

Your mileage may vary of course.

No comments:

Post a Comment