Programming LEDs in sys directory - Openkirin - Honor 8 Questions & Answers

Currently my openkirin honor 8 omni rom does not have led notifications for apps. I know the led works because it is enabled for different levels of battery.
Since Openkirin is not releasing any updates does anyone know how to program the led trigger to run if ANY app notification is triggered. I am fine with only one color being triggered I just want at least something to trigger.
The code for led triggers is located within the root here: /sys/class/green/trigger
here is the script:
none kbd-scrollock kbd-numlock kbd-capslock kbd-kanalock kbd-shiftlock kbd-altgrlock kbd-ctrllock kbd-altlock kbd-shiftllock kbd-shiftrlock kbd-ctrlllock kbd-ctrlrlock Battery-charging-or-full Battery-charging Battery-full Battery-charging-blink-full-solid USB-online Mains-online hisi_bk_battery-online mmc0 mmc1 mmc2 [timer] rfkill0 rfkill1 rfkill2
Does anyone know if this can be modified? I tried modifying for example the torch and the color of the torch was more orangish so I know changing values in the system files does have an effect.
Additionally here is a thread that I found that suggestions you can program different triggers.
https://forum.xda-developers.com/an...-notification-led-function-t3773888?nocache=1
Lastly the build I am running which has been great besides the led issue is: OmniROM Pie Alpha 5.2
Worst case scenario I could download an older ROM and look at the code being used within the same directory. Any suggestions guys, really looking for a copy paste of some code as it seems like it should be easy.
Thanks

Related

led customization

Hi, i was wondering if there was a way of changing the led notification colour ? i saw on the android sdk website that there was strings for controlling this but were is the file in the android os ? or is there a file for changing this ?
notification.ledARGB = 0xff00ff00;
notification.ledOnMS = 300;
notification.ledOffMS = 1000;
notification.flags |= Notification.FLAG_SHOW_LIGHTS;
or is this just strings for creating a application ?
thanks bill.
What I would do, is look through a copy of the Android AOSP source for anything matching those. You might have better luck finding it in the Framework itself, or the phone, e-mail, SMS/MMS, etc.
btw, you can also control the LED's through /sys/class/leds/*/brightness, though I'm not sure it requires root, but I think it can override the charging/low-battery LEDs.
These are "strings for making an application." Change the LED brightness settings listed above for direct control.
Oh rite so if i were looking for those strings in the android os files i wouldnt actually find them ? this would just be used say if i was going to create a application like chomp sms or popup sms. what i was kind of hopeing for is a file i could pull through adb maby changed a few of the settings then re push the file and have a diffrent colour led for that certain notification. Hope that makes sence lol.
Pretty much all the info you need is here:
http://forum.xda-developers.com/showthread.php?p=4678867
yeah i kinda see what your getting at with that other thread but what i was kind of looking for i gusse is a file that i could just pull from the android system edit a bit, push the file back in and bang diffrent colour led for each notification ect...
why not just get missed call from the market and change the color, blink frequency etc using that program.

[Kernel] SD Card activity LED

#include <cyanogen/std_disclaimer.h>
Ever wish your G1 had an activity light for the sd slot? Now it can!
The Linux kernel includes built-in support for triggers through sysfs (/sys/class/leds/*/trigger) which allow for such things to be set up. The only thing stopping us from using these is the fact that android triggers the lights manually, which then disables our trigger... What I've done is rename button-backlight to btn-backlight in the kernel, and added an init script to set it up automatically on boot. On G1 hardware, this results in the light under the call,home,back,end, and home buttons to flicker any time there's sd activity... I've applied the same patch for sapphire/myTouch and N1, although I have no way of testing these platforms, it shouldn't cause any problems.
This kernel:
-Is compiled against the latest cm-kernel code (as of May 21)
-Is available with and without bfs
-Turns your button panel into an SD indicator
-Includes an init script to set up the trigger at boot (runs before bootanimation!)
If you like my work, BUY CYANOGEN AND/OR KOUSH A BEER!
EDIT: look on page 5 for a update-sdled-v5.zip for the latest version... G1 (button backlights) and myTouch (jogball) support for sd activity without an init script, as well as a nand-disk option that can be set from a userinit.sh
EDIT: new v6 build on page 6.... rebased off the latest cm-kernel, which means oc support is now included....
whoops... I forgot to attach them... here's the files...
cool thanks a lot! will try that one now...
wow nice mod ! is it possible to change these led to the jogdial button underneath? i am using a mytouch - again,nice work...
Thanks! It should be easy enough to make that work... I just need to know what the jog dial is named under sysfs... I'll take a look at the code and see what I can find...
-------------------------------------
Sent from my HTC Dream
Meisterlampe2000: (or anyone else with a mytouch) could you please run the following command in terminal emulator or adb shell and post the output?
#ls /sys/class/leds
-------------------------------------
Sent from my HTC Dream
no problem!
it's called:
jogball-backlight
i can try it for you if u want!
Cool, so I found jogball-backlight declared in board-mahimahi-microp.c (strange, I expected to find it in board-sapphire...
I'll get it compiled and posted in a few minutes for ya
-------------------------------------
Sent from my HTC Dream
Awesome... Seems to slow down CSRom a bit though.
Is this overclockable?
i flashed on a mytouch with aosp 1.6 and overclock.update.zip - flashing this removed my OC.zip any ideas?
is it possible to check internal flash activity?
Overclocking is done at a kernel level, so in order to have both, I'd have to release an oc version... I've been considering running an oc kernel on my end anyway, so I will post a version with that once I've made the switch... as far as internal flash activity, I haven't discovered a way, but it should be possible... the only problem is that an led can only be set to one trigger, so if it is set up for internal flash, you don't get sd activity shown... I'll definitely be looking into it though
-------------------------------------
Sent from my HTC Dream
you should add it or at least try it, throw these two together and i think you might have something that'll be thrown into a lot of ROM's
myTouch jogball version
Ok, so here's a version that does the same thing, but with the myTouch jogball... THIS ONE WILL NOT WORK ON G1, as the init script sets up the jogball instead of the button backlight.. it is otherwise identical to the first one without bfs.
EDIT: wrong file edited... should work on the N1 trackball... if you wanna try the jogball on the myTouch, scroll down, I just posted another update
theMODEL22 said:
you should add it or at least try it, throw these two together and i think you might have something that'll be thrown into a lot of ROM's
Click to expand...
Click to collapse
Yeah, if I can find a kernel led trigger for the internal flash, I may be able to then create a trigger that will register with both triggers to provide a single activity light for both... I definitely like the idea
jummama said:
Ok, so here's a version that does the same thing, but with the myTouch jogball... THIS ONE WILL NOT WORK ON G1, as the init script sets up the jogball instead of the button backlight.. it is otherwise identical to the first one without bfs.
Click to expand...
Click to collapse
but as I said in the first post, I have no way of testing it... it shouldn't cause any problems... but as always NANDROID THAT ***** FIRST!
MH, the file location seemed to be strange...
It´s not working on Sapphire...
Here is what i get for /sys/class/leds
->blue,jogball-backlight,btn-backlight,lcd-backlight,green and red
I guess, all those mixed colors are done via RGB for the Status LED ?
...anyway, for the Jogball, it must be jogball-backlight somehow ?
Thanks for that first shot !
MH, the file location seemed to be strange...
It´s not working on Sapphire...
Here is what i get for /sys/class/leds
->blue,jogball-backlight,btn-backlight,lcd-backlight,green and red
I guess, all those mixed colors are done via RGB for the Status LED ?
...anyway, for the Jogball, it must be jogball-backlight somehow ?
Thanks for that first shot !
Click to expand...
Click to collapse
Hmm, looks like I need to do some more grepping... strangely, the only jogball-backlight I found was in a board-mahimahi file... so I guess this second release is actually just for any n1 users that want it on their jogball, lol
-------------------------------------
Sent from my HTC Dream
Hey!
Can you send only modified files for dream/trout ?
git, mail etc
pl_laszlo said:
Hey!
Can you send only modified files for dream/trout ?
git, mail etc
Click to expand...
Click to collapse
I attached a diff on the first post... the only thing I changed was the name declaration in board-trout.c...
the zip includes a /system/etc/init.d/02setledtrigger file that just echos the proper trigger into the newly renamed led

AOSP r7 Miscellaneous bug still present, anyone else?

Hi all,
I'm testing out a raw AOSP ROM with a few customizations (App Ops, 180 degree rotation, root, busybox) and I've noticed that the Miscellaneous bug seems to still exist in the android-5.0.0_r7 tag (lollipop-release branch). This was the closest thing I could find from Google that appeared to address it:
https://android.googlesource.com/pl...6793771cedb47aed72f1c64f870b70357746938^!/#F0
or easier to read on GitHub, found in another guy's ROM: https://github.com/C-RoM-L/android_...mmit/e6793771cedb47aed72f1c64f870b70357746938
... but it just seems like they're hiding that entry in release builds. Could this be why it's still showing up on an AOSP compilation? And if so, how do we negate it?
Thanks.

Dynamic brightness question

Hi guys, I have a question. I have a f3111 model and I'm seeing black color changes when something whiter is displayed on screen. More precisely, for example: I use Xplore file manager with dark theme. If I open a folder with lots of icons with white text, the black colors change, becoming more brighter. I heard it's something called dynamic brightness and it is on regardless of auto-brightness being on or off. Do you any of you experience this and do you know a way of disabling it?
Thanks
Sent from the center of the galaxy
Yeah, I think I found a way to disable this, but it needs a kernel recompilation. It's called cabc (content adaptive backlight control) in the kernel and it needs to be set to 0
Sent from the center of the galaxy
Hi @rrvuhpg,
Thanks for the suggestion. I tried copying the *Image.gz-dtb* and pack it along with the ramdisk using carliv kitchen (I replaced boot.img-kernel with the image). Unfortunate it does not boot. It just shows me a black screen. The Image.gz-dtb was constructed from the sony archive with their indications of how to build the kernel. The kernel was built with default config. Can you help me further? I'm missing some steps. Can you detail a bit, please, on how have you built the kernel?
Thanks.
It booted with the kernel from your git. Merci beaucoup!
It works, dynamic brigthness off with CONFIG_MTK_AAL_SUPPORT=n in the kernel config.
If anyone is annoyed by it I can share the kernel...
cojocar.andrei said:
It booted with the kernel from your git. Merci beaucoup!
It works, dynamic brigthness off with CONFIG_MTK_AAL_SUPPORT=n in the kernel config.
If anyone is annoyed by it I can share the kernel...
Click to expand...
Click to collapse
Very good news

[APP][OPEN SOURCE][ROOT][5.0+] Night Light (KCAL)

Night light is an open-source app which uses KCAL to adjust blue light intensity of the display colors, so that viewing the screen at dark becomes pleasant for the eyes, and help you fall asleep faster (this is what science have proven so...).
Features
Easy to use user interface. Settings are easier to find.
Uses KCAL to adjust screen RGB colors, hence its efficient and changes are seen everywhere on screen.
Supports older KCAL implementations as well as newer KCAL implementation for v4.4 kernels.
Simple color controls for normal users through color temperature control.
Manual KCAL controls for advanced users.
Automation routines lets you define routines where you specify Night Light settings which you wish to apply, and they will be automatically applied for you in specified times.
Intensity fading in/out is supported as part of automation routines.
Supports sunset/sunrise timings.
Set on boot delay.
Original KCAL settings of user is backed up and applied when night light is turned off. And it can be configured as well.
Support for user profiles, which are collections of settings that user can apply with one click.
And to fulfill your all kinds of automation needs, app is supported as a Tasker plugin. You can use it with Profiles.
Option to automatically disable Night Light in lock screen, and turn it back on after the device is unlocked.
Quick Setting tile for easy toggling on/off night light anywhere.
Launcher icon shortcut for toggling Night Light on/off and toggling intensities.
Dark and Light theme.
Advantages
No overlays.
Background service is only used for lock screen option. The entire automation (including the fading) is done using neat AlarmManager tricks (which not only is battery friendly, but memory friendly as well).
Requirements
Kernel supporting KCAL.
Root access.
Download
Source - https://github.com/corphish/NightLight
Wow. Thanks for this awesome app. This is my best daily night light app.
Thanks
sounds good
let me have a try brother......
corphish said:
Night light is an open-source app which uses KCAL to adjust blue light intensity of the display colors, so that viewing the screen at dark becomes pleasant for the eyes, and help you fall asleep faster (this is what science have proven so...).
Features
Easy one touch toggles, with a single slider to tweak blue light intensity.
Quick Setting tile for easy toggling on/off night light anywhere.
Automatic switching on/off night light at user specifed timings. (Limitation - Start time must be lesser in value than ending time, that is if you choose starting time at 2300 hrs and ending time at 0600 hrs (next day) it won't work for now).
Requirements
Kernel supporting KCAL.
Root access.
Download
Source - https://github.com/corphish/NightLight
Click to expand...
Click to collapse
The automatic switch doesn't seem to be reliable. Could you add intents so it can be toggled with Tasker? I already have a profile that triggers at sunset so that would be perfect.
Sent from my Nexus 5X using XDA Labs
Great app, thanks. Have been using CF.lumen until now, but that seems unsupported (and is closed source).
Please keep improving it. Would also like to donate a beer.
Can you explain whats this KCAL thing ??? ??
thanks for this app apreciate it i got ADD and Slightly Autism and i already have an issue sleeping my brain get supercharged and i can't get to sleep but this app helps [email protected]
Loving the app so far, however, I notice it won't trigger at the time I have set unless I manually open the app. I've removed it from Android's battery optimization so I don't think that can be it. Any ideas?
rickysidhu_ said:
Loving the app so far, however, I notice it won't trigger at the time I have set unless I manually open the app. I've removed it from Android's battery optimization so I don't think that can be it. Any ideas?
Click to expand...
Click to collapse
Same here. I forgot to report it. I use Tasker to launch it at sunset & sunrise along with switching between dark / light app themes.
Sent from my Nexus 6P using XDA Labs
yochananmarqos said:
Same here. I forgot to report it. I use Tasker to launch it at sunset & sunrise along with switching between dark / light apo themes.
Click to expand...
Click to collapse
I ended up doing this as well! Now the other thing I'm hoping gets implemented is a smooth transition to the orange hue.
zaibansari20 said:
Can you explain whats this KCAL thing ??? [emoji848][emoji848]
Click to expand...
Click to collapse
Kcal is a kernel tweak that lets you customize colors at lower (kernel) level, so there won't be any filter or layer on screen, but in most stock kernels it isn't available, so you have to find a custom kernel for your phone/rom that has it.
Thanks for the app, but I've used tasker with the command "echo 180 75 35> /sys/devices/platform/kcal_ctrl.0/kcal" for a long time (echo 256 256 256 > /sys/devices/platform/kcal_ctrl.0/kcal to get the color back.)
Obviously you can change the values to whatever you want.
But the app will be much more easy for many people
Envoyé de mon ONEPLUS A5000 en utilisant Tapatalk
J0kker said:
Kcal is a kernel tweak that lets you customize colors at lower (kernel) level, so there won't be any filter or layer on screen, but in most stock kernels it isn't available, so you have to find a custom kernel for your phone/rom that has it.
Click to expand...
Click to collapse
I'm using LineageOS with a custom kernel which allows mein to change RGB values from any kernel modification app...
Sent from my LG G2 using XDA Labs
zaibansari20 said:
I'm using LineageOS with a custom kernel which allows mein to change RGB values from any kernel modification app...
Click to expand...
Click to collapse
So it should work for you, you can try with a kernel manager like kernel adiutor but the app should work.
J0kker said:
Kcal is a kernel tweak that lets you customize colors at lower (kernel) level, so there won't be any filter or layer on screen, but in most stock kernels it isn't available, so you have to find a custom kernel for your phone/rom that has it.
Thanks for the app, but I've used tasker with the command "echo 180 75 35> /sys/devices/platform/kcal_ctrl.0/kcal" for a long time (echo 256 256 256 > /sys/devices/platform/kcal_ctrl.0/kcal to get the color back.)
Obviously you can change the values to whatever you want.
But the app will be much more easy for many people
Envoyé de mon ONEPLUS A5000 en utilisant Tapatalk
Click to expand...
Click to collapse
I tried the Tasker method and it works great. I had no idea that command existed and could be used in Tasker. Thank you for sharing! :good: :highfive:
rickysidhu_ said:
Loving the app so far, however, I notice it won't trigger at the time I have set unless I manually open the app. I've removed it from Android's battery optimization so I don't think that can be it. Any ideas?
Click to expand...
Click to collapse
Does it fail to trigger if a reboot had happened sometime before the time it should have triggered?
For example, if it was to trigger at 5pm, but a device reboot happened in, say, 3pm, then does it fail to trigger at 5pm?
Anyway, set on boot is broken (again), will need to fix it, but normal timers should work fine.
corphish said:
Does it fail to trigger if a reboot had happened sometime before the time it should have triggered?
For example, if it was to trigger at 5pm, but a device reboot happened in, say, 3pm, then does it fail to trigger at 5pm?
Anyway, set on boot is broken (again), will need to fix it, but normal timers should work fine.
Click to expand...
Click to collapse
Ahh, that might be it. I think it stops working after a reboot, so I'd be going back into the app to get it going again.
Very minor issue though, great app - thank you for your hard work!!:highfive:
corphish said:
Does it fail to trigger if a reboot had happened sometime before the time it should have triggered?
For example, if it was to trigger at 5pm, but a device reboot happened in, say, 3pm, then does it fail to trigger at 5pm?
Anyway, set on boot is broken (again), will need to fix it, but normal timers should work fine.
Click to expand...
Click to collapse
Launcher shortcut (toggle on/off) switch is also seems somewhat broken, it toggle on but fails to toggle off.
@jineshpatel30 @rickysidhu_
Here is an experimental version (in the attachment of this reply), with launcher shortcut toggle and set on boot fixed.
The reason why it is experimental :
- Now written in kotlin
- Uses some of the new stuff announced in I/O 18, like ktx and the new material design style
- Uses different font called 'Acme'. (Feel free to suggest fonts)
- I decided to ditch cards because normal layouts look better in this new style.
Source - https://github.com/corphish/NightLight/tree/p
corphish said:
@[email protected]_
Here is an experimental version (in the attachment of this reply), with launcher shortcut toggle and set on boot fixed.
The reason why it is experimental :
- Now written in kotlin
- Uses some of the new stuff announced in I/O 18, like ktx and the new material design style
- Uses different font called 'Acme'. (Feel free to suggest fonts)
- I decided to ditch cards because normal layouts look better in this new style.
Source - https://github.com/corphish/NightLight/tree/p
Click to expand...
Click to collapse
It kicked in automagically at sunset tonight which reminded me to come back and comment. That was unreliable previously.
What does the save button do at the bottom? I assume it saves something, but there's no toast message to acknowledge it's been pressed.
I don't like the font, myself. Since you're going for new and fancy code and styling, why not use ProductSans? I like the new font used in the Wear OS app, I think that's it.
Could you add the numerical values for the sliders for more accurate fine tuning? I like the way the new XDA Navigation Gestures app does it. It's in the latest beta posted in the thread and should be pushed to the Play Store soon.
Since CF.lumen is EOL now, this app is going to be a great alternative especially when it eventually breaks.
Thank you!
Sent from my Nexus 6P using XDA Labs

Categories

Resources