From eb74cd65ed8b27004a9ebed698c8940b73b20671 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20R?= Date: Mon, 18 Apr 2022 09:13:39 -0500 Subject: [PATCH] [Motorola One Fusion+] Fix Assistant button --- base.mk | 1 + files/moto-liber-gpio-keys.kl | 33 +++++++++++++++++++++++++++++++++ rw-system.sh | 3 +++ 3 files changed, 37 insertions(+) create mode 100644 files/moto-liber-gpio-keys.kl diff --git a/base.mk b/base.mk index 7fed17d..62e5d18 100644 --- a/base.mk +++ b/base.mk @@ -132,6 +132,7 @@ PRODUCT_COPY_FILES += \ device/phh/treble/files/zf6-googlekey_input.kl:system/phh/zf6-googlekey_input.kl \ device/phh/treble/files/teracube2e-mtk-kpd.kl:system/phh/teracube2e-mtk-kpd.kl \ device/phh/treble/files/bv9500plus-mtk-kpd.kl:system/phh/bv9500plus-mtk-kpd.kl \ + device/phh/treble/files/moto-liber-gpio-keys.kl:system/phh/moto-liber-gpio-keys.kl SELINUX_IGNORE_NEVERALLOWS := true diff --git a/files/moto-liber-gpio-keys.kl b/files/moto-liber-gpio-keys.kl new file mode 100644 index 0000000..871c758 --- /dev/null +++ b/files/moto-liber-gpio-keys.kl @@ -0,0 +1,33 @@ +# Copyright (c) 2013, 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 115 VOLUME_UP +key 114 VOLUME_DOWN +key 102 HOME +key 217 ASSIST +key 528 FOCUS +key 766 CAMERA diff --git a/rw-system.sh b/rw-system.sh index fe760b1..622f5b2 100644 --- a/rw-system.sh +++ b/rw-system.sh @@ -282,6 +282,9 @@ changeKeylayout() { fi if getprop ro.vendor.build.fingerprint | grep -iq -e motorola/liber; then + cp /system/phh/moto-liber-gpio-keys.kl /mnt/phh/keylayout/gpio-keys.kl + chmod 0644 /mnt/phh/keylayout/gpio-keys.kl + cp /system/phh/empty /mnt/phh/keylayout/uinput_nav.kl chmod 0644 /mnt/phh/keylayout/uinput_nav.kl changed=true