I've no idea then, play around with white and rgb folders, i can't test it by myself, don't play to much with the torch related folders and the torch related triggers, it can crash the device.
Playing with other folders/trigger shouldn't harm your device though, if anything goes wrong, then simply reboot to erase the modifications
Better do anything from adb shell, (playing with lcd-backlight will turn off screen, and only adb or force reboot can revert easily :silly: )
I thank you so much for this useful feature..
In the light of the new discoveries i will post a past thread where the topic was the color of the led.. Maybe the consideration are the same of the past.. But hope is the last to die
I thank you so much for this useful feature..
In the light of the new discoveries i will post a past thread where the topic was the color of the led.. Maybe the consideration are the same of the past.. But hope is the last to die
I just wanted to know how we can control pulse frequency when device is charging. It's approximately on=500ms and off =500 ms.
I thought that I found a method which is called every time led becomes active - public void setFlashing(int color, int mode, int onMS, int offMS)
but unfortunately this method is called only on notifications...
Seems like we can't control the second led
Anyway, if someone wants to control led's frequency on notifications you can use this xposed module which was kinda debug module for my researches. Don't know if there are already apps for it. if so then do not use mine. I don't care actually
p.s
is it bad for my battery if I set led blinking very fast? on=off=30 ms
I just wanted to know how we can control pulse frequency when device is charging. It's approximately on=500ms and off =500 ms.
I thought that I found a method which is called every time led becomes active - public void setFlashing(int color, int mode, int onMS, int offMS)
but unfortunately this method is called only on notifications...
Seems like we can't control the second led
Anyway, if someone wants to control led's frequency on notifications you can use this xposed module which was kinda debug module for my researches. Don't know if there are already apps for it. if so then do not use mine. I don't care actually
p.s
is it bad for my battery if I set led blinking very fast? on=off=30 ms
There is an app called "light manager" in the play store that does work and has a good GUI for configuration, not sure if it only works on a rooted phone.
Anyway, if someone wants to control led's frequency on notifications you can use this xposed module which was kinda debug module for my researches. Don't know if there are already apps for it. if so then do not use mine. I don't care actually
p.s
is it bad for my battery if I set led blinking very fast? on=off=30 ms
We can control blinking using /sys/class/leds/rgb/control (see below) but with both issues and drawback using that way...
I would more fear about LED wearing with fast blinking
I went through all of your work about the LEDs on moto G and I also have found the two LEDs functioning differently however then i decided to look around some more and whatI found was
1. The extra charging LED (leds-qpnp-e4a33a00)(charging)
2. The LCD Backlight LED (qcom,mdss_fb_primary.156)(lcd-backlight)
3. The Main Camera Flash (leds-qpnp-e4a34c00)(led:flash_0 and led:flash_torch)
4, The normal notification LED (leds-qpnp-rgb-e4a32800)(rgb and white)
5. The Main Camera Flash (qcom,camera-led-flash.0)(torch-light)
6. The LCD Backlight LED (leds-qpnp-e4a33c00)(wled:backlight)
I have tried to check if I can get the LEDs to turn on using the charging trigger. My conclusions are listed down
1. LED2 and LED6 are just the same
2. LED3 and LED5 are just the same
3. I have been successful in all attempts except in rgb/triggers Although I can trigger the same LED using white/triggers
Could you comment on my conclusions? Please Specially the 3rd one! Also if you have any idea why would they call a white led an rgb?
Looks like you made a pretty good job (i was too lazy to search for the "real" path)
All you said is in agreement with what i have found previously by experiments
==> that might mean that we are both wrong? :silly:
_____________
I would say that the fact there are two ways to light the flash LED is linked to the way the Hardware Abstraction Layer works : two uses == two ways (meaning that Flash-LED is both used as flash [led:flash_*] and torch [torch-light])
==> It was why i previously thought there was only one LED being lighten up in different ways (until i saw the 2 LEDs on MotoE board)
Code:
root@falcon_umts:/sys/devices/leds-qpnp-e4a34c00/leds # ls
led:flash_0
led:flash_torch
==> In case device has more than 1 flash LED, there would be led:flash_1 too and i think that led:flash_torch would light both...
led:flash_torch is configured to react to torch_trigger == when we turn torch lamp ON (set */charging/trigger to torch_trigger and see)
led:flash_0 is configured to react to flash0_trigger == when camera decides to flash.
whatever hexa value used, the color displayed will stay white (pretty obvious)
whenever a notification comes it will override the LED blinking == similar behavior as for white
==> But it doesn't overwrite the files (?)
RGB looks to be the main controler and would control the channels of an RGB led if it existed on the device
white is like a specific part of RGB (like led:torch_0 is for led:torch ?) and it would explain why motoX 2013 has a green LED and thus has rgb,red, green, and blue folders and that only rgb and green lights its green-only LED.
+ messing with white will mess with rgb and vice versa, i don't have enough time to play much with this but that may help for further understanding...
Original source <<< make sure you read the blog article before commenting ....
It's always cool to know at a glance that your device is charging without the need of lighting the screen, here is how:
Requirements :
Moto G (tested on XT1032)
Rooted
SU rights granted
adb if you want to monitor all this from a computer
Code:
#include <std_disclaimer.h>
/*
* Your warranty is now void.
*
* I am not responsible for bricked devices, dead SD cards, BURNT LEDs,
* thermonuclear war, or you getting fired because the alarm app failed.
* YOU are choosing to make these modifications, and if
* you point the finger at me for messing up your device, I will laugh at you.
*/
in /sys/class/leds/charging/trigger we have these triggers available :
The same is available in /sys/class/leds/white/trigger, and /sys/class/leds/white/brightness allows to dim the LED, though :
During test i was able to show that using /sys/class/leds/charging/trigger overrides any other trigger (if a notification comes, then it won't change the pattern) After extended test, it turned out that MotoG also have two LEDs
[*]Though using /sys/class/leds/white/brightness allows to use 0~255 values to dimm the LED, and /sys/class/leds/white/trigger works; it is overridden by any incoming notification that set brightness back to 0.
edit : Current knowledg is :
/sys/class/leds/charging/trigger → first LED, can be set to on/blinking while charging, although at full brightness.
/sys/class/leds/white/trigger → second LED, can be dimmed, but the LED turns back off when a notification comes in.
For now, the best way is to set "first" LED (/sys/class/leds/charging/) for charging using dedicated trigger and keeping the "second" one to none and get both working together this way. What we need is to find a way to dim the "first" LED
______________________________
Set at boot: WARNING : if you fail this, you may screw up your device ... (keep a backup somewhere)
Create a blank file and name it like 99charging_LED-blink
paste the following in that file :
Code:
#!/system/bin/sh
# enabling charging LED blinking while charging
echo "battery-charging-blink-full-solid" >/sys/class/leds/charging/trigger
echo "1" >/sys/class/leds/charging/brightness
mount /etc/init.d as RW
Paste 99charging_LED-blink there
set permissions as -RWXR-XR-X
Open terminal emulator, and type :
Code:
su
sh /etc/init.d/99charging_LED-blink
Plug it to charger, it should start blinking ... if not, make sure everything is correctly set