In Part I, I showed you how to use Tasker and some scripts to make your button backlight flash for an incoming notification. One problem with that technique is that it requires a script to be run every time the lights are flashed. This resulted in a dramatic increase in battery drain since the phone was kept from going completely idle. I tried creating a script that runs perpetually and only flashes the lights when a setting is changed, but when the phone does go idle, it slows down or completely stops the script.
I decided to try a new approach to the lights. Instead of to flashing the lights, when a notification comes in, I would leave the lights permanently on until the screen is turned on again. This however required a modified kernel. The default action by all of the kernels is to turn off the key lights when the phone goes idle. Picasticks was kind enough to provide me with a modified version of his kernel that stopped the lights being turned off. With that in hand, I tested what happens when I leave the key lights on. It turns out that the LEDs consume very very very little energy. Over the course of a 20 hour test, my phone only lost 22% of its battery power. Until I can figure out a way to make the lights flash in an efficient way, or Picasticks can find a low level way to incorporate it into the kernel, this is the most efficient solution. You may think that flashing the lights has to be more efficient than leaving them on. If you wake the phone to do it, you are burning through a lot more juice than if you just keep the light on. Think of it the same way florescent lights work. There is a cost associated with turning it on. If you repeat the process of turning them on too often, you consume more juice than just leaving them on. In this case, waking the phone uses 25-60mA for a few seconds where as the LEDs consume less than 1mA. If you waked the phone every 10 seconds to flash the lights and the phone stayed out of idle for only one second, that would equal 25mA * 6 = 150mAs for the most conservative estimate of the amount of battery consumed in 1 min. If I leave the light on and use the most liberal estimate for battery consumption (1mA), then it would consume 60mAs, almost three times less. If we flash the lights every 3 seconds like I did in Part I, that would consume at least 500 mAs, over 8 times as much as leaving the lights on. If you still don't believe me, try both out and let me know how it goes.
Here is how to set this up to work on your phone with Tasker:
(If you already have did Part I, you can start on step 5)
This will turn on the button backlight LEDs if you get a missed call, text, GV message, Gtalk message, Groove IP missed call, Sipdroid, missed call, cSipSimple missed call, new email, or new Gmail. If you want other notifications to trigger the lights, in Tasker hit New -> Event -> UI -> Notification -> Owner Application -> and select the app who's notifications you want to trigger the lights. When the Task Selection Menu pops up, select Togglekeylights. There is a 14 second delay built into the light to allow the phone to go back to sleep before turning on the light for missed calls.
If you don't want to use Picastick's kernel, then ask your kernel dev to be as kind as Picasticks and create you a kernel that disables the the sleep feature of the button backlights.
Also, I did this:
http://forum.androidcentral.com/opt...ng-external-notification-light-optimus-v.html
I think I voided my warranty
With the led script, disabling the led with key presses, and finally adding an external spot for the led, you'll have a fully functional and dedicated notification led.
All credit goes to Picasticks for this one. Thank you!
I decided to try a new approach to the lights. Instead of to flashing the lights, when a notification comes in, I would leave the lights permanently on until the screen is turned on again. This however required a modified kernel. The default action by all of the kernels is to turn off the key lights when the phone goes idle. Picasticks was kind enough to provide me with a modified version of his kernel that stopped the lights being turned off. With that in hand, I tested what happens when I leave the key lights on. It turns out that the LEDs consume very very very little energy. Over the course of a 20 hour test, my phone only lost 22% of its battery power. Until I can figure out a way to make the lights flash in an efficient way, or Picasticks can find a low level way to incorporate it into the kernel, this is the most efficient solution. You may think that flashing the lights has to be more efficient than leaving them on. If you wake the phone to do it, you are burning through a lot more juice than if you just keep the light on. Think of it the same way florescent lights work. There is a cost associated with turning it on. If you repeat the process of turning them on too often, you consume more juice than just leaving them on. In this case, waking the phone uses 25-60mA for a few seconds where as the LEDs consume less than 1mA. If you waked the phone every 10 seconds to flash the lights and the phone stayed out of idle for only one second, that would equal 25mA * 6 = 150mAs for the most conservative estimate of the amount of battery consumed in 1 min. If I leave the light on and use the most liberal estimate for battery consumption (1mA), then it would consume 60mAs, almost three times less. If we flash the lights every 3 seconds like I did in Part I, that would consume at least 500 mAs, over 8 times as much as leaving the lights on. If you still don't believe me, try both out and let me know how it goes.
Here is how to set this up to work on your phone with Tasker:
(If you already have did Part I, you can start on step 5)
- Install tasker
- Install sl4a
- Download the KeylightsNoFlash_v2.rar and extract it.
- Place sush into /system/bin and change the permissions to "rwxr-xr-x"
Code:adb remount adb push sush /system/bin/ adb shell chmod 755 /system/bin/sush
Code:mount -o remount,rw -t yaffs2 /system /system cp /sdcard/sush /system/bin/sush chmod 755 /system/bin/sush
- Place userbackup.xml in /sdcard/tasker
- Place the six script files into /sdcard/sl4a/scripts
- Open tasker, hit the menu, profile data, restore
- Press apply to exit Tasker, and Go to Settings>Accessibility> Enable Accessibility for Tasker
- Place Picasticks modified kernel (picasticks-07-led1.zip) onto your micro SD card.
- Reboot into recovery.
- Use the flash zip feature to install the modified kernel.
This will turn on the button backlight LEDs if you get a missed call, text, GV message, Gtalk message, Groove IP missed call, Sipdroid, missed call, cSipSimple missed call, new email, or new Gmail. If you want other notifications to trigger the lights, in Tasker hit New -> Event -> UI -> Notification -> Owner Application -> and select the app who's notifications you want to trigger the lights. When the Task Selection Menu pops up, select Togglekeylights. There is a 14 second delay built into the light to allow the phone to go back to sleep before turning on the light for missed calls.
If you don't want to use Picastick's kernel, then ask your kernel dev to be as kind as Picasticks and create you a kernel that disables the the sleep feature of the button backlights.
Also, I did this:
http://forum.androidcentral.com/opt...ng-external-notification-light-optimus-v.html
I think I voided my warranty
With the led script, disabling the led with key presses, and finally adding an external spot for the led, you'll have a fully functional and dedicated notification led.
All credit goes to Picasticks for this one. Thank you!
Last edited: