From 1fb1f6346b95776e2cdd427b04e8ddbae0a0f5e0 Mon Sep 17 00:00:00 2001 From: Taqi Raza Date: Sat, 30 Jul 2022 11:35:42 +0500 Subject: [PATCH 01/10] Fix brightness slider on Xiaomi Poco M4 Pro 5G --- rw-system.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rw-system.sh b/rw-system.sh index 2173b91..7961739 100644 --- a/rw-system.sh +++ b/rw-system.sh @@ -424,7 +424,7 @@ if getprop ro.vendor.build.fingerprint | grep -q -i \ -e xiaomi/nitrogen -e xiaomi/whyred -e xiaomi/platina \ -e xiaomi/ysl -e nubia/nx60 -e nubia/nx61 -e xiaomi/tulip \ -e xiaomi/lavender -e xiaomi/olive -e xiaomi/olivelite -e xiaomi/pine \ - -e Redmi/lancelot -e Redmi/galahad; then + -e Redmi/lancelot -e Redmi/galahad -e POCO/evergreen; then setprop persist.sys.qcom-brightness "$(cat /sys/class/leds/lcd-backlight/max_brightness)" fi From 809d83671f019f41fafc12f16891a29a448bb6f6 Mon Sep 17 00:00:00 2001 From: Taqi Raza Date: Sat, 30 Jul 2022 11:45:32 +0500 Subject: [PATCH 02/10] Update keylayout check fix getting device POCO in build fingerprint. --- rw-system.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rw-system.sh b/rw-system.sh index 2173b91..cc52f93 100644 --- a/rw-system.sh +++ b/rw-system.sh @@ -147,7 +147,7 @@ changeKeylayout() { fi if getprop ro.vendor.build.fingerprint | grep -iq \ - -e poco/ -e redmi/ -e xiaomi/ ; then + -e poco/ -e POCO/ -e redmi/ -e xiaomi/ ; then if [ ! -f /mnt/phh/keylayout/uinput-goodix.kl ]; then cp /system/phh/empty /mnt/phh/keylayout/uinput-goodix.kl chmod 0644 /mnt/phh/keylayout/uinput-goodix.kl From 5b3edfaf9d2f2a855fb0b08534416564ed3995c6 Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Wed, 24 Aug 2022 04:46:10 -0400 Subject: [PATCH 03/10] Fix switching from b slot to a slot -- Fixes https://github.com/phhusson/treble_experimentations/issues/2408 --- ota/phh-ota.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/ota/phh-ota.cpp b/ota/phh-ota.cpp index e90106a..0a4c7d5 100644 --- a/ota/phh-ota.cpp +++ b/ota/phh-ota.cpp @@ -41,11 +41,9 @@ int main(int argc, char **argv) { } if(argc>=2 && strcmp(argv[1], "new-slot") == 0) { std::string current_slot; - std::string next_slot; - if(!android::base::ReadFileToString("/metadata/phh/img", ¤t_slot)) { - next_slot = "a"; - } else { - if(current_slot.c_str()[0] == 'a') + std::string next_slot = "a"; + if(android::base::ReadFileToString("/metadata/phh/img", ¤t_slot) && + current_slot.c_str()[0] == 'a') { next_slot = "b"; } From 64c6844aca57104b08781573d114b21c27193555 Mon Sep 17 00:00:00 2001 From: iovxw Date: Sat, 17 Sep 2022 18:37:11 +0800 Subject: [PATCH 04/10] Fix sound for Xiaomi Mi 10T Lite (gauguin) --- rw-system.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rw-system.sh b/rw-system.sh index b1aafca..d0dba18 100644 --- a/rw-system.sh +++ b/rw-system.sh @@ -457,7 +457,7 @@ if getprop ro.vendor.build.fingerprint | grep -iq \ -e motorola/hannah -e motorola/james -e motorola/pettyl -e xiaomi/cepheus \ -e xiaomi/grus -e xiaomi/cereus -e xiaomi/cactus -e xiaomi/raphael -e xiaomi/davinci \ -e xiaomi/ginkgo -e xiaomi/willow -e xiaomi/laurel_sprout -e xiaomi/andromeda \ - -e redmi/curtana -e redmi/picasso \ + -e xiaomi/gauguin -e redmi/gauguinpro -e redmi/curtana -e redmi/picasso \ -e bq/Aquaris_M10 ; then mount -o bind /mnt/phh/empty_dir /vendor/lib64/soundfx mount -o bind /mnt/phh/empty_dir /vendor/lib/soundfx From 41c8ec4ee0ca25d55a166cb9bd2025f7dedd7008 Mon Sep 17 00:00:00 2001 From: iovxw Date: Sat, 17 Sep 2022 18:40:06 +0800 Subject: [PATCH 05/10] Fix brightness flickers on Xiaomi Mi 10T Lite (gauguin) --- rw-system.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rw-system.sh b/rw-system.sh index d0dba18..291dff9 100644 --- a/rw-system.sh +++ b/rw-system.sh @@ -392,9 +392,9 @@ if getprop ro.vendor.build.fingerprint | grep -iq \ setprop persist.sys.qcom-brightness -1 fi -# Lenovo Z5s brightness flickers without this setting +# Lenovo Z5s & Xiaomi Mi10TLite brightness flickers without this setting if getprop ro.vendor.build.fingerprint | grep -iq \ - -e Lenovo/jd2019; then + -e Lenovo/jd2019 -e Xiaomi/gauguin -e Redmi/gauguinpro; then setprop persist.sys.qcom-brightness -1 fi From 5fd63a42297f39baff4328848118871fdf8d0757 Mon Sep 17 00:00:00 2001 From: iovxw Date: Sun, 18 Sep 2022 01:16:41 +0800 Subject: [PATCH 06/10] Update Mi 10T Lite device fingerprints All possible fingerprints: Xiaomi Mi 10T Lite(Global): Xiaomi/gauguin Xiaomi Mi 10i(India): Xiaomi/gauguininpro Redmi Note 9 Pro(China): Redmi/gauguin, Redmi/gauguinpro --- rw-system.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rw-system.sh b/rw-system.sh index 291dff9..0fe18d0 100644 --- a/rw-system.sh +++ b/rw-system.sh @@ -394,7 +394,7 @@ fi # Lenovo Z5s & Xiaomi Mi10TLite brightness flickers without this setting if getprop ro.vendor.build.fingerprint | grep -iq \ - -e Lenovo/jd2019 -e Xiaomi/gauguin -e Redmi/gauguinpro; then + -e Lenovo/jd2019 -e Xiaomi/gauguin -e Redmi/gauguin; then setprop persist.sys.qcom-brightness -1 fi @@ -457,7 +457,7 @@ if getprop ro.vendor.build.fingerprint | grep -iq \ -e motorola/hannah -e motorola/james -e motorola/pettyl -e xiaomi/cepheus \ -e xiaomi/grus -e xiaomi/cereus -e xiaomi/cactus -e xiaomi/raphael -e xiaomi/davinci \ -e xiaomi/ginkgo -e xiaomi/willow -e xiaomi/laurel_sprout -e xiaomi/andromeda \ - -e xiaomi/gauguin -e redmi/gauguinpro -e redmi/curtana -e redmi/picasso \ + -e xiaomi/gauguin -e redmi/gauguin -e redmi/curtana -e redmi/picasso \ -e bq/Aquaris_M10 ; then mount -o bind /mnt/phh/empty_dir /vendor/lib64/soundfx mount -o bind /mnt/phh/empty_dir /vendor/lib/soundfx From 09ae57bf02f30812a9d0fbb5dc394eb38b1c2edf Mon Sep 17 00:00:00 2001 From: Felix Beslmeisl <> Date: Tue, 6 Sep 2022 14:20:16 +0200 Subject: [PATCH 07/10] Further fix on slot change --- ota/phh-ota.cpp | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/ota/phh-ota.cpp b/ota/phh-ota.cpp index 0a4c7d5..9b25721 100644 --- a/ota/phh-ota.cpp +++ b/ota/phh-ota.cpp @@ -14,6 +14,17 @@ using namespace std::chrono_literals; using namespace std::string_literals; using android::fiemap::IImageManager; + +std::string getNextSlot() { + std::string current_slot; + std::string next_slot = "a"; + if(android::base::ReadFileToString("/metadata/phh/img", ¤t_slot) && + current_slot.c_str()[0] == 'a') { + next_slot = "b"; + } + return next_slot; +} + int main(int argc, char **argv) { mkdir("/metadata/gsi/phh", 0771); chown("/metadata/gsi/phh", 0, 1000); @@ -27,25 +38,13 @@ int main(int argc, char **argv) { return 0; } if(argc>=2 && strcmp(argv[1], "switch-slot") == 0) { - std::string current_slot; - std::string next_slot; - if(!android::base::ReadFileToString("/metadata/phh/img", ¤t_slot)) { - next_slot = "a"; - } else { - if(current_slot.c_str()[0] == 'a') - next_slot = "b"; - } + std::string next_slot = getNextSlot(); mkdir("/metadata/phh", 0700); android::base::WriteStringToFile(next_slot, "/metadata/phh/img"); return 0; } if(argc>=2 && strcmp(argv[1], "new-slot") == 0) { - std::string current_slot; - std::string next_slot = "a"; - if(android::base::ReadFileToString("/metadata/phh/img", ¤t_slot) && - current_slot.c_str()[0] == 'a') { - next_slot = "b"; - } + std::string next_slot = getNextSlot(); std::string imageName = "system_otaphh_"s + next_slot; From f6e059b8e44fc15634f62e1ab5722b8ba767fa84 Mon Sep 17 00:00:00 2001 From: Felix Beslmeisl Date: Sun, 18 Sep 2022 23:03:47 +0200 Subject: [PATCH 08/10] Fixed line indent --- ota/phh-ota.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ota/phh-ota.cpp b/ota/phh-ota.cpp index 9b25721..895a897 100644 --- a/ota/phh-ota.cpp +++ b/ota/phh-ota.cpp @@ -16,7 +16,7 @@ using android::fiemap::IImageManager; std::string getNextSlot() { - std::string current_slot; + std::string current_slot; std::string next_slot = "a"; if(android::base::ReadFileToString("/metadata/phh/img", ¤t_slot) && current_slot.c_str()[0] == 'a') { From 8c28e09626c998cdb420f5b3ee1aa8d5ce727638 Mon Sep 17 00:00:00 2001 From: cangkurileung <111035552+cangkurileung@users.noreply.github.com> Date: Mon, 19 Sep 2022 13:14:13 +0000 Subject: [PATCH 09/10] Fix screen recorder on Redmi9 --- rw-system.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rw-system.sh b/rw-system.sh index 0fe18d0..c789ce4 100644 --- a/rw-system.sh +++ b/rw-system.sh @@ -581,6 +581,10 @@ if getprop ro.vendor.build.fingerprint | grep -iq -e Redmi/merlin; then setprop debug.sf.enable_hwc_vds 0 fi +if getprop ro.vendor.build.fingerprint | grep -iq -e Redmi/lancelot; then + setprop debug.sf.enable_hwc_vds 1 +fi + if getprop ro.vendor.build.fingerprint | grep -iq -e Redmi/rosemary \ -e Redmi/secret -e Redmi/maltose; then setprop debug.sf.latch_unsignaled 1 From 091321c413955c9d2015ec39871aae4da506548b Mon Sep 17 00:00:00 2001 From: zainarbani Date: Fri, 23 Sep 2022 22:48:12 +0700 Subject: [PATCH 10/10] Exclude FP input devices for rosemary rosemary uses 96 for fp custom keycode which detected by InputManager as KEY_KPENTER. screenshots key combo will fail if more than 2 key events detected, exclude it. Signed-off-by: zainarbani --- base.mk | 1 + files/rosemary-excluded-input-devices.xml | 31 +++++++++++++++++++++++ rw-system.sh | 3 +++ 3 files changed, 35 insertions(+) create mode 100644 files/rosemary-excluded-input-devices.xml diff --git a/base.mk b/base.mk index af27de5..d3a0a20 100644 --- a/base.mk +++ b/base.mk @@ -135,6 +135,7 @@ PRODUCT_COPY_FILES += \ 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 \ device/phh/treble/files/tecno-touchpanel.kl:system/phh/tecno-touchpanel.kl \ + device/phh/treble/files/rosemary-excluded-input-devices.xml:system/phh/rosemary-excluded-input-devices.xml SELINUX_IGNORE_NEVERALLOWS := true diff --git a/files/rosemary-excluded-input-devices.xml b/files/rosemary-excluded-input-devices.xml new file mode 100644 index 0000000..bb484cf --- /dev/null +++ b/files/rosemary-excluded-input-devices.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/rw-system.sh b/rw-system.sh index c789ce4..874ed50 100644 --- a/rw-system.sh +++ b/rw-system.sh @@ -589,6 +589,9 @@ if getprop ro.vendor.build.fingerprint | grep -iq -e Redmi/rosemary \ -e Redmi/secret -e Redmi/maltose; then setprop debug.sf.latch_unsignaled 1 setprop debug.sf.enable_hwc_vds 0 + + # Exclude FP input devices + mount -o bind /system/phh/rosemary-excluded-input-devices.xml /system/etc/excluded-input-devices.xml fi if getprop ro.vendor.build.fingerprint | grep -iq -E -e 'huawei|honor' || getprop persist.sys.overlay.huawei | grep -iq -E -e 'true'; then