[APP] LG 2X/Black Notifications

Search This thread

ergosum

Senior Member
Jul 28, 2010
86
16
That looks like it is working fine now, but I don't really understand how it could have been broken in the first place. What changes did you make to get it working originally?

As far as I can see it would have needed a new src/com/martinborjesson/o2xtouchlednotifications/touchled/devices/TouchLEDP990ics.java file based on the original TouchLEDP990 file, but with the new location of the brightness file. You would also need a couple of extra lines in the src/com/martinborjesson/o2xtouchlednotifications/touchled/TouchLED.java file:

That is what happened with previous commits to add support for new devices, I still haven't had time to set up an android SDK environment yet, so haven't done any proper testing.

That's what I thought. Briefly, this is what I've done.

In the v1, I had just modified the TouchLEDP990.java to test the existence of the new WLED_FILE (ICS) and the old, to keep compatibility. Now it works when it started as an app, but when booting, the service was always waiting for the process (su + chmod) to close. So I removed the process.waitFor, because adding an "exit\n" doesn't do it. (The new process wouldn't end.) So now the service starts, but it does nothing. I believe it is because the hasPermission returned false since the native process didn't wait the chmod to be done. So, I had to make the hasPermission return always true, otherwise the service wouldn't wait for chmod to be done.

So I did change the touchled file, and modified the superuser.java to remove the process wait. If you have the time to find another solution, good luck!
 
Last edited:

rmein

Senior Member
May 9, 2011
189
193
That's what I thought. Briefly, this is what I've done.

In the v1, I had just modified the TouchLEDP990.java to test the existence of the new WLED_FILE (ICS) and the old, to keep compatibility. Now it works when it started as an app, but when booting, the service was always waiting for the process (su + chmod) to close. So I removed the process.waitFor, because adding an "exit\n" doesn't do it. (The new process wouldn't end.) So now the service starts, but it does nothing. I believe it is because the hasPermission returned false since the native process didn't wait the chmod to be done. So, I had to make the hasPermission return always true, otherwise the service wouldn't wait for chmod to be done.

So I did change the touchled file, and modified the superuser.java to remove the process wait. If you have the time to find another solution, good luck!

I think it would take someone a bit more experienced than me to find a better solution than your workaround. I'll have a look into it, but I really can't figure out why it isn't behaving the way it did on gingerbread.
 

fakeasd

Member
Jan 8, 2011
35
14
I am still trying but for some reason, it doesn't work.

I have tried to contact the author by PMing him. I don't have his email and I don't have rights to commit in his github I believe (I created an account just for that purpose).





Wait !!! I think I found a way. It's not clean, but it works...


Update:
Here, v2. It will work but not immediately after boot, just wait like 1 minute. Now you don't have to open the app to make the notification work.
https://www.box.com/s/u4jbet743l9okz33f4fr
first off thanks for the modification, it's something i was really missing in ics stock roms :good:
i'm running your modified apk and it auto starts with no issues, but i'm not able to make the touch led notifications working, what am i doing wrong? what should i check? i'm using stock ics rom v30a modified by topogigi
 

rmein

Senior Member
May 9, 2011
189
193
first off thanks for the modification, it's something i was really missing in ics stock roms :good:
i'm running your modified apk and it auto starts with no issues, but i'm not able to make the touch led notifications working, what am i doing wrong? what should i check? i'm using stock ics rom v30a modified by topogigi

Try installing the first version, and then the second version over it. I don't think the second version will ask for superuser permission initially.

Finally got round to installing the SDK and eclipse, so I'll see if I can figure out what's going on.

I can confirm that the chmod is certainly successful even though the program hangs, though it should not really be necessary on each boot. I think the real problem is in checking the permissions. You should only need to run the chmod if the file permissions have been reset by installing a new rom or something like that.
 
Last edited:
  • Like
Reactions: fakeasd

ergosum

Senior Member
Jul 28, 2010
86
16
first off thanks for the modification, it's something i was really missing in ics stock roms :good:
i'm running your modified apk and it auto starts with no issues, but i'm not able to make the touch led notifications working, what am i doing wrong? what should i check? i'm using stock ics rom v30a modified by topogigi

-does the application see the phone as a p990?
-do you have access to the LED light bar? (the one where you can modify the LED luminosity from 0 to 20)
-does the default feedback test work?

If it is yes to all theses questions, you might check the log option and send it here (there shouldn't be sensitive information there).
If you know how to, could you give the the /sys/devices/platform/star_led/leds/star_led/brightness permissions?
 
  • Like
Reactions: fakeasd

fakeasd

Member
Jan 8, 2011
35
14
it works! i had to manually modify /sys/devices/platform/star_led/leds/star_led/brightness permissions, the app itself doesn't ask for su permissions and therefore is not checking brightness perms (?)

thanks for the hints guys :)
 

rmein

Senior Member
May 9, 2011
189
193
it works! i had to manually modify /sys/devices/platform/star_led/leds/star_led/brightness permissions, the app itself doesn't ask for su permissions and therefore is not checking brightness perms (?)

thanks for the hints guys :)

I'm running my own build of this at the moment, with support for the P990 enabled. I tried installing SuperSU instead of Superuser, and everything loads perfectly well on boot. The rom I am using is just stock v30a rooted with su though CWM, and not a custom one.

I spotted a post from Rohanajoshi in the DjangoManouche ICS thread saying there was a problem with superuser: apps dont get root access when settings are like "automatic response => Allow"


SuperSU solves this problem and lets the service run properly on boot. So if you're on the topogigi rom just download ergosum's first version and it should work.

edit:
I spoke too quickly there. I had problems with SuperSu for a bit and broke the app completely. Managed to fix SuperSU, then a reinstall of the app and everything works great
 
Last edited:

fakeasd

Member
Jan 8, 2011
35
14
I'm running my own build of this at the moment, with support for the P990 enabled. I tried installing SuperSU instead of Superuser, and everything loads perfectly well on boot. The rom I am using is just stock v30a rooted with su though CWM, and not a custom one.

I spotted a post from Rohanajoshi in the DjangoManouche ICS thread saying there was a problem with superuser: apps dont get root access when settings are like "automatic response => Allow"


SuperSU solves this problem and lets the service run properly on boot. So if you're on the topogigi rom just download ergosum's first version and it should work.

edit:
I spoke too quickly there. I had problems with SuperSu for a bit and broke the app completely. Managed to fix SuperSU, then a reinstall of the app and everything works great
topogigis modified ics, the custom rom i'm currently using, comes with supersu and the first version you are talking about is offline...
 

rmein

Senior Member
May 9, 2011
189
193
topogigis modified ics, the custom rom i'm currently using, comes with supersu and the first version you are talking about is offline...

Here's a copy of my version then. This will fail to start the service on boot if you have the superuser app, but should work fine if you have the SuperSU app.

My changes are here: https://github.com/rmein/LG-Optimus-2X-Black-Notifications.git

If we can be sure the bug is in the Superuser app rather than the Notification app, then I should probably try pushing the changes to the original author and see if he is interested in updating it. I'll have a look at it in more detail at the weekend to see if I can spot why it works with one and not the other.
 

Attachments

  • com.martinborjesson.o2xtouchlednotifications-2.apk
    115.9 KB · Views: 131

thewoZa

Senior Member
May 19, 2010
262
49
it works! i had to manually modify /sys/devices/platform/star_led/leds/star_led/brightness permissions, the app itself doesn't ask for su permissions and therefore is not checking brightness perms (?)

thanks for the hints guys :)

This worked for me but only after I had installed the version from Play Store, allowed su permissions, gone into Super SU, made sure it didn't have to ask for permissions again when upgraded, uninstalled Play Store version then installed modified version no 2.
 

ergosum

Senior Member
Jul 28, 2010
86
16
I'm running my own build of this at the moment, with support for the P990 enabled. I tried installing SuperSU instead of Superuser, and everything loads perfectly well on boot. The rom I am using is just stock v30a rooted with su though CWM, and not a custom one.

I spotted a post from Rohanajoshi in the DjangoManouche ICS thread saying there was a problem with superuser: apps dont get root access when settings are like "automatic response => Allow"


SuperSU solves this problem and lets the service run properly on boot. So if you're on the topogigi rom just download ergosum's first version and it should work.

edit:
I spoke too quickly there. I had problems with SuperSu for a bit and broke the app completely. Managed to fix SuperSU, then a reinstall of the app and everything works great

Hmm thanks for the explanation. I had a feeling SuperUser wasn't working very well too. Here is the v1 for people who changed to SuperSu. (I removed it thinking it wouldn't work.)
https://www.box.com/s/locjbo8j2j5l44kyrn0z
 

rmein

Senior Member
May 9, 2011
189
193
Hmm thanks for the explanation. I had a feeling SuperUser wasn't working very well too. Here is the v1 for people who changed to SuperSu. (I removed it thinking it wouldn't work.)
https://www.box.com/s/locjbo8j2j5l44kyrn0z

I have just tried it on the new CM10 build, and my version works fine with the ordinary superuser app there. There's something odd going on with superuser and the LG ICS builds.
 
  • Like
Reactions: ergosum

ergosum

Senior Member
Jul 28, 2010
86
16
I have just tried it on the new CM10 build, and my version works fine with the ordinary superuser app there. There's something odd going on with superuser and the LG ICS builds.

Ok, I have tried the v1 and SuperSU and it works. I think this is the best and cleanest way to get TouchLED Notifications. Besides, SuperSU fixed another issue I had with LBE. Thanks again!
 

rmein

Senior Member
May 9, 2011
189
193
I've been messing around trying to pin down the superuser bug. A couple of observations:

canWrite() on the brightness file initially returns False, even though the correct permissions have been set and the file is writeable by the application. This happens with both superuser and SuperSU. On CM10 roms, it initially returns the correct value. I have a feeling that if I can fix this bug, everything will work fine again.

With superuser, permission is granted and the chmod works, but the process does not close (bug in superuser I think).
 

ergosum

Senior Member
Jul 28, 2010
86
16
I've been messing around trying to pin down the superuser bug. A couple of observations:

canWrite() on the brightness file initially returns False, even though the correct permissions have been set and the file is writeable by the application. This happens with both superuser and SuperSU. On CM10 roms, it initially returns the correct value. I have a feeling that if I can fix this bug, everything will work fine again.
I don't understand: with SuperSU in stock ICS roms, the application works fine. In CM10, you said it works too (without SuperSU). Home come the canWrite returns a wrong value and the application still works?
With superuser, permission is granted and the chmod works, but the process does not close (bug in superuser I think).
Yes, I have the same opinion. Especially if another application (LBE) didn't work with SuperUser and works now with SuperSU.
 

Cristi_86

Member
Nov 11, 2012
7
0
it works! i had to manually modify /sys/devices/platform/star_led/leds/star_led/brightness permissions, the app itself doesn't ask for su permissions and therefore is not checking brightness perms (?)

thanks for the hints guys :)

I tried this, I set the brightness to 7, but it worked until the lights went out for the first time, then the brightness value returned to 25.
Why?

I have Official ICS V30a.
 
Last edited:

ergosum

Senior Member
Jul 28, 2010
86
16
I tried this, I set the brightness to 7, but it worked until the lights went out for the first time, then the brightness value returned to 25.
Why?

I have Official ICS V30a.

Which version did you use? (my version v1 or v2, or rmein's apk?)
Do you mean the application works but the first time, the brightness' value is 7, and next time 25? Or it works only the first time?
Can you check the file's permission is rw rw rw ?
 

Cristi_86

Member
Nov 11, 2012
7
0
Which version did you use? (my version v1 or v2, or rmein's apk?)
Do you mean the application works but the first time, the brightness' value is 7, and next time 25? Or it works only the first time?
Can you check the file's permission is rw rw rw ?

I use v2 and the file permission is rw rw rw.

I open the file "btightness" with any text editor and i see that the default value is 25. than i set the value to 7 and save the file. The brigness level remains to 7 until the touch key lights turns off for the first time. When i touch the screen again the lights are brighter and if i open the file, the value is reset to 25.
But if I go to Settings => Display => Brightness => Front key light, and turn it off, the brightness value remains at 7 but the lights remain lit all the time, even in deep sleep.
It has to do with the kernel that automatically overwrites the value, and when i disable them from settings, the kernel already consider them off even if the LED Notification use them?
 

ergosum

Senior Member
Jul 28, 2010
86
16
I use v2 and the file permission is rw rw rw.
First of all, you should replace SuperUser by SuperSU and use either the v1 or rmein's version (it's the same).
I open the file "btightness" with any text editor and i see that the default value is 25. than i set the value to 7 and save the file. The brigness level remains to 7 until the touch key lights turns off for the first time. When i touch the screen again the lights are brighter and if i open the file, the value is reset to 25.
But if I go to Settings => Display => Brightness => Front key light, and turn it off, the brightness value remains at 7 but the lights remain lit all the time, even in deep sleep.
It has to do with the kernel that automatically overwrites the value, and when i disable them from settings, the kernel already consider them off even if the LED Notification use them?
"Front key light" in the settings and the application are independent. You can set the brightness of the application to be whatever you want and independently from the brightness of the "front key light".

Now I think you don't understand how the application works: each time you get a monitored notification and you don't touch your phone, you will get a light notification (constant or dynamic ...). Once you press a button, the light notification disappear, until another monitored notification.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 23
    Hi everyone !

    LG 2X/Black Notifications is an app that handles incoming notifications and uses the LED buttons on the device to notify the user of any missed notifications. LG Optimus 2X (P990/P999/SU660), LG Optimus Black (P970) and LG Optimus 3D (P920) is supported. It does not require root if the required files has the proper permissions, if they do not root is required to change them (currently the latest update for T-Mobile G2x and LG Optimus 3D). It should be usable on all ROMs (not tested though). CyanogenMod7 has its own LED-notifications which has to be disabled if you wish to use this app.

    Features
    • Built-in support for Gmail/SMS/MMS/Missed calls
    • Support for any activity that generates notifications by using Accessibility
    • Configurable pulse and vibration for every notification
    • Set the default touch LED brightness
    • Charging indicator

    How the app works
    • The app is in an idle state and will do nothing until the device receives a notification.
    • When an notification is received and the screen is on and not in lock-screen, the accelerometer sensors will be started and used as a way to detect user activity. If the sensor is triggered the feedback will be cancelled. If the sensor is not triggered and the screen is turned off the feedback will start.
    • If the screen is off the feedback will be delayed for 2 seconds. The reason for this is because some notifications might turn on the screen and in turn will cancel the feedback, so the delay will hopefully prevent this. If nothing happens during the delay the feedback starts at once.
    • The feedback will repeat until it is timed out or the screen is turned on.

    If you have any questions and/or bugs to report about the app don't hesitate to post a reply to this thread or send me a message and I'll answer them as soon as possible. I'm also open for suggestions of features to implement. However due to limited time at the moment new features may take a while to be implemented.

    Download

    For more information and free download check it out on the Android Market.

    / Martin Börjesson
    6
    Tell me what and where to modify. I can create the apk

    Enviado desde mi LG-P990 usando Tapatalk 2

    It's ok, I have create an Apk file for people who don't want to recreate the file. I made the file completely compatible with ICS and GB rom. But you need to uninstall the old app before this one.



    Here: https://www.box.com/shared/hy5h68p85gfroaj781pe

    Update: this is the v1 and I deleted the app, the v2 is below.
    Update2: better use either the v1 in the last post (or rmein's version) with SuperSU. It is cleaner this way.

    It would be great if the owner of both this topic and the github repository update the application

    Mr. Börjesson, please give me your email so that I send to you the new java file.
    3
    I'm running my own build of this at the moment, with support for the P990 enabled. I tried installing SuperSU instead of Superuser, and everything loads perfectly well on boot. The rom I am using is just stock v30a rooted with su though CWM, and not a custom one.

    I spotted a post from Rohanajoshi in the DjangoManouche ICS thread saying there was a problem with superuser: apps dont get root access when settings are like "automatic response => Allow"


    SuperSU solves this problem and lets the service run properly on boot. So if you're on the topogigi rom just download ergosum's first version and it should work.

    edit:
    I spoke too quickly there. I had problems with SuperSu for a bit and broke the app completely. Managed to fix SuperSU, then a reinstall of the app and everything works great

    Hmm thanks for the explanation. I had a feeling SuperUser wasn't working very well too. Here is the v1 for people who changed to SuperSu. (I removed it thinking it wouldn't work.)
    https://www.box.com/s/locjbo8j2j5l44kyrn0z
    2
    Hi,
    I do not speak English, so I am sorry for my bad English.
    I have a P920 and I installed this app, but it does not run. I make a missed call to myself, but the leds do not light.

    Thank you very much!

    Your English is fine :)
    Have you rooted your phone ? You could check out the thread in the Optimus 3D-subforum, there is currently another developer working with the app for the P920 and he might be able to help you out.

    Hi,

    This app is working on gr 4 but each time I reboot, I've a message that says ' superuser permissions refused for LG 2X./Black .....'

    Sent from my LG-P990

    That sounds strange, it seems the Superuser-app might be configure wrong for the app. If you open the Superuser-app then you can perhaps change so it wont refuse permissions for the app.

    I was using this great app with LG Optimus Black stock roms like v10b/c/e, but i can't do it with CM7 nightlies right now. Everytime I open app it says "App detected it has no read or write access to a required file, do you wish to fix this?" I click OK, but still doesn't work.

    This message appears everytime I open the app. What could be the problem here?

    Thanks in advance.

    What happens when you click OK ? Does it say anything or does it seem to work normally ? Did you ever get a question about allowing Superuser-permissions ?
    CM7 have their own notification built-in so there might be a conflict, you could try and disable it.

    Love the app, just what my G2x needs. Your hard work and dedication are much appreciated.
    I do, however, have one problem maybe you or the other fine members of this forum can help me with.
    I have a notification ringtone set to go off every 5 minutes after a missed notification. Works great, I love it, wish I had it earlier. However, in the morning it goes off because of the battery 100% notification. Is there a fix, workaround, or setting that I'm missing? (I've searched quite a bit but only see discussions with the SGS2) As long as the circuitry shuts down, I don't care about that notification.

    I never experienced this. Are you using a third party-app that puts a notification in the notification bar when the battery is fully charged ? If so you might have to exclude that activity (Notifications -> Exclude activities). If you're uncertain which activity it is you can log notifications in the Advanced-menu and then check the log when it happened again.

    @xigzil

    How to fully disable the accelerator/g-sensor for power saving ?

    why do you have this build in?

    without this, i would say its a wonderful valueable app ,with it have to deinstall the app ):-

    thanks

    The accelerometer can't be disabled. It is used by the app to determine if the phone is being used. For example, you're writing an e-mail on your phone and gets an SMS. At this point the app enables the accelerometer to detect user activity, if it detects activity (by movement of the phone) it disables the accelerometer and doesn't do anything more. If the accelerometer were to be disabled it would start the notification as soon as the screen turns off since it doesn't know if the phone has been used at any point after the notification has been received, which would be quite bothersome.
    It might not be the best solution but I haven't found anything else and it works pretty well.

    Normally this shouldn't use a lot of battery at all though, since when it is started it is usually only enabled for a couple of seconds. Does it use an unusual amount of battery for you ?
    1
    Thanks!! I've been using this since beta 0.3

    Just a request...

    Can accelerometer be disabled ? Cos i may be picking up the phone but not looking at the screen at all.

    And, can the App icon be reverted to have transparent background (like in the early betas)

    Cheers

    Sent from my LG-P990 using XDA App

    An option to disable accelerometer could be added, but then you would get the pulse for every incoming notification even if you've looked at them (if you were using the phone when you got them). The accelerometer is disabled when the screen is off or in the lock-screen (if you use another lock-screen than the default this might not be true though) so that if you receive a notification and then move your phone around without unlocking it the pulse should still start. So generally the accelerometer shouldn't be a problem, but if you really want an option for it I could add one :)

    I changed the appearance of the icon since it couldn't be seen on Market because it has a white background. I also preferred the old look :) But it might be possible to fix it somehow, I'll note it down and look at it when I have time.