Lights library with correct LED color & dual LED support
This lights library is based on the Pyramid lights library (HTC Sensation) by the CyanogenMod Project.
Differences to the normal lights lib we are currently using:
- Based on HTC Pyramid lights lib from CyanogenMod Project
- Show correct battery state
- Add support for alternating LEDs (dual LED support)
Show correct battery state:
By default AOSP-based ROMs already report the devices as fully charged (green LED) even though the device is only at 90% of its battery capacity. This lights library will still show the amber LED until the kernel reports the battery as full.
Add support for flashing LED while charging:
Version 2 contains a changed behavior in comparison to the older version. The description of the older verison can be found below.
In the new version the LED will flash in the same color of your current charge state if you get a notification while charging, i.e.:
- Charging & you get a notification --> Amber LED flashing
- Fully charged & you get a notification --> Green LED flashing
Add support for alternating LEDs:
It is something that has been bugging me for a while now.The scenario is simple:
Your phone is lying on the table and you are getting a short message, mail or maybe miss a call. Once you get back it will normally blink the notification led and you'll know that you missed something. What if you are charging your phone though? The phone will just show the charging LED and there is no way to tell you missed something unless you unlock your phone.
I've been missing a feature that'll show the charging LED while shortly flashing with a different LED color in order to notify you of a missed short message, mail, etc.
While the Leo has support for something similar it is actually somewhat weird:
First the amber LED shortly turns on and then after a small pause the green LED turns on for an instant. Afterwards there is a rather long pause and then it starts over. This is actually more or less an amber colored notification followed by a green colored notification. As the purpose of dual LED support is to show that we have a notification while charging this is not properly met by the native support the Leo has.
Thus I decided to add my own implementation that'll show one LED first (color depends on the charge level) and switch to the other LED color and then after one second back to the original color. This way the LEDs will always be on and thus correctly represent the fact that the device is charging while it's also able to show that there is a notification.
- Ice Cream Sandwich Builds
- Take a look here: http://forum.xda-developers.com/show...51&postcount=2
- You tell me
If you don't know how you can use the attached file then this topic is probably not for you.