Reputation: 415
Before i ask this question, i've realized it, but it is based on some conditions.
Try1: Change the chmod of file '/sys/class/leds/button-backlight/brightness' to 777, the original file is readable but not writeable, then write '1' to this file to turn on led backlight, '0' to turn off. However, i don't want to change the property of this file.
Try2: something like 'Try 1', that is: Runtime.getRuntime().exec("echo 0 > /sys/class/leds/button-backlight/brightness");
to turn off, Runtime.getRuntime().exec("echo 1 > /sys/class/leds/button-backlight/brightness");
to turn on, but this requires your phone has been rooted or you're a super user when execute the code. So, it isn't the solution that i want.
My thought: i can follow the way that Android System itself turn on/off the led backlight when we touch key like 'Menu', 'Home', 'Back'. But, i don't know how to track or find the ralated code in Android Open Source Code.
I do really appreciate any tip, any thought or any possible way that you provide.
Upvotes: 2
Views: 6788