yashsingh1/xdaforums huggingface dataset:
[Desire HD Android Development] alienmind:
I think there are 2 possibilites here:

- METHOD 1: Implement what we have to do on an app. An AccesibilityService should be implemented. See http://developer.android.com/reference/android/accessibilityservice/AccessibilityService.html there's a TYPE_NOTIFICATION_STATE_CHANGED that may be interesting. Then we can do there whatever we want with the lights. This is the simpler approach.

- METHOD 2: Implement everything framework side. This is far more tricky, below my findings (mostly found as I type):

For what I can see, LIGHT_ID_BACKLIGHT is the backlight of the buttons...

This is just a supposition, but looks like BLN support is already in place on DHD (it is already on crespo - nexus s, and that's what I tested). There's a device dependent lights.c with BLN code implemented as a valid alternative to blinking LED, and looks like in ACE code it is too. lights.c contains the path to the (device dependent) sysfs file to actually turn on the lights. See device/samsung/crespo/liblight/lights.c or device/htc/ace/liblight/lights.c

In both implementations, open_lights() accepts name == LIGHT_ID_BACKLIGHT (LIGHT_ID_NOTIFICATION uses the LED)

open_lights() is called from JNI module com_android_server_LightsService.cpp.

It actually opens all available lights sources. setLight_native() will be called to turn on the light (specified by int light)

On NotificationManagerService the actual light is opened and turned on. See the file NotificationManagerService.java, line 406, where LIGHT_ID_NOTIFICATIONS should be changed to LIGHT_ID_BACKLIGHT

I think the second approach may be more definitive if we add also a setting on CMParts to set if we use BLN or LED or both...

But for sure a quick test using the first method would be faster

What do you think?
[Desire HD Android Development] alienmind:
I think something changed google-side a few months ago.

At first I had zero problems with older market and 200 dpi, now I have to change to 240.

As I said before, blame google. It's a ****ty policy to forbid apps on devices if they don't match a given dpi, specially as dpi is something the user can choose (in fact there are apps to change it... in market).
[Desire HD Android Development] alienmind:
Supposedly, navigation with stock browser should be faster and smoother, scroll down through a huge page with images (such as XDA). There should be no lags.

PS: Now I have a hw accelerated nexus s and I really really feel the difference. Benefits of having google support on this.
[Desire HD Android Development] Rdlgrmpf:
I think in general the 2nd approach is better because with the first one you would get a Toast every 3 turn-on/turn-offs or so.

2nd attempt looks way more difficult to me, so I will try the 1st right now.

Repo is already syncing from scratch as it was syncing to my home folder before... should be ~/android/system now. I had a look into /liblights/lights.c but it's hard for me to understand whats going on there.
[Desire HD Android Development] MacSeoin:
UV just screws things up?? Like what exactly? I don't have any problems as of yet due to undervolting

EDIT: I'd use search if it was possible on the app and if it is then how?

Swyped with my OC'd & UV'd BlackICE modded DHD
[Desire HD Android Development] Chezbel:
Add a bunch of LOG commands and use logcat to get a better idea of what's happening.
[Desire HD Android Development] AdrianM:
Yes, of course I blame Google.

I was asking because i thought that the old market had no issue with the DPI.

Now i have my answer. I have no reason to keep the old market now, seeing that Market 3.4.4 is fast.
[Desire HD Android Development] a user:
undervolting is the number one reason for problems on rooted devices. 99.9% of the people that use undervolting do not have the necessary knowledge to use it properly.
[Desire HD Android Development] Pick_A_Name:
Any ideas on this Alienmind? I'm going to flash the latest Kang and see if it helps, but I'd like your thoughts please. Thanks!
[Desire HD Android Development] alienmind:
No idea what could be. Try to clear app data. A clean install should do it though

Swyped from my Nexus S
[Desire HD Android Development] maatsby:
I agree, I was surprised that there were 12 updates waiting for me when i changed DPI back to default! So obviously old market is no longer immune to this problem. New market for all! :p

and there isn't much gain from undervolting in my opinion. i didn't notice much difference at all in my battery life tests between stock voltages and undervolting, so why take the risk?
[Desire HD Android Development] Rdlgrmpf:
Old one is still faster :)

Sent from my Desire HD
[Desire HD Android Development] fatthumb:
Hi alienmind, anymore planned updates on this one or maybe ICS? :)
[Desire HD Android Development] TUN_SD:
Lol! First of all alienminds phone need to get a bugfix.

And ISC for DHD is still early beta, don't hurry!

Look at the forum, that beta is available.

send with telepathy
[Desire HD Android Development] alienmind:
It all depends on having my device back (and fixed) or not. Now it does depend on the guy who is trying to repair it

ICS is still early beta.
[Desire HD Android Development] stefan8bc:
I just tried the 1.26b2 after being on MIUI and RevolutionHD for a while, but I'm not convinced yet. The launcher, unlock screen and app drawer seem to have a bit of sluggishness. It's just not supersmooth as MIUI and the 3D-Rosie in RevolutionHD. Could it be something in my settings? I'm planning on trying the stable version 1.25 later today, hopefully this is better. Any suggestions for getting the optimal performance? Because I really want to use this rom, the dpi-settings are nice and the battery drain in Sense-roms is also higher I think. I could also revert to MIUI :)
[Desire HD Android Development] BeNeDeLuX:
I revert also back to 1.25 from the 1.26b. In 1.25 everything is fine for me. Just give it a try before you use MIUI again ;)

BTW: Anyone know where i can find the default BlackIce wallpaper in the ROM or for download ??
[Desire HD Android Development] TUN_SD:
Did you mean that one?

http://db.tt/TIyg5873

send with telepathy
[Desire HD Android Development] BeNeDeLuX:
Thanks!

Yes, more or less :D

This one is without the background. Is there one with the background like the sceenshot in post #1 ?

--> http://img27.imageshack.us/img27/9166/screenshot1322897467188.png

If not i can also try to create it on my own.
[Desire HD Android Development] TUN_SD:
just invert the colors and you´re done
[Desire HD Android Development] Chezbel:
Did you make any progress on this? I don't have Eclipse or Android SDK installed so I'm not sure if I can help, but if you still haven't figured things out I can try to do some debugging using LOG commands and logcat... Or maybe someone with more knowledge of how the LEDs work will help us...
[Desire HD Android Development] TUN_SD:
hey chezbel, something different!

it is possible, to flash the framework from your kang over BI?

i like to mod it a littlebit, but if i try to compile BI frame, only errors appear
[Desire HD Android Development] alienmind:
Default background

https://github.com/alienmind/ICEDro...2.apk/res/drawable-hdpi/default_wallpaper.jpg
[Desire HD Android Development] Chezbel:
I'm not sure, I've tried a few times in the past to push a new framework-res.apk, but I usually get errors also.
[Desire HD Android Development] TUN_SD:
Puuuh, i´ve tried it, with succsess! now some dividers have new jobs! awesome!
[Desire HD Android Development] Rdlgrmpf:
Thanks for your support. Actually I can't get CM compiled right now and I haven't even changed anything yet :)

char const*const AMBER_LED_FILE = "/sys/class/leds/amber/brightness";
char const*const GREEN_LED_FILE = "/sys/class/leds/green/brightness";
char const*const BLUE_LED_FILE = "/sys/class/leds/blue/brightness";

char const*const BUTTON_FILE = "/sys/class/leds/button-backlight/brightness";

[COLOR="Red"]char const*const AMBER_BLINK_FILE = "/sys/class/leds/amber/blink";
char const*const GREEN_BLINK_FILE = "/sys/class/leds/green/blink";[/COLOR]

char const*const LCD_BACKLIGHT_FILE = "/sys/class/leds/lcd-backlight/brightness";

Code is from lights.c https://github.com/CyanogenMod/android_device_htc_ace/blob/gingerbread/liblights/lights.c

If we could get something like the red files it would be way easier. Maybe we should ask Lord about this, since it looks very kernely and close to hardware to me. But I don't think it is possible...

About the 1st approach: I can't get AccessibilityService running... Need to do some more googlesearch
[Desire HD Android Development] EvoXOhio:
Just installed this rom and every time I get a text my phone is saying the contents of the text aloud. How do I turn that crap off?
[Desire HD Android Development] TUN_SD:
WHAT?

try to go to settings, the 5 from bottom (something like speech, sry, german) and try there.
[Desire HD Android Development] EvoXOhio:
I see text to speech settings there but no way to turn it off.
[Desire HD Android Development] TUN_SD:
thats really strange.

maybe reflash? read the first time about that problem.
[Desire HD Android Development] ghostofcain:
Try reading the thread! this has been answered at least twice in the last two pages
[Desire HD Android Development] dyne2199:
Picked up the paid version of SysTune from the Market. Great work on that app, brother! Has everything I need in one slick package. Much appreciated! :D

Currently running b4 (from a fresh install of b2 with just a dalvik wipe) and everything is running smooth. Battery has been holding up rather nicely after wiping battery stats and an initial full charge and drain. Everything works and works extremely well. Great work on this ROM, guys! :D
[Desire HD Android Development] novastar:
does anyone know why some apps say "Your device is not compatible with this item" I'm trying to download ES File Manager. o.0
[Desire HD Android Development] Gtj94:
I'm fairly certain that's a problem to do with the new Market app. Have you installed the 3.2.0 market? If so go back to the old one and it will be fine :)
[Desire HD Android Development] RampageRR:
Also could be due to the lcd density. Switch back to 240 to use market, then go back to your preference.
[Desire HD Android Development] LorD ClockaN:
As alien said, edit our 99custom script with your desired dsp mode.

Have you gave your script appropriate permissions??

Sent from Desire HD with BlackIce ROM
[Desire HD Android Development] dreaswar:
Latest beta test kernel

Can you give me the link for the latest sense beta kernel with updated external speaker amp driver ?

Thanks in advance

Sorry, I have posted in the wrong thread
[Desire HD Android Development] LorD ClockaN:
Send me an pm, so I can send you the link after work and so I don't forget

Sent from Desire HD with BlackIce ROM
[Desire HD Android Development] egorgoblin:
Great rom. Fantastic job! Everything seems to work properly. But one thing that i did not get. My phone was charging (1st charge after wiping bat stats)...and suddenly it skiped from 87% to 100%. So i wiped at full charge againg. Left it for night and in the morning 27% gone. Battery log looked awfull. UDLauncher + -25UV. What could i done wrong? Did a full wipe. Any sugestions?
[Desire HD Android Development] eliashadow:
Your battery needs calibration.Download battery calibration from market and calibrate your battery.This will fix your issue.
[Desire HD Android Development] zepretender:
After each call, phone is crashing (black screen...) I need to remove battery.

I had this trouble with B2 and now B4...

I've made a full wipe, clean install...

Damned !
[Desire HD Android Development] alienmind:
Remove all kind of undervolting.

If that fails, you may have a proximity recallibration problem. Download proximity recallibrator from XDA (can't remember the thread)
[Desire HD Android Development] boromkeurgui:
amazing rom . smooth and fast . one of the best .no bugs , all work fine .

keep your good work pal. :cool:
[Desire HD Android Development] racatapum:
Hi, I have a problem with the FM radio application ... Buttons and Icons are misplaced ... I made ​​two full wipes 1.5 and installation and still the same ...
[Desire HD Android Development] demanzke:
Is the governor script not supposed to run at boot? Because it doesn't.

I've put #!/system/bin/sh in the first line and now it is running. Also, what is the free version of Systune good for? I can't see any use of that (don't be offended).

greetings

Edit: Guess it is not supposed to run, it makes my ADW Launcher pretty laggy.
[Desire HD Android Development] racatapum:
Solved changing dpi to 240...
[Desire HD Android Development] gwallee:
What does fast charging in IceTool actually mean? Should I leave it enabled?

This is a great project. I have had zero problems and the best battery life so far.
[Desire HD Android Development] fbw.sw:
has anyone else gps trouble with the b4 release? i am waiting about 15min now and still no satelites visible.

i tried iceools for local settings no success than i tried fasterfix, even no success.
[Desire HD Android Development] harrehk:
If you have Titanium Backup try Freezing "Pico TTS".
[Desire HD Android Development] EvoXOhio:
That's a good idea. Unfortunately it became so annoying I went back to my old rom. I will try it again later.
[Desire HD Android Development] Chezbel:
Do you get undefined symbols in AudioHardware.cpp? If so just comment out the lines that cause the error, or grab the modified file I posted in a different thread here:

http://xdaforums.com/showpost.php?p=20811490&postcount=11963
[Desire HD Android Development] LorD ClockaN:
I like last twitt from alien :-)

Sent from my Desire HD with BlackIce ROM and ICS crouching in restore option
[Desire HD Android Development] Chezbel:
@Rdlgrmpf and @Alienmind: Take a look at this page for LedEffects. There is a link on that page for downloading the sources, which might provide some help

http://cri.ch/sven/doku.php/computing/android/ledeffects
[Desire HD Android Development] stuffinthesky:
I saw that as well.

Swyped from my Inspire 4G using xda premium
[Desire HD Android Development] Rdlgrmpf:
Not sure what the error was, I'll make clubber and try again.

I took a rather quick look. The app registers itself as a Broadcastreceiver and then sets the LEDs the same way I did. So it writes the values directly into /sys/class... I could try setting the ButtonBacklight just to on instead of Blinking, should be enough for the beginning, since they aren't turned on usually you would still recognize that you have a notification and it won't spam the superuser log since it needs root once to set it on.

Do you guys think NotificationManager needs root to write to /sys/class/leds/button-backlight/brightness ? If it doesn't it may be enough to just add about 3 lines to the notify(String tag, int id, Notification notification) Method.

like: (green is added in)

public void notify(String tag, int id, Notification notification)
{
[COLOR="Lime"]if(!powermanager.isScreenOn()){
//write 255 to /sys/class/leds/button-backlight/brightness
}[/COLOR]
int[] idOut = new int[1];
INotificationManager service = getService();
String pkg = mContext.getPackageName();
if (localLOGV) Log.v(TAG, pkg + ": notify(" + id + ", " + notification + ")");
try {
service.enqueueNotificationWithTag(pkg, tag, id, notification, idOut);
if (id != idOut[0]) {
Log.w(TAG, "notify: id corrupted: sent " + id + ", got back " + idOut[0]);
}
} catch (RemoteException e) {
}
}

You would also have to make a new PowerManager object to use isScreenOn()

@Lord: I pm'd you about this stuff :)
[Desire HD Android Development] harrehk:
You can also try freezing "TTS Service 2.3.7"

Let us know how it works out for you!
[Desire HD Android Development] P.I Boy:
@alienmind

When the 'magic' will start. ;) hehe

-Online | XDA Premium-
[Desire HD Android Development] Rdlgrmpf:
Stupid me.. retreiving the LED flag from the Notification is already done in NM.. changing it. waiting for "stock" CM7 to compile and if it is successful I will try with my changed code. I don't expect much since it would be way too easy then :)
[Desire HD Android Development] HkDng:
No any update based on new build?
[Desire HD Android Development] Chezbel:
If you come up with something that you want people to test let us know.

EDIT: Also, if you have something that is worth including in an unofficial build let me know (probably by PM). If I can rebuild it I can put a KANG with it on Post #3.
[Desire HD Android Development] Rdlgrmpf:
CM won't compile for me... http://pastebin.com/9dJuMZX8 is the last output from the console. How do I create a log file again?

//edit: PM'd you

//edit 2: YEAH, good news

this is the new Notification Method:

public void notify(String tag, int id, Notification notification)
{
int[] idOut = new int[1];
INotificationManager service = getService();
String pkg = mContext.getPackageName();

boolean usesLight = (notification.flags & Notification.FLAG_SHOW_LIGHTS) != 0;
boolean isOngoing = (notification.flags & Notification.FLAG_ONGOING_EVENT) != 0;
Intent notifyIntent = new Intent(ACTION_NOTIFY);
notifyIntent.putExtra(EXTRA_PACKAGE, pkg);
notifyIntent.putExtra(EXTRA_USES_LIGHT, usesLight);
notifyIntent.putExtra(EXTRA_IS_ONGOING, isOngoing);
mContext.sendBroadcast(notifyIntent);

if (localLOGV) Log.v(TAG, pkg + ": notify(" + id + ", " + notification + ")");
try {
service.enqueueNotificationWithTag(pkg, tag, id, notification, idOut);
//Log.i("NotificationManager", "Pulsing: " + pkg);

// added by me
if((!pm.isScreenOn()) && usesLight && (!isOngoing)){ // Screen off, has LED flag and is not ongoing
Log.i("NotificationManager", "Notification enqueued, Screen off, LED flag set, not ongoing");
Process process = Runtime.getRuntime().exec("su");
Log.i("NotificationManager", "past su");
DataOutputStream os = new DataOutputStream(process.getOutputStream());
String strCommand = "echo 255 > /sys/class/leds/button-backlight/brightness";
os.writeBytes(strCommand + "\n");
os.flush();
os.writeBytes("exit\n");
os.flush();
process.waitFor();
}
//
if (id != idOut[0]) {
Log.w(TAG, "notify: id corrupted: sent " + id + ", got back " + idOut[0]);
}
} catch (RemoteException e) {
} catch (IOException e) { // Added by Chezbel
} catch (InterruptedException e) { // Added by Chezbel
}
}

Thanks to Chezbel for compiling :D I just tested it. it doesn't work completely BUT the Log shows this:

12-30 20:24:54.135: I/power(1398): *** set_screen_state 0
12-30 20:24:59.502: W/InputManagerService(1398): Starting input on non-focused client android.view.inputmethod.InputMethodManager$1@406604e8 (uid=1000 pid=1398)
[COLOR="Lime"][COLOR="Red"]12-30 20:25:56.500: I/NotificationManager(2076): Notification enqueued, Screen off, LED flag set, not ongoing[/COLOR][/COLOR]
12-30 20:25:56.530: I/AudioService(1398): AudioFocus requestAudioFocus() from android.media.AudioManager@40563938
[COLOR="red"]12-30 20:25:56.580: I/NotificationManager(2076): past su[/COLOR]
12-30 20:25:56.610: I/HTC Acoustic(1298): update ACDB id: (tx, rx, tx_acdb, rx_acdb) = (11, 6, 0, 607)
12-30 20:25:56.610: I/ActivityManager(1398): Starting: Intent { flg=0x10000000 cmp=com.noshufou.android.su/.SuRequestActivity (has extras) } from pid 1955
12-30 20:25:59.729: I/AudioService(1398): AudioFocus abandonAudioFocus() from android.media.AudioManager@40563938
12-30 20:26:04.146: I/power(1398): *** set_screen_state 1

That means that my if statement is entered. So what doesn't work is either the writing process or su. Any way to check whether one is su and put it into the Log?
[Desire HD Android Development] nenepyg:
Wsooooop alienmind :)))))
[Desire HD Android Development] Rdlgrmpf:
If anybody has an idea of how to write to the file or check for root please tell me.
[Desire HD Android Development] alienmind:
get the code for su from icetool. uid=0 is root

Swyped from my Nexus S
[Desire HD Android Development] Rdlgrmpf:
Will try. I just looked into NotificationManagerService and LightsService.

2 possible Ways:

1) change l. 486 in NotificationManagerService to

mNotificationLight = lights.getLight(LightsService.LIGHT_ID_BUTTONS); // changed from LIGHT_ID_NOTIFICATIONS

But I'm not sure if this works

2) Get a LightsService in NotificationManager.java instead of using the root-command-line-version

see line 33, 77, 106, 154ff. in the uploaded modified source http://dl.dropbox.com/u/27975653/NotificationManager_new_version.java

Additionally if NotificationManagerService gets a getMethod for its LightsService we may get access to it in NM.

I think that #1 won't work. #2 may work but I am not sure how to get the LightsService. NotificationManagerService gets it as a parameter to its constructor but I'm not sure where NMService is initialized.

The advantage of the cmd-line-method would be that you don't need to care about turning the light off again, since it will be overwritten when the screen is turned on.

Disadvantage would be that it is dirtier and not flashing.

Will try cmd-version with checking for root again. unfortunately I can't build the Rom myself

//edit: in which class does ICEtool check for root?
[Desire HD Android Development] alienmind:
Actually it doesn't explicitly, but it runs a series of commands to get the environment config for ICETool and check wherter if it should enable or not some tabs (this is the famous "can't see tabs" on previous version of icetool ... it was an incorrect checking for root).

To simplify things, I rewrote some code and it should like more or less like this (fragment from ICEToolSetup.java, modified on the fly without testing):

// Run the setup scripts
Process p = Runtime.getRuntime().exec("su");
DataOutputStream os=new DataOutputStream(p.getOutputStream());
os.writeBytes("whoami\n" + "; exit\n");
os.flush();
BufferedReader br = new BufferedReader(new InputStreamReader(p.getInputStream()));
try {
while ((inputLine = br.readLine()) != null) {
String line = inputLine.trim() + "\n";
if (line.startsWith("root") || line.startsWith("whoami: unknown uid 0")) {
// We are OK to go
}
}

}
} catch (Exception e) {
System.err.println(e.toString());
}

p.waitFor();

}
[Desire HD Android Development] Rdlgrmpf:
thanks, I'm on a service-trip right now :D

http://dl.dropbox.com/u/27975653/NotificationManagerService_new_version.java

see:

l.92 attribute

l.412 constuctor

l.460 get method

http://dl.dropbox.com/u/27975653/NotificationManager_newer_version.java

can't test though. Gotta wait for Chezbel building it.
[Desire HD Android Development] alienmind:
Just wanted to post some good news, at least for me ;-)

http://roguedroid.blogspot.com/2011/12/made-my-day.html

Please don't let's go offtopic => comments on G+ or the blog ;-)

Thanks for those guys who contributed to this...
[Desire HD Android Development] Rdlgrmpf:
Great news!

Buttons:

I think flashing Button-Backlights won't work until liblights/lights.c is changed.

NotificatonManagerService has a LightsService.Light object. Inside LightsService every method comes down to setLight_natice(some parameters), which in my opinion calls the matching method in lights.c . And if there is no blink file available it won't blink. Unless we manually implement a method that turns the light on, waits, turns light off, and so on
[Desire HD Android Development] googleye:
Still no fix for market compability issue? I have tried to reflash, update and with all market versionen in IceTool. Pretty annoying not being able to have many apps I used before.
[Desire HD Android Development] alienmind:
the fix is still the same, downgrade to 240 dpi and reboot

Swyped from my Nexus S
[Desire HD Android Development] googleye:
Okay, can't believe how ugly everything is at 240...

Sent from my Desire HD
[Desire HD Android Development] stuffinthesky:
I completely agree.

Swyped from my Inspire 4G using xda premium
[Desire HD Android Development] Chezbel:
Off topic, but happy new year!

http://db.tt/6CyMtD1S
[Desire HD Android Development] Youngunn2008:
Icetool fc when I press the app or ril tabs, any help with that? Just flashed back to this from absolution with a wipe of caches.
[Desire HD Android Development] Chezbel:
If you flash from a different ROM, you should do a full wipe (wipe data)
[Desire HD Android Development] TUN_SD:
Thank you! and the same to all of you from my cold rainy hometown!