[20.Jul.12][DEV] Lights Library v2 w/ correct LED color & notification while charging - HD2 Android NAND Development

[20.Jul.12][DEV] Lights Library v2 w/ correct LED color & notification while charging
If you don't know what a lights library is or what it does, then please move on. This topic is not for you.​
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
The old behavior has a main disadvantage that the dual LEDs might not work correctly if the device goes into deep sleep. This is hardware related. The newer version doesn't have such a limitation as it uses the hardware supported modes.
Old behavior:
marc1706 said:
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.
Click to expand...
Click to collapse
Works with:
Ice Cream Sandwich Builds
Take a look here: http://forum.xda-developers.com/showpost.php?p=27607351&postcount=2
You tell me
Source:
https://github.com/marc1706/android_device_htc_leo
Download:
View attachment lights.htcleo_v2.zip
Old version:
View attachment lights.htcleo.zip
Notes:
If you don't know how you can use the attached file then this topic is probably not for you.

Confirmed to be working on the following ROMs:
NexusHD2-ICS-4.0.4-CM9-HWA V2.3
IceCreamTosti v1.1 [AOKP B36 ]
Dorimanx-ROM-HIGH-END 3.1.9
Confirmed to not work on the following ROMs:
Any Gingerbread Sense ROMs

awesome thanks Marc
works perfectly

thanks Marc !
My test result:
after the power over 90% LED lamps do not appear(sense3.5)

Sorry, forgot to add that I only tested it on a ICS Rom. As far as I know it should also work on AOSP-based Gingerbread ROMs without issues.
I haven't had any time to play around on Sense ROMs but it'll probably won't work correctly on Sense ROMs.

What a pity!!!
it doesn't work on GB.
I'm on MIUI. will try on ICS then
Thank you

Try on Tytung's ICS 2.3 rom and it works! Thanks.

Exactly what i felt about missed notifications while on charge. Will test it out tonight and let you know.
Edit: Tried this on the rom I m using now (GB2.3.3 + Sense2.1). All my lights stopped working including display (toggle got disabled also. so couldn't adjust level) which remained full bright and hardware button lights didn't light up at all. So this isn't compatible with my ROM atleast.
Thankx though man. If you have time please consider making this compatible for GB sense. Would be great to see notification light blink while on charge too.

Thank you Marc!!!
Question: is this lib supporting the "auto-brightness custom levels" functions of CM7 and CM9?
Cheers!

Do I have to do something special? I copied it to \system\lib\hw set permissions, cleared Dalvik cache and rebooted. Charging light comes on fine. Called the phone to do a miss call. No blinking?
Using AOKP rom like in sig.

Installation should be as easy as copy/paste and setting the correct permissions (644).
Custom auto-brightness levels work with CM9.
@bipinsen: Did you touch the phone before it went back to sleep after you called?

marc1706 said:
Installation should be as easy as copy/paste and setting the correct permissions (644).
Custom auto-brightness levels work with CM9.
@bipinsen: Did you touch the phone before it went back to sleep after you called?
Click to expand...
Click to collapse
Here is what I do:
- Phone is sleeping; screen off; plugged in; LED light amber
- Call the phone; screen lights up; shows caller ID; LED light amber
- Call goes into voicemail; screen turns off; LED light amber
I'm looking at the phone now with the screen off and charging light *still* amber. I wake up the phone to the lockscreen and I see the missed call icon on the statusbar.
Edit: Full disclosure on the install. I still have the original file sitting in the \hw directory as "lights.htcleo.so.bak." I'm assuming that doesn't harm anything.

Weird. I'll see when I have time to test it on the ROM you are using.

Works very, very well! Exactly what I've been hoping for. Tested it while plugged in, and made a missed call. Lights changed accordingly to green flashes so I no longer have to wake up the screen in bed and kill my night vision to check for notifications. Thanks!

Marc, THANKS THANKS THANKS again!!!!
Just tested on GB ROM (Dorimanx Rom, see my sig) and everything IS working as you described!
Great JOB!!!!

marc1706, thanks for finally fixing lights library
I have one little request: could you please take a look when you have some spare time at this bug?
Thanks.

Marc1706,
As the late great comedian Chris Farley would say..."holy schnikes".
I have been waiting for something like this since the first Froyo roms on SD. Wow. Long ago, I almost had a workaround using LedMeKnow but it had GB issues and high battery drain. LedMeKnow inspired me to create a Tasker Profile that while plugged into the charger, if I missed a call or sms, my BUTTON lights would flash rapidly and dismissed upon screen unlock. I still use this profile and it's a very effective workaround.
SO...What the heck took so long? Not you specifically but I always thought this was a MUST have feature...it bugged me too like it did you. Very pleased to see you have provided this Lib. Thanks so much. Here is a quick report with Dorimanx rom 3.1.2 and Kernel 7.2.
1) 1st Handcent sms test...didn't work past 5 secs (but either did my button lights...weird) But when I turned screen on, it worked again but for only 5secs after the screen turned off.
2) missed call test...worked without stopping this time. Normally I would get RED flashing led...but with this LIB I get solid green for 2sec and red for 1sec or less. Works...but a bit odd. No complaints because the idea is working.
3) 2nd Handcent sms test...works like #2 above.
4) Pulled out of charger while flashing from #3 and I got my normal red led ON/OFF blinking.
5) Rebooted and tested Handcent and worked fine. I might have noticed the odd time when it went from red...to green...then briefly to black.

I get no blinking led while phone is plugged in the charger.
I use clk and latest ics rom from tytung V2.3.
I changed the lights.htcleo.so and changed permissions like it was on the old file. Then restarted the phone.
My phone is plugged on the charger. Phone is fully charged (100%). LED stays green all the time. Then i phoned myself with another phone.
But phone still stays green. No blinking. Screen is off. If i wake up my phone, i can see the missed call in the upper taskbar.
Where is the problem? Did i something wrong? Do i have to set up blinking led somewhere?
EDIT:
Strange behaviour: Now my led is blinking green and red. I did nothing, my phone was still in the charger...

My phone is still charging so I can't comment on the 90% issue but I'll edit my post once it does. Pertaining the missed call notification, mine is doing something weird.
*Edit Charging at 90% works fine.
I called my phone to test the missed call notification while charging and what it does is that it stays on amber for a minute and then its turns green for about a minute and twenty seconds then starts all over doing the same thing. What I noticed though is if I turn my screen on to where I have to put in my pattern lock it works like stated otherwise it does what I mentioned above.
I did as follows:
Moved lights.htcleo.so to \system\lib\hw with root explorer, set 644 as permissions,
(rw-r--r--) wiped dalvik cache, fixed permissions.
*edit: Using NexusHD2 v2.3
By the way, would it be possible for you to change the blinking so it could pulsate like in tytungs nexushd2 v2.2 when there was a missed call it would quickly blink amber and green and 2 secs later it would do the same? Here is the lights.htcleo.so libs that tytung used if need be:
http://code.google.com/p/nexus-hd2/downloads/list?q=label:lights.htcleo.so

All ok !
Confirm ALL worked on EU HD2 with Hiperdroid CM7
90% charge and etc.

Related

Turn off Flashing LED's

WHen I'm driving my car at night the flashing lights, on my Blue Angel are very off putting.
If it possible to disable the Blue (Blue tooth LED) and Green signal LED, but still have Blue tooth and us the phone?
To turn off the Blue LED from coming on with Bluetooth go to:
1. Hkey_Local_Machine/Drivers/Builtin/BWLEDMGR
1a. Change the Index value below it to "0" it is currently set to "1
Soft Reset and the Blue LED will not turn on.
Here is a revised procedure for turning the Green LED off. Cabrio came up with this.
2. To keep the Green LED from flashing or coming on at all go to
Hkey_Local_Machine/Drivers/Builtin/NLEDMGR leave the dll name as NLEDMgr.dll
2a. Change the Index value below it to "0" it is currently set to "1".
This seems to completely shut off the LED and keeps it from getting called up.
Make sure you soft reset after making the reg. change.
Do this at your own risk.
I am working on a proggie that will allow you to turn off the LEDs at will, and also turn them back on.
Stay tuned...
OMG the *flashing* is so annoying.
It can be on or off (I dont care) just wtf does it have to flash?
Agreed in the strongest way. LEDs as OEM have delivered the device are terrible. I don't like to sleep with a police car in my room! LED should be entirely user conifigurable as to what solid or blinking means or if they are used at all. The registry changes above seem to work fine for me. It would be ineresting to know what other values for these registry entries do (if anything)
Any new info on this subject?
The only ones who like it in my house are my cats, and i like me sleep to much to let it continue
Yes if you change the Registery Settings, as described above it all works :lol:
One solution:
Use tweaks2k2.Best software having abt 92 safe and reliable registry tweaks.It has the option of turning on/off leds,also increasing the keyboard light time :lol:
blueyesdude said:
One solution:
Use tweaks2k2.Best software having abt 92 safe and reliable registry tweaks.It has the option of turning on/off leds,also increasing the keyboard light time :lol:
Click to expand...
Click to collapse
thanks! you forgot to mention the link to the program
www.tweaks2k2.com/downloads.htm
Version 3.6.0 released today includes part of the trick for HTC Magician.
hey happygoat, hows ur program coming along?
Actually this technique listed (registry hack) only partially works.
I noticed to my rather large annoyance that it started flashing again while I was sleeping. There are other times when its start flashing as well, eg if you disconnect ActiveSync in progress.
This is unbelievable! Removing the LEDs cut my time to connect to the WLAN from turn on in half, from 12 to 6 seconds! Most of it seems to be that it starts connection attempts almost at once. Also the range is improved! Anybody know how this is possible?
Mastiff said:
This is unbelievable! Removing the LEDs cut my time to connect to the WLAN from turn on in half, from 12 to 6 seconds! Most of it seems to be that it starts connection attempts almost at once. Also the range is improved! Anybody know how this is possible?
Click to expand...
Click to collapse
has anyone tested the battery life? :wink:
Not me. That's not one of my concerns. But I can say that the unit is also a lot more responsive when turned on. It has annoyed me that the first 5-10 seconds I couldn't do much with it. Now it's ready for use at once! This one is the best tweak I have seen so far.
Mastiff said:
This is unbelievable! Removing the LEDs cut my time to connect to the WLAN from turn on in half, from 12 to 6 seconds! Most of it seems to be that it starts connection attempts almost at once. Also the range is improved! Anybody know how this is possible?
Click to expand...
Click to collapse
I definately think its coincidence. Anyway its easy to test, just change the registry back and do a timed test.
I wish i could... I can get the GPRS LED light up again, but the BT LED is dead no matter what I do. Anyway, I did at least 20 tests two days ago (before I changed the LED thing yesterday, because of another thread I started here about long connection times), and it was around 12 seconds every time. Now it's around 6 every time, and I haven't made any other changes to the unit.
For the love of god how do I turn this flashing light off???
The registry hacks dont work well enough, the right green LED still flashes in certain cases
wamatt said:
For the love of god how do I turn this flashing light off???
The registry hacks dont work well enough, the right green LED still flashes in certain cases
Click to expand...
Click to collapse
I believe that you are talking about Notifications. Well, that's a LED that works different. It's easy to turn off but it will go on the next time you have any notification event. BTW, I believe that in Sounds and Notifications in settings you can turn off this LED in some events.
I could give you a little program that I did form my internal use so you can check what I'm talking about (Notification LED going ON in any notification event no matter if it has been turned off by any other external program).
ctitanic said:
wamatt said:
For the love of god how do I turn this flashing light off???
The registry hacks dont work well enough, the right green LED still flashes in certain cases
Click to expand...
Click to collapse
I believe that you are talking about Notifications. Well, that's a LED that works different. It's easy to turn off but it will go on the next time you have any notification event. BTW, I believe that in Sounds and Notifications in settings you can turn off this LED in some events.
I could give you a little program that I did form my internal use so you can check what I'm talking about (Notification LED going ON in any notification event no matter if it has been turned off by any other external program).
Click to expand...
Click to collapse
There is no place in notifications to turn off the flashing LED. Although I think u are right about it being the problem...
This works in my hx4700, but I don't know if this is what you are asking for.

LEDs don't work

The blinking LEDs either side of the speaker don't work.
The one on the right which I believe blinks red to indicate notifications and missed calls have never worked and the green one on the left which shows you have reception has stopped.
As far as I can tell all is as it should be in the settings.
The one on the left of the earpiece is the LED, the right is the light sensor that adjusts your screen brightness. Below is a description of the LED lights straight from the manual that came with my Tilt2.
* The Notification LED shows a:
Flashing green light when there are new SMS, MMS or email messages, missed calls, or reminders.
Solid green light when the device is connected to the power adapter or a computer and the battery is fully charged.
Solid amber light when the battery is being charged.
Flashing amber light when the remaining battery level reaches below 10%.
how many threads in how many device forums till everyone knows thats not an led. it even says light sensor in the manual.
Oops silly me. RTFM.
Thanks for getting back to me.
TubThumper said:
The blinking LEDs either side of the speaker don't work.
The one on the right which I believe blinks red to indicate notifications and missed calls have never worked and the green one on the left which shows you have reception has stopped.
As far as I can tell all is as it should be in the settings.
Click to expand...
Click to collapse
Hi
the same was here. SOLVED Browse trough this link http://forum.xda-developers.com/showthread.php?t=460368 . Simply place 31 instead of present any number
Majjjjo
Majjjjo said:
Hi
the same was here. SOLVED Browse trough this link http://forum.xda-developers.com/showthread.php?t=460368 . Simply place 31 instead of present any number
Majjjjo
Click to expand...
Click to collapse
that wasnt his issue, he had mistaken the lightsensor for an led.

Tilt 2 LED - Just network signal?

Hello,
I just got a touch pro2 lastweek and I am beating my head trying to figure out what the deal is with the status notification LEDs
I see one to the LEFT of the earpiece/speaker that flashes green every few seconds and then just stops - all the flashing stops. I'm thinking the bliking stops when the phone goes to sleep. So i press the power to wake the phone - but the flashing doesn't come back. I was thinking this is the network/signal indicator but doesn't seem that way.
I see another that's to the RIGHT of the earpiece/speaker that doesn't go on at all.
So no way to tell if the phone is on wifi network or if bluetooth is on (without obviously waking the phone up and checking on screen). I'm looking for a way to see status without touching the phone - like my old HTC TyTn (rest in peace!)
It turns red when you charge you're phone.
It turns green when you are fully charged (with the charger still in)
It blinks green when you have a new message/e-mail/missed call.
It blinks red when you're batterie is almost empty.
That are the basics
thanks! that's about what i seemed to have gathered too... what about that fake light like thing to the right of speaker? never lights up?
and no bluetooth/wan notification ten, right?
armedmetallica said:
thanks! that's about what i seemed to have gathered too... what about that fake light like thing to the right of speaker? never lights up?
and no bluetooth/wan notification ten, right?
Click to expand...
Click to collapse
thats the light sensor for the screen
adjusts brightness depending on how much light is hitting the phone
Below is a description of the LED lights straight from the manual that came with my Tilt2.
* The Notification LED shows a:
Flashing green light when there are new SMS, MMS or email messages, missed calls, or reminders.
Solid green light when the device is connected to the power adapter or a computer and the battery is fully charged.
Solid amber light when the battery is being charged.
Flashing amber light when the remaining battery level reaches below 10%.
jcterry said:
Below is a description of the LED lights straight from the manual that came with my Tilt2.
* The Notification LED shows a:
Flashing green light when there are new SMS, MMS or email messages, missed calls, or reminders.
Solid green light when the device is connected to the power adapter or a computer and the battery is fully charged.
Solid amber light when the battery is being charged.
Flashing amber light when the remaining battery level reaches below 10%.
Click to expand...
Click to collapse
That's pretty much exactly it. There is a program floating around that allows you to change the light and customize the reason it flashes, but I think it's just fine the way it is .
it also flashed green then the red light really quick when its overheating :O
thanks for the quick replies folks.
I saw that in the manual too - but i never go by the manuals! i can't count how many times my manuals have been wrong about a particular function.
it's a disappointment since the older Tytn was much more friendly about the notifications. but i'll deal with it.
as far as that being a light sensor - i think it makes sense. I'll try trick it to see what I notice. Then I'm guessing it's the proximity sensor that's around the HTC logo? I think I was in the sun when I saw it but there's some sort of sensor around there. I figured that's the light sensor. perhaps not.
Thanks again!

[Q] Does the Desire Z/G2 have a Green LED ?

Hey xda
I've had my Desire Z for about two months now and damn its the best phone i've ever had ! However i noticed something the other night which i would like to ask you about.
I have no green led that blinks every 3 seconds or so at the top where the speaker is. Shouldn't there be that when the phone is having reception ? I noticed this when i was charging my phone.. The older HTC's i've had usually glows orange when charging, but changing to green when its done charging.. But mine just turns off the orange led so theres no led litten up at all
Is this normal for the Desire Z or what does your DZ do ?
I have a G2, the charging LED goes from orange to green when it is above 80% (I think), but it isn't used at all outside of charging.
the green LED blinks when you have messages waiting or emails etc. as well as full charge indicator.
It really depends on how you've set your notifications up.
dazkeirle said:
the green LED blinks when you have messages waiting or emails etc. as well as full charge indicator.
It really depends on how you've set your notifications up.
Click to expand...
Click to collapse
Is there somewhere i can change if the Green LED should be on or not ? Or maybe test it .. Because i never see this Green LED on.. When charging is done the orange led just turns off and no led is litten.. The same goes for when theres reception and i have a message.. The Green LED is not blinking at all
definitely sounds faulty to me. The only app I have ever heard rave reviews about is LEDme. Give that a try to configure the notification blinking. If that doesn't work, dig out your receipt for a return.
EDIT...... As Steviewevie has stated... App is called LED Me Know. My mistake.
The LED doesn't blink for notification unless you use an app (e.g. Led Me Know) or an app that does that for you.
In the stock DZ ROM, the trackpad itself blinks when you get a message, if that setting is switched on, though the blinking is very slow - e.g. every 10 seconds or so.
The LED in the speaker grille should turn green when the battery is fully charged. But when the phone is new there is a "learning" process for the ROM/battery, so that might be why you are not seeing it yet.
If you install the "Led Me Know" app (from the Market), there is a function in there to test out the notifications, so you could set it to use green and then test it from within the app, just to make sure your LED shows green ok.
The free app "Missed Call for Android 2.X" (there is another version that is just for Android 1.6) works well to change the LED notifications as well as vibrate patterns. I just tried it, and it works for flashing the green LED for a SMS notification.
Or if you only want to test it, download "covedesign dev"
Sent from my T-Mobile G2 running Cyanogenmod.
Or you could just get a blackberry instead.
Sent from my HTC Vision using XDA App
Thanks for all the help guys .. I tried various of your mentioned apps and none of them seems to be able to make my green led glow.. Just wondering if i want a spare or not, since it just a rather small fault.. Do you think they will replace it ? is it enough faulty for them to fix it ?
If its supposed to have a green LED, and the green LED is broken, then I think its justification for a replacement.
Whether it bugs you enough to replace it, that's your decision. The only time I've seen it light up (without changing the settings with the Missed Call app) is when charging is done. So it really doesn't have much use, anyway.
redpoint73 said:
If its supposed to have a green LED, and the green LED is broken, then I think its justification for a replacement.
Whether it bugs you enough to replace it, that's your decision. The only time I've seen it light up (without changing the settings with the Missed Call app) is when charging is done. So it really doesn't have much use, anyway.
Click to expand...
Click to collapse
Well im gonna hear the store where i bought what they think.. As you say its not to much use but you know it just bugs me, when i spend so many money on the phone
If you're rooted, download the app covedesign dev.
Sent from my T-Mobile G2 running Cyanogenmod.
ibemad1 said:
If you're rooted, download the app covedesign dev.
Sent from my T-Mobile G2 running Cyanogenmod.
Click to expand...
Click to collapse
Not rooted anymore, as i prepared my device for return.. But i tried it before, when i was rooted, and i was not able to get my green led to lit up with that program.. So i guess its faulty

[Q] Why no LED blinks when battery is dying?

Hi there, I am currently running Cyanogenmod 7.0.3 on my HTC Desire Z and having some issues with the notification led in the speaker:
Why, when battery is nearly flat (under 10%) no LED blinks and if I receive a text the green one keeps blinking unless I reboot the device?
I would like to have the amber LED blinking when battery is dying. I already tried LED ME KNOW but works for a while than stops especially after a reboot.
Thanks in advance.
La Rascassa said:
Hi there, I am currently running Cyanogenmod 7.0.3 on my HTC Desire Z and having some issues with the notification led in the speaker:
Why, when battery is nearly flat (under 10%) no LED blinks and if I receive a text the green one keeps blinking unless I reboot the device?
I would like to have the amber LED blinking when battery is dying. I already tried LED ME KNOW but works for a while than stops especially after a reboot.
Thanks in advance.
Click to expand...
Click to collapse
The blinking LED under 10% is just going to happen. Not sure how you'd change it, as the function is built into the ROM.
The trackpad should still pulse properly when you receive a message though.
Thanks for your reply martonikaj, anyway the speaker led seems to go crazy when battery goes under 10%!
Now, I received a text 15 minutes ago, read but the green light still blinks.
I simply would like to have the amber (or a red) Led blinking to remind me, when I'm not using the phone, that I have to recharge it!
Anyone is experiencing the same issue as me?
EDIT: Seems that someone else has the same problem here, with no answer either:
http: //code.google.com/p/cyanogenmod/issues/detail?id=3260
mine's the same way. I have a consistent green speaker LED blinking under 10%.
I just never really get under 10% that often so it doesn't really bug me.
martonikaj said:
mine's the same way. I have a consistent green speaker LED blinking under 10%.
I just never really get under 10% that often so it doesn't really bug me.
Click to expand...
Click to collapse
I realize that the green led doesn't blink to advise you that your battery is nearly dead but simply because, after reading a text or other notification, the device cannot "get rid" of the green light. In fact if you reboot the phone it goes away and doesn't show up unless you receive another notification.
La Rascassa said:
I realize that the green led doesn't blink to advise you that your battery is nearly dead but simply because, after reading a text or other notification, the device cannot "get rid" of the green light. In fact if you reboot the phone it goes away and doesn't show up unless you receive another notification.
Click to expand...
Click to collapse
Well its not that it cant get rid of it, its that the system tells it to blink the LED lower than 10%, and that's overlapped by the fact that the notification also blinks the LED green. So after the notification LED pulse is gone, it just continues because the system picks up where the notification left off.
Either way, yes, its a bug.
martonikaj said:
So after the notification LED pulse is gone, it just continues because the system picks up where the notification left off.
Click to expand...
Click to collapse
Not in my case. If I don't receive any notification the green LED doesn't blink, even under 10%.
martonikaj said:
Either way, yes, its a bug.
Click to expand...
Click to collapse
You are 100% right! As far as I know it hasn't been solved yet. CM 7.1 RC still have this problem.

Categories

Resources