[APP][ROOT][1.6+] ButtonLED v1.6 (05/05/13)

Status
Not open for further replies.
Search This thread

GermainZ

Inactive Recognized Developer / Retired Forum Mod
Aug 3, 2012
6,174
8,800
now i don't have the phone so i can't check the logs. but it did nothing. maybe it was a problem with rom, not the app
Alright. Let me know if it happens again.

got it working, love that now i can see notifications without turning on my screen, since the case blocks my LED on my Optimus G

one thing that would be great is a was to block certain apps (music, evernote, play store, etc) instead of having to use key words that might appear in some text messages
That's not possible using Tasker, sorry. :)
Now that I think of it, tho, it might be possible using some shell commands. Don't hold your breath, it probably won't be reliable enough for me to actually implement it.
 

Beef Incarnate

Senior Member
Dec 30, 2012
57
2
Alright. Let me know if it happens again.


That's not possible using Tasker, sorry. :)
Now that I think of it, tho, it might be possible using some shell commands. Don't hold your breath, it probably won't be reliable enough for me to actually implement it.

if you could do it, that would be great, and im sure other people would love it as well. but if not, im gonna be turing my screen on every once in a while anyway out of habit
 

GermainZ

Inactive Recognized Developer / Retired Forum Mod
Aug 3, 2012
6,174
8,800
Nah, not possible.

The only way to do it would be for me to specify commonly excluded apps -you won't be able to change them (unless you have Tasker and use the Tasker project instead of the APK).

If there's enough demand, I'll add a poll, and we'll see.
 

dgaralon

Member
Jan 26, 2013
7
3
Remove the second wait from the shell command (in the backlight task), as well as the goto action. Make a new task that does this:
- wait for %OFF_TIME
- perform task: backlight, if %RUNNING = 1
- call it 'wait'.
In the backlight task, add this at the end:
Perform task, 'wait', stop: yes.

Basically, the backlight task holds a wake lock, but calls the wait task when it's not blinking the LEDs (which doesn't hold a wake lock).
Considering Tasker sets an alarm to resume after the wait action, it shouldn't cause any problems. And it will probably greatly reduce battery usage.

I've been flashing test ROMs for the last few days and have been busy before that, so I didn't have much time to test it.


I have executed some tests using Tasker because I can not generate an app. I export it as a apk but when I try to install it I get an error analyzing package or somethig similar....

I changed the tasks as you said but still I could see a wake lock , associated to the Tasker process, and android never went to deep sleep mode while the led was blinking. Then I unchecked the Keep Awake option in both task (Backlist and Wait). In this case I got some deep sleep time but the seconds that the led is on or off are sometimes higher that the value defined in config variables (ex. 5 on /5 off). Perhaps it is part of the wake up process required after each sleeping period. Also I have checked that with higher values of ON_TIME and OFF_TIME more deep sleep time I get (ex. 10 on / 10 off)

In my phone, using the charging led (very low battery consumption), maybe the best option is to put a very high value for ON_TIME. In this case I could see the notification light most time while android sleep quietly.

I hope this information can help you.
 

GermainZ

Inactive Recognized Developer / Retired Forum Mod
Aug 3, 2012
6,174
8,800
I have executed some tests using Tasker because I can not generate an app. I export it as a apk but when I try to install it I get an error analyzing package or somethig similar....

I changed the tasks as you said but still I could see a wake lock , associated to the Tasker process, and android never went to deep sleep mode while the led was blinking. Then I unchecked the Keep Awake option in both task (Backlist and Wait). In this case I got some deep sleep time but the seconds that the led is on or off are sometimes higher that the value defined in config variables (ex. 5 on /5 off). Perhaps it is part of the wake up process required after each sleeping period. Also I have checked that with higher values of ON_TIME and OFF_TIME more deep sleep time I get (ex. 10 on / 10 off)

In my phone, using the charging led (very low battery consumption), maybe the best option is to put a very high value for ON_TIME. In this case I could see the notification light most time while android sleep quietly.

I hope this information can help you.
EDIT: (just so no one gets confused: this is about the upcoming version; don't worry about it)

In the modification I described, the wake lock isn't dropped while waiting for ON_TIME anyway, only while waiting for OFF_TIME.
I just flashed a new kernel and I'll try testing some things. Thanks for the help.

EDIT: The extra delay, if I'm not mistaken, should be around 2 seconds. That's because with the changes you made, the proximity sensor is being polled every blink (since the %counter variable is a local variable, it gets reset to 0 when we stop the task and restart it later again). I already changed it, but forgot to mention it earlier.
EDIT2: Removing the wakelock altogether isn't an option on some custom ROMs. It might cause the task to sleep forever.
 
Last edited:

GermainZ

Inactive Recognized Developer / Retired Forum Mod
Aug 3, 2012
6,174
8,800
SC20130129-030414.png
Looks like it works... (BBS' Custom Reference was created just before the LEDs started blinking; ButtonLED's settings: 1s on/15s off)
:D
 
Last edited:

dgaralon

Member
Jan 26, 2013
7
3
View attachment 1685208
Looks like it works... (BBS' Custom Reference was created just before the LEDs started blinking; ButtonLED's settings: 1s on/15s off)
:D

It sounds great. I will check it in my phone as soon as you publish it.

With this solution (Keep Awake in ON_TIME) we only could play with higher values of OFF_TIME (>10s) .... As I said it is not the best solution for me due to I prefer to have more time the led on in order to see the notification most of the time. Perhaps the backlist drains more battery that a simple led. In this case your picture of course is the best.
Maybe you can use the lowest value (ON_TIME or OFF_TIME) in the task that have "Keep Awake" to true and the highest in the other task that allows deep sleep. With this logic people could decide.

Thanks you for your effort.
 
Last edited:

Shyciii

Senior Member
Oct 12, 2011
614
98
OnePlus 7T Pro
Auto Locate/File browser isn't working. My device rooted, busybox also installed. When tap Auto Locate/File Browser nothing happens. I turned on log, but the log file is empty.
My device is Samsung Galaxy S Advance (I9070P).
 

GermainZ

Inactive Recognized Developer / Retired Forum Mod
Aug 3, 2012
6,174
8,800
Auto Locate/File browser isn't working. My device rooted, busybox also installed. When tap Auto Locate/File Browser nothing happens. I turned on log, but the log file is empty.
My device is Samsung Galaxy S Advance (I9070P).

Can you post / PM me a logcat? Note that it might contain some private information (e.g. notifications' titles: SMS contents, WhatsApp contacts, etc), so PM me instead if in doubt.
If the logcat doesn't show anything of use, I'll send you a debuggable APK.

EDIT: Thanks for sending the logcat. I think I've figured out what the problem was. Should be fixed in the next release (working out final details; I'll try uploading it tomorrow).
 
Last edited:

dgaralon

Member
Jan 26, 2013
7
3
Can you post / PM me a logcat? Note that it might contain some private information (e.g. notifications' titles: SMS contents, WhatsApp contacts, etc), so PM me instead if in doubt.
If the logcat doesn't show anything of use, I'll send you a debuggable APK.

EDIT: Thanks for sending the logcat. I think I've figured out what the problem was. Should be fixed in the next release (working out final details; I'll try uploading it tomorrow).

I also detected similar problems with the File Browser & Auto Locate when I executed it. Analyzing the tasks in the Tasker project I could see that the in my case the problem is that my phone has got a busybox installed (pre-root ROM) but I don't have the symlinks for all the commands (ex. grep, sed). So, if you put "busybox sed" it works well but using only "sed" fails because is not in the shell path.
I can not create the symlinks due to the /system file system is read-only and I can not remount it in rw mode.......

Anyway, maybe the best option is to allow to write the brigthness file path directly in a text-box if the other options fails.

Regards.
 
  • Like
Reactions: GermainZ

Silellak

Senior Member
May 17, 2012
1,089
525
Thanks for the work you've done on this app so far!

Out of curiosity, would it be possible to add a feature in a future version so that the hard buttons only flash if the phone is charging? This is the most useful use-case for me on my phone (One XL), because the notification light is always in use while the device is charging.

No big deal if it's not possible, just figured I'd ask. Thanks again! :good:
 

GermainZ

Inactive Recognized Developer / Retired Forum Mod
Aug 3, 2012
6,174
8,800
I also detected similar problems with the File Browser & Auto Locate when I executed it. Analyzing the tasks in the Tasker project I could see that the in my case the problem is that my phone has got a busybox installed (pre-root ROM) but I don't have the symlinks for all the commands (ex. grep, sed). So, if you put "busybox sed" it works well but using only "sed" fails because is not in the shell path.
I can not create the symlinks due to the /system file system is read-only and I can not remount it in rw mode.......

Anyway, maybe the best option is to allow to write the brigthness file path directly in a text-box if the other options fails.

Regards.
I do specify busybox.
I'll add an option to directly write the path as you said (probably not in this next release tho), probably the best thing to do.

Thanks for the work you've done on this app so far!

Out of curiosity, would it be possible to add a feature in a future version so that the hard buttons only flash if the phone is charging? This is the most useful use-case for me on my phone (One XL), because the notification light is always in use while the device is charging.

No big deal if it's not possible, just figured I'd ask. Thanks again! :good:
I'll add it later. Meanwhile, you can set the low battery level to 100% when not charging, and change it to 0% when charging. :)
 

GermainZ

Inactive Recognized Developer / Retired Forum Mod
Aug 3, 2012
6,174
8,800
I tried a few ways to drop the wakelock for ON_TIME, but I kinda discovered a Tasker bug (all of them roughly use the same method, so it's the same bug).
I'll try a few other ways later, but didn't want to keep everyone waiting.

Now, with the amount of changes I've made, I'm afraid I might have broken something, which is why I'm not updating the OP yet.
If you guys can test it (MDPI version, <JB; HDPI devices can still install it BTW, it'll just be small and ugly), it'd be great.

Changes:
  • Wake locks are released while the LEDs are off and ButtonLED is waiting;
  • Sleep timer is fixed. The current value is also displayed when changing the sleep start/end times;
  • Tapping on a log entry will give you the option to add that notification to the exclusion list;
  • ButtonLED will give you the choice to install Busybox if it's not found;
  • File Browser/Auto Locate issues might be fixed for users who were having them (pressing File Browser did nothing at all even if Busybox is installed). Please try it if you were having this issue.

If nothing serious is reported, I'll upload the rest ASAP. Thanks!
 

Attachments

  • ButtonLED.1.5.test.apk
    712.1 KB · Views: 61

afwolfpacked

Senior Member
Mar 6, 2012
889
286
Delran, NJ
Re: [APP][ROOT][1.6-4.x] ButtonLED v1.4 (19/01/12)

Works great on sgh t679 Samsung galaxy exhibit 4g HDMI

As you stated the graphics aren't HDMI and looks funny.

SMS with no subject shows in log ad ntitle and gives entry for each flash.

Option to exclude works by line in log

Start/stop sets but haven't tried when say 10pm till 6am goes past day but see no reason it wouldn't.


Sent from my SGH-T679 using xda premium
 
Last edited:

travisjustin

Senior Member
Jan 27, 2013
210
82
App isn't showing up in accessibility for me to enable. HTC one s running 4.2.1 baked7 ROM.

(Edit) Had it working fine previously under 4.1 using cm10.
 
Last edited:

travisjustin

Senior Member
Jan 27, 2013
210
82
Re: [APP][ROOT][1.6-4.x] ButtonLED v1.4 (19/01/12)

Reinstall worked. Do you still want the logcat?

Sent from my HTC One S using xda app-developers app
 

chokitodopoder

Senior Member
Jul 1, 2011
111
35
Re: [APP][ROOT][1.6-4.x] ButtonLED v1.4 (19/01/12)

I'm going to test here. My only requests are that it keeps blinking as long as there are unread notifications, whether the screen goes on and off, and stop blinking if the notification is removed by the system without my interaction, e.g. it starts blinking when I receive a mail, but before I notice it, i've already deleted it on my pc. So the phone clean the notification, but the buttons keep blinking.

I don't know anything about java or Android, but I've read some things about firmwares and mods. Have you ever thought about seeing how notification leds works on phones that have them and just adapt it to the hw buttons? If possible to just change the address of the hw leds, like we do in ButtonLed choosing the path to ours, it could solve the battery drains and these things I've mentioned before, maybe ofc.

Sent from my GT-P1010 using xda app-developers app
 
Status
Not open for further replies.

Top Liked Posts

  • There are no posts matching your filters.
  • 183
    I'm not planning to update this app anytime soon. You can try alternatives if you want, such as Backlight & Sound Notification. Thanks. :D
    Read the FAQ before asking questions. If you haven't read it, my only reply will be "Does the FAQ help?"
    You do NOT need a kernel with BLN support to use this app. In fact, I made this because my device has no BLN kernels.
    Also, a quick note for those who are gonna read the comments: The attached MDPI/HDPI versions look fine on respective devices. The first version of ButtonLED was only available for MDPI, which should explain the first few comments.

    Hey guys,

    I've been fiddling around Tasker for the last few weeks and finally decided to create a fully functional app using it.
    At this point, some of you will be thinking "another useless, ugly, cluttered Tasker created app that does something nobody needs".
    Well, then, I'll try to prove you wrong ;)
    You do NOT need Tasker to use the app.

    App Description:
    ButtonLED is similar to NoLED: It allows you to have led like notifications without actually having the led light. However, NoLED uses uses your screen; ButtonLED only uses the hardware buttons' backlight (your screen stays off). It's customizable to an extent, with more to come depending on feedback and suggestions.

    Features:
    • status bar notifications + missed call/unread text support;
    • pause for some user defined time on proximity (e.g. If phone is turned down, or is in your pocket);
    • turn button backlight for x seconds, then off for y seconds;
    • notification exceptions (e.g. To ignore all notification that contain "hello", add *hello* to the exception list);
    • logs;
    • should work on all devices since the user can locate the brightness file;
    • and some more (check the screenshots, install the app).

    Compatibility:
    It should work on all rooted devices (some devices have a kernel level limitation; read the FAQ). At the moment, you'll also need to have a proximity sensor to run it. It should work without having to do (almost) anything manually for many devices. If auto locate doesn't find anything useful, you'll have to manually locate the brightness file. Please share the results when you do that so i can improve the auto locate feature.

    Running The App:
    install and open the app. You should be greeted by a popup showing you a list of files. Select the most appropriate (you're looking for something that has a path such as "/sys/devices/platform/bcm21553-leds/leds/button-backlight/brightness). Once you're done, click "enable buttonled in accessibility" and do so. Come back to buttonled and tap the "test buttonled" button. If your capacitive buttons flash, you're good to go. Otherwise, you will need to select a different brightness file (use auto locate or do it manually).
    You may also want to customize the options.
    Some examples for the brightness file:
    Code:
    I'll update this list later.
    Auto Locate will not follow symlinks as it can cause infinite loops or imprecise results (if it doesn't search deep enough). Usually, /sys/class/leds will have symlinks to all LEDs, backlight included. Check it out.

    Screenshots (actual release is slightly different):
    SC20121025-223105.pngSC20121025-223223.pngSC20121027-202338.pngSC20121027-202341.pngSC20121027-202357.pngSC20121027-202421.pngSC20121027-202440.png

    Changelog:
    v1.6 (05/05/13):
    • You can now ignore apps as well.
    • The battery tweak can be disabled on devices where ButtonLED was flashing the LEDs once or twice before sleeping forever.
    • You can long press log items to view the full text, for items that didn't fit.
    • Proximity sensor feature is now disabled (it wasn't working anyway due to a Tasker limitation) (the UI option is still listed as "FEATURE DISABLED"). This should have a minor but positive impact on performance/battery.
    • Minor UI changes.
    • Other minor changes.

    v1.5 (24/02/13):
    • Wake locks are released while the LEDs are off and ButtonLED is waiting;
    • Sleep timer is fixed. The current value is also displayed when changing the sleep start/end times;
    • Tapping on a log entry will give you the option to add that notification to the exclusion list;
    • ButtonLED will give you the choice to install Busybox if it's not found;
    • File Browser/Auto Locate issues might be fixed for users who were having them (pressing File Browser did nothing at all even if Busybox is installed). Please try it if you were having this issue.
    • Added XHDPI version for everyone. Also added MDPI for JB/CM10 users.
    v1.4 (19/01/13):
    • Manual search is now as fast as other file explorers (busybox is required);
    • Sleep start/end added (ButtonLED will not react to notifications during that time);
    • Confirmation added before removing exceptions;
    • Fixed a (rare?) issue where ButtonLED kept blinking the lights after the screen is turned on;
    • Might be more battery efficient if using higher LED Off delays, not sure. But if it is, it will be much better (more testing needed);
    v1.3.1 (03/12/12):
    • ButtonLED will stop notifying you about missed calls and unread texts when you turn your screen on, instead of continuing till you view them;
    • Auto Locate will now simply search /sys for the brightness file. That means it will locate more files, across more devices. It's also faster;
    • Fixed the bug where ButtonLED would forget resuming once the battery drops below the threshold then go above it again.
    v1.3 (03/11/12):
    • Stop service and exit menu option;
    • Ignore notifications if battery is lower than threshold;
    • Fixed exceptions not taking effect;
    • Changed the path auto locate looks into. Hopefully, this will make it work for more devices;
    • Two versions are now available, one for mdpi devices, the other for hdpi devices (thanks for .xxx. for testing).
    v1.2 (27/10/12):
    • Rewrote most of the logic;
    • Better handling of events;
    • Less battery consumption and more accurate logs;
    • Logs now show battery percentage on processed notifications, screen on (if notifications are pending) and device shutdown, which should give users an idea about battery consumption;
    • Fixed logs showing skipped notifications as processed (e.g. Notifications that were issued with the screen turned on were skipped but shown as processed in the logs);
    • Auto Locate brightness file option (beta; need more device specific info to tweak the search);
    • Separated missed call from unread text notifications;
    • Run with higher task priority, should avoid lag (uses the renice linux shell command).
    v1.1 (24/10/12):
    • Missed call/unread text notifications support;
    • Optional permanent notification;
    • Option to use flashlight instead of the hard buttons' led light;
    • Test button that will turn on and off the led/flashlight;
    • Other minor modifications and fixes.
    (original beta thread)


    To Do:
    • Landscape support;
    • Patterns?
    • This list is updated based on your feedback. Want to see a feature? Suggest it!

    Bugs:
    • Proximity sensor doesn't have any effect;
    • This list is updated based on your feedback. Thanks for reporting any bug you find.

    Downloads:
    Don't forget to post your comments!
    Get ButtonLED
    Jelly Bean/CM10 users, get the "ButtonLED.x.x.XXXX_JB.apk".
    Everyone else, download "ButtonLED.x.x.XXXX.apk".
    Don't know which APK to grab? Read the FAQ for info on how to determine your resolution (MDPI, HDPI, XHDPI, ..).
    You can find previous versions here.

    Tasker Project:
    You can get the Tasker project if you prefer, it offers the same functionality but will run inside Tasker instead of being a separate app.
    You need Tasker (pre-ICS versions only) and the Holo Light IPack icon pack to use this.
    Grab the appropriate project file from here.
    Place the XML file in your SD Card (e.g. mnt/sdcard/tasker/projects/) and open Tasker. Long tap on an existing project (if you can't see the projects bar, disable beginner mode in Tasker's settings, then swipe down from the "projects"/"tasks"/"scenes"/"variables" bar), select "import", then tap on the file's name (e.g. buttonled.hdpi). You should see a new project appear with ButtonLED's icon. Apply the changes by tapping on the green check mark in the bottom left corner, then open Tasker again.
    To open ButtonLED's configuration menu, run the task named "config".
    ~~~~
    17
    FAQ:

    Q: It's not detecting my brightness file!
    A: Apparently, if you have a kernel with BLN support, you don't have one. Otherwise, try searching manually or asking on your device's forum. And to make sure auto locate didn't miss something, you can run this in a terminal emulator (this will also expand the search so expect some weird results):
    Code:
    find / | grep brightness
    It's worth noting that Auto Locate will not follow symlinks as it can cause infinite loops or imprecise results (if it doesn't search deep enough). Usually, /sys/class/leds will have symlinks to all LEDs, backlight included. Check it out.

    Q: The test button works fine, but ButtonLED won't react to my notifications.
    A: make sure ButtonLED is enabled in accessibility. Also, check ButtonLED's logs. Is it detecting the notifications? Is it reacting to them, but you fail to see it? If that's the case, try increasing the led on duration.

    Q: Can i use this with application xyz (e.g. Whatsapp)?
    A: if the application sends notifications, yes. ButtonLED will automatically detect them.

    Q: Should i get the MDPI or HDPI APK?
    A: if your device's density is ~160, get the MDPI APK. If it's ~240, download the HDPI APK. If you don't know, download an app from the market that will show you (e.g. screen resolution), or grab the MDPI APK and if it looks squished, uninstall it then install the HDPI APK.

    Q: Battery usage is too high!
    A: ButtonLED will hold a wakelock when it's flashing the LEDs. Configure it to ignore notifications you don't care about (turn the logs on, and use exceptions). See this post.

    Q: Auto Locate/File Browser isn't working!
    A: Try installing Busybox.
    Also make sure ButtonLED has root permissions - check your SU app, and try to revoke permissions then give them back.
    If that fails, it might be related to how Tasker checks if your device is rooted:
    Tasker decides that a device is rooted if /system/app/Superuser.apk is present and su is present in one of the directories of $PATH

    Q: Test works, and the logs show that ButtonLED detects and processes my notifications, but it won't light my LEDs!
    A: Check this out.

    Q: Talkback is talking randomly even when I have it disabled!
    A: That's a known Samsung issue. It's not related to ButtonLED.

    Q: How do I ask for help?
    A: What have you tried? Did you do anything covered in this FAQ but it didn't help? Have you read the last few pages of comments? If you don't answer any of these questions, I'll assume you haven't read this FAQ and my reply will be "Read the FAQ".
    ~~~~
    5
    Ah, thanks for the hint! Maybe that is my problem: I thought it would only notify me about missed calls (and messages if on), but in fact it is turned on with every single task (even if it's without notification). So I use LUX for brightness control and ButtonLED reacted with the lux brightness check (stupid, but lux does this check even if the screen is off, can only be seen in ButtonLED logs... :silly: )... I now configured it as exception, hope it will help battery drain :)

    How can i configure sleep hours? Can't find this option in ButtonLED...
    It's not implemented yet. I just finished adding it and trying to test it for a bit.

    1.3.1 hdpi is working without issue on my HTC EVO 4G LTE, running super jelly 4.1.2 jb. This is pretty awesome!

    Sent from my HTC EVO LTE
    Just to know, are you using the normal APK or the one posted in the beginning of the post?

    This app is incredibly useful and i could uninstall all my other apps , but not this one .
    it runs perfect on my Galaxy gio AOSP ics
    All :good: for you
    Glad you like it :D



    V1.4 Current Changes (just a teaser; I'll try uploading it in the next few hours):
    • Manual search is as fast as other file explorers now; busybox must be installed.
    • Sleep start/end added (ButtonLED will not react to notifications during that time).
    • Confirmation added before removing exceptions.
    • Sometimes ButtonLED used to keep blinking the lights after the screen is turned on. Fixed.

    I tried focusing on urgent issues.
    4
    Added v1.5. Changelog:
    • Wake locks are released while the LEDs are off and ButtonLED is waiting;
    • Sleep timer is fixed. The current value is also displayed when changing the sleep start/end times;
    • Tapping on a log entry will give you the option to add that notification to the exclusion list;
    • ButtonLED will give you the choice to install Busybox if it's not found;
    • File Browser/Auto Locate issues might be fixed for users who were having them (pressing File Browser did nothing at all even if Busybox is installed). Please try it if you were having this issue.
    • Added XHDPI version for everyone. Also added MDPI for JB/CM10 users.

    I've updated the FAQ as well, regarding Accessibility/Talkback issues.
    Also, APKs are now uploaded to dropbox because I've reached the file number limit on XDA. :D

    For those who were having issues with ButtonLED never waking up again, I'm not sure why that's happening. I'll try to look into it. Meanwhile, an easy fix would be to grab the Tasker project, and edit the "Wait" task (tap the Preferences icon, then "Keep Device Awake").