[Sony Xperia (XZ1)] Fix brightness. Partial support for camera button

This commit is contained in:
Pierre-Hugues Husson 2018-12-16 22:04:04 +01:00
parent 25e6438ba5
commit 69541d380d
2 changed files with 16 additions and 0 deletions

5
files/sony-gpio-keys.kl Normal file
View File

@ -0,0 +1,5 @@
key 114 VOLUME_DOWN
key 115 VOLUME_UP
key 528 FOCUS
key 766 CAMERA

View File

@ -80,6 +80,12 @@ changeKeylayout() {
changed=true
fi
if getprop ro.vendor.build.fingerprint |grep -iq -E -e '^Sony/G834';then
cp /system/phh/sony-gpio-keys.kl /mnt/phh/keylayout/gpio-keys.kl
chmod 0644 /mnt/phh/keylayout/gpio-keys.kl
changed=true
fi
if [ "$changed" == true ];then
mount -o bind /mnt/phh/keylayout /system/usr/keylayout
restorecon -R /system/usr/keylayout
@ -115,6 +121,11 @@ if getprop ro.hardware |grep -qF qcom && [ -f /sys/class/backlight/panel0-backli
setprop persist.sys.qcom-brightness $(cat /sys/class/backlight/panel0-backlight/max_brightness)
fi
#Sony don't use Qualcomm HAL, so they don't have their mess
if getprop ro.vendor.build.fingerprint |grep -qE 'Sony/';then
setprop persist.sys.qcom-brightness -1
fi
if getprop ro.vendor.build.fingerprint |grep -qi oneplus/oneplus6/oneplus6;then
resize2fs /dev/block/platform/soc/1d84000.ufshc/by-name/userdata
fi