diff --git a/base.mk b/base.mk index b1305c1..38c8d1b 100644 --- a/base.mk +++ b/base.mk @@ -115,6 +115,9 @@ PRODUCT_COPY_FILES += \ device/phh/treble/files/lenovo-synaptics_dsx.kl:system/phh/lenovo-synaptics_dsx.kl \ device/phh/treble/files/oppo-touchpanel.kl:system/phh/oppo-touchpanel.kl \ device/phh/treble/files/google-uinput-fpc.kl:system/phh/google-uinput-fpc.kl \ + device/phh/treble/files/daisy-buttonJack.kl:system/phh/daisy-buttonJack.kl \ + device/phh/treble/files/daisy-uinput-fpc.kl:system/phh/daisy-uinput-fpc.kl \ + device/phh/treble/files/daisy-uinput-goodix.kl:system/phh/daisy-uinput-goodix.kl SELINUX_IGNORE_NEVERALLOWS := true diff --git a/files/daisy-buttonJack.kl b/files/daisy-buttonJack.kl new file mode 100644 index 0000000..8a2c319 --- /dev/null +++ b/files/daisy-buttonJack.kl @@ -0,0 +1,30 @@ +# Copyright (c) 2019, The Linux Foundation. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following +# disclaimer in the documentation and/or other materials provided +# with the distribution. +# * Neither the name of The Linux Foundation nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS +# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +key 226 HEADSETHOOK +key 257 VOLUME_UP +key 258 VOLUME_DOWN diff --git a/files/daisy-uinput-fpc.kl b/files/daisy-uinput-fpc.kl new file mode 100644 index 0000000..754b787 --- /dev/null +++ b/files/daisy-uinput-fpc.kl @@ -0,0 +1,11 @@ +################################## +# +#add for fpc fingerprints +# +################################## + +key 195 SYSTEM_NAVIGATION_UP +key 196 SYSTEM_NAVIGATION_DOWN +key 197 SYSTEM_NAVIGATION_LEFT +key 198 SYSTEM_NAVIGATION_RIGHT +key 353 DPAD_CENTER diff --git a/files/daisy-uinput-goodix.kl b/files/daisy-uinput-goodix.kl new file mode 100644 index 0000000..c0b0089 --- /dev/null +++ b/files/daisy-uinput-goodix.kl @@ -0,0 +1,11 @@ +################################## +# +#add for goodix fingerprints +# +################################## + +key 195 SYSTEM_NAVIGATION_UP +key 196 SYSTEM_NAVIGATION_DOWN +key 197 SYSTEM_NAVIGATION_LEFT +key 198 SYSTEM_NAVIGATION_RIGHT +key 353 DPAD_CENTER diff --git a/rw-system.sh b/rw-system.sh index e02caa6..51aa995 100644 --- a/rw-system.sh +++ b/rw-system.sh @@ -87,7 +87,7 @@ changeKeylayout() { -e xiaomi/polaris -e xiaomi/sirius -e xiaomi/dipper \ -e xiaomi/wayne -e xiaomi/jasmine -e xiaomi/jasmine_sprout \ -e xiaomi/platina -e iaomi/perseus -e xiaomi/ysl -e Redmi/begonia\ - -e xiaomi/nitrogen -e xiaomi/daisy -e xiaomi/sakura -e xiaomi/andromeda \ + -e xiaomi/nitrogen -e xiaomi/sakura -e xiaomi/andromeda \ -e xiaomi/whyred -e xiaomi/tulip -e xiaomi/onc; then if [ ! -f /mnt/phh/keylayout/uinput-goodix.kl ]; then cp /system/phh/empty /mnt/phh/keylayout/uinput-goodix.kl @@ -101,6 +101,21 @@ changeKeylayout() { fi fi + if getprop ro.vendor.build.fingerprint | grep -iq -e xiaomi/daisy; then + mpk="/mnt/phh/keylayout" + cp /system/phh/daisy-buttonJack.kl ${mpk}/msm8953-snd-card-mtp_Button_Jack.kl + changed=true + if [ ! -f /mnt/phh/keylayout/uinput-goodix.kl ]; then + cp /system/phh/daisy-uinput-goodix.kl ${mpk}/uinput-goodix.kl + changed=true + fi + if [ ! -f /mnt/phh/keylayout/uinput-fpc.kl ]; then + cp /system/phh/daisy-uinput-fpc.kl ${mpk}/uinput-fpc.kl + changed=true + fi + chmod 0644 ${mpk}/uinput* ${mpk}/msm8953* + fi + if getprop ro.vendor.build.fingerprint | grep -qi oneplus/oneplus6/oneplus6; then cp /system/phh/oneplus6-synaptics_s3320.kl /mnt/phh/keylayout/synaptics_s3320.kl chmod 0644 /mnt/phh/keylayout/synaptics_s3320.kl