I had a couple people ask me how to do this. I figured I would put together a brief thread on how to accomplish this. I may expand it later if people need more help. This is intended for ROM devs only; however, that should not stop anyone from trying.
The snippet of code below will allow you to turn night mode on/off. Night mode essentially turns off all of the led lights on your phone. I believe the method setNightMode is in most, if not all, Sense roms. I do not believe it is in AOSP.
This can be added as a setting in your Display preferences with a little work. I will attach what I changed on my rom to add the setting. If your rom is based off of the stock inc rom, then you can just replace your files with mine and recompile to get the feature. In addition, you will need to add two strings (night_mode_title & night_mode_summary) to public.xml and strings.xml.
The battery style in stock Android looks pretty dull. It doesn’t … more
XDA Developers was founded by developers, for developers. It is now a valuable resource for people who want to make the most of their mobile devices, from customizing the look and feel to adding new functionality. Are you a developer?