From 3f1fb0d20b5681b5c57150c86f0162c8373f0ddd Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Mon, 10 Sep 2018 00:32:11 +0200 Subject: [PATCH] OP6: Keylayout to support dt2w --- base.mk | 5 ++++- files/oneplus6-synaptics_s3320.kl | 28 ++++++++++++++++++++++++++++ rw-system.sh | 6 ++++++ 3 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 files/oneplus6-synaptics_s3320.kl diff --git a/base.mk b/base.mk index 4a3a463..30c7e03 100644 --- a/base.mk +++ b/base.mk @@ -78,6 +78,7 @@ PRODUCT_PACKAGES += \ endif PRODUCT_PACKAGES += \ + android.hardware.wifi.hostapd-V1.0-java \ vendor.huawei.hardware.biometrics.fingerprint-V2.1-java \ vendor.huawei.hardware.tp-V1.0-java \ vendor.qti.hardware.radio.am-V1.0-java \ @@ -88,4 +89,6 @@ PRODUCT_COPY_FILES += \ PRODUCT_COPY_FILES += \ device/phh/treble/files/samsung-gpio_keys.kl:system/phh/samsung-gpio_keys.kl \ - device/phh/treble/files/samsung-sec_touchscreen.kl:system/phh/samsung-sec_touchscreen.kl + device/phh/treble/files/samsung-sec_touchscreen.kl:system/phh/samsung-sec_touchscreen.kl \ + device/phh/treble/files/oneplus6-synaptics_s3320.kl:system/phh/oneplus6-synaptics_s3320.kl \ + diff --git a/files/oneplus6-synaptics_s3320.kl b/files/oneplus6-synaptics_s3320.kl new file mode 100644 index 0000000..7c0e47c --- /dev/null +++ b/files/oneplus6-synaptics_s3320.kl @@ -0,0 +1,28 @@ +# Copyright (c) 2015, 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 62 WAKEUP diff --git a/rw-system.sh b/rw-system.sh index 89d3357..34b18e6 100644 --- a/rw-system.sh +++ b/rw-system.sh @@ -60,6 +60,12 @@ changeKeylayout() { changed=true fi + if [ "$(getprop ro.vendor.product.device)" == "OnePlus6" ];then + cp /system/phh/oneplus6-synaptics_s3320.kl /mnt/phh/keylayout/synaptics_s3320.kl + chmod 0644 /mnt/phh/keylayout/synaptics_s3320.kl + changed=true + fi + if [ "$changed" == true ];then mount -o bind /mnt/phh/keylayout /system/usr/keylayout restorecon -R /system/usr/keylayout