FORUMS
Remove All Ads from XDA

[APP] LG 2X/Black Notifications

15 posts
Thanks Meter: 29
 
By xigzil, Junior Member on 15th June 2011, 07:37 PM
Post Reply Email Thread
9th December 2012, 01:43 PM |#101  
Member
Thanks Meter: 15
 
More
Quote:
Originally Posted by rmein

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!
 
 
9th December 2012, 05:28 PM |#102  
rmein's Avatar
Senior Member
Thanks Meter: 193
 
More
Quote:
Originally Posted by ergosum

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.
10th December 2012, 12:23 AM |#103  
fakeasd's Avatar
Member
Thanks Meter: 14
 
More
Quote:
Originally Posted by ergosum

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
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
10th December 2012, 07:42 AM |#104  
rmein's Avatar
Senior Member
Thanks Meter: 193
 
More
Quote:
Originally Posted by fakeasd

first off thanks for the modification, it's something i was really missing in ics stock roms
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.
The Following User Says Thank You to rmein For This Useful Post: [ View ] Gift rmein Ad-Free
10th December 2012, 08:51 PM |#105  
Member
Thanks Meter: 15
 
More
Quote:
Originally Posted by fakeasd

first off thanks for the modification, it's something i was really missing in ics stock roms
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?
The Following User Says Thank You to ergosum For This Useful Post: [ View ] Gift ergosum Ad-Free
10th December 2012, 09:37 PM |#106  
fakeasd's Avatar
Member
Thanks Meter: 14
 
More
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
11th December 2012, 10:25 AM |#107  
rmein's Avatar
Senior Member
Thanks Meter: 193
 
More
Quote:
Originally Posted by fakeasd

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
11th December 2012, 12:41 PM |#108  
fakeasd's Avatar
Member
Thanks Meter: 14
 
More
Quote:
Originally Posted by rmein

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...
11th December 2012, 01:50 PM |#109  
rmein's Avatar
Senior Member
Thanks Meter: 193
 
More
Quote:
Originally Posted by fakeasd

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-...ifications.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.
11th December 2012, 03:25 PM |#110  
Senior Member
Thanks Meter: 47
 
More
Quote:
Originally Posted by fakeasd

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.
11th December 2012, 07:44 PM |#111  
Member
Thanks Meter: 15
 
More
Quote:
Originally Posted by rmein

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
The Following 3 Users Say Thank You to ergosum For This Useful Post: [ View ] Gift ergosum Ad-Free
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes