Add keylayout to use additional button on Mi MIX 3

AI button is useless in AOSP, so use it as camera key instead
This commit is contained in:
AndroPlus 2018-11-23 20:35:46 +09:00
parent c0ba937fd5
commit ebce78113a
3 changed files with 40 additions and 0 deletions

View File

@ -94,6 +94,7 @@ PRODUCT_COPY_FILES += \
device/phh/treble/files/huawei-fingerprint.kl:system/phh/huawei/fingerprint.kl \
device/phh/treble/files/samsung-sec_e-pen.idc:system/usr/idc/sec_e-pen.idc \
device/phh/treble/files/samsung-9810-floating_feature.xml:system/ph/sam-9810-flo_feat.xml \
device/phh/treble/files/mimix3-gpio-keys.kl:system/phh/mimix3-gpio-keys.kl
SELINUX_IGNORE_NEVERALLOWS := true

33
files/mimix3-gpio-keys.kl Normal file
View File

@ -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
key 115 VOLUME_UP
key 114 VOLUME_DOWN
key 102 HOME
key 528 FOCUS
key 766 CAMERA
# AI
key 689 CAMERA

View File

@ -74,6 +74,12 @@ changeKeylayout() {
changed=true
fi
if getprop ro.vendor.build.fingerprint |grep -iq -e iaomi/perseus;then
cp /system/phh/mimix3-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