Turning off LEDs?

Hi, I’m using Android VIM3_Pie_V210128.

I can’t find out how to turn off the white led and the red led without going into the settings menu.

I want to do it using adb commands.
This worked, but only until reboot:
adb shell “echo 2 > /sys/class/redled/mode”
adb shell “echo none > /sys/class/leds/sys_led/trigger”
It seems Android just overwrites those settings on reboot.

The documentation on this page doesn’t help me: How To Control LEDs | Khadas Documentation

@hanskr This docs use for linux , about android , you can ask @Terry or @jasonl

@hanskr yes ,when reboot ,it will set led mode again

Oh, I see now. That doc is under Linux category, thanks.

So, is there a way to toggle the Android settings for led through ADB?

Why did you want to save the led config with adb? You can refer to the source code

Thank you, Terry!

The reason I want to change led config through adb is because we’re installing a lot of devices, and it takes a lot of time to connect a mouse and do it through the GUI.

This is the solution that worked:
adb shell setprop persist.sys.red.led.mode 2
adb shell setprop persist.sys.white.led.trigger 2

Then the leds will be off after reboot. Or if I want to turn the leds off immediately I can run these as well:
adb shell “echo 2 > /sys/class/redled/mode”
adb shell “echo off > /sys/class/leds/sys_led/trigger”