Add persist.sys.phh.backlight.scale to control brightness scale from treble app

This commit is contained in:
Pierre-Hugues Husson 2020-12-06 00:58:01 +01:00
parent 30071d0420
commit 843c0ec80a
2 changed files with 20 additions and 0 deletions

View File

@ -143,3 +143,20 @@ if [ "$1" == "persist.sys.phh.vsmart.dt2w" ];then
fi
exit
fi
if [ "$1" == "persist.sys.phh.backlight.scale" ];then
if [[ "$prop_value" != "0" && "$prop_value" != "1" ]]; then
exit 1
fi
if [[ "$prop_value" == 1 ]];then
if [ -f /sys/class/leds/lcd-backlight/max_brightness ];then
setprop persist.sys.qcom-brightness "$(cat /sys/class/leds/lcd-backlight/max_brightness)"
elif [ -f /sys/class/backlight/panel0-backlight/max_brightness ];then
setprop persist.sys.qcom-brightness "$(cat /sys/class/backlight/panel0-backlight/max_brightness)"
fi
else
setprop persist.sys.qcom-brightness -1
fi
exit
fi

View File

@ -44,6 +44,9 @@ on property:persist.sys.phh.caf.audio_policy=*
on property:persist.sys.phh.vsmart.dt2w=*
exec u:r:phhsu_daemon:s0 root -- /system/bin/phh-prop-handler.sh "persist.sys.phh.vsmart.dt2w"
on property:persist.sys.phh.backlight.scale=*
exec u:r:phhsu_daemon:s0 root -- /system/bin/phh-prop-handler.sh "persist.sys.phh.backlight.scale"
on property:ro.sf.lcd_density=*
restart surfaceflinger