Question

I found some info on the web:

echo 1 /sys/devices/platform/flashlight.0/leds/flashlight/brightness

But on my Nexus 7 (flashed an AOSP), I couldn't find that directory.

Any idea about which file should I write to? Is this doable?

After ls /sys/devices/platform, I got:

LID
alarm
arm-pmu.0
bcm4330_rfkill
bcmdhd_wlan.1
bluesleep
fiq_debugger.0
fsl-tegra-udc
gpio-keys.0
grouper_misc
leds-gpio
oprofile-perf.0
power
power.0
pwm-backlight
ram_console
reg-dummy
reg-fixed-voltage.1
reg-fixed-voltage.10
reg-fixed-voltage.11
reg-fixed-voltage.2
reg-fixed-voltage.3
reg-fixed-voltage.4
reg-fixed-voltage.6
reg-fixed-voltage.8
regulatory.0
sdhci-tegra.2
sdhci-tegra.3
serial8250
snd-soc-dummy
spdif-dit.0
spdif-dit.1
spi_tegra.0
spi_tegra.3
tegra-ehci.1
tegra-i2c.0
tegra-i2c.1
tegra-i2c.2
tegra-i2c.3
tegra-i2c.4
tegra-nvmap
tegra-otg
tegra-pcm-audio
tegra-se
tegra-snd-rt5640.0
tegra30-ahub
tegra30-dam.0
tegra30-dam.1
tegra30-dam.2
tegra30-hda
tegra30-i2s.1
tegra30-i2s.3
tegra30-i2s.4
tegra30-spdif
tegra_camera
tegra_pwm.0
tegra_rtc
tegra_smmu
tegra_uart.1
tegra_uart.2
tegra_uart.3
tegra_uart.4
tegra_wdt
uevent
Was it helpful?

Solution 3

You should use the pwm-backlight!

OTHER TIPS

There is a new binary shipping with Android Jellybean 4.2, which can be used to directly read/write to the system settings provider, accessible via command line.

For example: in order to increase brightness of the screen, use below command:

adb shell settings put system screen_brightness 200

Read more about SCREEN_BRIGHTNESS Note that the range of values is [0 - 255]

The range of values is not necessarily from 0 - 255. On my OnePlus for example it ranges from 0-2047. If you want to know yours just set the brightness slider to max and then type: adb shell settings get system screen_brightness.

This did not work for the latest Nexus 7 (2013) for me. But this answer explains the way to find what you are looking for on any version: https://stackoverflow.com/a/13492336

However we need to note that in order to change any of this you need to have root access.

You can use this adb command to set screen brightness

adb shell settings put system screen_brightness 255

and if your device has auto brightness setting then use this command first

adb shell settings put system screen_brightness_mode 0
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top