在我的应用程序中,我需要一种方法来通过编程方式关闭标准Android手机键(主页、菜单、返回和搜索)上的灯光 - 我该如何实现?
Runtime r = Runtime.getRuntime();
r.exec("echo 0 > /system/class/leds/keyboard-backlight/brightness");
This is applicable only for the device samsung devices:
To get the BackLight sate:
int backLight = Settings.System.getInt(getContentResolver(), "button_key_light");
// if it return -1 it means that light is on
// if it return 0 the light is off
// some time it will return values like 600(1.5 sec)
if you want to put the backLight as off u can do like this
Settings.System.putInt(getApplicationContext().getContentResolver(), "button_key_light", 0);
sys
挂载在/sys
上,这将使路径变为/sys/class/leds/button-backlight/brightness
- 这在Elephone P5000上有效。 - Ján Sáreník