From 19ce2265e57fae7c33394b10873036c8e37a81de Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Sun, 10 Jun 2018 22:54:14 +0200 Subject: [PATCH] Detect qcom extended brightness and set a property based on this, to be used by framework --- rw-system.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/rw-system.sh b/rw-system.sh index 61076cc..2010b35 100644 --- a/rw-system.sh +++ b/rw-system.sh @@ -61,3 +61,8 @@ fi if ! grep android.hardware.ir /vendor/manifest.xml;then mount -o bind system/phh/empty /system/etc/permissions/android.hardware.consumerir.xml fi + +if getprop ro.hardware |grep -qF qcom && [ -f /sys/class/backlight/panel0-backlight/max_brightness ] && \ + grep -qvE '^255$' /sys/class/backlight/panel0-backlight/max_brightness;then + setprop persist.sys.qcom-brightness $(cat /sys/class/backlight/panel0-backlight/max_brightness) +fi