├── upload.sh ├── README.md └── patches ├── personal ├── platform_vendor_certification │ └── 0001-No-more-Pif.patch ├── platform_vendor_superior │ ├── 0004-Nuke-priv-keys-call.patch │ ├── 0002-Inherit-call-phh_gsi-mk.patch │ └── 0001-Add-ccache-to-environment-script.patch ├── platform_packages_apps_Settings │ ├── 0008-add-Face-Unlock-with-ParanoidSense.patch │ ├── 0001-Accent-search-button.patch │ └── 0007-Add-capability-to-allow-tethering-to-use-VPN-upstreams-3.patch ├── platform_frameworks_base │ ├── 0026-Fixup-Default-Pocket-Lock-sensor.patch │ ├── 0025-Enable-SPLIT_SHADE_SUBPIXEL_OPTIMIZATION.patch │ ├── 0010-Fixup-QS-pulldown-default-value.patch │ ├── 0019-Reduce-Circle-Battery-Text.patch │ ├── 0013-Reduce-default-QS-Label-Size.patch │ ├── 0020-SystemUI-Disable-blur-wakeup-animation.patch │ └── 0005-Allow-to-disable-expanded-media-player.patch ├── platform_packages_modules_Connectivity │ ├── 0001-netbpfload-Disable-reboot-on-failure.patch │ ├── 0004-netbpfload-Support-no-bpf-usecase.patch │ └── 0003-mdns-disable-SocketNetlinkMonitor.patch ├── platform_frameworks_av │ ├── 0001-Dont-segfault-if-we-get-a-NULL-parameter.patch │ ├── 0003-Free-buffers-on-observer-died.patch │ ├── 0006-Add-a-prop-to-set-AUDIO_OUTPUT_FLAG_DIRECT-on-voip_rx.patch │ └── 0004-Check-trackMeta-for-NULL.patch ├── platform_packages_apps_SuperiorLab │ ├── 0002-Clipboard-Overlay.patch │ ├── 0004-Squiggle.patch │ ├── 0006-SAF-Restriction.patch │ ├── 0011-Gaming-Mode.patch │ ├── 0013-Allow-to-turn-on-Bluetooth-with-one-tap-2-2.patch │ └── 0001-Android-P-animations.patch └── platform_vendor_hardware_overlay │ └── 0002-Handle-TrebleAppSecure.patch ├── trebledroid ├── platform_packages_modules_vndk │ └── 0001-Include-vndk-v28-apex.patch ├── platform_build │ ├── 0003-Include-vndk-v28-sepolicy-support.patch │ ├── 0002-build-Remove-llkd.patch │ └── 0004-core-sysprop-Write-build-display-id-to-product-prop.patch ├── platform_system_linkerconfig │ └── 0001-Disable-vndklite-handling.patch ├── platform_system_netd │ ├── 0004-Don-t-abort-in-case-of-cgroup-bpf-setup-fail-since-s.patch │ ├── 0003-Support-no-bpf-usecase.patch │ ├── 0001-Huawei-Kirin-960-accept-broken-rpfilter-match.patch │ └── 0002-Don-t-fail-on-FTP-conntracking-failing.patch ├── platform_packages_modules_DnsResolver │ └── 0001-Dont-abort-if-the-DnsHelper-failed-to-init-on-BPF-le.patch ├── platform_frameworks_base │ ├── 0045-Add-Samsung-sysinput.patch │ ├── 0009-Support-samsung-Pie-and-Q-light-hal.patch │ ├── 0049-Include-vendor.samsung.hardware.radio-V2.2-java-HIDL.patch │ ├── 0048-Include-vendor.samsung.hardware.radio.network-V1-jav.patch │ ├── 0037-Once-we-integrate-Samsung-Power-hal-in-libpowermanag.patch │ ├── 0012-HOME-deserves-to-wake-up-devices-just-as-well-as-bac.patch │ ├── 0003-Fix-env-empty-string-ANDROID_STORAGE.patch │ ├── 0016-Remove-useless-notification-about-console-service-be.patch │ ├── 0025-Allow-disabling-of-fingerprint-cleanups-needed-on-so.patch │ ├── 0036-Catch-NPE-in-SystemUI.patch │ ├── 0034-Restore-getSimStateForSlotIndex-in-SubscriptionManag.patch │ ├── 0028-SystemUI-Use-AVCProfileMain-for-screen-recorder.patch │ ├── 0039-Fix-brightness-slider-curve-for-some-devices.patch │ ├── 0019-TelephonyManager-add-API-annotations-for-setTelephon.patch │ ├── 0053-Add-a-prop-to-disable-animation-in-for-sysui-media-c.patch │ ├── 0002-Fallback-to-stupid-autobrightness-if-brightness-valu.patch │ ├── 0026-Dynamically-resize-boot-animation-to-match-screen-si.patch │ ├── 0014-Fix-brightness-range-not-being-complete-on-Samsung-d.patch │ ├── 0001-Disable-vendor-mismatch-warning.patch │ ├── 0005-Don-t-crash-if-there-is-IR-HAL-is-not-declared.patch │ ├── 0021-Automatically-detect-pick-up-sensor-so-that-an-overl.patch │ ├── 0008-Re-order-services-so-that-it-works-even-without-qtag.patch │ └── 0043-Add-a-prop-to-use-linear-backlight-control.patch ├── platform_system_vold │ ├── 0005-Every-voldmanaged-storage-is-adoptable.patch │ ├── 0003-Don-t-unmount-rw-system.sh-binds.patch │ ├── 0001-Allow-deletion-of-symlink.patch │ ├── 0002-Failing-to-create-facedata-shouldn-t-be-fatal.patch │ └── 0004-Exfat-can-be-mounted-with-exfat-kernel-fs-driver-or-.patch ├── platform_external_selinux │ ├── 0001-Increase-default-log_level-to-get-actual-selinux-err.patch │ ├── 0008-Improve-SELinux-policy-workaround-on-device-phh-treb.patch │ ├── 0010-Allow-conflict-on-fuseblk.patch │ ├── 0006-Allow-mismatches-of-exfat-genfscon.patch │ ├── 0009-Allow-sys-vm-watermark_scale_factor-conflict-seen-on.patch │ ├── 0005-if-service-is-rcs-accept-conflict.-Seen-on-Moto-E5.patch │ ├── 0004-Allow-devices-virtual-block-genfscon-conflict-seen-o.patch │ └── 0002-Revert-libsepol-Make-an-unknown-permission-an-error-.patch ├── platform_frameworks_native │ ├── 0012-Disable-gpuservice-on-old-BPF-less-kernel.patch │ ├── 0003-unshared_oob-didn-t-exist-in-O-P-so-detect-its-suppo.patch │ ├── 0013-SurfaceFlinger-Disable-SF-HWC-backpressure.patch │ ├── 0001-On-Samsung-we-need-to-send-a-hack-message-to-HAL-to-.patch │ ├── 0004-Remove-Samsung-system-permission-on-sensors.patch │ ├── 0005-Mark-accelerometer-input-as-sensor-exclusively-if-th.patch │ ├── 0010-Fix-loading-unnamed-GLES.patch │ └── 0002-Matching-an-input-with-a-display-uses-uniqueId.patch ├── platform_system_core │ ├── 0016-Add-vendor-firmware_mnt.-Moto-Razr-2019-look-for-fir.patch │ ├── 0020-fix-Nubia-6-series-custom-rc-action-prop-validation.patch │ ├── 0019-Disable-project_quota-on-old-devices-but-new-enough-.patch │ ├── 0011-Let-system-override-adb-secure-props-so-we-dont-get-.patch │ ├── 0017-Ignore-dm-verity-setup-issues.patch │ ├── 0006-Ugly-but-secure-Set-dev-uinput-as-0666-to-fix-finger.patch │ ├── 0022-Keep-our-own-version-of-ro.logd.kernel.-We-do-want-l.patch │ ├── 0015-Disable-quotas-on-legacy-devices-with-encryption-dis.patch │ ├── 0007-Revert-Set-system-xbin-permissions-to-750.patch │ ├── 0023-Keep-capex-when-there-are-vendor-apexes.patch │ ├── 0002-Don-t-abandon-creating-property-tree-if-there-is-a-c.patch │ ├── 0009-fs_mgr-Keep-allowing-encryptable-fstab-flag.patch │ ├── 0021-HACK-Ignore-errors-when-setting-fscrypt-directory.-S.patch │ ├── 0001-Let-system-override-ro.apex.updatable.patch │ ├── 0018-Fix-support-for-devices-without-cgroupv2-support.patch │ ├── 0010-FDE-is-dead.-Fallback-FDE-to-no-encryption-and-FDE-F.patch │ ├── 0005-Detect-allowed-sdcard-options-based-on-vndk.patch │ └── 0026-Flattened-apexes-no-longer-exist-we-ll-deal-with-it-.patch ├── platform_bootable_recovery │ └── 0001-Don-t-reboot-if-we-couldn-t-get-bootctrl.patch ├── platform_packages_modules_Connectivity │ ├── 0009-Revert-netdupdatable-add-back-abort-on-init-fail.patch │ ├── 0001-Allow-failing-to-load-bpf-programs-for-BPF-less-devi.patch │ └── 0004-Revert-drop-support-for-V-gsi-on-pixel-5-R-base-kern.patch ├── platform_system_nfc │ └── 0001-Let-vendor-have-priority-over-NFC-config-file-rather.patch ├── platform_hardware_interfaces │ ├── 0003-Fix-crash-on-Samsung-S23-using-stock-properties-beca.patch │ ├── 0001-Add-a-vendor800-command-to-be-able-to-call-vendor-sp.patch │ └── 0002-Fix-light-sensor-crash-on-Xiaomi-13.patch ├── platform_frameworks_opt_net_ims │ └── 0001-Pie-MTK-IMS-calls-static-ImsManager.updateImsService.patch ├── platform_frameworks_opt_telephony │ ├── 0010-Fix-NPE-with-1.0-and-1.1-CardStatus.patch │ ├── 0003-Fix-baseband-being-too-long-to-fit-into-a-91-chars-p.patch │ ├── 0002-Telephony-Don-not-call-onUssdRelease-for-Huawei-RIL.patch │ ├── 0012-When-logging-UiccSlot-ignore-error-if-we-cant-print-.patch │ ├── 0008-telephony-forward-port-support-for-forceCognitive.patch │ └── 0004-Reintroduce-public-void-TelephonyMetrics.writeRilSen.patch ├── platform_frameworks_av │ ├── 0015-Not-all-sources-in-a-route-are-valid.-Dont-ignore-th.patch │ ├── 0021-Add-a-prop-to-disable-AUDIO_OUTPUT_FLAG_FAST-from-au.patch │ ├── 0013-Make-camera-IDs-filter-out-optional.patch │ ├── 0012-No-longer-make-re-assigning-legacy-audio-groups-fata.patch │ ├── 0016-Use-a-fake-volume-policy-when-none-has-been-found.patch │ ├── 0020-audiopolicy-Fix-broken-mic-while-video-recording-on-.patch │ ├── 0010-Add-a-property-to-force-camera-timestamp-source.patch │ ├── 0008-There-are-three-SCO-devices.-Fallback-from-one-to-th.patch │ └── 0019-voip-Fix-high-pitched-voice-on-Qualcomm-devices.patch ├── platform_bionic │ └── 0001-Disable-vndklite-handling.patch ├── platform_system_extras │ └── 0001-libfscrypt-Bail-out-if-we-can-t-open-directory.patch ├── platform_packages_modules_DeviceLock │ └── 0001-Don-t-crash-when-we-get-no-DeviceLockManager.patch ├── platform_packages_modules_Wifi │ └── 0001-Add-persist.sys.phh.wifi_disable_sae-property-to-dis.patch ├── platform_system_sepolicy │ └── 0002-Fix-sepolicy-for-kernel-5.10-that-doesn-t-support-bp.patch ├── platform_packages_apps_Settings │ ├── 0001-Act-as-usb-device-when-there-is-no-hal-but-we-believ.patch │ └── 0002-Ignore-cancelled-fingerprint-events-they-are-expecte.patch ├── platform_system_apex │ └── 0001-Disable-O_DIRECT-for-old-kernels.patch └── platform_system_bpf │ └── 0001-Support-no-bpf-usecase.patch └── pre ├── platform_packages_apps_Aperture └── 01-Enable-auxiliary-cameras.patch ├── platform_frameworks_base └── 0002-Revert-SystemUI-Always-disable-rotation-on-lockscree.patch ├── platform_vendor_superior ├── 02-Nuke-duplicated-ro-adb-secure.patch └── 01-Disable-generated-kernel-headers.patch └── platform_packages_apps_Launcher3 └── 01-Add-misssing-package-usage-stats-permission.patch /upload.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | for file in `ls ~/ | grep xz` ; do 4 | gh release upload --clobber $1 ~/$file 5 | done 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # treble_superior_patches 2 | Patches for build Superior OS as PHH-Treble GSI 3 | 4 | ## Credits 5 | These people have helped this project in some way or another, so they should be the ones who receive all the credit: 6 | - [phhusson](https://github.com/phhusson) 7 | - [AndyYan](https://github.com/AndyCGYan) 8 | - [ponces](https://github.com/ponces) 9 | - [eremitein](https://github.com/eremitein) 10 | - [Peter Cai](https://github.com/PeterCxy) 11 | - [haridhayal11](https://github.com/haridhayal11) 12 | - [Iceows](https://github.com/Iceows) 13 | -------------------------------------------------------------------------------- /patches/personal/platform_vendor_certification/0001-No-more-Pif.patch: -------------------------------------------------------------------------------- 1 | From 972d43ae13e470e0665f10c5bdc0069cf83f50ee Mon Sep 17 00:00:00 2001 2 | From: ChonDoit 3 | Date: Thu, 3 Oct 2024 23:45:23 -0300 4 | Subject: [PATCH] No more Pif 5 | 6 | --- 7 | config.mk | 3 --- 8 | 1 file changed, 3 deletions(-) 9 | 10 | diff --git a/config.mk b/config.mk 11 | index 604155f..e69de29 100644 12 | --- a/config.mk 13 | +++ b/config.mk 14 | @@ -1,3 +0,0 @@ 15 | -# PifPrebuilt 16 | -PRODUCT_PACKAGES += \ 17 | - PifPrebuilt 18 | -- 19 | 2.25.1 20 | 21 | -------------------------------------------------------------------------------- /patches/personal/platform_vendor_superior/0004-Nuke-priv-keys-call.patch: -------------------------------------------------------------------------------- 1 | From 38f32cbce5647a9e55e7379f028dd76f86a53287 Mon Sep 17 00:00:00 2001 2 | From: ChonDoit 3 | Date: Tue, 1 Oct 2024 00:40:17 -0300 4 | Subject: [PATCH] Nuke priv keys call 5 | 6 | --- 7 | config/branding.mk | 2 -- 8 | 1 file changed, 2 deletions(-) 9 | 10 | diff --git a/config/branding.mk b/config/branding.mk 11 | index 5aae8ce..cfb7738 100644 12 | --- a/config/branding.mk 13 | +++ b/config/branding.mk 14 | @@ -71,5 +71,3 @@ PRODUCT_SYSTEM_DEFAULT_PROPERTIES += \ 15 | ro.build.datetime=$(BUILD_DATE_TIME) \ 16 | ro.superior.edition=$(SUPERIOR_EDITION) 17 | 18 | -# Private keys for signing 19 | --include vendor/superior-priv/keys/keys.mk 20 | -- 21 | 2.25.1 22 | 23 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_packages_modules_vndk/0001-Include-vndk-v28-apex.patch: -------------------------------------------------------------------------------- 1 | From d31481328f865b04e778b8a7bad5278f0970a97f Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Fri, 6 Oct 2023 05:18:39 -0400 4 | Subject: [PATCH] Include vndk v28 apex 5 | 6 | Change-Id: I5689074542f13e136e5bc1292afec2a8288f9e1c 7 | --- 8 | apex/Android.bp | 6 ++++++ 9 | 1 file changed, 6 insertions(+) 10 | 11 | diff --git a/apex/Android.bp b/apex/Android.bp 12 | index 3e20230..4ccf12f 100644 13 | --- a/apex/Android.bp 14 | +++ b/apex/Android.bp 15 | @@ -89,3 +89,9 @@ apex_vndk { 16 | system_ext_specific: true, 17 | } 18 | 19 | +apex_vndk { 20 | + name: "com.android.vndk.v28", 21 | + defaults: ["vndk-apex-defaults"], 22 | + vndk_version: "28", 23 | + system_ext_specific: true, 24 | +} 25 | -- 26 | 2.34.1 27 | 28 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_build/0003-Include-vndk-v28-sepolicy-support.patch: -------------------------------------------------------------------------------- 1 | From e6b76d1e7d9be605890c8125efdf0b4a33957048 Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Fri, 6 Oct 2023 19:11:22 -0400 4 | Subject: [PATCH 3/4] Include vndk v28 sepolicy support 5 | 6 | --- 7 | core/config.mk | 1 + 8 | 1 file changed, 1 insertion(+) 9 | 10 | diff --git a/core/config.mk b/core/config.mk 11 | index 546858aac9..11e8799405 100644 12 | --- a/core/config.mk 13 | +++ b/core/config.mk 14 | @@ -879,6 +879,7 @@ BOARD_SEPOLICY_VERS := $(PLATFORM_SEPOLICY_VERSION) 15 | 16 | # A list of SEPolicy versions, besides PLATFORM_SEPOLICY_VERSION, that the framework supports. 17 | PLATFORM_SEPOLICY_COMPAT_VERSIONS := $(filter-out $(PLATFORM_SEPOLICY_VERSION), \ 18 | + 28.0 \ 19 | 29.0 \ 20 | 30.0 \ 21 | 31.0 \ 22 | -- 23 | 2.34.1 24 | 25 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_system_linkerconfig/0001-Disable-vndklite-handling.patch: -------------------------------------------------------------------------------- 1 | From 1aab47c48e3c3d4b1c12a25f9cd5b8d169683ffc Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Wed, 27 Oct 2021 14:40:26 -0400 4 | Subject: [PATCH] Disable vndklite handling 5 | 6 | Change-Id: I4a132512471a68891f2efb59539267c35a3c3e56 7 | --- 8 | modules/environment.cc | 2 +- 9 | 1 file changed, 1 insertion(+), 1 deletion(-) 10 | 11 | diff --git a/modules/environment.cc b/modules/environment.cc 12 | index 01e520e..e4991c2 100644 13 | --- a/modules/environment.cc 14 | +++ b/modules/environment.cc 15 | @@ -28,7 +28,7 @@ bool IsTreblelizedDevice() { 16 | } 17 | 18 | bool IsVndkLiteDevice() { 19 | - return Variables::GetValue("ro.vndk.lite").value_or("") == "true"; 20 | + return false; 21 | } 22 | 23 | bool IsVndkInSystemNamespace() { 24 | -- 25 | 2.34.1 26 | 27 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_system_netd/0004-Don-t-abort-in-case-of-cgroup-bpf-setup-fail-since-s.patch: -------------------------------------------------------------------------------- 1 | From 60e8ec91fa93bbd5f190cb70563c0b57f101ad21 Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Wed, 26 Oct 2022 18:13:56 -0400 4 | Subject: [PATCH 4/4] Don't abort in case of cgroup/bpf setup fail, since some 5 | devices dont have BPF 6 | 7 | --- 8 | server/main.cpp | 2 +- 9 | 1 file changed, 1 insertion(+), 1 deletion(-) 10 | 11 | diff --git a/server/main.cpp b/server/main.cpp 12 | index b0c5406d..ec15ecc2 100644 13 | --- a/server/main.cpp 14 | +++ b/server/main.cpp 15 | @@ -145,7 +145,7 @@ int main() { 16 | 17 | if (libnetd_updatable_init(cg2_path.c_str())) { 18 | ALOGE("libnetd_updatable_init failed"); 19 | - exit(1); 20 | + //exit(1); 21 | } 22 | gLog.info("libnetd_updatable_init success"); 23 | 24 | -- 25 | 2.34.1 26 | 27 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_build/0002-build-Remove-llkd.patch: -------------------------------------------------------------------------------- 1 | From d37dc312e1710545fd4b6c6cda4f5d7bcbbae5f5 Mon Sep 17 00:00:00 2001 2 | From: Andy CrossGate Yan 3 | Date: Thu, 14 Oct 2021 12:20:52 +0000 4 | Subject: [PATCH 2/4] build: Remove llkd 5 | 6 | ...until someone figures out why Genshin Impact fails it 7 | 8 | Change-Id: I29384a820a0c07b29d3f11d7039bed40eeaee926 9 | --- 10 | target/product/base_system.mk | 1 - 11 | 1 file changed, 1 deletion(-) 12 | 13 | diff --git a/target/product/base_system.mk b/target/product/base_system.mk 14 | index 5969cc884d..c780679f1a 100644 15 | --- a/target/product/base_system.mk 16 | +++ b/target/product/base_system.mk 17 | @@ -211,7 +211,6 @@ PRODUCT_PACKAGES += \ 18 | libvulkan \ 19 | libwilhelm \ 20 | linker \ 21 | - llkd \ 22 | lmkd \ 23 | LocalTransport \ 24 | locksettings \ 25 | -- 26 | 2.34.1 27 | 28 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_packages_modules_DnsResolver/0001-Dont-abort-if-the-DnsHelper-failed-to-init-on-BPF-le.patch: -------------------------------------------------------------------------------- 1 | From dd03c99e311866b3e05c7a18c73183155715986a Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Tue, 7 May 2024 22:44:25 +0000 4 | Subject: [PATCH] Dont abort if the DnsHelper failed to init on BPF-less kernel 5 | 6 | --- 7 | DnsProxyListener.cpp | 1 - 8 | 1 file changed, 1 deletion(-) 9 | 10 | diff --git a/DnsProxyListener.cpp b/DnsProxyListener.cpp 11 | index 8064aef7..008e1a5d 100644 12 | --- a/DnsProxyListener.cpp 13 | +++ b/DnsProxyListener.cpp 14 | @@ -691,7 +691,6 @@ IsUidBlockedFn resolveIsUidNetworkingBlockedFn() { 15 | const int ret = (*ADnsHelper_init)(); 16 | if (ret) { 17 | LOG(ERROR) << __func__ << ": ADnsHelper_init failed " << strerror(-ret); 18 | - abort(); 19 | } 20 | 21 | IsUidBlockedFn f = 22 | -- 23 | 2.34.1 24 | 25 | -------------------------------------------------------------------------------- /patches/personal/platform_vendor_superior/0002-Inherit-call-phh_gsi-mk.patch: -------------------------------------------------------------------------------- 1 | From 96a5792d7c747042448555c896a765e82e30ef8f Mon Sep 17 00:00:00 2001 2 | From: ChonDoit 3 | Date: Sat, 11 Nov 2023 16:58:32 +0000 4 | Subject: [PATCH] Inherit call phh_gsi.mk 5 | 6 | --- 7 | config/common.mk | 7 +++++++ 8 | 1 file changed, 7 insertions(+) 9 | 10 | diff --git a/config/common.mk b/config/common.mk 11 | index 33fd0094..d51fa2b7 100644 12 | --- a/config/common.mk 13 | +++ b/config/common.mk 14 | @@ -14,6 +14,13 @@ 15 | 16 | PRODUCT_BRAND ?= SuperiorOS 17 | 18 | +# PHH GSI 19 | +$(call inherit-product, vendor/superior/config/phh_gsi.mk) 20 | +$(call inherit-product, device/superior/sepolicy/common/sepolicy.mk) 21 | + 22 | +# Set Bootanimation at 720P 23 | +TARGET_BOOT_ANIMATION_RES := 720 24 | + 25 | PRODUCT_BUILD_PROP_OVERRIDES += BUILD_UTC_DATE=0 26 | 27 | # Enable SIP+VoIP on all targets 28 | -- 29 | 2.34.1 30 | 31 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_frameworks_base/0045-Add-Samsung-sysinput.patch: -------------------------------------------------------------------------------- 1 | From a0912bc287e7c0ad6bb16742e5c8e4a41f7192ff Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Mon, 29 Jan 2024 17:07:07 -0500 4 | Subject: [PATCH 45/54] Add Samsung sysinput 5 | 6 | --- 7 | services/core/Android.bp | 1 + 8 | 1 file changed, 1 insertion(+) 9 | 10 | diff --git a/services/core/Android.bp b/services/core/Android.bp 11 | index 6b7849ed..7924c739 100644 12 | --- a/services/core/Android.bp 13 | +++ b/services/core/Android.bp 14 | @@ -259,6 +259,7 @@ java_library_static { 15 | "vendor.mediatek.hardware.mtkpower-V1.1-java", 16 | "vendor.samsung.hardware.sysinput-V1.2-java", 17 | //AIDL 18 | + "vendor.samsung.hardware.sysinput-V1-java", 19 | "vendor.samsung.hardware.biometrics.fingerprint-V1-java", 20 | "vendor.samsung.hardware.light-V1-java", 21 | ], 22 | -- 23 | 2.34.1 24 | 25 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_system_vold/0005-Every-voldmanaged-storage-is-adoptable.patch: -------------------------------------------------------------------------------- 1 | From 18901920f46d3b3915e4dcebbd4ac1207875ae2d Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Wed, 11 Mar 2020 14:02:35 +0100 4 | Subject: [PATCH] Every voldmanaged storage is adoptable 5 | 6 | --- 7 | main.cpp | 2 +- 8 | 1 file changed, 1 insertion(+), 1 deletion(-) 9 | 10 | diff --git a/main.cpp b/main.cpp 11 | index 261f4d4..a45215f 100644 12 | --- a/main.cpp 13 | +++ b/main.cpp 14 | @@ -275,7 +275,7 @@ static int process_config(VolumeManager* vm, VoldConfigs* configs) { 15 | int partnum = entry.partnum; 16 | int flags = 0; 17 | 18 | - if (entry.is_encryptable()) { 19 | + if (entry.is_encryptable() || true) { 20 | flags |= android::vold::Disk::Flags::kAdoptable; 21 | configs->has_adoptable = true; 22 | } 23 | -- 24 | 2.34.1 25 | 26 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_external_selinux/0001-Increase-default-log_level-to-get-actual-selinux-err.patch: -------------------------------------------------------------------------------- 1 | From 3f08011b0526525692fc46e8e04824ed1b395885 Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Mon, 9 Apr 2018 00:19:49 +0200 4 | Subject: [PATCH 01/10] Increase default log_level to get actual selinux error 5 | in kmsg 6 | 7 | --- 8 | secilc/secilc.c | 2 +- 9 | 1 file changed, 1 insertion(+), 1 deletion(-) 10 | 11 | diff --git a/secilc/secilc.c b/secilc/secilc.c 12 | index 80d3583d..a51630b2 100644 13 | --- a/secilc/secilc.c 14 | +++ b/secilc/secilc.c 15 | @@ -107,7 +107,7 @@ int main(int argc, char *argv[]) 16 | int opt_index = 0; 17 | char *fc_buf = NULL; 18 | size_t fc_size; 19 | - enum cil_log_level log_level = CIL_ERR; 20 | + enum cil_log_level log_level = CIL_WARN; 21 | static struct option long_opts[] = { 22 | {"help", no_argument, 0, 'h'}, 23 | {"verbose", no_argument, 0, 'v'}, 24 | -- 25 | 2.34.1 26 | 27 | -------------------------------------------------------------------------------- /patches/personal/platform_packages_apps_Settings/0008-add-Face-Unlock-with-ParanoidSense.patch: -------------------------------------------------------------------------------- 1 | From c8bc7616ed24c6058670841230fcf83231dbc799 Mon Sep 17 00:00:00 2001 2 | From: Chris Crump 3 | Date: Sat, 25 Nov 2023 11:56:05 +0000 4 | Subject: [PATCH] Add Face Unlock with ParanoidSense 5 | 6 | --- 7 | AndroidManifest.xml | 2 +- 8 | 1 file changed, 1 insertion(+), 1 deletion(-) 9 | 10 | diff --git a/AndroidManifest.xml b/AndroidManifest.xml 11 | index 79f8f39..97433aa 100644 12 | --- a/AndroidManifest.xml 13 | +++ b/AndroidManifest.xml 14 | @@ -2701,7 +2701,7 @@ 15 | android:screenOrientation="portrait"/> 16 | 17 | 21 | 22 | 3 | Date: Mon, 29 Nov 2021 17:49:13 -0500 4 | Subject: [PATCH 3/5] Don't unmount rw-system.sh binds 5 | 6 | Change-Id: If9132c21defa8b09879b79a70794c5275d6852d0 7 | --- 8 | VolumeManager.cpp | 1 + 9 | 1 file changed, 1 insertion(+) 10 | 11 | diff --git a/VolumeManager.cpp b/VolumeManager.cpp 12 | index c981f2d4..ce2a4510 100644 13 | --- a/VolumeManager.cpp 14 | +++ b/VolumeManager.cpp 15 | @@ -1000,6 +1000,7 @@ int VolumeManager::unmountAll() { 16 | while ((mentry = getmntent(fp)) != NULL) { 17 | auto test = std::string(mentry->mnt_dir); 18 | if ((StartsWith(test, "/mnt/") && 19 | + !StartsWith(test, "/mnt/phh") && 20 | #ifdef __ANDROID_DEBUGGABLE__ 21 | !StartsWith(test, "/mnt/scratch") && 22 | #endif 23 | -- 24 | 2.34.1 25 | 26 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_system_vold/0001-Allow-deletion-of-symlink.patch: -------------------------------------------------------------------------------- 1 | From 18f2b912ca1728a3542b86ce212771364e5f8646 Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Sat, 17 Feb 2018 19:39:38 +0100 4 | Subject: [PATCH 1/5] Allow deletion of symlink 5 | 6 | Change-Id: I9731895f88729072297f753088583aabbe6990f4 7 | --- 8 | FsCrypt.cpp | 1 + 9 | 1 file changed, 1 insertion(+) 10 | 11 | diff --git a/FsCrypt.cpp b/FsCrypt.cpp 12 | index 51b35c51..2b0dbc6a 100644 13 | --- a/FsCrypt.cpp 14 | +++ b/FsCrypt.cpp 15 | @@ -374,6 +374,7 @@ static bool prepare_dir_with_policy(const std::string& dir, mode_t mode, uid_t u 16 | static bool destroy_dir(const std::string& dir) { 17 | LOG(DEBUG) << "Destroying: " << dir; 18 | if (rmdir(dir.c_str()) != 0 && errno != ENOENT) { 19 | + if(unlink(dir.c_str()) == 0) return true; 20 | PLOG(ERROR) << "Failed to destroy " << dir; 21 | return false; 22 | } 23 | -- 24 | 2.34.1 25 | 26 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_frameworks_base/0009-Support-samsung-Pie-and-Q-light-hal.patch: -------------------------------------------------------------------------------- 1 | From 2b6a99ed21c92e71160931854f5a45e2360fa43a Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Sun, 24 Mar 2019 23:05:14 +0100 4 | Subject: [PATCH 09/54] Support samsung Pie and Q light hal 5 | 6 | Change-Id: I01f94acd7d0672733e48854d80368f9ac6f861c6 7 | --- 8 | services/core/jni/Android.bp | 2 ++ 9 | 1 file changed, 2 insertions(+) 10 | 11 | diff --git a/services/core/jni/Android.bp b/services/core/jni/Android.bp 12 | index 3607dddc66d5..3641e3b21149 100644 13 | --- a/services/core/jni/Android.bp 14 | +++ b/services/core/jni/Android.bp 15 | @@ -209,6 +209,8 @@ cc_defaults { 16 | "android.system.suspend-V1-ndk", 17 | "server_configurable_flags", 18 | "service.incremental", 19 | + "vendor.samsung.hardware.light@2.0", 20 | + "vendor.samsung.hardware.light@3.0", 21 | ], 22 | 23 | static_libs: [ 24 | -- 25 | 2.34.1 26 | 27 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_frameworks_native/0012-Disable-gpuservice-on-old-BPF-less-kernel.patch: -------------------------------------------------------------------------------- 1 | From 781e66a1e51e184970de933428825d2b4cc958bb Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Tue, 7 May 2024 22:34:40 +0000 4 | Subject: [PATCH 12/14] Disable gpuservice on old BPF-less kernel 5 | 6 | Change-Id: I8e1626e2e9d12ee0dc03d758799bc88085899476 7 | --- 8 | services/gpuservice/gpumem/GpuMem.cpp | 1 + 9 | 1 file changed, 1 insertion(+) 10 | 11 | diff --git a/services/gpuservice/gpumem/GpuMem.cpp b/services/gpuservice/gpumem/GpuMem.cpp 12 | index 141fe021ee..90b8b5c52d 100644 13 | --- a/services/gpuservice/gpumem/GpuMem.cpp 14 | +++ b/services/gpuservice/gpumem/GpuMem.cpp 15 | @@ -48,6 +48,7 @@ void GpuMem::initialize() { 16 | if (fd < 0) { 17 | ALOGE("Failed to retrieve pinned program from %s [%d(%s)]", kGpuMemTotalProgPath, errno, 18 | strerror(errno)); 19 | + while(true) sleep(1); 20 | return; 21 | } 22 | 23 | -- 24 | 2.34.1 25 | 26 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_system_core/0016-Add-vendor-firmware_mnt.-Moto-Razr-2019-look-for-fir.patch: -------------------------------------------------------------------------------- 1 | From 6f4b6d9993d93e5efe6476e1e297022d816b14b4 Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Tue, 11 Jul 2023 14:52:40 -0400 4 | Subject: [PATCH 16/26] Add /vendor/firmware_mnt. Moto Razr 2019 look for 5 | firmwares (modem, sensors, ...) there 6 | 7 | --- 8 | rootdir/ueventd.rc | 2 +- 9 | 1 file changed, 1 insertion(+), 1 deletion(-) 10 | 11 | diff --git a/rootdir/ueventd.rc b/rootdir/ueventd.rc 12 | index d0ab3f7bb..39e8fe9eb 100644 13 | --- a/rootdir/ueventd.rc 14 | +++ b/rootdir/ueventd.rc 15 | @@ -1,7 +1,7 @@ 16 | import /vendor/etc/ueventd.rc 17 | import /odm/etc/ueventd.rc 18 | 19 | -firmware_directories /etc/firmware/ /odm/firmware/ /vendor/firmware/ /firmware/image/ 20 | +firmware_directories /etc/firmware/ /odm/firmware/ /vendor/firmware/ /firmware/image/ /vendor/firmware_mnt/image/ 21 | uevent_socket_rcvbuf_size 16M 22 | 23 | subsystem graphics 24 | -- 25 | 2.34.1 26 | 27 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_frameworks_base/0049-Include-vendor.samsung.hardware.radio-V2.2-java-HIDL.patch: -------------------------------------------------------------------------------- 1 | From 1ebf36b6785576dd13401b392ff59625f39584d5 Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Wed, 21 Feb 2024 16:19:47 -0500 4 | Subject: [PATCH 49/54] Include vendor.samsung.hardware.radio-V2.2-java HIDL in 5 | base libs, will be used by f/o/telephony 6 | 7 | --- 8 | Android.bp | 1 + 9 | 1 file changed, 1 insertion(+) 10 | 11 | diff --git a/Android.bp b/Android.bp 12 | index 3539553a95e9..31ef1907c110 100644 13 | --- a/Android.bp 14 | +++ b/Android.bp 15 | @@ -233,6 +233,7 @@ java_library { 16 | "android.hardware.gnss-V2.1-java", 17 | "android.hardware.health-V1.0-java-constants", 18 | "android.hardware.radio-V1.6-java", 19 | + "vendor.samsung.hardware.radio-V2.2-java", 20 | "android.hardware.radio.data-V3-java", 21 | "android.hardware.radio.ims-V2-java", 22 | "android.hardware.radio.messaging-V3-java", 23 | -- 24 | 2.34.1 25 | 26 | -------------------------------------------------------------------------------- /patches/personal/platform_frameworks_base/0026-Fixup-Default-Pocket-Lock-sensor.patch: -------------------------------------------------------------------------------- 1 | From 046d3af88a9d23f303aa1cbfd658a25b4a9937e7 Mon Sep 17 00:00:00 2001 2 | From: ChonDoit 3 | Date: Tue, 22 Oct 2024 14:14:23 -0300 4 | Subject: [PATCH 26/31] Fixup! Default Pocket Lock sensor 5 | 6 | --- 7 | core/res/res/values/superior_config.xml | 2 +- 8 | 1 file changed, 1 insertion(+), 1 deletion(-) 9 | 10 | diff --git a/core/res/res/values/superior_config.xml b/core/res/res/values/superior_config.xml 11 | index c6fb93d1..457a12b8 100644 12 | --- a/core/res/res/values/superior_config.xml 13 | +++ b/core/res/res/values/superior_config.xml 14 | @@ -137,5 +137,5 @@ 15 | 16 | 17 | 18 | - 19 | + android.sensor.proximity 20 | 21 | -- 22 | 2.47.0 23 | 24 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_frameworks_base/0048-Include-vendor.samsung.hardware.radio.network-V1-jav.patch: -------------------------------------------------------------------------------- 1 | From 90d4b6286f60cb37449217495b110c595eeec675 Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Wed, 21 Feb 2024 12:41:46 -0500 4 | Subject: [PATCH 48/54] Include vendor.samsung.hardware.radio.network-V1-java 5 | in base libs, will be used by f/o/telephony 6 | 7 | --- 8 | Android.bp | 1 + 9 | 1 file changed, 1 insertion(+) 10 | 11 | diff --git a/Android.bp b/Android.bp 12 | index 8d7ab983593d..3539553a95e9 100644 13 | --- a/Android.bp 14 | +++ b/Android.bp 15 | @@ -238,6 +238,7 @@ java_library { 16 | "android.hardware.radio.messaging-V3-java", 17 | "android.hardware.radio.modem-V3-java", 18 | "android.hardware.radio.network-V3-java", 19 | + "vendor.samsung.hardware.radio.network-V1-java", 20 | "android.hardware.radio.sim-V3-java", 21 | "android.hardware.radio.voice-V3-java", 22 | "android.hardware.thermal-V1.0-java-constants", 23 | -- 24 | 2.34.1 25 | 26 | -------------------------------------------------------------------------------- /patches/pre/platform_packages_apps_Aperture/01-Enable-auxiliary-cameras.patch: -------------------------------------------------------------------------------- 1 | From f75a9f85f373f70748de6146ff12a68ddd63c863 Mon Sep 17 00:00:00 2001 2 | From: ChonDoit 3 | Date: Mon, 24 Apr 2023 16:55:33 +0000 4 | Subject: [PATCH] Enable Auxiliary Camera 5 | 6 | Change-Id: I2bff41fcba4761666bbd0f4468a06ba89abfc033 7 | --- 8 | app/src/main/res/values/config.xml | 2 +- 9 | 1 file changed, 1 insertion(+), 1 deletion(-) 10 | 11 | diff --git a/app/src/main/res/values/config.xml b/app/src/main/res/values/config.xml 12 | index 39d9698..f044d7f 100644 13 | --- a/app/src/main/res/values/config.xml 14 | +++ b/app/src/main/res/values/config.xml 15 | @@ -5,7 +5,7 @@ 16 | --> 17 | 18 | 19 | - false 20 | + true 21 | 22 | 23 | 24 | -- 25 | 2.34.1 26 | 27 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_system_core/0020-fix-Nubia-6-series-custom-rc-action-prop-validation.patch: -------------------------------------------------------------------------------- 1 | From d8b4dc40b41965c41505f21cd76453e38e22f2b5 Mon Sep 17 00:00:00 2001 2 | From: Huy Hoang <38396158+boydaihungst@users.noreply.github.com> 3 | Date: Thu, 19 Oct 2023 07:06:55 +0700 4 | Subject: [PATCH 20/26] fix: Nubia 6 series custom rc action prop validation 5 | 6 | --- 7 | init/action_parser.cpp | 1 + 8 | 1 file changed, 1 insertion(+) 9 | 10 | diff --git a/init/action_parser.cpp b/init/action_parser.cpp 11 | index 49fe24a43..f683790e9 100644 12 | --- a/init/action_parser.cpp 13 | +++ b/init/action_parser.cpp 14 | @@ -47,6 +47,7 @@ bool IsActionableProperty(Subcontext* subcontext, const std::string& prop_name) 15 | "init.svc.vendor.", "ro.vendor.", "persist.vendor.", 16 | "vendor.", "init.svc.odm.", "ro.odm.", 17 | "persist.odm.", "odm.", "ro.boot.", 18 | + "nubia.perf." 19 | }; 20 | 21 | for (const auto& prefix : kPartnerPrefixes) { 22 | -- 23 | 2.34.1 24 | 25 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_system_netd/0003-Support-no-bpf-usecase.patch: -------------------------------------------------------------------------------- 1 | From 7995aba04c82cf2a8d47b2d3f6c45959470135ec Mon Sep 17 00:00:00 2001 2 | From: ChonDoit 3 | Date: Fri, 7 Oct 2022 02:43:21 +0000 4 | Subject: [PATCH 3/4] Support no-bpf usecase 5 | 6 | Change-Id: Ic759e2cfaf11705169a4a6b677b0e5aca26907b3 7 | --- 8 | server/Controllers.cpp | 2 +- 9 | 1 file changed, 1 insertion(+), 1 deletion(-) 10 | 11 | diff --git a/server/Controllers.cpp b/server/Controllers.cpp 12 | index 87b2c55d..1a027210 100644 13 | --- a/server/Controllers.cpp 14 | +++ b/server/Controllers.cpp 15 | @@ -321,7 +321,7 @@ void Controllers::init() { 16 | // As such simply exit netd. This may crash loop the system, but by failing 17 | // to bootup we will trigger rollback and thus this offers us protection against 18 | // a mainline update breaking things. 19 | - exit(1); 20 | + // exit(1); 21 | } 22 | gLog.info("Enabling bandwidth control: %" PRId64 "us", s.getTimeAndResetUs()); 23 | 24 | -- 25 | 2.34.1 26 | 27 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_bootable_recovery/0001-Don-t-reboot-if-we-couldn-t-get-bootctrl.patch: -------------------------------------------------------------------------------- 1 | From 48f0b520ddb023295740c43fd10d88bd43eb4973 Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Thu, 12 Sep 2019 20:31:07 +0200 4 | Subject: [PATCH] Don't reboot if we couldn't get bootctrl 5 | 6 | Change-Id: Id1793660bd1c97ab369607f58a772ca3512ec1af 7 | --- 8 | update_verifier/update_verifier.cpp | 2 +- 9 | 1 file changed, 1 insertion(+), 1 deletion(-) 10 | 11 | diff --git a/update_verifier/update_verifier.cpp b/update_verifier/update_verifier.cpp 12 | index a0160e2f..24d6ccab 100644 13 | --- a/update_verifier/update_verifier.cpp 14 | +++ b/update_verifier/update_verifier.cpp 15 | @@ -324,7 +324,7 @@ int update_verifier(int argc, char** argv) { 16 | const auto module = android::hal::BootControlClient::WaitForService(); 17 | if (module == nullptr) { 18 | LOG(ERROR) << "Error getting bootctrl module."; 19 | - return reboot_device(); 20 | + return 0; 21 | } 22 | 23 | uint32_t current_slot = module->GetCurrentSlot(); 24 | -- 25 | 2.34.1 26 | 27 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_frameworks_base/0037-Once-we-integrate-Samsung-Power-hal-in-libpowermanag.patch: -------------------------------------------------------------------------------- 1 | From 80360e077d4cf9146f14ac39ef45338f3d9987af Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Mon, 27 Dec 2021 17:57:11 -0500 4 | Subject: [PATCH 37/54] Once we integrate Samsung Power hal in libpowermanager, 5 | libpowermanager and its deps require linking against 6 | vendor.samsung.hardware.miscpower@2.0 7 | 8 | Change-Id: I9084f64e505009abe9420d28b44199605cee52d8 9 | --- 10 | services/core/jni/Android.bp | 1 + 11 | 1 file changed, 1 insertion(+) 12 | 13 | diff --git a/services/core/jni/Android.bp b/services/core/jni/Android.bp 14 | index 3641e3b21149..50cf6f56d703 100644 15 | --- a/services/core/jni/Android.bp 16 | +++ b/services/core/jni/Android.bp 17 | @@ -211,6 +211,7 @@ cc_defaults { 18 | "service.incremental", 19 | "vendor.samsung.hardware.light@2.0", 20 | "vendor.samsung.hardware.light@3.0", 21 | + "vendor.samsung.hardware.miscpower@2.0", 22 | ], 23 | 24 | static_libs: [ 25 | -- 26 | 2.34.1 27 | 28 | -------------------------------------------------------------------------------- /patches/personal/platform_packages_modules_Connectivity/0001-netbpfload-Disable-reboot-on-failure.patch: -------------------------------------------------------------------------------- 1 | From 7c9a967f266d9bc5b3a2232b94399c615c9e7782 Mon Sep 17 00:00:00 2001 2 | From: Dmitry Gruzd 3 | Date: Sun, 14 Apr 2024 01:25:15 +0300 4 | Subject: [PATCH]netbpfload: Disable reboot on failure 5 | 6 | This allows to see the boot animation 7 | --- 8 | netbpfload/netbpfload.rc | 2 +- 9 | 1 file changed, 1 insertion(+), 1 deletion(-) 10 | 11 | diff --git a/netbpfload/netbpfload.rc b/netbpfload/netbpfload.rc 12 | index 14181dc..c6fd63d 100644 13 | --- a/netbpfload/netbpfload.rc 14 | +++ b/netbpfload/netbpfload.rc 15 | @@ -81,6 +81,6 @@ service bpfloader /system/bin/netbpfload 16 | # 'cannot prove return value is 0 or 1' or 'unsupported / unknown operation / helper', 17 | # 'invalid bpf_context access', etc. 18 | # 19 | - reboot_on_failure reboot,bpfloader-failed 20 | + # reboot_on_failure reboot,bpfloader-failed 21 | # we're not really updatable, but want to be able to load bpf programs shipped in apexes 22 | updatable 23 | -- 24 | 2.34.1 25 | 26 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_external_selinux/0008-Improve-SELinux-policy-workaround-on-device-phh-treb.patch: -------------------------------------------------------------------------------- 1 | From ce0f8fed3ff7e9ca42d0da8aea4ec9903d57435e Mon Sep 17 00:00:00 2001 2 | From: ponces 3 | Date: Mon, 7 Nov 2022 16:14:20 +0000 4 | Subject: [PATCH 08/10] Improve SELinux policy workaround on device/phh/treble 5 | conflict to exit with SEPOL_OK instead of SEPOL_EEXIST 6 | 7 | This fixes boot on many Samsung devices as exiting with SEPOL_EEXIST will prevent them to boot 8 | --- 9 | libsepol/cil/src/cil_build_ast.c | 1 - 10 | 1 file changed, 1 deletion(-) 11 | 12 | diff --git a/libsepol/cil/src/cil_build_ast.c b/libsepol/cil/src/cil_build_ast.c 13 | index 77e130d1..daf8b8b3 100644 14 | --- a/libsepol/cil/src/cil_build_ast.c 15 | +++ b/libsepol/cil/src/cil_build_ast.c 16 | @@ -141,7 +141,6 @@ int cil_add_decl_to_symtab(struct cil_db *db, symtab_t *symtab, hashtab_key_t ke 17 | /* multiple_decls is enabled and works for this datum type, add node */ 18 | cil_list_append(prev->nodes, CIL_NODE, node); 19 | node->data = prev; 20 | - return SEPOL_EEXIST; 21 | } 22 | 23 | return SEPOL_OK; 24 | -- 25 | 2.34.1 26 | 27 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_external_selinux/0010-Allow-conflict-on-fuseblk.patch: -------------------------------------------------------------------------------- 1 | From 6fe4ae3a8172443330a4a4c48fd6f05a02975a7c Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Fri, 6 Oct 2023 08:49:59 -0400 4 | Subject: [PATCH 10/10] Allow conflict on fuseblk 5 | 6 | --- 7 | libsepol/cil/src/cil_post.c | 2 +- 8 | 1 file changed, 1 insertion(+), 1 deletion(-) 9 | 10 | diff --git a/libsepol/cil/src/cil_post.c b/libsepol/cil/src/cil_post.c 11 | index 1703b3b6..5428005d 100644 12 | --- a/libsepol/cil/src/cil_post.c 13 | +++ b/libsepol/cil/src/cil_post.c 14 | @@ -511,7 +511,7 @@ static int cil_post_genfscon_context_compare(const void *a, const void *b) 15 | */ 16 | if(strcmp(a_genfscon->path_str, "/sys/vm/watermark_scale_factor") == 0) 17 | bypass = 1; 18 | - if(strcmp(a_genfscon->fs_str, "exfat") == 0 || strcmp(a_genfscon->fs_str, "esdfs") == 0) { 19 | + if(strcmp(a_genfscon->fs_str, "exfat") == 0 || strcmp(a_genfscon->fs_str, "esdfs") == 0 || strcmp(a_genfscon->fs_str, "fuseblk") == 0) { 20 | if(strcmp(a_genfscon->path_str, "/") == 0) 21 | bypass = 1; 22 | } 23 | -- 24 | 2.34.1 25 | 26 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_frameworks_base/0012-HOME-deserves-to-wake-up-devices-just-as-well-as-bac.patch: -------------------------------------------------------------------------------- 1 | From 949f4d77bff2d37774594583c233531f812d1efa Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Sat, 6 Jun 2020 18:21:56 +0200 4 | Subject: [PATCH 12/54] HOME deserves to wake-up devices just as well as back 5 | and menu 6 | 7 | Change-Id: Ia562bafd8c620d00c17e8eb338e4701c6c4a3c3a 8 | --- 9 | core/java/android/view/KeyEvent.java | 1 + 10 | 1 file changed, 1 insertion(+) 11 | 12 | diff --git a/core/java/android/view/KeyEvent.java b/core/java/android/view/KeyEvent.java 13 | index 1ee9509b116a..1def2f859dfd 100644 14 | --- a/core/java/android/view/KeyEvent.java 15 | +++ b/core/java/android/view/KeyEvent.java 16 | @@ -2097,6 +2097,7 @@ public class KeyEvent extends InputEvent implements Parcelable { 17 | switch (keyCode) { 18 | case KeyEvent.KEYCODE_CAMERA: 19 | case KeyEvent.KEYCODE_MENU: 20 | + case KeyEvent.KEYCODE_HOME: 21 | case KeyEvent.KEYCODE_PAIRING: 22 | case KeyEvent.KEYCODE_STEM_1: 23 | case KeyEvent.KEYCODE_STEM_2: 24 | -- 25 | 2.34.1 26 | 27 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_external_selinux/0006-Allow-mismatches-of-exfat-genfscon.patch: -------------------------------------------------------------------------------- 1 | From 1b6e0989e7c8fdd3d4813f4aa19aa40d39b43d79 Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Sun, 24 May 2020 17:22:22 +0200 4 | Subject: [PATCH 06/10] Allow mismatches of exfat genfscon 5 | 6 | --- 7 | libsepol/cil/src/cil_post.c | 4 ++++ 8 | 1 file changed, 4 insertions(+) 9 | 10 | diff --git a/libsepol/cil/src/cil_post.c b/libsepol/cil/src/cil_post.c 11 | index 99410da0..7f614c03 100644 12 | --- a/libsepol/cil/src/cil_post.c 13 | +++ b/libsepol/cil/src/cil_post.c 14 | @@ -502,6 +502,10 @@ static int cil_post_genfscon_context_compare(const void *a, const void *b) 15 | */ 16 | if(strcmp(a_genfscon->path_str, "/devices/virtual/block/") == 0) 17 | bypass = 1; 18 | + if(strcmp(a_genfscon->fs_str, "exfat") == 0 || strcmp(a_genfscon->fs_str, "esdfs") == 0) { 19 | + if(strcmp(a_genfscon->path_str, "/") == 0) 20 | + bypass = 1; 21 | + } 22 | if(bypass == 1) { 23 | fprintf(stderr, "Received conflicting %s vs %s but ignore\n", a_genfscon->path_str, b_genfscon->path_str); 24 | return 0; 25 | -- 26 | 2.34.1 27 | 28 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_packages_modules_Connectivity/0009-Revert-netdupdatable-add-back-abort-on-init-fail.patch: -------------------------------------------------------------------------------- 1 | From d770a7eeca41db1832b0b0ea4bc218ed89449a77 Mon Sep 17 00:00:00 2001 2 | From: Alberto Ponces 3 | Date: Thu, 20 Jun 2024 12:38:58 +0100 4 | Subject: [PATCH 9/9] Revert "netdupdatable: add back abort() on init() fail" 5 | 6 | This reverts commit ff845a642bc988f960c77ac60664560f8cdc7ee3. 7 | --- 8 | netd/NetdUpdatable.cpp | 4 ++-- 9 | 1 file changed, 2 insertions(+), 2 deletions(-) 10 | 11 | diff --git a/netd/NetdUpdatable.cpp b/netd/NetdUpdatable.cpp 12 | index 3b15916398..8b9e5a759c 100644 13 | --- a/netd/NetdUpdatable.cpp 14 | +++ b/netd/NetdUpdatable.cpp 15 | @@ -31,8 +31,8 @@ int libnetd_updatable_init(const char* cg2_path) { 16 | 17 | android::netdutils::Status ret = sBpfHandler.init(cg2_path); 18 | if (!android::netdutils::isOk(ret)) { 19 | - LOG(ERROR) << __func__ << ": Failed: (" << ret.code() << ") " << ret.msg(); 20 | - abort(); 21 | + LOG(ERROR) << __func__ << ": Failed. " << ret.code() << " " << ret.msg(); 22 | + return -ret.code(); 23 | } 24 | return 0; 25 | } 26 | -- 27 | 2.34.1 28 | 29 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_system_nfc/0001-Let-vendor-have-priority-over-NFC-config-file-rather.patch: -------------------------------------------------------------------------------- 1 | From 01bbd8b5fec55a315c5cdd9fbed0cf541ae54d88 Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Mon, 21 Dec 2020 19:36:54 +0100 4 | Subject: [PATCH] Let vendor have priority over NFC config file, rather than 5 | GSI 6 | 7 | Thanks @mikalovtch 8 | 9 | Change-Id: Iaee468f3b8e5c8ec90ca7e856a6526d1cbcaa33e 10 | --- 11 | src/adaptation/nfc_config.cc | 2 +- 12 | 1 file changed, 1 insertion(+), 1 deletion(-) 13 | 14 | diff --git a/src/adaptation/nfc_config.cc b/src/adaptation/nfc_config.cc 15 | index f635fd50..15d42cab 100644 16 | --- a/src/adaptation/nfc_config.cc 17 | +++ b/src/adaptation/nfc_config.cc 18 | @@ -30,7 +30,7 @@ using namespace ::android::base; 19 | namespace { 20 | std::string searchConfigPath(std::string file_name) { 21 | const std::vector search_path = { 22 | - "/product/etc/", "/odm/etc/", "/vendor/etc/", "/system_ext/etc/", "/etc/", 23 | + "/odm/etc/", "/vendor/etc/", "/product/etc/", "/system_ext/etc/", "/etc/", 24 | }; 25 | for (std::string path : search_path) { 26 | path.append(file_name); 27 | -- 28 | 2.34.1 29 | 30 | -------------------------------------------------------------------------------- /patches/personal/platform_packages_apps_Settings/0001-Accent-search-button.patch: -------------------------------------------------------------------------------- 1 | From 6b83a997964329e0695a02974b24fdb4dc2ed935 Mon Sep 17 00:00:00 2001 2 | From: ChonDoit 3 | Date: Thu, 17 Aug 2023 01:50:54 +0000 4 | Subject: [PATCH 1/3] Accent search button 5 | 6 | --- 7 | res/drawable/ic_homepage_search.xml | 2 +- 8 | 1 file changed, 1 insertion(+), 1 deletion(-) 9 | 10 | diff --git a/res/drawable/ic_homepage_search.xml b/res/drawable/ic_homepage_search.xml 11 | index 3da1cc7..3895b6b 100644 12 | --- a/res/drawable/ic_homepage_search.xml 13 | +++ b/res/drawable/ic_homepage_search.xml 14 | @@ -20,7 +20,7 @@ 15 | android:height="24dp" 16 | android:viewportWidth="24" 17 | android:viewportHeight="24" 18 | - android:tint="?android:attr/textColorSecondary"> 19 | + android:tint="?android:attr/colorAccent"> 20 | 23 | -- 24 | 2.46.0 25 | 26 | -------------------------------------------------------------------------------- /patches/personal/platform_packages_modules_Connectivity/0004-netbpfload-Support-no-bpf-usecase.patch: -------------------------------------------------------------------------------- 1 | From fce09cc548618e12ca62289c66d902d4d08c280a Mon Sep 17 00:00:00 2001 2 | From: khalvat-M 3 | Date: Thu, 27 Jun 2024 02:17:11 +0330 4 | Subject: [PATCH] netbpfload: Support no-bpf usecase 5 | 6 | Based on https://github.com/LineageOS-UL/android_system_bpf/commit/5519c18abea64769e65f6773590195ac5d54af50 7 | --- 8 | netbpfload/NetBpfLoad.cpp | 2 +- 9 | 1 file changed, 1 insertion(+), 1 deletion(-) 10 | 11 | diff --git a/netbpfload/NetBpfLoad.cpp b/netbpfload/NetBpfLoad.cpp 12 | index 7b9980ff05..62ab2b6664 100644 13 | --- a/netbpfload/NetBpfLoad.cpp 14 | +++ b/netbpfload/NetBpfLoad.cpp 15 | @@ -366,7 +366,7 @@ int main(int argc, char** argv, char * const envp[]) { 16 | // which could otherwise fail with ENOENT during object pinning or renaming, 17 | // due to ordering issues) 18 | for (const auto& location : locations) { 19 | - if (createSysFsBpfSubDir(location.prefix)) return 1; 20 | + if (createSysFsBpfSubDir(location.prefix)) failed = true; 21 | } 22 | 23 | // Note: there's no actual src dir for fs_bpf_loader .o's, 24 | -- 25 | 2.34.1 26 | 27 | 28 | -------------------------------------------------------------------------------- /patches/personal/platform_packages_modules_Connectivity/0003-mdns-disable-SocketNetlinkMonitor.patch: -------------------------------------------------------------------------------- 1 | From 84e052815af50645e33b7217079c656032b35ba0 Mon Sep 17 00:00:00 2001 2 | From: Yaroslav Zviezda 3 | Date: Fri, 19 Apr 2024 00:25:52 +0300 4 | Subject: [PATCH] [UL] mdns: disable SocketNetlinkMonitor 5 | 6 | Change-Id: Id7e25ccb04704d54bd5f4e4ac3c2726f1935cbd4 7 | --- 8 | .../server/connectivity/mdns/internal/SocketNetlinkMonitor.java | 2 +- 9 | 1 file changed, 1 insertion(+), 1 deletion(-) 10 | 11 | diff --git a/service-t/src/com/android/server/connectivity/mdns/internal/SocketNetlinkMonitor.java b/service-t/src/com/android/server/connectivity/mdns/internal/SocketNetlinkMonitor.java 12 | index 6f16436abf..57a844c83b 100644 13 | --- a/service-t/src/com/android/server/connectivity/mdns/internal/SocketNetlinkMonitor.java 14 | +++ b/service-t/src/com/android/server/connectivity/mdns/internal/SocketNetlinkMonitor.java 15 | @@ -79,7 +79,7 @@ public class SocketNetlinkMonitor extends NetlinkMonitor implements AbstractSock 16 | 17 | @Override 18 | public boolean isSupported() { 19 | - return true; 20 | + return false; 21 | } 22 | 23 | @Override 24 | -- 25 | 2.34.1 26 | 27 | -------------------------------------------------------------------------------- /patches/personal/platform_vendor_superior/0001-Add-ccache-to-environment-script.patch: -------------------------------------------------------------------------------- 1 | From 56aae12deaf3ac9b29fab9177601bb5af5d3fac5 Mon Sep 17 00:00:00 2001 2 | From: ChonDoit 3 | Date: Sat, 11 Nov 2023 17:00:34 +0000 4 | Subject: [PATCH] Add CCache Check to Environment Setup 5 | 6 | --- 7 | build/envsetup.sh | 17 +++++++++++++++++ 8 | 1 file changed, 17 insertions(+) 9 | 10 | diff --git a/build/envsetup.sh b/build/envsetup.sh 11 | index faef80c1..e0011377 100644 12 | --- a/build/envsetup.sh 13 | +++ b/build/envsetup.sh 14 | @@ -959,3 +959,20 @@ function fixup_common_out_dir() { 15 | mkdir -p ${common_out_dir} 16 | fi 17 | } 18 | + 19 | +# Check and set ccache path on envsetup 20 | +if [ -z ${CCACHE_EXEC} ]; then 21 | + ccache_path=$(which ccache) 22 | + if [ ! -z "$ccache_path" ]; then 23 | + mkdir /mnt/ccache 24 | + mount --bind ~/.ccache /mnt/ccache 25 | + export USE_CCACHE=1 26 | + export CCACHE_COMPRESS=1 27 | + export CCACHE_EXEC=/usr/bin/ccache 28 | + export CCACHE_DIR=/mnt/ccache 29 | + ccache -M 50G -F 0 30 | + echo "ccache found and CCACHE_EXEC has been set to : $ccache_path" 31 | + else 32 | + echo "ccache not found/installed!" 33 | + fi 34 | +fi 35 | -- 36 | 2.34.1 37 | 38 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_build/0004-core-sysprop-Write-build-display-id-to-product-prop.patch: -------------------------------------------------------------------------------- 1 | From e6231ef5108eb2973d5485b75c87b3d7e539b7c1 Mon Sep 17 00:00:00 2001 2 | From: Adithya R 3 | Date: Thu, 18 Aug 2022 21:29:34 +0530 4 | Subject: [PATCH] core: sysprop: Write build display id to product prop 5 | 6 | Some vendors override build id in odm or vendor, such as oplus. 7 | 8 | Change-Id: I1c2de43ba7c3544710897ad9127d320dd02293fe 9 | --- 10 | core/sysprop.mk | 3 +++ 11 | 1 file changed, 3 insertions(+) 12 | 13 | diff --git a/core/sysprop.mk b/core/sysprop.mk 14 | index b0f238d..f3c0f81 100644 15 | --- a/core/sysprop.mk 16 | +++ b/core/sysprop.mk 17 | @@ -75,6 +75,9 @@ define generate-common-build-props 18 | echo "ro.$(1).product.cpu.abilist64=$(TARGET_CPU_ABI_LIST_64_BIT)" >> $(2);\ 19 | )\ 20 | )\ 21 | + $(if $(filter product,$(1)),\ 22 | + echo "ro.build.display.id=$(BUILD_DISPLAY_ID)" >> $(2);\ 23 | + )\ 24 | echo "ro.$(1).build.date=`$(DATE_FROM_FILE)`" >> $(2);\ 25 | echo "ro.$(1).build.date.utc=`$(DATE_FROM_FILE) +%s`" >> $(2);\ 26 | echo "ro.$(1).build.fingerprint?=$(BUILD_FINGERPRINT_FROM_FILE)" >> $(2);\ 27 | -- 28 | 2.34.1 29 | 30 | -------------------------------------------------------------------------------- /patches/personal/platform_frameworks_base/0025-Enable-SPLIT_SHADE_SUBPIXEL_OPTIMIZATION.patch: -------------------------------------------------------------------------------- 1 | From 16efb95ba4f61d55924f1c1514a2332288283323 Mon Sep 17 00:00:00 2001 2 | From: ChonDoit 3 | Date: Wed, 25 Sep 2024 00:21:20 -0300 4 | Subject: [PATCH 25/31] Enable SPLIT_SHADE_SUBPIXEL_OPTIMIZATION 5 | 6 | --- 7 | packages/SystemUI/src/com/android/systemui/flags/Flags.kt | 2 +- 8 | 1 file changed, 1 insertion(+), 1 deletion(-) 9 | 10 | diff --git a/packages/SystemUI/src/com/android/systemui/flags/Flags.kt b/packages/SystemUI/src/com/android/systemui/flags/Flags.kt 11 | index facb0a29..62538792 100644 12 | --- a/packages/SystemUI/src/com/android/systemui/flags/Flags.kt 13 | +++ b/packages/SystemUI/src/com/android/systemui/flags/Flags.kt 14 | @@ -510,7 +510,7 @@ object Flags { 15 | 16 | // TODO(b/277201412): Tracking Bug 17 | @JvmField 18 | - val SPLIT_SHADE_SUBPIXEL_OPTIMIZATION = unreleasedFlag("split_shade_subpixel_optimization") 19 | + val SPLIT_SHADE_SUBPIXEL_OPTIMIZATION = releasedFlag("split_shade_subpixel_optimization") 20 | 21 | // TODO(b/278761837): Tracking Bug 22 | @JvmField val USE_NEW_ACTIVITY_STARTER = releasedFlag(name = "use_new_activity_starter") 23 | -- 24 | 2.47.0 25 | 26 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_frameworks_base/0003-Fix-env-empty-string-ANDROID_STORAGE.patch: -------------------------------------------------------------------------------- 1 | From a8ffcda0fc86e2021a2e04a36ffab6f6c87fa80c Mon Sep 17 00:00:00 2001 2 | From: Raphael Mounier 3 | Date: Sat, 6 Aug 2022 18:08:36 +0200 4 | Subject: [PATCH 03/54] Fix env empty string - ANDROID_STORAGE 5 | 6 | Huawei hi6250 define in init.hi6250.rc ANDROID_STORAGE to "", so check empty string and replace with default path. Apply change for all env directory 7 | --- 8 | core/java/android/os/Environment.java | 2 +- 9 | 1 file changed, 1 insertion(+), 1 deletion(-) 10 | 11 | diff --git a/core/java/android/os/Environment.java b/core/java/android/os/Environment.java 12 | index a459aaa42930..168825411139 100644 13 | --- a/core/java/android/os/Environment.java 14 | +++ b/core/java/android/os/Environment.java 15 | @@ -1526,7 +1526,7 @@ public class Environment { 16 | 17 | static File getDirectory(String variableName, String defaultPath) { 18 | String path = System.getenv(variableName); 19 | - return path == null ? new File(defaultPath) : new File(path); 20 | + return ((path == null || path.isEmpty()) ? new File(defaultPath) : new File(path)); 21 | } 22 | 23 | @NonNull 24 | -- 25 | 2.34.1 26 | 27 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_frameworks_native/0003-unshared_oob-didn-t-exist-in-O-P-so-detect-its-suppo.patch: -------------------------------------------------------------------------------- 1 | From db878a2dce60d6a19e2d4ea8cc80317e1d159710 Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Tue, 5 Jan 2021 23:44:00 +0100 4 | Subject: [PATCH 03/14] unshared_oob didn't exist in O/P, so detect its 5 | supported based on vndk version 6 | 7 | --- 8 | cmds/installd/migrate_legacy_obb_data.sh | 2 +- 9 | 1 file changed, 1 insertion(+), 1 deletion(-) 10 | 11 | diff --git a/cmds/installd/migrate_legacy_obb_data.sh b/cmds/installd/migrate_legacy_obb_data.sh 12 | index 7399681c3e..9d5b73eae2 100644 13 | --- a/cmds/installd/migrate_legacy_obb_data.sh 14 | +++ b/cmds/installd/migrate_legacy_obb_data.sh 15 | @@ -18,7 +18,7 @@ 16 | rm -rf /data/media/0/Android/obb/test_probe 17 | mkdir -p /data/media/0/Android/obb/ 18 | touch /data/media/0/Android/obb/test_probe 19 | -if ! test -f /data/media/0/Android/obb/test_probe ; then 20 | +if ! test -f /data/media/0/Android/obb/test_probe || [ "$(adb shell getprop ro.vndk.version)" -le 28 ]; then 21 | log -p i -t migrate_legacy_obb_data "No support for 'unshared_obb'. Not migrating" 22 | rm -rf /data/media/0/Android/obb/test_probe 23 | exit 0 24 | -- 25 | 2.34.1 26 | 27 | -------------------------------------------------------------------------------- /patches/personal/platform_frameworks_av/0001-Dont-segfault-if-we-get-a-NULL-parameter.patch: -------------------------------------------------------------------------------- 1 | From cbf112d4aaf88dcdd93c619ed8ccc5c5d961f2e8 Mon Sep 17 00:00:00 2001 2 | From: Steve Kondik 3 | Date: Wed, 1 May 2013 02:58:11 -0700 4 | Subject: [PATCH 03/12] camera: Don't segfault if we get a NULL parameter 5 | 6 | * Values end up NULL on some drivers, don't crash. 7 | 8 | Change-Id: Ic897dbd4629cf3af98c85f93be202c382dde806b 9 | Signed-off-by: Pranav Vashi 10 | Signed-off-by: Joey Huab 11 | --- 12 | camera/CameraParameters.cpp | 3 +++ 13 | 1 file changed, 3 insertions(+) 14 | 15 | diff --git a/camera/CameraParameters.cpp b/camera/CameraParameters.cpp 16 | index e95c91c..99befa7 100644 17 | --- a/camera/CameraParameters.cpp 18 | +++ b/camera/CameraParameters.cpp 19 | @@ -238,6 +238,9 @@ void CameraParameters::unflatten(const String8 ¶ms) 20 | 21 | void CameraParameters::set(const char *key, const char *value) 22 | { 23 | + if (key == NULL || value == NULL) 24 | + return; 25 | + 26 | // XXX i think i can do this with strspn() 27 | if (strchr(key, '=') || strchr(key, ';')) { 28 | //XXX ALOGE("Key \"%s\"contains invalid character (= or ;)", key); 29 | -- 30 | 2.34.1 31 | 32 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_system_netd/0001-Huawei-Kirin-960-accept-broken-rpfilter-match.patch: -------------------------------------------------------------------------------- 1 | From b5397cc4cdb7901887abe737405f6ef2aa652369 Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Mon, 2 Jul 2018 22:01:43 +0200 4 | Subject: [PATCH 1/4] Huawei Kirin 960:: accept broken rpfilter match 5 | 6 | How bad a security flaw is this? 7 | People lived with rpfilter on IPv4 for a very long time... 8 | 9 | Change-Id: I9aa63d18e54a8254133adf97bf757c03d6b66757 10 | --- 11 | server/TetherController.cpp | 2 +- 12 | 1 file changed, 1 insertion(+), 1 deletion(-) 13 | 14 | diff --git a/server/TetherController.cpp b/server/TetherController.cpp 15 | index 03185e71..a890d60c 100644 16 | --- a/server/TetherController.cpp 17 | +++ b/server/TetherController.cpp 18 | @@ -718,7 +718,7 @@ int TetherController::setForwardRules(bool add, const char *intIface, const char 19 | "*raw\n" 20 | "%s %s -i %s -m rpfilter --invert ! -s fe80::/64 -j DROP\n" 21 | "COMMIT\n", op, LOCAL_RAW_PREROUTING, intIface); 22 | - if (iptablesRestoreFunction(V6, rpfilterCmd, nullptr) == -1 && add) { 23 | + if (iptablesRestoreFunction(V6, rpfilterCmd, nullptr) == -1 && add && false) { 24 | return -EREMOTEIO; 25 | } 26 | 27 | -- 28 | 2.34.1 29 | 30 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_frameworks_native/0013-SurfaceFlinger-Disable-SF-HWC-backpressure.patch: -------------------------------------------------------------------------------- 1 | From a84523098370e545cbf7c8bc29b4a5812c91a624 Mon Sep 17 00:00:00 2001 2 | From: Andy CrossGate Yan 3 | Date: Sun, 26 May 2024 21:34:17 +0800 4 | Subject: [PATCH 13/14] SurfaceFlinger: Disable SF HWC backpressure 5 | 6 | --- 7 | services/surfaceflinger/SurfaceFlinger.cpp | 3 ++- 8 | 1 file changed, 2 insertions(+), 1 deletion(-) 9 | 10 | diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp 11 | index cf5f55d7bd..ac5567bfe1 100644 12 | --- a/services/surfaceflinger/SurfaceFlinger.cpp 13 | +++ b/services/surfaceflinger/SurfaceFlinger.cpp 14 | @@ -2547,7 +2547,8 @@ bool SurfaceFlinger::commit(PhysicalDisplayId pacesetterId, 15 | } 16 | } 17 | 18 | - if (pacesetterFrameTarget.isFramePending()) { 19 | + if (base::GetBoolProperty("persist.sys.phh.enable_sf_hwc_backpressure"s, true) 20 | + && pacesetterFrameTarget.isFramePending()) { 21 | if (mBackpressureGpuComposition || pacesetterFrameTarget.didMissHwcFrame()) { 22 | if (FlagManager::getInstance().vrr_config()) { 23 | mScheduler->getVsyncSchedule()->getTracker().onFrameMissed( 24 | -- 25 | 2.34.1 26 | 27 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_frameworks_base/0016-Remove-useless-notification-about-console-service-be.patch: -------------------------------------------------------------------------------- 1 | From 53329e4771498cbaf560e1aefdcab0232b4ebfe7 Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Fri, 11 Dec 2020 14:41:09 +0100 4 | Subject: [PATCH 16/54] Remove useless notification about "console" service 5 | being running 6 | 7 | --- 8 | .../core/java/com/android/server/am/ActivityManagerService.java | 2 +- 9 | 1 file changed, 1 insertion(+), 1 deletion(-) 10 | 11 | diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java 12 | index 663ba8a38d77..79ab590f3f3a 100644 13 | --- a/services/core/java/com/android/server/am/ActivityManagerService.java 14 | +++ b/services/core/java/com/android/server/am/ActivityManagerService.java 15 | @@ -5245,7 +5245,7 @@ public class ActivityManagerService extends IActivityManager.Stub 16 | } 17 | 18 | private void showConsoleNotificationIfActive() { 19 | - if (!SystemProperties.get("init.svc.console").equals("running")) { 20 | + if (!SystemProperties.get("init.svc.console").equals("running") || true) { 21 | return; 22 | } 23 | String title = mContext 24 | -- 25 | 2.34.1 26 | 27 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_system_core/0019-Disable-project_quota-on-old-devices-but-new-enough-.patch: -------------------------------------------------------------------------------- 1 | From 7009b38ea686122a2fc04760cc4ce6c34c85d599 Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Fri, 6 Oct 2023 19:01:27 -0400 4 | Subject: [PATCH 19/26] Disable project_quota on old devices but new enough to 5 | have encryption (they do keep quota support) 6 | 7 | --- 8 | fs_mgr/fs_mgr.cpp | 8 ++++++++ 9 | 1 file changed, 8 insertions(+) 10 | 11 | diff --git a/fs_mgr/fs_mgr.cpp b/fs_mgr/fs_mgr.cpp 12 | index 38b9d8ffc..6a09ec4a8 100644 13 | --- a/fs_mgr/fs_mgr.cpp 14 | +++ b/fs_mgr/fs_mgr.cpp 15 | @@ -384,6 +384,14 @@ static void tune_quota(const std::string& blk_device, const FstabEntry& entry, 16 | want_quota = false; 17 | } 18 | 19 | + struct utsname uts; 20 | + unsigned int major, minor; 21 | + 22 | + if ((uname(&uts) == 0) && (sscanf(uts.release, "%u.%u", &major, &minor) == 2)) { 23 | + if(major < 4) want_projid = false; 24 | + if(major == 4 && minor < 9) want_projid = false; 25 | + } 26 | + 27 | if (!tune2fs_available()) { 28 | LERROR << "Unable to " << (want_quota ? "enable" : "disable") << " quotas on " << blk_device 29 | << " because " TUNE2FS_BIN " is missing"; 30 | -- 31 | 2.34.1 32 | 33 | -------------------------------------------------------------------------------- /patches/personal/platform_frameworks_base/0010-Fixup-QS-pulldown-default-value.patch: -------------------------------------------------------------------------------- 1 | From 0f09d8aae22c51fb28dcb7fba4a82fbf303a01eb Mon Sep 17 00:00:00 2001 2 | From: ChonDoit 3 | Date: Wed, 28 Aug 2024 19:52:44 -0300 4 | Subject: [PATCH 10/31] Fixup! QS pulldown default value 5 | 6 | --- 7 | .../src/com/android/systemui/shade/QuickSettingsController.java | 2 +- 8 | 1 file changed, 1 insertion(+), 1 deletion(-) 9 | 10 | diff --git a/packages/SystemUI/src/com/android/systemui/shade/QuickSettingsController.java b/packages/SystemUI/src/com/android/systemui/shade/QuickSettingsController.java 11 | index 726a2137..daf90b6f 100644 12 | --- a/packages/SystemUI/src/com/android/systemui/shade/QuickSettingsController.java 13 | +++ b/packages/SystemUI/src/com/android/systemui/shade/QuickSettingsController.java 14 | @@ -2227,7 +2227,7 @@ public class QuickSettingsController implements Dumpable { 15 | @Override 16 | public void onTuningChanged(String key, String newValue) { 17 | if (STATUS_BAR_QUICK_QS_PULLDOWN.equals(key)) { 18 | - mOneFingerQuickSettingsIntercept = TunerService.parseInteger(newValue, 1); 19 | + mOneFingerQuickSettingsIntercept = TunerService.parseInteger(newValue, 0); 20 | } 21 | } 22 | } 23 | -- 24 | 2.47.0 25 | 26 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_system_core/0011-Let-system-override-adb-secure-props-so-we-dont-get-.patch: -------------------------------------------------------------------------------- 1 | From dbfee5724435578184e805c8cdd437b12260b27f Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Fri, 9 Dec 2022 13:57:10 -0500 4 | Subject: [PATCH 11/26] Let system override adb/secure props, so we dont get 5 | stuck in ro.adb.secure=1 vendors 6 | 7 | --- 8 | init/property_service.cpp | 2 +- 9 | 1 file changed, 1 insertion(+), 1 deletion(-) 10 | 11 | diff --git a/init/property_service.cpp b/init/property_service.cpp 12 | index 0b2cf3cc6..eedad50f3 100644 13 | --- a/init/property_service.cpp 14 | +++ b/init/property_service.cpp 15 | @@ -802,7 +802,7 @@ static void LoadProperties(char* data, const char* filter, const char* filename, 16 | } else if (it->second != value) { 17 | LOG(WARNING) << "Overriding previous property '" << key << "':'" << it->second 18 | << "' with new value '" << value << "'"; 19 | - if(strcmp("ro.apex.updatable", key) == 0) { 20 | + if(strcmp("ro.apex.updatable", key) == 0 || strstr(key, "adb") || strstr(key, "secure")) { 21 | LOG(WARNING) << "... Ignored"; 22 | } else { 23 | it->second = value; 24 | -- 25 | 2.34.1 26 | 27 | -------------------------------------------------------------------------------- /patches/personal/platform_frameworks_av/0003-Free-buffers-on-observer-died.patch: -------------------------------------------------------------------------------- 1 | From 1b9ba4ce7c088fad9f458b4bfb720d4783fdc49f Mon Sep 17 00:00:00 2001 2 | From: ChonDoit 3 | Date: Fri, 14 Oct 2022 12:28:28 +0000 4 | Subject: [PATCH 06/12] libstagefright: Free buffers on observer died 5 | 6 | If observer died while allocating buffers, component remains 7 | in loaded state. In cleanup, it checks for idle state to 8 | free the allocated buffers which leads to memory leak. 9 | Hence explicitly calling free buffers to avoid memory leak. 10 | --- 11 | media/libstagefright/omx/OMXNodeInstance.cpp | 8 ++++++++ 12 | 1 file changed, 8 insertions(+) 13 | 14 | diff --git a/media/libstagefright/omx/OMXNodeInstance.cpp b/media/libstagefright/omx/OMXNodeInstance.cpp 15 | index bebd516..363d77a 100644 16 | --- a/media/libstagefright/omx/OMXNodeInstance.cpp 17 | +++ b/media/libstagefright/omx/OMXNodeInstance.cpp 18 | @@ -580,8 +580,16 @@ status_t OMXNodeInstance::freeNode() { 19 | break; 20 | } 21 | 22 | + if (mActiveBuffers.size() > 0) { 23 | + freeActiveBuffers(); 24 | + } 25 | + 26 | Mutex::Autolock _l(mLock); 27 | 28 | + if (mActiveBuffers.size() > 0) { 29 | + freeActiveBuffers(); 30 | + } 31 | + 32 | status_t err = mOwner->freeNode(this); 33 | 34 | mDispatcher.clear(); 35 | -- 36 | 2.34.1 37 | 38 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_system_core/0017-Ignore-dm-verity-setup-issues.patch: -------------------------------------------------------------------------------- 1 | From c62c93b6cc04554462663fb573a0837a666b5a4c Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Fri, 6 Oct 2023 08:20:48 -0400 4 | Subject: [PATCH 17/26] Ignore dm-verity setup issues 5 | 6 | On Amlogic STB Android 9 vendor, no boot device is setup 7 | (fstab doesn't use /dev/block/by-name but more direct mappings) 8 | that means that libavb can't access the partition by-name, thus failing 9 | to read vbmeta & co, and thus failing setting up dm-verity. 10 | 11 | We don't care much about dm-verity so let's just ignore this 12 | --- 13 | init/first_stage_mount.cpp | 1 - 14 | 1 file changed, 1 deletion(-) 15 | 16 | diff --git a/init/first_stage_mount.cpp b/init/first_stage_mount.cpp 17 | index a6e4fa3..2e40ac7 100644 18 | --- a/init/first_stage_mount.cpp 19 | +++ b/init/first_stage_mount.cpp 20 | @@ -437,7 +437,6 @@ bool FirstStageMountVBootV2::MountPartition(const Fstab::iterator& begin, bool e 21 | if (begin->fs_mgr_flags.avb) { 22 | if (!SetUpDmVerity(&(*begin))) { 23 | PLOG(ERROR) << "Failed to setup verity for '" << begin->mount_point << "'"; 24 | - return false; 25 | } 26 | } else { 27 | LOG(INFO) << "AVB is not enabled, skip verity setup for '" << begin->mount_point << "'"; 28 | -- 29 | 2.34.1 30 | 31 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_hardware_interfaces/0003-Fix-crash-on-Samsung-S23-using-stock-properties-beca.patch: -------------------------------------------------------------------------------- 1 | From dce503981d424772049cf9f7f7066d9da0435dfb Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Tue, 24 Oct 2023 04:59:57 -0400 4 | Subject: [PATCH 3/3] Fix crash on Samsung S23 using stock properties, because 5 | of sensor reporting vec3 instead of scalar. Likely the device orientation 6 | sensor 7 | 8 | --- 9 | sensors/aidl/convert/convert.cpp | 3 +++ 10 | 1 file changed, 3 insertions(+) 11 | 12 | diff --git a/sensors/aidl/convert/convert.cpp b/sensors/aidl/convert/convert.cpp 13 | index be3833dfa7..c56b30475c 100644 14 | --- a/sensors/aidl/convert/convert.cpp 15 | +++ b/sensors/aidl/convert/convert.cpp 16 | @@ -167,6 +167,9 @@ void convertToSensorEvent(const Event& src, sensors_event_t* dst) { 17 | auto dstr = ::android::internal::ToString(d); 18 | // ALOGE("Received 6DOF for expected scalar %s", dstr.c_str()); 19 | dst->data[0] = d.values[0]; 20 | + } else if (src.payload.getTag() == Event::EventPayload::vec3) { 21 | + auto d = src.payload.get(); 22 | + dst->data[0] = d.x; 23 | } else { 24 | dst->data[0] = src.payload.get(); 25 | } 26 | -- 27 | 2.34.1 28 | 29 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_system_core/0006-Ugly-but-secure-Set-dev-uinput-as-0666-to-fix-finger.patch: -------------------------------------------------------------------------------- 1 | From 9532731e39fc4da61d04e79894c7b306c9e020d5 Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Fri, 1 Nov 2019 18:22:13 +0100 4 | Subject: [PATCH 06/26] Ugly but secure: Set /dev/uinput as 0666 to fix 5 | fingerprint sensor on some devices 6 | 7 | cf https://github.com/phhusson/device_phh_treble/pull/122/commits/e000d69c286b6686777ea6f1867f379e30273e48 8 | This is safe because even though it's 0666, its SELinux policy is very 9 | tight, and only bluetooth HAL, shell (and fingerprint HAL on Xiaomi) can 10 | access it. 11 | 12 | Change-Id: Id374e781957927d5604cb96c7a39b3fb28b3a6c5 13 | --- 14 | rootdir/ueventd.rc | 2 +- 15 | 1 file changed, 1 insertion(+), 1 deletion(-) 16 | 17 | diff --git a/rootdir/ueventd.rc b/rootdir/ueventd.rc 18 | index 3927501a4..d0ab3f7bb 100644 19 | --- a/rootdir/ueventd.rc 20 | +++ b/rootdir/ueventd.rc 21 | @@ -60,7 +60,7 @@ subsystem vfio 22 | 23 | # these should not be world writable 24 | /dev/uhid 0660 uhid uhid 25 | -/dev/uinput 0660 uhid uhid 26 | +/dev/uinput 0666 uhid uhid 27 | /dev/rtc0 0640 system system 28 | /dev/tty0 0660 root system 29 | /dev/graphics/* 0660 root graphics 30 | -- 31 | 2.34.1 32 | 33 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_system_core/0022-Keep-our-own-version-of-ro.logd.kernel.-We-do-want-l.patch: -------------------------------------------------------------------------------- 1 | From ba54501631df4d08e45f576cc57d0b45ee4d85a4 Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Sat, 25 Nov 2023 09:51:14 -0500 4 | Subject: [PATCH 22/26] Keep our own version of ro.logd.kernel. We do want 5 | logcat -b kernel, unlike what OEM set from their vendor 6 | 7 | --- 8 | init/property_service.cpp | 2 +- 9 | 1 file changed, 1 insertion(+), 1 deletion(-) 10 | 11 | diff --git a/init/property_service.cpp b/init/property_service.cpp 12 | index dbd1e61a5..b2fedebd8 100644 13 | --- a/init/property_service.cpp 14 | +++ b/init/property_service.cpp 15 | @@ -815,7 +815,7 @@ static void LoadProperties(char* data, const char* filter, const char* filename, 16 | << "' with new value '" << value << "'"; 17 | if(strcmp("ro.apex.updatable", key) == 0 && !kernel_supports_capex()) { 18 | LOG(WARNING) << "... Ignored apex by kernel version"; 19 | - } else if(strstr(key, "adb") || strstr(key, "secure")) { 20 | + } else if(strstr(key, "adb") || strstr(key, "secure") || strstr(key, "ro.logd.kernel")) { 21 | LOG(WARNING) << "... Ignored"; 22 | } else { 23 | it->second = value; 24 | -- 25 | 2.34.1 26 | 27 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_frameworks_opt_net_ims/0001-Pie-MTK-IMS-calls-static-ImsManager.updateImsService.patch: -------------------------------------------------------------------------------- 1 | From 874d9e14f0b04c6118c065160f72669a72eb0bdd Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Sun, 14 Nov 2021 13:47:29 -0500 4 | Subject: [PATCH] Pie MTK IMS calls static 5 | ImsManager.updateImsServiceConfig(Context,int,boolean). Bring it back 6 | 7 | Change-Id: I3dd66d436629d37c8ec795df6569736195ae570e 8 | --- 9 | src/java/com/android/ims/ImsManager.java | 8 ++++++++ 10 | 1 file changed, 8 insertions(+) 11 | 12 | diff --git a/src/java/com/android/ims/ImsManager.java b/src/java/com/android/ims/ImsManager.java 13 | index 217a26f2..b687e4bf 100644 14 | --- a/src/java/com/android/ims/ImsManager.java 15 | +++ b/src/java/com/android/ims/ImsManager.java 16 | @@ -1679,6 +1679,14 @@ public class ImsManager implements FeatureUpdates { 17 | } 18 | } 19 | 20 | + public static void updateImsServiceConfig(Context context, int phoneId, boolean force) { 21 | + ImsManager mgr = ImsManager.getInstance(context, phoneId); 22 | + if (mgr != null) { 23 | + mgr.updateImsServiceConfig(); 24 | + } 25 | + Rlog.e(TAG, "updateImsServiceConfig: ImsManager null, returning without update."); 26 | + } 27 | + 28 | /** 29 | * Push configuration updates to the ImsService implementation. 30 | */ 31 | -- 32 | 2.34.1 33 | 34 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_frameworks_opt_telephony/0010-Fix-NPE-with-1.0-and-1.1-CardStatus.patch: -------------------------------------------------------------------------------- 1 | From b1e5546cc4cb05a791b0fbe76126c0926b257511 Mon Sep 17 00:00:00 2001 2 | From: Christian Hoffmann 3 | Date: Fri, 21 Oct 2022 12:58:04 +0200 4 | Subject: [PATCH 10/16] Fix NPE with 1.0 and 1.1 CardStatus 5 | 6 | Change-Id: I965f6ef419b7aef828da02f5d4745bd33d09fe3a 7 | --- 8 | src/java/com/android/internal/telephony/RadioResponse.java | 2 ++ 9 | 1 file changed, 2 insertions(+) 10 | 11 | diff --git a/src/java/com/android/internal/telephony/RadioResponse.java b/src/java/com/android/internal/telephony/RadioResponse.java 12 | index 0bc29583fb..71bb2e5b75 100644 13 | --- a/src/java/com/android/internal/telephony/RadioResponse.java 14 | +++ b/src/java/com/android/internal/telephony/RadioResponse.java 15 | @@ -1879,6 +1879,8 @@ public class RadioResponse extends IRadioResponse.Stub { 16 | 17 | if (rr != null) { 18 | IccCardStatus iccCardStatus = RILUtils.convertHalCardStatus(cardStatus); 19 | + IccSlotPortMapping slotPortMapping = new IccSlotPortMapping(); 20 | + iccCardStatus.mSlotPortMapping = slotPortMapping; 21 | mRil.riljLog("responseIccCardStatus: from HIDL: " + iccCardStatus); 22 | if (responseInfo.error == RadioError.NONE) { 23 | sendMessageResponse(rr.mResult, iccCardStatus); 24 | -- 25 | 2.34.1 26 | 27 | -------------------------------------------------------------------------------- /patches/personal/platform_frameworks_base/0019-Reduce-Circle-Battery-Text.patch: -------------------------------------------------------------------------------- 1 | From 4e1747180496f8d2ef95a588db950aa150af6987 Mon Sep 17 00:00:00 2001 2 | From: ChonDoit 3 | Date: Thu, 19 Sep 2024 23:50:49 -0300 4 | Subject: [PATCH 19/31] Reduce Circle Battery Text 5 | 6 | Unnecessarily larger than it should be 7 | --- 8 | .../src/com/android/settingslib/graph/CircleBatteryDrawable.kt | 2 +- 9 | 1 file changed, 1 insertion(+), 1 deletion(-) 10 | 11 | diff --git a/packages/SettingsLib/src/com/android/settingslib/graph/CircleBatteryDrawable.kt b/packages/SettingsLib/src/com/android/settingslib/graph/CircleBatteryDrawable.kt 12 | index 28d6deda..b3f6f148 100644 13 | --- a/packages/SettingsLib/src/com/android/settingslib/graph/CircleBatteryDrawable.kt 14 | +++ b/packages/SettingsLib/src/com/android/settingslib/graph/CircleBatteryDrawable.kt 15 | @@ -227,7 +227,7 @@ class CircleBatteryDrawable(private val context: Context, frameColor: Int) : Dra 16 | // compute percentage text 17 | if (!charging && batteryLevel != 100 && showPercent) { 18 | textPaint.color = getColorForLevel(batteryLevel) 19 | - textPaint.textSize = height * 0.52f 20 | + textPaint.textSize = height * 0.46f 21 | val textHeight = -textPaint.fontMetrics.ascent 22 | val pctText = 23 | if (batteryLevel > criticalLevel) 24 | -- 25 | 2.47.0 26 | 27 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_hardware_interfaces/0001-Add-a-vendor800-command-to-be-able-to-call-vendor-sp.patch: -------------------------------------------------------------------------------- 1 | From 7208af40a2968eb1e04017e45e6fe0388daa1bcb Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Sun, 19 Dec 2021 17:03:15 -0500 4 | Subject: [PATCH 1/3] Add a vendor800 command, to be able to call 5 | vendor-specific hwc functions 6 | 7 | Change-Id: Icbef1e9e3a331ae3bd5a05687d545851d94d88a8 8 | --- 9 | .../composer-command-buffer/2.1/ComposerCommandBuffer.h | 6 ++++++ 10 | 1 file changed, 6 insertions(+) 11 | 12 | diff --git a/graphics/composer/2.1/utils/command-buffer/include/composer-command-buffer/2.1/ComposerCommandBuffer.h b/graphics/composer/2.1/utils/command-buffer/include/composer-command-buffer/2.1/ComposerCommandBuffer.h 13 | index 336d15dc6c..423893f837 100644 14 | --- a/graphics/composer/2.1/utils/command-buffer/include/composer-command-buffer/2.1/ComposerCommandBuffer.h 15 | +++ b/graphics/composer/2.1/utils/command-buffer/include/composer-command-buffer/2.1/ComposerCommandBuffer.h 16 | @@ -402,6 +402,12 @@ class CommandWriterBase { 17 | endCommand(); 18 | } 19 | 20 | + void vendor800_1(uint32_t val) { 21 | + beginCommand(0x800 << 16, 1); 22 | + write(val); 23 | + endCommand(); 24 | + } 25 | + 26 | protected: 27 | template 28 | void beginCommand(T command, uint16_t length) { 29 | -- 30 | 2.34.1 31 | 32 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_system_core/0015-Disable-quotas-on-legacy-devices-with-encryption-dis.patch: -------------------------------------------------------------------------------- 1 | From e77a410a93459646c656ce76681b506d1bdb2d72 Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Tue, 6 Jun 2023 16:17:11 +0100 4 | Subject: [PATCH 15/26] Disable quotas on legacy devices with encryption 5 | disabled 6 | 7 | Source: https://t.me/phhtreblebuilders/20521 and https://t.me/phhtreblebuilders/20546 8 | --- 9 | fs_mgr/fs_mgr.cpp | 7 +++++++ 10 | 1 file changed, 7 insertions(+) 11 | 12 | diff --git a/fs_mgr/fs_mgr.cpp b/fs_mgr/fs_mgr.cpp 13 | index 8c0c1efe3..38b9d8ffc 100644 14 | --- a/fs_mgr/fs_mgr.cpp 15 | +++ b/fs_mgr/fs_mgr.cpp 16 | @@ -377,6 +377,13 @@ static void tune_quota(const std::string& blk_device, const FstabEntry& entry, 17 | return; 18 | } 19 | 20 | + // There is no relation between quotas and encryption disabled, it's just that encryption 21 | + // being disabled shows that the device is pretty old, so quotas might be broken on it 22 | + if (!entry.fs_mgr_flags.file_encryption) { 23 | + LINFO << "Disabling quotas on legacy devices with encryption disabled"; 24 | + want_quota = false; 25 | + } 26 | + 27 | if (!tune2fs_available()) { 28 | LERROR << "Unable to " << (want_quota ? "enable" : "disable") << " quotas on " << blk_device 29 | << " because " TUNE2FS_BIN " is missing"; 30 | -- 31 | 2.34.1 32 | 33 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_frameworks_native/0001-On-Samsung-we-need-to-send-a-hack-message-to-HAL-to-.patch: -------------------------------------------------------------------------------- 1 | From 50db1f171c6f2833f5f146190b6da249919e11bc Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Wed, 14 Aug 2019 23:37:10 +0200 4 | Subject: [PATCH 01/14] On Samsung, we need to send a hack-message to HAL to 5 | get all Sensors 6 | 7 | Change-Id: Id6a1fa48340de61c418493668e9abd22c2599376 8 | --- 9 | services/sensorservice/SensorDevice.cpp | 3 +++ 10 | 1 file changed, 3 insertions(+) 11 | 12 | diff --git a/services/sensorservice/SensorDevice.cpp b/services/sensorservice/SensorDevice.cpp 13 | index f62562ce9d..be7d33ba62 100644 14 | --- a/services/sensorservice/SensorDevice.cpp 15 | +++ b/services/sensorservice/SensorDevice.cpp 16 | @@ -40,6 +40,7 @@ 17 | #include "android/hardware/sensors/2.1/types.h" 18 | #include "convertV2_1.h" 19 | 20 | +#include 21 | using namespace android::hardware::sensors; 22 | using android::util::ProtoOutputStream; 23 | namespace sensorservice_flags = com::android::frameworks::sensorservice::flags; 24 | @@ -79,6 +80,8 @@ SensorDevice::SensorDevice() : mInHalBypassMode(false) { 25 | } 26 | 27 | void SensorDevice::initializeSensorList() { 28 | + if(::android::base::GetBoolProperty("persist.sys.phh.samsung_sensors", false)) 29 | + setMode(5555); 30 | if (mHalWrapper == nullptr) { 31 | return; 32 | } 33 | -- 34 | 2.34.1 35 | 36 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_frameworks_av/0015-Not-all-sources-in-a-route-are-valid.-Dont-ignore-th.patch: -------------------------------------------------------------------------------- 1 | From b48eeef242b27b4e391723c8b24b2fc07b598a4a Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Sun, 28 Mar 2021 18:54:47 +0200 4 | Subject: [PATCH 15/24] Not all sources in a route are valid. Dont ignore the 5 | whole route because of one broken source 6 | 7 | Change-Id: If8a51740e71bef3a4738262ad7b43a337b0ec36d 8 | --- 9 | .../audiopolicy/common/managerdefinitions/src/Serializer.cpp | 2 +- 10 | 1 file changed, 1 insertion(+), 1 deletion(-) 11 | 12 | diff --git a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp 13 | index 6ee076660b..146c78b8f6 100644 14 | --- a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp 15 | +++ b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp 16 | @@ -670,7 +670,7 @@ std::variant PolicySerializer::deserializefindPortByTagName(trim(devTag)); 18 | } 19 | if (source == NULL) { 20 | - if (!mIgnoreVendorExtensions) { 21 | + if (false && !mIgnoreVendorExtensions) { 22 | ALOGE("%s: no source found with name \"%s\"", __func__, devTag); 23 | return BAD_VALUE; 24 | } else { 25 | -- 26 | 2.34.1 27 | 28 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_system_core/0007-Revert-Set-system-xbin-permissions-to-750.patch: -------------------------------------------------------------------------------- 1 | From 6dd7c07a73c4a80269bd3ef9e9586d6392511f02 Mon Sep 17 00:00:00 2001 2 | From: Alberto Ponces 3 | Date: Tue, 1 Feb 2022 13:48:35 +0000 4 | Subject: [PATCH 07/26] Revert "Set /system/xbin permissions to 750." 5 | 6 | This reverts commit 42a1a126e554a8bca31d0afc832848b7b0fa1f4e. 7 | 8 | Change-Id: I277def5153616d6f00bc877e6170b7fed7cd799d 9 | --- 10 | libcutils/fs_config.cpp | 2 +- 11 | 1 file changed, 1 insertion(+), 1 deletion(-) 12 | 13 | diff --git a/libcutils/fs_config.cpp b/libcutils/fs_config.cpp 14 | index 919be2ff2..9ab7f4305 100644 15 | --- a/libcutils/fs_config.cpp 16 | +++ b/libcutils/fs_config.cpp 17 | @@ -83,7 +83,7 @@ static const struct fs_path_config android_dirs[] = { 18 | { 00751, AID_ROOT, AID_SHELL, 0, "system/bin" }, 19 | { 00755, AID_ROOT, AID_ROOT, 0, "system/etc/ppp" }, 20 | { 00755, AID_ROOT, AID_SHELL, 0, "system/vendor" }, 21 | - { 00750, AID_ROOT, AID_SHELL, 0, "system/xbin" }, 22 | + { 00751, AID_ROOT, AID_SHELL, 0, "system/xbin" }, 23 | { 00751, AID_ROOT, AID_SHELL, 0, "system/apex/*/bin" }, 24 | { 00750, AID_ROOT, AID_SYSTEM, 0, "system_ext/apex/com.android.tethering/bin/for-system" }, 25 | { 00751, AID_ROOT, AID_SHELL, 0, "system_ext/bin" }, 26 | -- 27 | 2.34.1 28 | 29 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_frameworks_native/0004-Remove-Samsung-system-permission-on-sensors.patch: -------------------------------------------------------------------------------- 1 | From 90afacd9625b2ff98e8a22ac8bcc8682cf90b693 Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Wed, 31 Mar 2021 23:36:03 +0200 4 | Subject: [PATCH 04/14] Remove Samsung system permission on sensors 5 | 6 | --- 7 | libs/sensor/Sensor.cpp | 1 + 8 | libs/sensor/include/sensor/Sensor.h | 1 + 9 | 2 files changed, 2 insertions(+) 10 | 11 | diff --git a/libs/sensor/Sensor.cpp b/libs/sensor/Sensor.cpp 12 | index a1549ea385..3eec309a93 100644 13 | --- a/libs/sensor/Sensor.cpp 14 | +++ b/libs/sensor/Sensor.cpp 15 | @@ -429,6 +429,7 @@ const String8& Sensor::getStringType() const { 16 | } 17 | 18 | const String8& Sensor::getRequiredPermission() const { 19 | + if (mRequiredPermission == "com.samsung.permission.SSENSOR") return mFakeRequiredPermission; 20 | return mRequiredPermission; 21 | } 22 | 23 | diff --git a/libs/sensor/include/sensor/Sensor.h b/libs/sensor/include/sensor/Sensor.h 24 | index bae8a1380b..afaafb321e 100644 25 | --- a/libs/sensor/include/sensor/Sensor.h 26 | +++ b/libs/sensor/include/sensor/Sensor.h 27 | @@ -125,6 +125,7 @@ private: 28 | uint32_t mFifoMaxEventCount; 29 | String8 mStringType; 30 | String8 mRequiredPermission; 31 | + String8 mFakeRequiredPermission; 32 | bool mRequiredPermissionRuntime = false; 33 | int32_t mRequiredAppOp; 34 | int32_t mMaxDelay; 35 | -- 36 | 2.34.1 37 | 38 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_system_core/0023-Keep-capex-when-there-are-vendor-apexes.patch: -------------------------------------------------------------------------------- 1 | From 246d4313bc8f069c7076401c200d38bcddf9edba Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Tue, 16 Jan 2024 10:30:57 -0500 4 | Subject: [PATCH 23/26] Keep capex when there are vendor apexes 5 | 6 | When disabling APEX on Linux < 5, we might break some vendor APEXes 7 | For instance Pixel 4a on Linux 4.14. 8 | If there is a vendor apex, enable APEX anyway. 9 | --- 10 | init/property_service.cpp | 14 ++++++++++++-- 11 | 1 file changed, 12 insertions(+), 2 deletions(-) 12 | 13 | diff --git a/init/property_service.cpp b/init/property_service.cpp 14 | index b2fedebd8..d049df264 100644 15 | --- a/init/property_service.cpp 16 | +++ b/init/property_service.cpp 17 | @@ -712,8 +712,18 @@ static bool kernel_supports_capex() { 18 | uname(&buf); 19 | const char *where = buf.release; 20 | int a = atoi(where); 21 | - if(a <= 4) return false; 22 | - return true; 23 | + if(a >= 5) return true; 24 | + 25 | + // If there are vendor apexes, we most likely actually need them 26 | + auto dir = std::unique_ptr{opendir("/vendor/apex"), closedir}; 27 | + if (!dir) { 28 | + return false; 29 | + } 30 | + for (struct dirent* ent = readdir(dir.get()); ent; ent = readdir(dir.get())) { 31 | + if(strstr(ent->d_name, "apex")) return true; 32 | + } 33 | + 34 | + return false; 35 | } 36 | 37 | /* 38 | -- 39 | 2.34.1 40 | 41 | -------------------------------------------------------------------------------- /patches/personal/platform_frameworks_av/0006-Add-a-prop-to-set-AUDIO_OUTPUT_FLAG_DIRECT-on-voip_rx.patch: -------------------------------------------------------------------------------- 1 | From 3eb94aefcf66d75d9b139292e85f9822313ccb62 Mon Sep 17 00:00:00 2001 2 | From: ChonDoit 3 | Date: Wed, 24 Jan 2024 18:23:14 -0300 4 | Subject: [PATCH] Add a prop to set AUDIO_OUTPUT_FLAG_DIRECT on voip_rx 5 | 6 | This Should fix High Pitched when set to MONO ONLY doesn't 7 | --- 8 | .../audiopolicy/common/managerdefinitions/src/Serializer.cpp | 5 +++++ 9 | 1 file changed, 5 insertions(+) 10 | 11 | diff --git a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp 12 | index 6bf5d14c3c..c049692dc0 100644 13 | --- a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp 14 | +++ b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp 15 | @@ -511,6 +511,11 @@ std::variant PolicySerializer::deserializesetFlags(intFlags); 25 | } else { 26 | // Sink role 27 | -- 28 | 2.34.1 29 | 30 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_bionic/0001-Disable-vndklite-handling.patch: -------------------------------------------------------------------------------- 1 | From c0724aca39c9e50864d73d405c8bec8de757efbb Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Wed, 27 Oct 2021 14:39:29 -0400 4 | Subject: [PATCH 1/2] Disable vndklite handling 5 | 6 | Change-Id: Ic4474cf80fc4b45a9a2760dd51e2ca29c4d961e2 7 | --- 8 | linker/linker.cpp | 5 ----- 9 | 1 file changed, 5 deletions(-) 10 | 11 | diff --git a/linker/linker.cpp b/linker/linker.cpp 12 | index b0caeddc1..3e0e7fecf 100644 13 | --- a/linker/linker.cpp 14 | +++ b/linker/linker.cpp 15 | @@ -97,7 +97,6 @@ static uint64_t g_module_unload_counter = 0; 16 | static const char* const kLdConfigArchFilePath = "/system/etc/ld.config." ABI_STRING ".txt"; 17 | 18 | static const char* const kLdConfigFilePath = "/system/etc/ld.config.txt"; 19 | -static const char* const kLdConfigVndkLiteFilePath = "/system/etc/ld.config.vndk_lite.txt"; 20 | 21 | static const char* const kLdGeneratedConfigFilePath = "/linkerconfig/ld.config.txt"; 22 | 23 | @@ -3463,10 +3462,6 @@ static std::string get_ld_config_file_apex_path(const char* executable_path) { 24 | } 25 | 26 | static std::string get_ld_config_file_vndk_path() { 27 | - if (android::base::GetBoolProperty("ro.vndk.lite", false)) { 28 | - return kLdConfigVndkLiteFilePath; 29 | - } 30 | - 31 | std::string ld_config_file_vndk = kLdConfigFilePath; 32 | size_t insert_pos = ld_config_file_vndk.find_last_of('.'); 33 | if (insert_pos == std::string::npos) { 34 | -- 35 | 2.34.1 36 | 37 | -------------------------------------------------------------------------------- /patches/pre/platform_frameworks_base/0002-Revert-SystemUI-Always-disable-rotation-on-lockscree.patch: -------------------------------------------------------------------------------- 1 | From 43896692182e7daae6a363dce454010ffe34d4d5 Mon Sep 17 00:00:00 2001 2 | From: ChonDoit 3 | Date: Wed, 23 Oct 2024 22:40:18 -0300 4 | Subject: [PATCH 2/2] Revert "SystemUI: Always disable rotation on lockscreen" 5 | 6 | This reverts commit d5a4d5d0e59f8bf790fce8f92e2cc5ce4a8e6ba3. 7 | --- 8 | .../statusbar/policy/KeyguardStateControllerImpl.java | 4 +++- 9 | 1 file changed, 3 insertions(+), 1 deletion(-) 10 | 11 | diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyguardStateControllerImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyguardStateControllerImpl.java 12 | index 2f6c46a45e9c..9a30a37681ec 100644 13 | --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyguardStateControllerImpl.java 14 | +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyguardStateControllerImpl.java 15 | @@ -284,7 +284,9 @@ public class KeyguardStateControllerImpl implements KeyguardStateController, Dum 16 | 17 | @Override 18 | public boolean isKeyguardScreenRotationAllowed() { 19 | - return false; 20 | + return SystemProperties.getBoolean("lockscreen.rot_override", false) 21 | + || mContext.getResources().getBoolean(R.bool.config_enableLockScreenRotation) 22 | + || mFeatureFlags.isEnabled(LOCKSCREEN_ENABLE_LANDSCAPE); 23 | } 24 | 25 | @Override 26 | -- 27 | 2.45.1.windows.1 28 | 29 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_system_extras/0001-libfscrypt-Bail-out-if-we-can-t-open-directory.patch: -------------------------------------------------------------------------------- 1 | From e12cf11ceb1981a28ac2826407ca3c99a92bb01e Mon Sep 17 00:00:00 2001 2 | From: Luca Stefani 3 | Date: Wed, 9 Sep 2020 12:43:54 +0200 4 | Subject: [PATCH] libfscrypt: Bail out if we can't open directory 5 | 6 | * On QCOM Q vendor init.qcom.rc has a 'mkdir' entry 7 | for /data/system 8 | * While the encryption policy matches and is applied properly in 9 | permissive, vendor_init doesn't have enough perms to open 10 | and run ioctl over system_data_file to check its policy 11 | * Instead of opening the possiblity to vendors, just 12 | bail out if we fail to open the directory 13 | 14 | Test: m, boot r-gsi on Zenfone 6 15 | Change-Id: I5ea37019221cd0887b8a5d7454f5a42ac01335c7 16 | --- 17 | libfscrypt/fscrypt.cpp | 2 +- 18 | 1 file changed, 1 insertion(+), 1 deletion(-) 19 | 20 | diff --git a/libfscrypt/fscrypt.cpp b/libfscrypt/fscrypt.cpp 21 | index 4c756b18..f3b106e9 100644 22 | --- a/libfscrypt/fscrypt.cpp 23 | +++ b/libfscrypt/fscrypt.cpp 24 | @@ -354,7 +354,7 @@ bool EnsurePolicy(const EncryptionPolicy& policy, const std::string& directory) 25 | android::base::unique_fd fd(open(directory.c_str(), O_DIRECTORY | O_NOFOLLOW | O_CLOEXEC)); 26 | if (fd == -1) { 27 | PLOG(ERROR) << "Failed to open directory " << directory; 28 | - return false; 29 | + return true; 30 | } 31 | 32 | bool already_encrypted = fscrypt_is_encrypted(fd); 33 | -- 34 | 2.34.1 35 | 36 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_packages_modules_DeviceLock/0001-Don-t-crash-when-we-get-no-DeviceLockManager.patch: -------------------------------------------------------------------------------- 1 | From ce509a6a4788e696de672d7d772853cc49c5b38e Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Wed, 18 Oct 2023 17:44:59 -0400 4 | Subject: [PATCH] Don't crash when we get no DeviceLockManager 5 | 6 | Change-Id: Iaba659694e706c82a95ec2e99feb26e2bc6314e0 7 | --- 8 | .../devicelockcontroller/SystemDeviceLockManagerImpl.java | 5 ++++- 9 | 1 file changed, 4 insertions(+), 1 deletion(-) 10 | 11 | diff --git a/DeviceLockController/src/com/android/devicelockcontroller/SystemDeviceLockManagerImpl.java b/DeviceLockController/src/com/android/devicelockcontroller/SystemDeviceLockManagerImpl.java 12 | index 93540aec..4916c823 100644 13 | --- a/DeviceLockController/src/com/android/devicelockcontroller/SystemDeviceLockManagerImpl.java 14 | +++ b/DeviceLockController/src/com/android/devicelockcontroller/SystemDeviceLockManagerImpl.java 15 | @@ -48,7 +48,10 @@ public final class SystemDeviceLockManagerImpl implements SystemDeviceLockManage 16 | final DeviceLockManager deviceLockManager = context.getSystemService( 17 | DeviceLockManager.class); 18 | 19 | - mIDeviceLockService = deviceLockManager.getService(); 20 | + if (deviceLockManager != null) 21 | + mIDeviceLockService = deviceLockManager.getService(); 22 | + else 23 | + mIDeviceLockService = null; 24 | } 25 | 26 | private SystemDeviceLockManagerImpl() { 27 | -- 28 | 2.34.1 29 | 30 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_external_selinux/0009-Allow-sys-vm-watermark_scale_factor-conflict-seen-on.patch: -------------------------------------------------------------------------------- 1 | From daf8cded81349ec4f151861cd793139adb5eda4f Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Thu, 20 Jul 2023 14:21:21 -0400 4 | Subject: [PATCH 09/10] Allow /sys/vm/watermark_scale_factor conflict -- seen 5 | on Freebox Player Pop 6 | 7 | --- 8 | libsepol/cil/src/cil_post.c | 9 +++++++++ 9 | 1 file changed, 9 insertions(+) 10 | 11 | diff --git a/libsepol/cil/src/cil_post.c b/libsepol/cil/src/cil_post.c 12 | index 7f614c03..1703b3b6 100644 13 | --- a/libsepol/cil/src/cil_post.c 14 | +++ b/libsepol/cil/src/cil_post.c 15 | @@ -502,6 +502,15 @@ static int cil_post_genfscon_context_compare(const void *a, const void *b) 16 | */ 17 | if(strcmp(a_genfscon->path_str, "/devices/virtual/block/") == 0) 18 | bypass = 1; 19 | + /* 20 | + * This conflict has been seen on Freebox Player Pop 21 | + * - AOSP T says (genfscon proc "/sys/vm/watermark_scale_factor" (u object_r proc_watermark_scale_factor ((s0) (s0)))) 22 | + * - stock rom says proc_vm_writable 23 | + * 24 | + * Stock ROM uses it only in recovery so it's safe to ignore 25 | + */ 26 | + if(strcmp(a_genfscon->path_str, "/sys/vm/watermark_scale_factor") == 0) 27 | + bypass = 1; 28 | if(strcmp(a_genfscon->fs_str, "exfat") == 0 || strcmp(a_genfscon->fs_str, "esdfs") == 0) { 29 | if(strcmp(a_genfscon->path_str, "/") == 0) 30 | bypass = 1; 31 | -- 32 | 2.34.1 33 | 34 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_frameworks_base/0025-Allow-disabling-of-fingerprint-cleanups-needed-on-so.patch: -------------------------------------------------------------------------------- 1 | From 2a1ee059c06724737018301410ced6844e011b16 Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Sat, 2 Apr 2022 18:04:01 -0400 4 | Subject: [PATCH 25/54] Allow disabling of fingerprint cleanups, needed on some 5 | Realme devices that cant enumerate 6 | 7 | --- 8 | .../biometrics/sensors/fingerprint/hidl/Fingerprint21.java | 4 ++++ 9 | 1 file changed, 4 insertions(+) 10 | 11 | diff --git a/services/core/java/com/android/server/biometrics/sensors/fingerprint/hidl/Fingerprint21.java b/services/core/java/com/android/server/biometrics/sensors/fingerprint/hidl/Fingerprint21.java 12 | index ad1451e5..13a8c9d7 100644 13 | --- a/services/core/java/com/android/server/biometrics/sensors/fingerprint/hidl/Fingerprint21.java 14 | +++ b/services/core/java/com/android/server/biometrics/sensors/fingerprint/hidl/Fingerprint21.java 15 | @@ -1013,6 +1013,10 @@ public class Fingerprint21 implements IHwBinder.DeathRecipient, ServiceProvider 16 | 17 | private void scheduleInternalCleanup(int userId, 18 | @Nullable ClientMonitorCallback callback) { 19 | + final boolean mNocleanup = android.os.SystemProperties.getBoolean("persist.sys.phh.fingerprint.nocleanup", false); 20 | + if (mNocleanup) { 21 | + return; 22 | + } 23 | if (mCleanup) { 24 | mHandler.post(() -> { 25 | scheduleUpdateActiveUserWithoutHandler(userId); 26 | -- 27 | 2.34.1 28 | 29 | -------------------------------------------------------------------------------- /patches/pre/platform_vendor_superior/02-Nuke-duplicated-ro-adb-secure.patch: -------------------------------------------------------------------------------- 1 | From c198a1774788aa696341847d6974d812ed334202 Mon Sep 17 00:00:00 2001 2 | From: ChonDoit 3 | Date: Fri, 2 Feb 2024 13:18:37 -0300 4 | Subject: [PATCH] Nuke duplicated ro.secure.adb 5 | 6 | --- 7 | config/superior_props.mk | 13 +------------ 8 | 1 file changed, 1 insertion(+), 12 deletions(-) 9 | 10 | diff --git a/config/superior_props.mk b/config/superior_props.mk 11 | index 522678bc..135b2ae4 100644 12 | --- a/config/superior_props.mk 13 | +++ b/config/superior_props.mk 14 | @@ -20,17 +20,6 @@ PRODUCT_SYSTEM_DEFAULT_PROPERTIES += \ 15 | ro.com.google.clientidbase=$(PRODUCT_GMS_CLIENTID_BASE) 16 | endif 17 | 18 | -ifeq ($(TARGET_BUILD_VARIANT),eng) 19 | -# Disable ADB authentication 20 | -PRODUCT_SYSTEM_DEFAULT_PROPERTIES += ro.adb.secure=0 21 | -else 22 | -# Enable ADB authentication 23 | -PRODUCT_SYSTEM_DEFAULT_PROPERTIES += ro.adb.secure=1 24 | - 25 | -# Disable extra StrictMode features on all non-engineering builds 26 | -PRODUCT_SYSTEM_DEFAULT_PROPERTIES += persist.sys.strictmode.disable=true 27 | -endif 28 | - 29 | ifneq ($(TARGET_BUILD_VARIANT),eng) 30 | # Disable extra StrictMode features on all non-engineering builds 31 | PRODUCT_SYSTEM_DEFAULT_PROPERTIES += \ 32 | @@ -83,4 +72,4 @@ PRODUCT_DEXPREOPT_SPEED_APPS += \ 33 | SystemUI 34 | 35 | PRODUCT_SYSTEM_DEFAULT_PROPERTIES += \ 36 | - dalvik.vm.systemuicompilerfilter=speed 37 | \ No newline at end of file 38 | + dalvik.vm.systemuicompilerfilter=speed 39 | -- 40 | 2.34.1 41 | 42 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_system_core/0002-Don-t-abandon-creating-property-tree-if-there-is-a-c.patch: -------------------------------------------------------------------------------- 1 | From 31d2c3d4ff4f93fe80f7ee56ee04054334037f31 Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Sun, 18 Oct 2020 18:14:47 +0200 4 | Subject: [PATCH 02/26] Don't abandon creating property tree if there is a 5 | conflict, and hope for the best 6 | 7 | Change-Id: I194c815fdd58bfb84aaf7db02b8f0d00b4db21e8 8 | --- 9 | .../libpropertyinfoserializer/property_info_serializer.cpp | 3 ++- 10 | 1 file changed, 2 insertions(+), 1 deletion(-) 11 | 12 | diff --git a/property_service/libpropertyinfoserializer/property_info_serializer.cpp b/property_service/libpropertyinfoserializer/property_info_serializer.cpp 13 | index 803657ab8..ecdd0be20 100644 14 | --- a/property_service/libpropertyinfoserializer/property_info_serializer.cpp 15 | +++ b/property_service/libpropertyinfoserializer/property_info_serializer.cpp 16 | @@ -19,6 +19,7 @@ 17 | #include "property_info_parser/property_info_parser.h" 18 | 19 | #include 20 | +#include 21 | 22 | #include "trie_builder.h" 23 | #include "trie_serializer.h" 24 | @@ -34,7 +35,7 @@ bool BuildTrie(const std::vector& property_info, 25 | 26 | for (const auto& [name, context, type, is_exact] : property_info) { 27 | if (!trie_builder.AddToTrie(name, context, type, is_exact, error)) { 28 | - return false; 29 | + std::cerr << "Failed adding " << name << " to property trie... let's hope for the best" << std::endl; 30 | } 31 | } 32 | 33 | -- 34 | 2.34.1 35 | 36 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_system_core/0009-fs_mgr-Keep-allowing-encryptable-fstab-flag.patch: -------------------------------------------------------------------------------- 1 | From 771612a08b792dd12cdec0d7faba0b2c3371bc8a Mon Sep 17 00:00:00 2001 2 | From: ChonDoit 3 | Date: Fri, 7 Oct 2022 03:32:01 +0000 4 | Subject: [PATCH] Allow encryptable fstab flag at any case 5 | 6 | ChonDoe: Simple re-do from Ponces patch due fails on bash (? 7 | 8 | With FDE drop "encryptable" fstab flags isn't allowed anymore 9 | for any except adoptable storage. Unencrypted device with old DFE 10 | will leads to bootloop due this, lets allow it again at any case. 11 | 12 | --- 13 | fs_mgr/libfstab/fstab.cpp | 5 ++--- 14 | 1 file changed, 2 insertions(+), 3 deletions(-) 15 | 16 | diff --git a/fs_mgr/libfstab/fstab.cpp b/fs_mgr/libfstab/fstab.cpp 17 | index 268316710..6b6b8b0c8 100644 18 | --- a/fs_mgr/libfstab/fstab.cpp 19 | +++ b/fs_mgr/libfstab/fstab.cpp 20 | @@ -329,9 +329,8 @@ bool ParseFsMgrFlags(const std::string& flags, FstabEntry* entry) { 21 | // anything in recovery mode anyway (except possibly to cause the 22 | // reservation of a crypto footer) and thus never got removed. 23 | if (entry->fs_mgr_flags.crypt && !entry->fs_mgr_flags.vold_managed && !InRecovery()) { 24 | - LERROR << "FDE is no longer supported; 'encryptable' can only be used for adoptable " 25 | - "storage"; 26 | - return false; 27 | + LWARNING << "IGNORED = FDE is no longer supported; 'encryptable' can only be used for adoptable storage"; 28 | + return true; 29 | } 30 | return true; 31 | } 32 | -- 33 | 2.34.1 34 | 35 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_frameworks_opt_telephony/0003-Fix-baseband-being-too-long-to-fit-into-a-91-chars-p.patch: -------------------------------------------------------------------------------- 1 | From 0c20adcb65c2ee9dbdfc2507c88ea1a5efe24bf1 Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Mon, 6 Dec 2021 16:28:22 -0500 4 | Subject: [PATCH 03/16] Fix baseband being too long to fit into a 91 chars 5 | property, preventing telephony subsystem from starting 6 | 7 | Change-Id: I1762e4a8cc137626be89f350229d6be162bdaf57 8 | --- 9 | src/java/com/android/internal/telephony/GsmCdmaPhone.java | 2 +- 10 | 1 file changed, 1 insertion(+), 1 deletion(-) 11 | 12 | diff --git a/src/java/com/android/internal/telephony/GsmCdmaPhone.java b/src/java/com/android/internal/telephony/GsmCdmaPhone.java 13 | index 42d5d0fdcf..79a23ec160 100644 14 | --- a/src/java/com/android/internal/telephony/GsmCdmaPhone.java 15 | +++ b/src/java/com/android/internal/telephony/GsmCdmaPhone.java 16 | @@ -3438,7 +3438,7 @@ public class GsmCdmaPhone extends Phone { 17 | String version = (String)ar.result; 18 | if (version != null) { 19 | int length = version.length(); 20 | - final int MAX_VERSION_LEN = SystemProperties.PROP_VALUE_MAX/2; 21 | + final int MAX_VERSION_LEN = SystemProperties.PROP_VALUE_MAX/2 - 2; 22 | TelephonyManager.from(mContext).setBasebandVersionForPhone(getPhoneId(), 23 | length <= MAX_VERSION_LEN ? version 24 | : version.substring(length - MAX_VERSION_LEN, length)); 25 | -- 26 | 2.34.1 27 | 28 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_frameworks_av/0021-Add-a-prop-to-disable-AUDIO_OUTPUT_FLAG_FAST-from-au.patch: -------------------------------------------------------------------------------- 1 | From f5c38ee63be969f6a16d14f8d6c6836e08740313 Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Mon, 30 Oct 2023 10:30:58 -0400 4 | Subject: [PATCH 21/24] Add a prop to disable AUDIO_OUTPUT_FLAG_FAST from audio 5 | policies, when CPU can't really handle that kind of load 6 | 7 | --- 8 | .../audiopolicy/common/managerdefinitions/src/Serializer.cpp | 4 ++++ 9 | 1 file changed, 4 insertions(+) 10 | 11 | diff --git a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp 12 | index 77a96b47a4..26edcaa1c4 100644 13 | --- a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp 14 | +++ b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp 15 | @@ -504,6 +504,10 @@ std::variant PolicySerializer::deserialize 3 | Date: Fri, 6 Oct 2023 10:57:13 -0400 4 | Subject: [PATCH 36/54] Catch NPE in SystemUI 5 | 6 | No idea why it triggers, but it crashes SystemUI on boot for my TV 7 | device 8 | --- 9 | .../com/android/systemui/keyguard/KeyguardViewMediator.java | 6 +++++- 10 | 1 file changed, 5 insertions(+), 1 deletion(-) 11 | 12 | diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java 13 | index 0de61a2652be..1643c1535477 100644 14 | --- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java 15 | +++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java 16 | @@ -3482,7 +3482,11 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable, 17 | Trace.beginSection("KeyguardViewMediator#handleMotifyStartedWakingUp"); 18 | synchronized (KeyguardViewMediator.this) { 19 | if (DEBUG) Log.d(TAG, "handleNotifyWakingUp"); 20 | - mKeyguardViewControllerLazy.get().onStartedWakingUp(); 21 | + try { 22 | + mKeyguardViewControllerLazy.get().onStartedWakingUp(); 23 | + } catch(Throwable t) { 24 | + android.util.Log.e("PHH", "handleNotifyStartedWakingUp crashed bip", t); 25 | + } 26 | } 27 | Trace.endSection(); 28 | } 29 | -- 30 | 2.34.1 31 | 32 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_frameworks_base/0034-Restore-getSimStateForSlotIndex-in-SubscriptionManag.patch: -------------------------------------------------------------------------------- 1 | From 8b0966fc71e8e329c6f2808e4cbab8e9fe7571d6 Mon Sep 17 00:00:00 2001 2 | From: Andy CrossGate Yan 3 | Date: Wed, 2 Aug 2023 20:59:53 +0800 4 | Subject: [PATCH 34/54] Restore getSimStateForSlotIndex in SubscriptionManager 5 | 6 | MTK IMS still needs it here 7 | 8 | Change-Id: I41bac57c68055f369232359a464642daab94403b 9 | --- 10 | .../android/telephony/SubscriptionManager.java | 14 ++++++++++++++ 11 | 1 file changed, 14 insertions(+) 12 | 13 | diff --git a/telephony/java/android/telephony/SubscriptionManager.java b/telephony/java/android/telephony/SubscriptionManager.java 14 | index c5f2d42389e5..1324741145bd 100644 15 | --- a/telephony/java/android/telephony/SubscriptionManager.java 16 | +++ b/telephony/java/android/telephony/SubscriptionManager.java 17 | @@ -2902,6 +2902,20 @@ public class SubscriptionManager { 18 | return TelephonyManager.getDefault().isNetworkRoaming(subId); 19 | } 20 | 21 | + /** 22 | + * Returns a constant indicating the state of sim for the slot index. 23 | + * 24 | + * @param slotIndex Logical SIM slot index. 25 | + * 26 | + * @see TelephonyManager.SimState 27 | + * 28 | + * @hide 29 | + */ 30 | + @TelephonyManager.SimState 31 | + public static int getSimStateForSlotIndex(int slotIndex) { 32 | + return TelephonyManager.getSimStateForSlotIndex(slotIndex); 33 | + } 34 | + 35 | /** 36 | * Set a field in the subscription database. Note not all fields are supported. 37 | * 38 | -- 39 | 2.34.1 40 | 41 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_system_core/0021-HACK-Ignore-errors-when-setting-fscrypt-directory.-S.patch: -------------------------------------------------------------------------------- 1 | From 1872981cf538cdd76cdb2806d8ec5514a239ac82 Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Thu, 23 Nov 2023 11:05:20 -0500 4 | Subject: [PATCH 21/26] HACK: Ignore errors when setting fscrypt directory. 5 | Some devices fail to set it on first boot, but is happy later (?!?) 6 | 7 | --- 8 | init/builtins.cpp | 8 ++++++-- 9 | 1 file changed, 6 insertions(+), 2 deletions(-) 10 | 11 | diff --git a/init/builtins.cpp b/init/builtins.cpp 12 | index 606ea8c0a..3be6c7cb9 100644 13 | --- a/init/builtins.cpp 14 | +++ b/init/builtins.cpp 15 | @@ -430,9 +430,13 @@ static Result make_dir_with_options(const MkdirOptions& options) { 16 | } 17 | } 18 | if (IsFbeEnabled()) { 19 | + //TODO FIXME 20 | +//01-01 06:10:54.928 477 477 E vold : Failed to set encryption policy of /data/data to be0c03668ef1fddc v1 modes 127/4 flags 0x0: Invalid argument 21 | +//01-01 06:10:55.927 0 0 W : c2 477 ext4_process_policy: Policy inconsistent with encryption context 22 | +//01-01 06:10:55.927 0 0 E : c2 477 vold: Failed to set encryption policy of /data/data to be0c03668ef1fddc v1 modes 127/4 flags 0x0: Invalid argument 23 | + 24 | if (!FscryptSetDirectoryPolicy(ref_basename, options.fscrypt_action, options.target)) { 25 | - return reboot_into_recovery( 26 | - {"--prompt_and_wipe_data", "--reason=set_policy_failed:"s + options.target}); 27 | + return {}; 28 | } 29 | } 30 | return {}; 31 | -- 32 | 2.34.1 33 | 34 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_frameworks_av/0013-Make-camera-IDs-filter-out-optional.patch: -------------------------------------------------------------------------------- 1 | From 152328ae268b982acedcba95c7d9e48ddd465d40 Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Mon, 21 Dec 2020 20:19:11 +0100 4 | Subject: [PATCH 13/24] Make camera IDs filter-out optional 5 | 6 | Nowadays most people have Camera 2 apps, and would like to have all 7 | cameras, rather than limit which cameras are available. 8 | Add a property for that. 9 | --- 10 | .../camera/libcameraservice/common/CameraProviderManager.cpp | 4 +++- 11 | 1 file changed, 3 insertions(+), 1 deletion(-) 12 | 13 | diff --git a/services/camera/libcameraservice/common/CameraProviderManager.cpp b/services/camera/libcameraservice/common/CameraProviderManager.cpp 14 | index 1f01e95..5f71fab 100644 15 | --- a/services/camera/libcameraservice/common/CameraProviderManager.cpp 16 | +++ b/services/camera/libcameraservice/common/CameraProviderManager.cpp 17 | @@ -328,7 +328,9 @@ std::vector CameraProviderManager::getAPI1CompatibleCameraDeviceIds 18 | // API1 app doesn't handle logical and physical camera devices well. So 19 | // for each camera facing, only take the first id advertised by HAL in 20 | // all [logical, physical1, physical2, ...] id combos, and filter out the rest. 21 | - filterLogicalCameraIdsLocked(providerDeviceIds); 22 | + if(!property_get_bool("persist.sys.phh.include_all_cameras", false)) { 23 | + filterLogicalCameraIdsLocked(providerDeviceIds); 24 | + } 25 | collectDeviceIdsLocked(providerDeviceIds, publicDeviceIds, systemDeviceIds); 26 | } 27 | auto sortFunc = 28 | -- 29 | 2.34.1 30 | 31 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_frameworks_opt_telephony/0002-Telephony-Don-not-call-onUssdRelease-for-Huawei-RIL.patch: -------------------------------------------------------------------------------- 1 | From ee9ad0472008edf6213cdb49932f986299a7cb46 Mon Sep 17 00:00:00 2001 2 | From: Artem Borisov 3 | Date: Sat, 10 Nov 2018 17:19:17 +0000 4 | Subject: [PATCH 02/16] Telephony: Don not call onUssdRelease for Huawei RIL 5 | 6 | Huawei RIL doesn't seem to work properly with USSD_MODE_NW_RELEASE, 7 | always releasing USSD when it should be finished instead. 8 | Let's explicitly call onUssdFinished in this case. 9 | 10 | Change-Id: I69faed1c51d4582834879975d6ab13daf7f48ad4 11 | --- 12 | src/java/com/android/internal/telephony/GsmCdmaPhone.java | 6 +++++- 13 | 1 file changed, 5 insertions(+), 1 deletion(-) 14 | 15 | diff --git a/src/java/com/android/internal/telephony/GsmCdmaPhone.java b/src/java/com/android/internal/telephony/GsmCdmaPhone.java 16 | index 4c7a3d3ffa..42d5d0fdcf 100644 17 | --- a/src/java/com/android/internal/telephony/GsmCdmaPhone.java 18 | +++ b/src/java/com/android/internal/telephony/GsmCdmaPhone.java 19 | @@ -3128,7 +3128,11 @@ public class GsmCdmaPhone extends Phone { 20 | if (found != null) { 21 | // Complete pending USSD 22 | if (isUssdRelease) { 23 | - found.onUssdRelease(); 24 | + if (SystemProperties.getBoolean("persist.sys.radio.huawei", false)) { 25 | + found.onUssdFinished(ussdMessage, isUssdRequest); 26 | + } else { 27 | + found.onUssdRelease(); 28 | + } 29 | } else if (isUssdError) { 30 | found.onUssdFinishedError(); 31 | } else { 32 | -- 33 | 2.34.1 34 | 35 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_frameworks_native/0005-Mark-accelerometer-input-as-sensor-exclusively-if-th.patch: -------------------------------------------------------------------------------- 1 | From e0d0fce849431dd86dbc6f770919b209ec8da9de Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Sun, 12 Dec 2021 08:45:36 -0500 4 | Subject: [PATCH 05/14] Mark accelerometer input as sensor exclusively if there 5 | are ABS axis 6 | 7 | The reason this is needed is that on -fucked up- Xiami Mi A2 Lite and 8 | Galaxy J8, the input device reporting power button/vol- reports ACCELEROMETER 9 | input prop. 10 | This leads to wrong timestamping ioctl, leading to crashes and broken UI 11 | 12 | Change-Id: I491ab89724c908ef09a23a6427d24a8889bf806a 13 | --- 14 | services/inputflinger/reader/EventHub.cpp | 8 +++++++- 15 | 1 file changed, 7 insertions(+), 1 deletion(-) 16 | 17 | diff --git a/services/inputflinger/reader/EventHub.cpp b/services/inputflinger/reader/EventHub.cpp 18 | index 3ca691efba..a2b5d7d8b0 100644 19 | --- a/services/inputflinger/reader/EventHub.cpp 20 | +++ b/services/inputflinger/reader/EventHub.cpp 21 | @@ -2431,7 +2431,13 @@ void EventHub::openDeviceLocked(const std::string& devicePath) { 22 | 23 | // Check whether this device is an accelerometer. 24 | if (device->propBitmask.test(INPUT_PROP_ACCELEROMETER)) { 25 | - device->classes |= InputDeviceClass::SENSOR; 26 | + bool hasAxis = false; 27 | + for (int i = 0; i <= ABS_MAX; i++) { 28 | + if (device->absBitmask.test(i)) hasAxis = true; 29 | + } 30 | + if(hasAxis) { 31 | + device->classes |= InputDeviceClass::SENSOR; 32 | + } 33 | } 34 | 35 | // Check whether this device has switches. 36 | -- 37 | 2.34.1 38 | 39 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_frameworks_base/0028-SystemUI-Use-AVCProfileMain-for-screen-recorder.patch: -------------------------------------------------------------------------------- 1 | From 780b1cd591b16004fcac81cb45917ccca2179992 Mon Sep 17 00:00:00 2001 2 | From: Arne Coucheron 3 | Date: Thu, 5 Nov 2020 05:38:44 +0100 4 | Subject: [PATCH 28/54] SystemUI: Use AVCProfileMain for screen recorder 5 | 6 | Some devices don't support the High profile very well. 7 | Use Main profile, which is more compatible, so they 8 | can use screen recorder too. 9 | 10 | Change-Id: Iac23480e080edf4300e6f411c3394c0b41030daa 11 | --- 12 | .../com/android/systemui/screenrecord/ScreenMediaRecorder.java | 2 +- 13 | 1 file changed, 1 insertion(+), 1 deletion(-) 14 | 15 | diff --git a/packages/SystemUI/src/com/android/systemui/screenrecord/ScreenMediaRecorder.java b/packages/SystemUI/src/com/android/systemui/screenrecord/ScreenMediaRecorder.java 16 | index 5469a4e9da08..60b8e7175da3 100644 17 | --- a/packages/SystemUI/src/com/android/systemui/screenrecord/ScreenMediaRecorder.java 18 | +++ b/packages/SystemUI/src/com/android/systemui/screenrecord/ScreenMediaRecorder.java 19 | @@ -152,7 +152,7 @@ public class ScreenMediaRecorder extends MediaProjection.Callback { 20 | * VIDEO_FRAME_RATE_TO_RESOLUTION_RATIO; 21 | mMediaRecorder.setVideoEncoder(MediaRecorder.VideoEncoder.H264); 22 | mMediaRecorder.setVideoEncodingProfileLevel( 23 | - MediaCodecInfo.CodecProfileLevel.AVCProfileHigh, 24 | + MediaCodecInfo.CodecProfileLevel.AVCProfileMain, 25 | MediaCodecInfo.CodecProfileLevel.AVCLevel3); 26 | mMediaRecorder.setVideoSize(width, height); 27 | mMediaRecorder.setVideoFrameRate(refreshRate); 28 | -- 29 | 2.34.1 30 | 31 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_hardware_interfaces/0002-Fix-light-sensor-crash-on-Xiaomi-13.patch: -------------------------------------------------------------------------------- 1 | From 85f11fd68459dade2683da86b5aebaacaefe5cc5 Mon Sep 17 00:00:00 2001 2 | From: Andy CrossGate Yan 3 | Date: Tue, 18 Apr 2023 23:48:15 +0000 4 | Subject: [PATCH 2/3] Fix light sensor crash on Xiaomi 13 5 | 6 | SensorService expects a scalar, but Xiaomi HAL returns a pose6DOF vector encapsulation 7 | Thanks @phhusson for the analysis 8 | 9 | Change-Id: Ie358321d5328d01541f455d6af86944ff413c9c9 10 | --- 11 | sensors/aidl/convert/convert.cpp | 9 ++++++++- 12 | 1 file changed, 8 insertions(+), 1 deletion(-) 13 | 14 | diff --git a/sensors/aidl/convert/convert.cpp b/sensors/aidl/convert/convert.cpp 15 | index 2dc7a177a0..be3833dfa7 100644 16 | --- a/sensors/aidl/convert/convert.cpp 17 | +++ b/sensors/aidl/convert/convert.cpp 18 | @@ -162,7 +162,14 @@ void convertToSensorEvent(const Event& src, sensors_event_t* dst) { 19 | case SensorType::MOTION_DETECT: 20 | case SensorType::HEART_BEAT: 21 | case SensorType::LOW_LATENCY_OFFBODY_DETECT: { 22 | - dst->data[0] = src.payload.get(); 23 | + if (src.payload.getTag() == Event::EventPayload::pose6DOF) { 24 | + auto d = src.payload.get(); 25 | + auto dstr = ::android::internal::ToString(d); 26 | + // ALOGE("Received 6DOF for expected scalar %s", dstr.c_str()); 27 | + dst->data[0] = d.values[0]; 28 | + } else { 29 | + dst->data[0] = src.payload.get(); 30 | + } 31 | break; 32 | } 33 | 34 | -- 35 | 2.34.1 36 | 37 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_external_selinux/0005-if-service-is-rcs-accept-conflict.-Seen-on-Moto-E5.patch: -------------------------------------------------------------------------------- 1 | From a55acf8200ba38d7bdede7336c9d4cc1a4d1c5cd Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Thu, 12 Sep 2019 20:37:04 +0200 4 | Subject: [PATCH 05/10] if service is "rcs", accept conflict. Seen on Moto E5 5 | 6 | Change-Id: I0cc2d0fad83f403f2b5d7458039b1564ce5ed9dd 7 | --- 8 | libselinux/src/label_backends_android.c | 14 ++++++++++++-- 9 | 1 file changed, 12 insertions(+), 2 deletions(-) 10 | 11 | diff --git a/libselinux/src/label_backends_android.c b/libselinux/src/label_backends_android.c 12 | index 77f7a1eb..55a30944 100644 13 | --- a/libselinux/src/label_backends_android.c 14 | +++ b/libselinux/src/label_backends_android.c 15 | @@ -62,14 +62,24 @@ static int nodups_specs(struct saved_data *data) 16 | curr_spec->property_key)) { 17 | if (strcmp(spec_arr[jj].lr.ctx_raw, 18 | curr_spec->lr.ctx_raw)) { 19 | - rc = -1; 20 | - errno = EINVAL; 21 | selinux_log 22 | (SELINUX_ERROR, 23 | "Multiple different specifications for %s (%s and %s).\n", 24 | curr_spec->property_key, 25 | spec_arr[jj].lr.ctx_raw, 26 | curr_spec->lr.ctx_raw); 27 | + int ignore = 0; 28 | + /* 29 | + * This issue has been found on Moto E5 30 | + * E SELinux : Multiple different specifications for rcs (u:object_r:radio_service:s0 and u:object_r:mot_rcs_service:s0). 31 | + */ 32 | + if(!strcmp(curr_spec->property_key, "rcs")) 33 | + ignore = 1; 34 | + 35 | + if(!ignore) { 36 | + rc = -1; 37 | + errno = EINVAL; 38 | + } 39 | } else { 40 | selinux_log 41 | (SELINUX_WARNING, 42 | -- 43 | 2.34.1 44 | 45 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_frameworks_opt_telephony/0012-When-logging-UiccSlot-ignore-error-if-we-cant-print-.patch: -------------------------------------------------------------------------------- 1 | From e0832343864d4745a012c99121782080e3a408e0 Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Tue, 17 Oct 2023 11:08:06 -0400 4 | Subject: [PATCH 12/16] When logging UiccSlot, ignore error if we cant print 5 | IccIds 6 | 7 | --- 8 | .../com/android/internal/telephony/uicc/UiccSlot.java | 8 +++++++- 9 | 1 file changed, 7 insertions(+), 1 deletion(-) 10 | 11 | diff --git a/src/java/com/android/internal/telephony/uicc/UiccSlot.java b/src/java/com/android/internal/telephony/uicc/UiccSlot.java 12 | index db10271a2f..00c8acb0db 100644 13 | --- a/src/java/com/android/internal/telephony/uicc/UiccSlot.java 14 | +++ b/src/java/com/android/internal/telephony/uicc/UiccSlot.java 15 | @@ -687,7 +687,13 @@ public class UiccSlot extends Handler { 16 | @NonNull 17 | @Override 18 | public String toString() { 19 | - return "[UiccSlot: mActive=" + mActive + ", mIccId=" + getPrintableIccIds() + ", mIsEuicc=" 20 | + Map printableIccIds = null; 21 | + try { 22 | + printableIccIds = getPrintableIccIds(); 23 | + } catch(Throwable t) { 24 | + android.util.Log.e("PHH", "getPrintableIccIds failed", t); 25 | + } 26 | + return "[UiccSlot: mActive=" + mActive + ", mIccId=" + printableIccIds + ", mIsEuicc=" 27 | + mIsEuicc + ", MEP=" + isMultipleEnabledProfileSupported() + ", mPortIdxToPhoneId=" 28 | + mPortIdxToPhoneId + ", mEid=" + Rlog.pii(TelephonyUtils.IS_DEBUGGABLE, mEid) 29 | + ", mCardState=" + mCardState + " mSupportedMepMode=" + mSupportedMepMode + "]"; 30 | -- 31 | 2.34.1 32 | 33 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_system_core/0001-Let-system-override-ro.apex.updatable.patch: -------------------------------------------------------------------------------- 1 | From 929cbf22ad8f8ea69b6cb37932d76dc9894fb506 Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Wed, 23 Feb 2022 17:37:47 -0500 4 | Subject: [PATCH 01/26] Let system override ro.apex.updatable 5 | 6 | APEX are broken because of a kernel bug in Android 10 devices 7 | So we have system set ro.apex.updatable = false 8 | However, vendor can override system, which prevents us from setting this 9 | to false 10 | So, ignore the override policy for this prop 11 | --- 12 | init/property_service.cpp | 8 ++++++-- 13 | 1 file changed, 6 insertions(+), 2 deletions(-) 14 | 15 | diff --git a/init/property_service.cpp b/init/property_service.cpp 16 | index 157fc709c..0b2cf3cc6 100644 17 | --- a/init/property_service.cpp 18 | +++ b/init/property_service.cpp 19 | @@ -802,8 +802,12 @@ static void LoadProperties(char* data, const char* filter, const char* filename, 20 | } else if (it->second != value) { 21 | LOG(WARNING) << "Overriding previous property '" << key << "':'" << it->second 22 | << "' with new value '" << value << "'"; 23 | - it->second = value; 24 | - } 25 | + if(strcmp("ro.apex.updatable", key) == 0) { 26 | + LOG(WARNING) << "... Ignored"; 27 | + } else { 28 | + it->second = value; 29 | + } 30 | + } 31 | } else { 32 | LOG(ERROR) << "Do not have permissions to set '" << key << "' to '" << value 33 | << "' in property file '" << filename << "': " << error; 34 | -- 35 | 2.34.1 36 | 37 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_system_core/0018-Fix-support-for-devices-without-cgroupv2-support.patch: -------------------------------------------------------------------------------- 1 | From 919a8cd87bb8347867911235929ad47f73beb52e Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Wed, 26 Oct 2022 17:59:11 -0400 4 | Subject: [PATCH 18/26] Fix support for devices without cgroupv2 support 5 | 6 | This is technically a revert of 1bd1746447. 7 | The warning inside the commit doesn't really apply to us, because the 8 | devices without cgroupv2 simply won't freeze processes at all 9 | (which is in itself an issue, but a different one) 10 | --- 11 | init/service.cpp | 3 +++ 12 | 1 file changed, 3 insertions(+) 13 | 14 | diff --git a/init/service.cpp b/init/service.cpp 15 | index eb24dd593..4dfaf3137 100644 16 | --- a/init/service.cpp 17 | +++ b/init/service.cpp 18 | @@ -703,12 +703,15 @@ Result Service::Start() { 19 | limit_percent_ != -1 || !limit_property_.empty(); 20 | errno = -createProcessGroup(uid(), pid_, use_memcg); 21 | if (errno != 0) { 22 | + PLOG(ERROR) << "createProcessGroup(" << uid() << ", " << pid_ << ") failed for service '" << name_ << "'"; 23 | +#if 0 24 | Result result = cgroups_activated.Write(kActivatingCgroupsFailed); 25 | if (!result.ok()) { 26 | return Error() << "Sending notification failed: " << result.error(); 27 | } 28 | return Error() << "createProcessGroup(" << uid() << ", " << pid_ << ", " << use_memcg 29 | << ") failed for service '" << name_ << "': " << strerror(errno); 30 | +#endif 31 | } 32 | 33 | // When the blkio controller is mounted in the v1 hierarchy, NormalIoPriority is 34 | -- 35 | 2.34.1 36 | 37 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_frameworks_native/0010-Fix-loading-unnamed-GLES.patch: -------------------------------------------------------------------------------- 1 | From 71510732a097c837a83861b0f03c1305dfa2d404 Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Wed, 20 Dec 2023 09:48:04 -0500 4 | Subject: [PATCH 10/14] Fix loading unnamed GLES 5 | 6 | Normally Android loads libGLES_${ro.hardware.egl}.so 7 | But up to Android 14, it was allowed not to set ro.hardware.egl 8 | In which case, Android would just load whatever libGLES_xxxx.so 9 | 10 | Android 14.0 did it more finely, and would fallback only when 11 | ro.hardware.egl is not set, which was still fine for older platforms. 12 | Android 14.1 broke it by refusing the fallback when ro.board.platform is 13 | set (which often is) 14 | 15 | Simply allow the fallback in all cases. 16 | 17 | Test: 18 | - Blackview BV9800 Pro fails to boot without this patch 19 | - It does boot with it 20 | --- 21 | opengl/libs/EGL/Loader.cpp | 3 +-- 22 | 1 file changed, 1 insertion(+), 2 deletions(-) 23 | 24 | diff --git a/opengl/libs/EGL/Loader.cpp b/opengl/libs/EGL/Loader.cpp 25 | index e487cbc54d..71e170c73f 100644 26 | --- a/opengl/libs/EGL/Loader.cpp 27 | +++ b/opengl/libs/EGL/Loader.cpp 28 | @@ -314,8 +314,7 @@ void* Loader::open(egl_connection_t* cnx) { 29 | hnd = attempt_to_load_system_driver(cnx, nullptr, true); 30 | } 31 | 32 | - if (!hnd && !failToLoadFromDriverSuffixProperty && 33 | - property_get_int32("ro.vendor.api_level", 0) < __ANDROID_API_U__) { 34 | + if (!hnd) { 35 | // Still can't find the graphics drivers with the exact name. This time try to use wildcard 36 | // matching if the device is launched before Android 14. 37 | hnd = attempt_to_load_system_driver(cnx, nullptr, false); 38 | -- 39 | 2.34.1 40 | 41 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_packages_modules_Connectivity/0001-Allow-failing-to-load-bpf-programs-for-BPF-less-devi.patch: -------------------------------------------------------------------------------- 1 | From 0c62748ef5781c19f566a18fad343f262a6c28a0 Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Wed, 26 Oct 2022 18:10:04 -0400 4 | Subject: [PATCH 1/9] Allow failing to load bpf programs, for BPF-less devices 5 | 6 | Change-Id: I68ba3be2e15c188e56e32a6ecf844e1ca64d560f 7 | --- 8 | netd/BpfHandler.cpp | 10 ++++++++-- 9 | 1 file changed, 8 insertions(+), 2 deletions(-) 10 | 11 | diff --git a/netd/BpfHandler.cpp b/netd/BpfHandler.cpp 12 | index a00c363254..aaaa41c6d7 100644 13 | --- a/netd/BpfHandler.cpp 14 | +++ b/netd/BpfHandler.cpp 15 | @@ -125,8 +125,14 @@ static Status initPrograms(const char* cg2_path) { 16 | RETURN_IF_NOT_OK(checkProgramAccessible(XT_BPF_DENYLIST_PROG_PATH)); 17 | RETURN_IF_NOT_OK(checkProgramAccessible(XT_BPF_EGRESS_PROG_PATH)); 18 | RETURN_IF_NOT_OK(checkProgramAccessible(XT_BPF_INGRESS_PROG_PATH)); 19 | - RETURN_IF_NOT_OK(attachProgramToCgroup(BPF_EGRESS_PROG_PATH, cg_fd, BPF_CGROUP_INET_EGRESS)); 20 | - RETURN_IF_NOT_OK(attachProgramToCgroup(BPF_INGRESS_PROG_PATH, cg_fd, BPF_CGROUP_INET_INGRESS)); 21 | + auto ret = attachProgramToCgroup(BPF_EGRESS_PROG_PATH, cg_fd, BPF_CGROUP_INET_EGRESS); 22 | + if (!isOk(ret)) { 23 | + ALOGE("Failed loading egress program"); 24 | + } 25 | + auto ret2 = attachProgramToCgroup(BPF_INGRESS_PROG_PATH, cg_fd, BPF_CGROUP_INET_INGRESS); 26 | + if (!isOk(ret)) { 27 | + ALOGE("Failed loading ingress program"); 28 | + } 29 | 30 | // For the devices that support cgroup socket filter, the socket filter 31 | // should be loaded successfully by bpfloader. So we attach the filter to 32 | -- 33 | 2.34.1 34 | 35 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_frameworks_native/0002-Matching-an-input-with-a-display-uses-uniqueId.patch: -------------------------------------------------------------------------------- 1 | From 6dcdf89f11eeb4af174a07c966e902c523ba265c Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Thu, 22 Oct 2020 23:22:46 +0200 4 | Subject: [PATCH 02/14] Matching an input with a display uses uniqueId 5 | 6 | Not all devices have a `location`, notably bluetooth devices. 7 | However, we might still want to associate them with a screen, 8 | so match them with uniqueId indeed. 9 | 10 | This is useful to have bluetooth keyboard in desktop mode for instance. 11 | 12 | Change-Id: Ifcbc8329d54386f58e013270d9888316c0f516b6 13 | --- 14 | services/inputflinger/reader/InputDevice.cpp | 5 ++++- 15 | 1 file changed, 4 insertions(+), 1 deletion(-) 16 | 17 | diff --git a/services/inputflinger/reader/InputDevice.cpp b/services/inputflinger/reader/InputDevice.cpp 18 | index 4d8ffb68bb..1d041e1498 100644 19 | --- a/services/inputflinger/reader/InputDevice.cpp 20 | +++ b/services/inputflinger/reader/InputDevice.cpp 21 | @@ -272,7 +272,10 @@ std::list InputDevice::configureInternal(nsecs_t when, 22 | mAssociatedDisplayUniqueId = std::nullopt; 23 | mAssociatedViewport = std::nullopt; 24 | // Find the display port that corresponds to the current input port. 25 | - const std::string& inputPort = mIdentifier.location; 26 | + std::string inputPort = mIdentifier.location; 27 | + if (inputPort.empty()) { 28 | + inputPort = mIdentifier.uniqueId; 29 | + } 30 | if (!inputPort.empty()) { 31 | const std::unordered_map& ports = 32 | readerConfig.portAssociations; 33 | -- 34 | 2.34.1 35 | 36 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_system_vold/0002-Failing-to-create-facedata-shouldn-t-be-fatal.patch: -------------------------------------------------------------------------------- 1 | From ba59b56a2eaa2bd53c8372a1b97147ebb5e72ad9 Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Sat, 7 Mar 2020 14:49:09 +0100 4 | Subject: [PATCH 2/5] Failing to create facedata shouldn't be fatal 5 | 6 | Some Pie vendors create it on their own, so SELinux would deny that 7 | Also not all devices have face unlock anyway 8 | 9 | See https://github.com/phhusson/treble_experimentations/issues/1119 10 | --- 11 | vold_prepare_subdirs.cpp | 4 ++-- 12 | 1 file changed, 2 insertions(+), 2 deletions(-) 13 | 14 | diff --git a/vold_prepare_subdirs.cpp b/vold_prepare_subdirs.cpp 15 | index e82a7c2d..de5583f4 100644 16 | --- a/vold_prepare_subdirs.cpp 17 | +++ b/vold_prepare_subdirs.cpp 18 | @@ -208,7 +208,7 @@ static bool prepare_subdirs(const std::string& volume_uuid, int user_id, int fla 19 | } 20 | auto facedata_path = vendor_de_path + "/facedata"; 21 | if (!prepare_dir(sehandle, 0700, AID_SYSTEM, AID_SYSTEM, facedata_path)) { 22 | - return false; 23 | + LOG(ERROR) << "Failed preparing folder for de facedata"; 24 | } 25 | } 26 | } 27 | @@ -257,7 +257,7 @@ static bool prepare_subdirs(const std::string& volume_uuid, int user_id, int fla 28 | auto vendor_ce_path = android::vold::BuildDataVendorCePath(user_id); 29 | auto facedata_path = vendor_ce_path + "/facedata"; 30 | if (!prepare_dir(sehandle, 0700, AID_SYSTEM, AID_SYSTEM, facedata_path)) { 31 | - return false; 32 | + LOG(ERROR) << "Failed preparing folder for de facedata"; 33 | } 34 | } 35 | } 36 | -- 37 | 2.34.1 38 | 39 | -------------------------------------------------------------------------------- /patches/pre/platform_vendor_superior/01-Disable-generated-kernel-headers.patch: -------------------------------------------------------------------------------- 1 | From 720b8eacd6ab1af6beb82052357d45a7b51364d8 Mon Sep 17 00:00:00 2001 2 | From: ChonDoit 3 | Date: Sat, 1 Oct 2022 18:03:17 +0000 4 | Subject: [PATCH 1/6] Disable Generated Kernel Headers 5 | 6 | ...but done in a way so that there's no need to remove generated_kernel_headers from individual projects - thanks @ExpressLuke 7 | --- 8 | build/soong/Android.bp | 13 +------------ 9 | 1 file changed, 1 insertion(+), 12 deletions(-) 10 | 11 | diff --git a/build/soong/Android.bp b/build/soong/Android.bp 12 | index 452aae2..90eaa73 100644 13 | --- a/build/soong/Android.bp 14 | +++ b/build/soong/Android.bp 15 | @@ -20,9 +20,6 @@ bootstrap_go_package { 16 | superior_generator { 17 | name: "generated_kernel_includes", 18 | 19 | - // The headers make command 20 | - cmd: "$(PATH_OVERRIDE_SOONG) $(KERNEL_MAKE_CMD) $(KERNEL_MAKE_FLAGS) -C $(TARGET_KERNEL_SOURCE) O=$(KERNEL_BUILD_OUT_PREFIX)$(genDir) ARCH=$(KERNEL_ARCH) $(KERNEL_CROSS_COMPILE) headers_install && vendor/superior/tools/clean_headers.sh $(KERNEL_BUILD_OUT_PREFIX)$(genDir)", 21 | - 22 | // Directories that can be imported by a cc_* module generated_headers property 23 | export_include_dirs: [ 24 | "usr/audio/include/uapi", 25 | @@ -31,15 +28,7 @@ superior_generator { 26 | "usr/include/audio/include/uapi", 27 | "usr/techpack/audio/include", 28 | ], 29 | - 30 | - // Sources for dependency tracking 31 | - dep_root: "$(TARGET_KERNEL_SOURCE)", 32 | - dep_files: [ 33 | - "Makefile", 34 | - "include/**/*", 35 | - "arch/$(KERNEL_ARCH)/include/**/*", 36 | - "techpack/audio/include/**/*", 37 | - ], 38 | + 39 | } 40 | 41 | cc_defaults { 42 | -- 43 | 2.34.1 44 | 45 | 46 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_frameworks_base/0039-Fix-brightness-slider-curve-for-some-devices.patch: -------------------------------------------------------------------------------- 1 | From 34e366e41f1a97a5a144db58b026717821e7d159 Mon Sep 17 00:00:00 2001 2 | From: ChonDoit 3 | Date: Thu, 24 Aug 2023 15:58:15 -0300 4 | Subject: [PATCH 39/54] Fix brightness slider curve for some devices 5 | 6 | Some devices report max brightness as 2047 or 4095 7 | --- 8 | .../settingslib/display/BrightnessUtils.java | 15 ++++++++++----- 9 | 1 file changed, 10 insertions(+), 5 deletions(-) 10 | 11 | --- 12 | .../src/com/android/settingslib/display/BrightnessUtils.java | 4 ++-- 13 | 1 file changed, 2 insertions(+), 2 deletions(-) 14 | 15 | diff --git a/packages/SettingsLib/DisplayUtils/src/com/android/settingslib/display/BrightnessUtils.java b/packages/SettingsLib/DisplayUtils/src/com/android/settingslib/display/BrightnessUtils.java 16 | index 35f01f67..41a760f0 100644 17 | --- a/packages/SettingsLib/DisplayUtils/src/com/android/settingslib/display/BrightnessUtils.java 18 | +++ b/packages/SettingsLib/DisplayUtils/src/com/android/settingslib/display/BrightnessUtils.java 19 | @@ -26,10 +26,10 @@ import com.android.internal.display.BrightnessSynchronizer; 20 | public class BrightnessUtils { 21 | 22 | public static final boolean sysUseLowGamma = Boolean.parseBoolean( 23 | - SystemProperties.get("persist.sys.brightness.low.gamma", "false")); 24 | + SystemProperties.get("persist.sys.phh.low_gamma_brightness", "false")); 25 | 26 | public static final int GAMMA_SPACE_MIN = 0; 27 | - public static final int GAMMA_SPACE_MAX = sysUseLowGamma ? 255 : 65535; 28 | + public static final int GAMMA_SPACE_MAX = sysUseLowGamma ? 255 : 65536; 29 | 30 | // Hybrid Log Gamma constant values 31 | private static final float R = 0.5f; 32 | -- 33 | 2.34.1 34 | 35 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_frameworks_base/0019-TelephonyManager-add-API-annotations-for-setTelephon.patch: -------------------------------------------------------------------------------- 1 | From 5532c13ae6f101786c3271126d8cdf7240fd72a9 Mon Sep 17 00:00:00 2001 2 | From: Peter Cai 3 | Date: Wed, 16 Dec 2020 21:26:45 +0800 4 | Subject: [PATCH 19/54] TelephonyManager: add API annotations for 5 | setTelephonyProperty 6 | 7 | * This method was added back by reverting commit 8 | debb4616ef67f9ed5054eca51ec58592358ff55f, but they do not conform to 9 | the new R API requirements. 10 | 11 | * R requires such annotations. 12 | --- 13 | telephony/java/android/telephony/TelephonyManager.java | 5 +++-- 14 | 1 file changed, 3 insertions(+), 2 deletions(-) 15 | 16 | diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java 17 | index 0c1857754fd5..0c9601ad7b30 100644 18 | --- a/telephony/java/android/telephony/TelephonyManager.java 19 | +++ b/telephony/java/android/telephony/TelephonyManager.java 20 | @@ -8568,7 +8568,7 @@ public class TelephonyManager { 21 | * @hide 22 | */ 23 | @UnsupportedAppUsage 24 | - public static void setTelephonyProperty(int phoneId, String property, String value) { 25 | + public static void setTelephonyProperty(int phoneId, @NonNull String property, @Nullable String value) { 26 | String propVal = ""; 27 | String p[] = null; 28 | String prop = SystemProperties.get(property); 29 | @@ -8622,7 +8622,8 @@ public class TelephonyManager { 30 | * 31 | * @hide 32 | */ 33 | - public static void setTelephonyProperty(String property, String value) { 34 | + @UnsupportedAppUsage 35 | + public static void setTelephonyProperty(@NonNull String property, @Nullable String value) { 36 | if (value == null) { 37 | value = ""; 38 | } 39 | -- 40 | 2.34.1 41 | 42 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_frameworks_av/0012-No-longer-make-re-assigning-legacy-audio-groups-fata.patch: -------------------------------------------------------------------------------- 1 | From cd1fd072f6b11427f5a0f312244cedc5b1e0e0f4 Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Sat, 12 Sep 2020 12:32:50 +0200 4 | Subject: [PATCH 12/24] No longer make re-assigning legacy audio groups fatal. 5 | Mi9 declares AUDIO_STREAM_PATCH and AUDIO_STREAM_REROUTING which is defined 6 | by framework too 7 | 8 | Change-Id: I794fe22d63a8af705be4f5f09b9879ecaab3eae5 9 | --- 10 | services/audiopolicy/engine/common/src/EngineBase.cpp | 6 +++--- 11 | 1 file changed, 3 insertions(+), 3 deletions(-) 12 | 13 | diff --git a/services/audiopolicy/engine/common/src/EngineBase.cpp b/services/audiopolicy/engine/common/src/EngineBase.cpp 14 | index e259e6e048..abd8786b4a 100644 15 | --- a/services/audiopolicy/engine/common/src/EngineBase.cpp 16 | +++ b/services/audiopolicy/engine/common/src/EngineBase.cpp 17 | @@ -264,9 +264,9 @@ engineConfig::ParsingResult EngineBase::processParsingResult( 18 | } 19 | if (group.stream != AUDIO_STREAM_DEFAULT) { 20 | // A legacy stream can be assigned once to a volume group 21 | - LOG_ALWAYS_FATAL_IF(checkStreamForGroups(group.stream, mVolumeGroups), 22 | - "stream %s already assigned to a volume group, " 23 | - "review the configuration", toString(group.stream).c_str()); 24 | + if(checkStreamForGroups(group.stream, mVolumeGroups)) { 25 | + ALOGE("stream %s already assigned to a volume group, review the configuration", toString(group.stream).c_str()); 26 | + } 27 | volumeGroup->addSupportedStream(group.stream); 28 | } 29 | addSupportedAttributesToGroup(group, volumeGroup, strategy); 30 | -- 31 | 2.34.1 32 | 33 | -------------------------------------------------------------------------------- /patches/personal/platform_frameworks_av/0004-Check-trackMeta-for-NULL.patch: -------------------------------------------------------------------------------- 1 | From 465aad4e1f388915c98feab43fa7d62e90432885 Mon Sep 17 00:00:00 2001 2 | From: Karthikeyan Periasamy 3 | Date: Wed, 25 Jan 2017 14:53:12 -0800 4 | Subject: [PATCH 11/12] libstagefright: Check trackMeta for NULL 5 | 6 | getTrackMetaData will return NULL for failure. If we pass the NULL, 7 | we observe undefined behavior of mediaserver application . 8 | 9 | Check trackMeta and go to next index if it is NULL 10 | 11 | [neobuddy89]: Adapted for AOSP 12 | 13 | CRs-Fixed: 1115425 14 | Change-Id: I55a73cb0f327b6af31d30ed1b3d27c83578762d3 15 | Signed-off-by: Hưng Phan 16 | --- 17 | .../StagefrightMetadataRetriever.cpp | 8 ++++++++ 18 | 1 file changed, 8 insertions(+) 19 | 20 | diff --git a/media/libmediaplayerservice/StagefrightMetadataRetriever.cpp b/media/libmediaplayerservice/StagefrightMetadataRetriever.cpp 21 | index b3f7f25..67b3dd2 100644 22 | --- a/media/libmediaplayerservice/StagefrightMetadataRetriever.cpp 23 | +++ b/media/libmediaplayerservice/StagefrightMetadataRetriever.cpp 24 | @@ -353,6 +353,10 @@ sp StagefrightMetadataRetriever::getFrameInternal( 25 | continue; 26 | } 27 | 28 | + if (meta == NULL) { 29 | + continue; 30 | + } 31 | + 32 | const char *mime; 33 | if (meta->findCString(kKeyMIMEType, &mime) && !strncasecmp(mime, "video/", 6)) { 34 | break; 35 | @@ -618,6 +622,10 @@ void StagefrightMetadataRetriever::parseMetaData() { 36 | continue; 37 | } 38 | 39 | + if (trackMeta == NULL) { 40 | + continue; 41 | + } 42 | + 43 | int64_t durationUs; 44 | if (trackMeta->findInt64(kKeyDuration, &durationUs)) { 45 | if (durationUs > maxDurationUs) { 46 | -- 47 | 2.34.1 48 | 49 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_frameworks_base/0053-Add-a-prop-to-disable-animation-in-for-sysui-media-c.patch: -------------------------------------------------------------------------------- 1 | From 2926422e7d589a2b18714f457272f9c3239bec38 Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Wed, 8 May 2024 11:55:07 -0400 4 | Subject: [PATCH 53/54] Add a prop to disable animation in for sysui media 5 | carousel 6 | 7 | --- 8 | .../media/controls/ui/controller/MediaCarouselController.kt | 3 ++- 9 | 1 file changed, 2 insertions(+), 1 deletion(-) 10 | 11 | diff --git a/packages/SystemUI/src/com/android/systemui/media/controls/ui/controller/MediaCarouselController.kt b/packages/SystemUI/src/com/android/systemui/media/controls/ui/controller/MediaCarouselController.kt 12 | index b721236eab01..8da1ddc2010f 100644 13 | --- a/packages/SystemUI/src/com/android/systemui/media/controls/ui/controller/MediaCarouselController.kt 14 | +++ b/packages/SystemUI/src/com/android/systemui/media/controls/ui/controller/MediaCarouselController.kt 15 | @@ -22,6 +22,7 @@ import android.content.Intent 16 | import android.content.res.ColorStateList 17 | import android.content.res.Configuration 18 | import android.database.ContentObserver 19 | +import android.os.SystemProperties 20 | import android.provider.Settings 21 | import android.provider.Settings.ACTION_MEDIA_CONTROLS_SETTINGS 22 | import android.util.Log 23 | @@ -1050,7 +1051,7 @@ constructor( 24 | desiredHostState.showsOnlyActiveMedia 25 | 26 | for (mediaPlayer in MediaPlayerData.players()) { 27 | - if (animate) { 28 | + if (animate && !SystemProperties.getBoolean("persist.sys.phh.no_media_carousel_animation", false)) { 29 | mediaPlayer.mediaViewController.animatePendingStateChange( 30 | duration = duration, 31 | delay = startDelay 32 | -- 33 | 2.34.1 34 | 35 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_external_selinux/0004-Allow-devices-virtual-block-genfscon-conflict-seen-o.patch: -------------------------------------------------------------------------------- 1 | From 2efe57e39df931d5dba0f2c61c30e79a2e55af03 Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Fri, 6 Sep 2019 15:07:25 +0200 4 | Subject: [PATCH 04/10] Allow /devices/virtual/block/ genfscon conflict (seen 5 | on Xiaomi Mi 9) 6 | 7 | Change-Id: I06e4e9d5b82d61a8aeab595b47e2589249675895 8 | --- 9 | libsepol/cil/src/cil_post.c | 18 +++++++++++++++++- 10 | 1 file changed, 17 insertions(+), 1 deletion(-) 11 | 12 | diff --git a/libsepol/cil/src/cil_post.c b/libsepol/cil/src/cil_post.c 13 | index a7c66ead..99410da0 100644 14 | --- a/libsepol/cil/src/cil_post.c 15 | +++ b/libsepol/cil/src/cil_post.c 16 | @@ -491,7 +491,23 @@ static int cil_post_genfscon_context_compare(const void *a, const void *b) 17 | { 18 | struct cil_genfscon *a_genfscon = *(struct cil_genfscon**)a; 19 | struct cil_genfscon *b_genfscon = *(struct cil_genfscon**)b; 20 | - return context_compare(a_genfscon->context, b_genfscon->context); 21 | + int rc = context_compare(a_genfscon->context, b_genfscon->context); 22 | + if(rc) { 23 | + fprintf(stderr, "hello %s\n", a_genfscon->fs_str); 24 | + int bypass = 0; 25 | + /* 26 | + * This conflict has been seen on Xiaomi Mi 9: 27 | + * - AOSP Q says (genfscon sysfs /devices/virtual/block/ (u object_r sysfs_devices_block ((s0) (s0)))) 28 | + * - stock rom says (genfscon sysfs /devices/virtual/block/ (u object_r sysfs_ufs_target ((s0) (s0)))) 29 | + */ 30 | + if(strcmp(a_genfscon->path_str, "/devices/virtual/block/") == 0) 31 | + bypass = 1; 32 | + if(bypass == 1) { 33 | + fprintf(stderr, "Received conflicting %s vs %s but ignore\n", a_genfscon->path_str, b_genfscon->path_str); 34 | + return 0; 35 | + } 36 | + } 37 | + return rc; 38 | } 39 | 40 | static int cil_post_netifcon_context_compare(const void *a, const void *b) 41 | -- 42 | 2.34.1 43 | 44 | -------------------------------------------------------------------------------- /patches/personal/platform_packages_apps_SuperiorLab/0002-Clipboard-Overlay.patch: -------------------------------------------------------------------------------- 1 | From 0751982ce0409b772232f35d63f5f6bc4c2f8d24 Mon Sep 17 00:00:00 2001 2 | From: ChonDoit 3 | Date: Tue, 27 Aug 2024 12:48:45 -0300 4 | Subject: [PATCH 02/14] Clipboard Overlay 5 | 6 | --- 7 | res/values/custom_strings.xml | 4 ++++ 8 | res/xml/superior_lab_notifications.xml | 6 ++++++ 9 | 2 files changed, 10 insertions(+) 10 | 11 | diff --git a/res/values/custom_strings.xml b/res/values/custom_strings.xml 12 | index bcd374f..e81e068 100644 13 | --- a/res/values/custom_strings.xml 14 | +++ b/res/values/custom_strings.xml 15 | @@ -9,4 +9,8 @@ 16 | Android P animation style 17 | Enable Android P \"Default\" animations 18 | 19 | + 20 | + Show clipboard overlay 21 | + Show an overlay in the left bottom corner of the screen when something is copied to the clipboard 22 | + 23 | 24 | diff --git a/res/xml/superior_lab_notifications.xml b/res/xml/superior_lab_notifications.xml 25 | index 7957e4e..405e5c5 100644 26 | --- a/res/xml/superior_lab_notifications.xml 27 | +++ b/res/xml/superior_lab_notifications.xml 28 | @@ -23,5 +23,11 @@ 29 | android:summary="@string/less_boring_heads_up_summary" 30 | android:defaultValue="false" /> 31 | 32 | + 37 | + 38 | 39 | 40 | -- 41 | 2.47.0 42 | 43 | -------------------------------------------------------------------------------- /patches/personal/platform_packages_apps_SuperiorLab/0004-Squiggle.patch: -------------------------------------------------------------------------------- 1 | From 4ad5aa5ada734cc9527f73a33e22ca3df0ab9b15 Mon Sep 17 00:00:00 2001 2 | From: ChonDoit 3 | Date: Tue, 27 Aug 2024 13:05:23 -0300 4 | Subject: [PATCH 04/14] Squiggle 5 | 6 | --- 7 | res/values/custom_strings.xml | 4 ++++ 8 | res/xml/superior_lab_quicksettings.xml | 6 ++++++ 9 | 2 files changed, 10 insertions(+) 10 | 11 | diff --git a/res/values/custom_strings.xml b/res/values/custom_strings.xml 12 | index d7825c2..56ce38b 100644 13 | --- a/res/values/custom_strings.xml 14 | +++ b/res/values/custom_strings.xml 15 | @@ -20,4 +20,8 @@ 16 | Compact QS Media player 17 | Enable compact mode for Media Player Widget 18 | 19 | + 20 | + Show squiggle animation 21 | + Show media panel squiggle animation. 22 | + 23 | 24 | diff --git a/res/xml/superior_lab_quicksettings.xml b/res/xml/superior_lab_quicksettings.xml 25 | index e6350c4..d7feab2 100644 26 | --- a/res/xml/superior_lab_quicksettings.xml 27 | +++ b/res/xml/superior_lab_quicksettings.xml 28 | @@ -41,6 +41,12 @@ 29 | android:summary="@string/qs_compact_media_player_mode_summary" 30 | android:defaultValue="true" /> 31 | 32 | + 37 | + 38 | 39 | 40 | 3 | Date: Wed, 9 Sep 2020 22:36:42 +0200 4 | Subject: [PATCH 02/10] Revert "libsepol: Make an unknown permission an error 5 | in CIL" 6 | 7 | This reverts commit dc4e54126bf25dea4d51820922ccd1959be68fbc. 8 | 9 | This is required because some targets calls undefined permissions: 10 | - Realme X2 Pro calls sigcont 11 | - Honor 7X calls perf_event 12 | --- 13 | libsepol/cil/src/cil_resolve_ast.c | 12 ++++++++---- 14 | 1 file changed, 8 insertions(+), 4 deletions(-) 15 | 16 | diff --git a/libsepol/cil/src/cil_resolve_ast.c b/libsepol/cil/src/cil_resolve_ast.c 17 | index d2bfdc81..91fa1075 100644 18 | --- a/libsepol/cil/src/cil_resolve_ast.c 19 | +++ b/libsepol/cil/src/cil_resolve_ast.c 20 | @@ -136,14 +136,18 @@ static int __cil_resolve_perms(symtab_t *class_symtab, symtab_t *common_symtab, 21 | } 22 | } 23 | if (rc != SEPOL_OK) { 24 | + struct cil_list *empty_list; 25 | if (class_flavor == CIL_MAP_CLASS) { 26 | cil_log(CIL_ERR, "Failed to resolve permission %s for map class\n", (char*)curr->data); 27 | - } else { 28 | - cil_log(CIL_ERR, "Failed to resolve permission %s\n", (char*)curr->data); 29 | + goto exit; 30 | } 31 | - goto exit; 32 | + cil_log(CIL_WARN, "Failed to resolve permission %s\n", (char*)curr->data); 33 | + /* Use an empty list to represent unknown perm */ 34 | + cil_list_init(&empty_list, perm_strs->flavor); 35 | + cil_list_append(*perm_datums, CIL_LIST, empty_list); 36 | + } else { 37 | + cil_list_append(*perm_datums, CIL_DATUM, perm_datum); 38 | } 39 | - cil_list_append(*perm_datums, CIL_DATUM, perm_datum); 40 | } else { 41 | cil_list_append(*perm_datums, curr->flavor, curr->data); 42 | } 43 | -- 44 | 2.34.1 45 | 46 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_frameworks_base/0002-Fallback-to-stupid-autobrightness-if-brightness-valu.patch: -------------------------------------------------------------------------------- 1 | From ae164a473cb945a0e09828136c722048c44e87c9 Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Tue, 5 Oct 2021 17:59:16 -0400 4 | Subject: [PATCH 02/54] Fallback to stupid autobrightness if brightness values 5 | are broken 6 | 7 | This is needed because of: 8 | `ava.lang.IllegalArgumentException: The control points must all have strictly increasing X values.` 9 | on some Samsung devices 10 | 11 | Change-Id: Ieb679b34239013a5e31b34cb010b12febd9ef6d9 12 | --- 13 | .../com/android/server/display/DisplayDeviceConfig.java | 9 +++++++-- 14 | 1 file changed, 7 insertions(+), 2 deletions(-) 15 | 16 | diff --git a/services/core/java/com/android/server/display/DisplayDeviceConfig.java b/services/core/java/com/android/server/display/DisplayDeviceConfig.java 17 | index 9b2dcc53f456..04e06b99d3ee 100644 18 | --- a/services/core/java/com/android/server/display/DisplayDeviceConfig.java 19 | +++ b/services/core/java/com/android/server/display/DisplayDeviceConfig.java 20 | @@ -894,9 +894,14 @@ public class DisplayDeviceConfig { 21 | */ 22 | public static DisplayDeviceConfig create(Context context, boolean useConfigXml, 23 | DisplayManagerFlags flags) { 24 | - final DisplayDeviceConfig config; 25 | + DisplayDeviceConfig config; 26 | if (useConfigXml) { 27 | - config = getConfigFromGlobalXml(context, flags); 28 | + try { 29 | + config = getConfigFromGlobalXml(context, flags); 30 | + } catch(Exception e) { 31 | + android.util.Log.e("PHH", "Failed parsing automatic brightness values, fallbacking", e); 32 | + config = getConfigFromPmValues(context, flags); 33 | + } 34 | } else { 35 | config = getConfigFromPmValues(context, flags); 36 | } 37 | -- 38 | 2.34.1 39 | 40 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_packages_modules_Connectivity/0004-Revert-drop-support-for-V-gsi-on-pixel-5-R-base-kern.patch: -------------------------------------------------------------------------------- 1 | From 74a631969871db241b4f08b74e4b6729fbb70657 Mon Sep 17 00:00:00 2001 2 | From: Peter Cai 3 | Date: Sat, 16 Mar 2024 15:27:27 -0400 4 | Subject: [PATCH 4/9] Revert "drop support for V gsi on pixel 5 R base kernel" 5 | 6 | This reverts commit bbbd18a71368a80f689b924dcf82062c2ee351b2. 7 | --- 8 | ..._android_server_connectivity_ClatCoordinator.cpp | 13 +++++++++++++ 9 | 1 file changed, 13 insertions(+) 10 | 11 | diff --git a/service/jni/com_android_server_connectivity_ClatCoordinator.cpp b/service/jni/com_android_server_connectivity_ClatCoordinator.cpp 12 | index c125bd6479..787ef8fd69 100644 13 | --- a/service/jni/com_android_server_connectivity_ClatCoordinator.cpp 14 | +++ b/service/jni/com_android_server_connectivity_ClatCoordinator.cpp 15 | @@ -90,6 +90,11 @@ static void verifyPerms(const char * const path, 16 | 17 | #undef ALOGF 18 | 19 | +bool isGsiImage() { 20 | + // this implementation matches 2 other places in the codebase (same function name too) 21 | + return !access("/system/system_ext/etc/init/init.gsi.rc", F_OK); 22 | +} 23 | + 24 | static const char* kClatdDir = "/apex/com.android.tethering/bin/for-system"; 25 | static const char* kClatdBin = "/apex/com.android.tethering/bin/for-system/clatd"; 26 | 27 | @@ -130,6 +135,14 @@ static void verifyClatPerms() { 28 | 29 | #undef V2 30 | 31 | + // HACK: Some old vendor kernels lack ~5.10 backport of 'bpffs selinux genfscon' support. 32 | + // This is *NOT* supported, but let's allow, at least for now, U+ GSI to boot on them. 33 | + // (without this hack pixel5 R vendor + U gsi breaks) 34 | + if (isGsiImage() && !bpf::isAtLeastKernelVersion(5, 10, 0)) { 35 | + ALOGE("GSI with *BAD* pre-5.10 kernel lacking bpffs selinux genfscon support."); 36 | + return; 37 | + } 38 | + 39 | if (fatal) abort(); 40 | } 41 | 42 | -- 43 | 2.34.1 44 | 45 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_packages_modules_Wifi/0001-Add-persist.sys.phh.wifi_disable_sae-property-to-dis.patch: -------------------------------------------------------------------------------- 1 | From 69f7824ab0ad50c982a48a3fc21a30d7e715831e Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Wed, 21 Feb 2024 17:26:07 -0500 4 | Subject: [PATCH] Add persist.sys.phh.wifi_disable_sae property to disable 5 | WPA2=>WPA3 upgrades 6 | 7 | Change-Id: I72a0133e986f2c745af3c915ed65d7b540d2119b 8 | --- 9 | service/java/com/android/server/wifi/WifiGlobals.java | 5 ++++- 10 | 1 file changed, 4 insertions(+), 1 deletion(-) 11 | 12 | diff --git a/service/java/com/android/server/wifi/WifiGlobals.java b/service/java/com/android/server/wifi/WifiGlobals.java 13 | index 454d8c25c7..9601064af8 100644 14 | --- a/service/java/com/android/server/wifi/WifiGlobals.java 15 | +++ b/service/java/com/android/server/wifi/WifiGlobals.java 16 | @@ -59,7 +59,7 @@ public class WifiGlobals { 17 | private final AtomicInteger mSendDhcpHostnameRestriction = new AtomicInteger(); 18 | 19 | // These are read from the overlay, cache them after boot up. 20 | - private final boolean mIsWpa3SaeUpgradeEnabled; 21 | + private boolean mIsWpa3SaeUpgradeEnabled; 22 | private boolean mIsWpa3SaeUpgradeOffloadEnabled; 23 | private final boolean mIsOweUpgradeEnabled; 24 | private final boolean mFlushAnqpCacheOnWifiToggleOffEvent; 25 | @@ -108,6 +108,9 @@ public class WifiGlobals { 26 | 27 | mIsWpa3SaeUpgradeEnabled = mContext.getResources() 28 | .getBoolean(R.bool.config_wifiSaeUpgradeEnabled); 29 | + var prop = android.os.SystemProperties.get("persist.sys.phh.wifi_disable_sae", null); 30 | + if (prop != null && "true".equals(prop)) 31 | + mIsWpa3SaeUpgradeEnabled = false; 32 | mIsWpa3SaeUpgradeOffloadEnabled = mContext.getResources() 33 | .getBoolean(R.bool.config_wifiSaeUpgradeOffloadEnabled); 34 | mIsOweUpgradeEnabled = mContext.getResources() 35 | -- 36 | 2.34.1 37 | 38 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_system_sepolicy/0002-Fix-sepolicy-for-kernel-5.10-that-doesn-t-support-bp.patch: -------------------------------------------------------------------------------- 1 | From 5aee0e8138f55e3de9889f12b2c48b08da8ceb97 Mon Sep 17 00:00:00 2001 2 | From: danielzhang130 <37479705+danielzhang130@users.noreply.github.com> 3 | Date: Fri, 12 Apr 2024 13:01:08 -0400 4 | Subject: [PATCH 2/2] Fix sepolicy for kernel < 5.10 that doesn't support bpf 5 | file context (#1) 6 | 7 | Change-Id: I877bd90b1dc74c9d2f7713c70fd9aebd92331085 8 | 9 | Signed-off-by: Daniel Zhang 10 | --- 11 | private/network_stack.te | 4 ++-- 12 | 1 file changed, 2 insertions(+), 2 deletions(-) 13 | 14 | diff --git a/private/network_stack.te b/private/network_stack.te 15 | index 7587c1f46..9e6bd4b12 100644 16 | --- a/private/network_stack.te 17 | +++ b/private/network_stack.te 18 | @@ -61,8 +61,8 @@ hal_client_domain(network_stack, hal_tetheroffload) 19 | allow network_stack self:netlink_netfilter_socket create_socket_perms_no_ioctl; 20 | allow network_stack network_stack_service:service_manager find; 21 | # allow Tethering(network_stack process) to run/update/read the eBPF maps to offload tethering traffic by eBPF. 22 | -allow network_stack { fs_bpf_net_private fs_bpf_net_shared fs_bpf_netd_readonly fs_bpf_netd_shared fs_bpf_tethering }:dir search; 23 | -allow network_stack { fs_bpf_net_private fs_bpf_net_shared fs_bpf_netd_readonly fs_bpf_netd_shared fs_bpf_tethering }:file { getattr read write }; 24 | +allow network_stack { fs_bpf fs_bpf_net_private fs_bpf_net_shared fs_bpf_netd_readonly fs_bpf_netd_shared fs_bpf_tethering }:dir search; 25 | +allow network_stack { fs_bpf fs_bpf_net_private fs_bpf_net_shared fs_bpf_netd_readonly fs_bpf_netd_shared fs_bpf_tethering }:file { getattr read write }; 26 | allow network_stack bpfloader:bpf { map_read map_write prog_run }; 27 | # allow Tethering(network_stack process) to read flag value in tethering_u_or_later_native namespace 28 | get_prop(network_stack, device_config_tethering_u_or_later_native_prop) 29 | -- 30 | 2.34.1 31 | 32 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_frameworks_opt_telephony/0008-telephony-forward-port-support-for-forceCognitive.patch: -------------------------------------------------------------------------------- 1 | From 6b03579b2dea0a7d80e6505e8cb49fc380e7505e Mon Sep 17 00:00:00 2001 2 | From: corneranchu 3 | Date: Sat, 1 Oct 2022 01:49:58 +0000 4 | Subject: [PATCH 08/16] telephony: forward-port support for forceCognitive 5 | 6 | * This is needed on some MTK devices. Android 10 refactored some code, 7 | so now the "non-persistent/cognitive" filter is relocated to RIL and 8 | also in DcTracker.setupData(). 9 | 10 | Change-Id: I7dd387a9f064a969ca5774e53b05388de12aa308 11 | --- 12 | src/java/com/android/internal/telephony/RadioDataProxy.java | 4 +++- 13 | 1 file changed, 3 insertions(+), 1 deletion(-) 14 | 15 | diff --git a/src/java/com/android/internal/telephony/RadioDataProxy.java b/src/java/com/android/internal/telephony/RadioDataProxy.java 16 | index 9671077b0f..561fceaa7d 100644 17 | --- a/src/java/com/android/internal/telephony/RadioDataProxy.java 18 | +++ b/src/java/com/android/internal/telephony/RadioDataProxy.java 19 | @@ -21,6 +21,7 @@ import android.net.LinkProperties; 20 | import android.os.AsyncResult; 21 | import android.os.Message; 22 | import android.os.RemoteException; 23 | +import android.os.SystemProperties; 24 | import android.telephony.Rlog; 25 | import android.telephony.ServiceState; 26 | import android.telephony.data.DataProfile; 27 | @@ -244,7 +245,8 @@ public class RadioDataProxy extends RadioServiceProxy { 28 | } else { 29 | ArrayList dpis = new ArrayList<>(); 30 | for (DataProfile dp : profiles) { 31 | - if (dp.isPersistent()) { 32 | + boolean forceCognitive = SystemProperties.getBoolean("persist.sys.phh.radio.force_cognitive", false); 33 | + if (dp.isPersistent() || forceCognitive) { 34 | dpis.add(RILUtils.convertToHalDataProfile10(dp)); 35 | } 36 | } 37 | -- 38 | 2.34.1 39 | 40 | -------------------------------------------------------------------------------- /patches/personal/platform_packages_apps_SuperiorLab/0006-SAF-Restriction.patch: -------------------------------------------------------------------------------- 1 | From 96f6b4a8a0695d7d92c597898ab2cd57bfeee40e Mon Sep 17 00:00:00 2001 2 | From: ChonDoit 3 | Date: Tue, 27 Aug 2024 13:08:23 -0300 4 | Subject: [PATCH 06/14] SAF Restriction 5 | 6 | --- 7 | res/values/custom_strings.xml | 4 ++++ 8 | res/xml/superior_lab_misc.xml | 6 ++++++ 9 | 2 files changed, 10 insertions(+) 10 | 11 | diff --git a/res/values/custom_strings.xml b/res/values/custom_strings.xml 12 | index 1fe48a6..aa82cd0 100644 13 | --- a/res/values/custom_strings.xml 14 | +++ b/res/values/custom_strings.xml 15 | @@ -28,4 +28,8 @@ 16 | Spoof encryption status 17 | Spoof storage encryption status to encrypted. 18 | 19 | + 20 | + No storage restrict 21 | + Remove the restriction when selecting folders through Storage Access Framework. 22 | + 23 | 24 | diff --git a/res/xml/superior_lab_misc.xml b/res/xml/superior_lab_misc.xml 25 | index 4411e31..78bd1b9 100644 26 | --- a/res/xml/superior_lab_misc.xml 27 | +++ b/res/xml/superior_lab_misc.xml 28 | @@ -17,6 +17,12 @@ 29 | android:summary="@string/pie_animation_style_summary" 30 | android:defaultValue="false" /> 31 | 32 | + 37 | + 38 | 3 | Date: Tue, 14 Aug 2018 21:48:19 +0200 4 | Subject: [PATCH 1/4] Act as usb device when there is no hal, but we believe we 5 | are a device 6 | 7 | Change-Id: I036090738525fd8cc63534d52d02ab1852950a7d 8 | --- 9 | .../usb/UsbConnectionBroadcastReceiver.java | 7 +++++++ 10 | 1 file changed, 7 insertions(+) 11 | 12 | diff --git a/src/com/android/settings/connecteddevice/usb/UsbConnectionBroadcastReceiver.java b/src/com/android/settings/connecteddevice/usb/UsbConnectionBroadcastReceiver.java 13 | index 16ea602bc4f..262afbcbb31 100644 14 | --- a/src/com/android/settings/connecteddevice/usb/UsbConnectionBroadcastReceiver.java 15 | +++ b/src/com/android/settings/connecteddevice/usb/UsbConnectionBroadcastReceiver.java 16 | @@ -93,6 +93,13 @@ public class UsbConnectionBroadcastReceiver extends BroadcastReceiver implements 17 | mFunctions = functions; 18 | mDataRole = mUsbBackend.getDataRole(); 19 | mPowerRole = mUsbBackend.getPowerRole(); 20 | + //If we have no USB HAL, mDataRole is invalid 21 | + //But we can't be connected AND have none data_role, so it's safe. 22 | + //It would be better to fix UsbManager when no HAL is available, but that's more work 23 | + if(mDataRole == UsbPortStatus.DATA_ROLE_NONE && 24 | + intent.getExtras().getBoolean(UsbManager.USB_CONNECTED) && 25 | + !intent.getExtras().getBoolean(UsbManager.USB_HOST_CONNECTED)) 26 | + mDataRole = UsbPortStatus.DATA_ROLE_DEVICE; 27 | } else if (UsbManager.ACTION_USB_PORT_CHANGED.equals(intent.getAction())) { 28 | UsbPortStatus portStatus = intent.getExtras() 29 | .getParcelable(UsbManager.EXTRA_PORT_STATUS); 30 | -- 31 | 2.34.1 32 | 33 | -------------------------------------------------------------------------------- /patches/personal/platform_frameworks_base/0013-Reduce-default-QS-Label-Size.patch: -------------------------------------------------------------------------------- 1 | From 90a1966178d2169b93ea45def9df8a663e2d8ca1 Mon Sep 17 00:00:00 2001 2 | From: ChonDoit 3 | Date: Mon, 2 Sep 2024 00:05:03 -0300 4 | Subject: [PATCH 13/31] Reduce default QS Label Size 5 | 6 | --- 7 | packages/SystemUI/src/com/android/systemui/qs/TileUtils.java | 2 +- 8 | .../src/com/android/systemui/qs/tileimpl/QSTileViewImpl.kt | 2 +- 9 | 2 files changed, 2 insertions(+), 2 deletions(-) 10 | 11 | diff --git a/packages/SystemUI/src/com/android/systemui/qs/TileUtils.java b/packages/SystemUI/src/com/android/systemui/qs/TileUtils.java 12 | index 3a50c42b..c57b98c2 100644 13 | --- a/packages/SystemUI/src/com/android/systemui/qs/TileUtils.java 14 | +++ b/packages/SystemUI/src/com/android/systemui/qs/TileUtils.java 15 | @@ -82,7 +82,7 @@ public class TileUtils { 16 | public static float getQSTileLabelSize(Context context) { 17 | return (float) Settings.System.getIntForUser(context.getContentResolver(), 18 | Settings.System.QS_TILE_LABEL_SIZE, 19 | - 14, UserHandle.USER_CURRENT); 20 | + 13, UserHandle.USER_CURRENT); 21 | } 22 | 23 | public static boolean getQSTileVerticalLayout(Context context, int defaultValue) { 24 | diff --git a/packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSTileViewImpl.kt b/packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSTileViewImpl.kt 25 | index 9e6c5c37..df09514c 100644 26 | --- a/packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSTileViewImpl.kt 27 | +++ b/packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSTileViewImpl.kt 28 | @@ -209,7 +209,7 @@ open class QSTileViewImpl @JvmOverloads constructor( 29 | private var vertical = false 30 | private val forceHideCheveron = true 31 | private var labelHide = false 32 | - private var labelSize = 14f 33 | + private var labelSize = 13f 34 | 35 | init { 36 | val typedValue = TypedValue() 37 | -- 38 | 2.47.0 39 | 40 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_frameworks_av/0016-Use-a-fake-volume-policy-when-none-has-been-found.patch: -------------------------------------------------------------------------------- 1 | From 8d0bf8d33e27a676c86281d7c093f867af92209b Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Sun, 28 Mar 2021 14:48:49 +0200 4 | Subject: [PATCH 16/24] Use a fake volume policy when none has been found 5 | 6 | This is useful, because on Samsung devices, the "real" 7 | (=non-gsi-cheating) audio policy doesn't have any volume policy. 8 | 9 | This requires actually adding the fake audio policy xml file (done in 10 | device/phh/treble) 11 | 12 | Change-Id: I461a3f22893ab2b1d96d67f22397369b2cae41e5 13 | --- 14 | services/audiopolicy/engine/config/src/EngineConfig.cpp | 7 ++++++- 15 | 1 file changed, 6 insertions(+), 1 deletion(-) 16 | 17 | diff --git a/services/audiopolicy/engine/config/src/EngineConfig.cpp b/services/audiopolicy/engine/config/src/EngineConfig.cpp 18 | index ca78ce7213..59211577c4 100644 19 | --- a/services/audiopolicy/engine/config/src/EngineConfig.cpp 20 | +++ b/services/audiopolicy/engine/config/src/EngineConfig.cpp 21 | @@ -800,7 +800,12 @@ android::status_t parseLegacyVolumeFile(const char* path, VolumeGroups &volumeGr 22 | android::status_t parseLegacyVolumes(VolumeGroups &volumeGroups) { 23 | if (std::string audioPolicyXmlConfigFile = audio_get_audio_policy_config_file(); 24 | !audioPolicyXmlConfigFile.empty()) { 25 | - return parseLegacyVolumeFile(audioPolicyXmlConfigFile.c_str(), volumeGroups); 26 | + int ret = parseLegacyVolumeFile(audioPolicyXmlConfigFile.c_str(), volumeGroups); 27 | + if (ret == NO_ERROR && volumeGroups.size() == 0) { 28 | + ret = parseLegacyVolumeFile("/system/etc/fake_audio_policy_volume.xml", volumeGroups); 29 | + ALOGE("Parsing volume for /system/etc/fake_audio_policy_volume.xml gave %zu", volumeGroups.size()); 30 | + } 31 | + return ret; 32 | } else { 33 | ALOGE("No readable audio policy config file found"); 34 | return BAD_VALUE; 35 | -- 36 | 2.34.1 37 | 38 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_system_core/0010-FDE-is-dead.-Fallback-FDE-to-no-encryption-and-FDE-F.patch: -------------------------------------------------------------------------------- 1 | From aa03f2d0bb1dfe17deaa23e2c3300c3b7f8214a3 Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Thu, 10 Nov 2022 13:30:50 -0500 4 | Subject: [PATCH 10/26] FDE is dead. Fallback FDE to no encryption, and FDE+FBE 5 | to FBE 6 | 7 | --- 8 | fs_mgr/libfstab/fstab.cpp | 7 +++---- 9 | 1 file changed, 3 insertions(+), 4 deletions(-) 10 | 11 | diff --git a/fs_mgr/libfstab/fstab.cpp b/fs_mgr/libfstab/fstab.cpp 12 | index 0603f25b0..453010e4e 100644 13 | --- a/fs_mgr/libfstab/fstab.cpp 14 | +++ b/fs_mgr/libfstab/fstab.cpp 15 | @@ -187,7 +187,7 @@ bool ParseFsMgrFlags(const std::string& flags, FstabEntry* entry) { 16 | #undef CheckFlag 17 | 18 | // Then handle flags that take an argument. 19 | - if (StartsWith(flag, "encryptable=")) { 20 | + if (StartsWith(flag, "encryptable=") || StartsWith(flag, "forceencrypt=")) { 21 | // The "encryptable" flag identifies adoptable storage volumes. The 22 | // argument to this flag is ignored, but it should be "userdata". 23 | // 24 | @@ -197,9 +197,8 @@ bool ParseFsMgrFlags(const std::string& flags, FstabEntry* entry) { 25 | // storage volumes. Today, FDE is no longer supported, leaving only 26 | // the adoptable storage volume meaning for this flag. 27 | entry->fs_mgr_flags.crypt = true; 28 | - } else if (StartsWith(flag, "forceencrypt=") || StartsWith(flag, "forcefdeorfbe=")) { 29 | - LERROR << "flag no longer supported: " << flag; 30 | - return false; 31 | + } else if (StartsWith(flag, "forcefdeorfbe=")) { 32 | + ParseFileEncryption("aes-256-xts:aes-256-cts", entry); 33 | } else if (StartsWith(flag, "voldmanaged=")) { 34 | // The voldmanaged flag is followed by an = and the label, a colon and the partition 35 | // number or the word "auto", e.g. voldmanaged=sdcard:3 36 | -- 37 | 2.34.1 38 | 39 | -------------------------------------------------------------------------------- /patches/personal/platform_packages_apps_SuperiorLab/0011-Gaming-Mode.patch: -------------------------------------------------------------------------------- 1 | From 32234c0a220e5fd1b20fb78e9819a641e7e85cf9 Mon Sep 17 00:00:00 2001 2 | From: ChonDoit 3 | Date: Tue, 10 Sep 2024 22:48:35 -0300 4 | Subject: [PATCH 11/14] Gaming Mode 5 | 6 | --- 7 | res/values/custom_strings.xml | 3 +++ 8 | res/xml/superior_lab_misc.xml | 10 ++++++++++ 9 | 2 files changed, 13 insertions(+) 10 | 11 | diff --git a/res/values/custom_strings.xml b/res/values/custom_strings.xml 12 | index f77e2c3..7d44827 100644 13 | --- a/res/values/custom_strings.xml 14 | +++ b/res/values/custom_strings.xml 15 | @@ -105,4 +105,7 @@ 16 | Floating rotate button 17 | Show a floating rotate button when device is rotated 18 | 19 | + 20 | + Game space 21 | + Extra features for immersive gaming experience 22 | 23 | diff --git a/res/xml/superior_lab_misc.xml b/res/xml/superior_lab_misc.xml 24 | index 78bd1b9..b0b8bf4 100644 25 | --- a/res/xml/superior_lab_misc.xml 26 | +++ b/res/xml/superior_lab_misc.xml 27 | @@ -11,6 +11,16 @@ 28 | 30 | 31 | + 32 | + 36 | + 39 | + 40 | + 41 | 3 | Date: Mon, 29 Jul 2019 18:09:12 +0200 4 | Subject: [PATCH 2/4] Don't fail on FTP conntracking failing 5 | 6 | The issue has been seen on some Samsung devices. 7 | See https://github.com/phhusson/treble_experimentations/issues/425 8 | 9 | Thanks @zamrih for pin-pointing the issue and validating fix 10 | 11 | Change-Id: I3d9c865eb5a4b421f9983210c2ceae62b4906234 12 | --- 13 | server/TetherController.cpp | 12 +++++++++--- 14 | 1 file changed, 9 insertions(+), 3 deletions(-) 15 | 16 | diff --git a/server/TetherController.cpp b/server/TetherController.cpp 17 | index a890d60c..88e7f52b 100644 18 | --- a/server/TetherController.cpp 19 | +++ b/server/TetherController.cpp 20 | @@ -722,13 +722,19 @@ int TetherController::setForwardRules(bool add, const char *intIface, const char 21 | return -EREMOTEIO; 22 | } 23 | 24 | - std::vector v4 = { 25 | + std::vector v4Ftp = { 26 | "*raw", 27 | - StringPrintf("%s %s -p tcp --dport 21 -i %s -j CT --helper ftp", op, 28 | - LOCAL_RAW_PREROUTING, intIface), 29 | + StringPrintf("%s %s -p tcp --dport 21 -i %s -j CT --helper ftp", 30 | + op, LOCAL_RAW_PREROUTING, intIface), 31 | StringPrintf("%s %s -p tcp --dport 1723 -i %s -j CT --helper pptp", op, 32 | LOCAL_RAW_PREROUTING, intIface), 33 | "COMMIT", 34 | + }; 35 | + if(iptablesRestoreFunction(V4, Join(v4Ftp, '\n'), nullptr) == -1) { 36 | + ALOGE("Failed adding iptables CT target on FTP."); 37 | + } 38 | + 39 | + std::vector v4 = { 40 | "*filter", 41 | StringPrintf("%s %s -i %s -o %s -m state --state ESTABLISHED,RELATED -g %s", op, 42 | LOCAL_FORWARD, extIface, intIface, LOCAL_TETHER_COUNTERS_CHAIN), 43 | -- 44 | 2.34.1 45 | 46 | -------------------------------------------------------------------------------- /patches/personal/platform_packages_apps_Settings/0007-Add-capability-to-allow-tethering-to-use-VPN-upstreams-3.patch: -------------------------------------------------------------------------------- 1 | From 5d4ce7fa495a911c2dad5058829e255b21691310 Mon Sep 17 00:00:00 2001 2 | From: Sam Mortimer 3 | Date: Thu, 4 Apr 2024 17:29:44 +0000 4 | Subject: [PATCH] Settings: Add capability to allow tethering to use VPN 5 | upstreams [3/3] 6 | 7 | --- 8 | res/values/superior_strings.xml | 4 ++++ 9 | res/xml/tether_prefs.xml | 6 ++++++ 10 | 2 files changed, 10 insertions(+) 11 | 12 | diff --git a/res/values/superior_strings.xml b/res/values/superior_strings.xml 13 | index b447d00..97fdc84 100644 14 | --- a/res/values/superior_strings.xml 15 | +++ b/res/values/superior_strings.xml 16 | @@ -317,4 +317,8 @@ 17 | A-GPS 18 | Use satellite assistance data from the internet. 19 | 20 | + 21 | + Allow clients to use VPNs 22 | + Permit hotspot clients to use this device\u2019s VPN connections for upstream connectivity 23 | + 24 | 25 | diff --git a/res/xml/tether_prefs.xml b/res/xml/tether_prefs.xml 26 | index 89bd631..59934ef 100644 27 | --- a/res/xml/tether_prefs.xml 28 | +++ b/res/xml/tether_prefs.xml 29 | @@ -49,6 +49,12 @@ 30 | android:summary="@string/ethernet_tethering_subtext" 31 | settings:keywords="@string/keywords_hotspot_tethering" /> 32 | 33 | + 38 | + 39 | 3 | Date: Tue, 17 Sep 2024 00:47:44 -0300 4 | Subject: [PATCH 13/14] Allow to turn on Bluetooth with one-tap [2/2] 5 | 6 | --- 7 | res/values/custom_strings.xml | 4 ++++ 8 | res/xml/superior_lab_quicksettings.xml | 6 ++++++ 9 | 2 files changed, 10 insertions(+) 10 | 11 | diff --git a/res/values/custom_strings.xml b/res/values/custom_strings.xml 12 | index 06de747..d4a61d0 100644 13 | --- a/res/values/custom_strings.xml 14 | +++ b/res/values/custom_strings.xml 15 | @@ -124,4 +124,8 @@ 16 | Tint background 17 | Make luminance and chroma selection affect background colors as well 18 | 19 | + 20 | + One-Tap Bluetooth 21 | + Enable bluetooth with only one-tap (Long-tap to open dialog) 22 | + 23 | 24 | diff --git a/res/xml/superior_lab_quicksettings.xml b/res/xml/superior_lab_quicksettings.xml 25 | index 919df05..a4fd86e 100644 26 | --- a/res/xml/superior_lab_quicksettings.xml 27 | +++ b/res/xml/superior_lab_quicksettings.xml 28 | @@ -18,6 +18,12 @@ 29 | android:entryValues="@array/quick_pulldown_values" 30 | android:defaultValue="0" /> 31 | 32 | + 37 | + 38 | 3 | Date: Tue, 18 Oct 2022 16:08:09 -0400 4 | Subject: [PATCH 4/5] Exfat can be mounted with "exfat" kernel fs driver, or 5 | "sdfat" or "texfat" (Samsung and Sony variants) 6 | 7 | --- 8 | fs/Exfat.cpp | 11 ++++++++--- 9 | 1 file changed, 8 insertions(+), 3 deletions(-) 10 | 11 | diff --git a/fs/Exfat.cpp b/fs/Exfat.cpp 12 | index ed539216..a3694646 100644 13 | --- a/fs/Exfat.cpp 14 | +++ b/fs/Exfat.cpp 15 | @@ -35,7 +35,9 @@ static const char* kFsckPath = "/system/bin/fsck.exfat"; 16 | 17 | bool IsSupported() { 18 | return access(kMkfsPath, X_OK) == 0 && access(kFsckPath, X_OK) == 0 && 19 | - IsFilesystemSupported("exfat"); 20 | + (IsFilesystemSupported("exfat") || 21 | + IsFilesystemSupported("texfat") || 22 | + IsFilesystemSupported("sdfat")); 23 | } 24 | 25 | status_t Check(const std::string& source) { 26 | @@ -64,13 +66,16 @@ status_t Mount(const std::string& source, const std::string& target, int ownerUi 27 | auto mountData = android::base::StringPrintf("uid=%d,gid=%d,fmask=%o,dmask=%o", ownerUid, 28 | ownerGid, permMask, permMask); 29 | 30 | - if (mount(source.c_str(), target.c_str(), "exfat", mountFlags, mountData.c_str()) == 0) { 31 | + const char* fs = "exfat"; 32 | + if (IsFilesystemSupported("sdfat")) fs = "sdfat"; 33 | + if (IsFilesystemSupported("texfat")) fs = "texfat"; 34 | + if (mount(source.c_str(), target.c_str(), fs, mountFlags, mountData.c_str()) == 0) { 35 | return 0; 36 | } 37 | 38 | PLOG(ERROR) << "Mount failed; attempting read-only"; 39 | mountFlags |= MS_RDONLY; 40 | - if (mount(source.c_str(), target.c_str(), "exfat", mountFlags, mountData.c_str()) == 0) { 41 | + if (mount(source.c_str(), target.c_str(), fs, mountFlags, mountData.c_str()) == 0) { 42 | return 0; 43 | } 44 | 45 | -- 46 | 2.34.1 47 | 48 | -------------------------------------------------------------------------------- /patches/personal/platform_vendor_hardware_overlay/0002-Handle-TrebleAppSecure.patch: -------------------------------------------------------------------------------- 1 | From cf77e6d6d016178427cc4a3233dbaeff9d47fd18 Mon Sep 17 00:00:00 2001 2 | From: ChonDoit 3 | Date: Sun, 16 Oct 2022 13:39:16 +0000 4 | Subject: [PATCH] Handle TrebleApp Secure with PHH-SECURE_BUILD 5 | 6 | --- 7 | TrebleApp/Android.mk | 11 +++++++---- 8 | 1 file changed, 7 insertions(+), 4 deletions(-) 9 | 10 | diff --git a/TrebleApp/Android.mk b/TrebleApp/Android.mk 11 | index d302519..8bfd6ba 100644 12 | --- a/TrebleApp/Android.mk 13 | +++ b/TrebleApp/Android.mk 14 | @@ -1,17 +1,20 @@ 15 | LOCAL_PATH := $(my-dir) 16 | 17 | include $(CLEAR_VARS) 18 | - 19 | LOCAL_MODULE := TrebleApp 20 | -LOCAL_SRC_FILES := app.apk 21 | +ifeq ($(PHH-SECURE_BUILD), true) 22 | + LOCAL_SRC_FILES := app_secure.apk 23 | + LOCAL_OVERRIDES_PACKAGES := su SuperUser Updater 24 | + else 25 | + LOCAL_SRC_FILES := app.apk 26 | + LOCAL_OVERRIDES_PACKAGES := su Updater 27 | +endif 28 | LOCAL_MODULE_CLASS := APPS 29 | LOCAL_MODULE_SUFFIX := .apk 30 | LOCAL_BUILT_MODULE_STEM := package.apk 31 | LOCAL_CERTIFICATE := platform 32 | LOCAL_PRIVILEGED_MODULE := true 33 | -LOCAL_OVERRIDES_PACKAGES := Updater 34 | ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 31 && echo OK),OK) 35 | LOCAL_ENFORCE_USES_LIBRARIES := false 36 | endif 37 | - 38 | include $(BUILD_PREBUILT) 39 | diff --git a/TrebleApp/Android.mk b/TrebleApp/Android.mk 40 | index 71c5fa3..fe0d2e3 100644 41 | --- a/TrebleApp/Android.mk 42 | +++ b/TrebleApp/Android.mk 43 | @@ -2,13 +2,8 @@ LOCAL_PATH := $(my-dir) 44 | 45 | include $(CLEAR_VARS) 46 | LOCAL_MODULE := TrebleApp 47 | -ifeq ($(PHH-SECURE_BUILD), true) 48 | - LOCAL_SRC_FILES := app_secure.apk 49 | - LOCAL_OVERRIDES_PACKAGES := su SuperUser Updater 50 | - else 51 | - LOCAL_SRC_FILES := app.apk 52 | - LOCAL_OVERRIDES_PACKAGES := su Updater 53 | -endif 54 | +LOCAL_SRC_FILES := app.apk 55 | +LOCAL_OVERRIDES_PACKAGES := su Updater 56 | LOCAL_MODULE_CLASS := APPS 57 | LOCAL_MODULE_SUFFIX := .apk 58 | LOCAL_BUILT_MODULE_STEM := package.apk 59 | -- 60 | 2.34.1 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_frameworks_base/0026-Dynamically-resize-boot-animation-to-match-screen-si.patch: -------------------------------------------------------------------------------- 1 | From c531613aa6ff8e21d3ff56f81d802502cc6973fa Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Mon, 20 Dec 2021 15:01:41 -0500 4 | Subject: [PATCH 26/54] Dynamically resize boot animation to match screen size 5 | 6 | Change-Id: I54e49fc6b8c670103852e212d1416e27ff976205 7 | --- 8 | cmds/bootanimation/BootAnimation.cpp | 22 ++++++++++++++++++++++ 9 | 1 file changed, 22 insertions(+) 10 | 11 | diff --git a/cmds/bootanimation/BootAnimation.cpp b/cmds/bootanimation/BootAnimation.cpp 12 | index 77b74e9898b8..ba14cc03fccb 100644 13 | --- a/cmds/bootanimation/BootAnimation.cpp 14 | +++ b/cmds/bootanimation/BootAnimation.cpp 15 | @@ -618,6 +618,28 @@ status_t BootAnimation::readyToRun() { 16 | mFlingerSurface = s; 17 | mTargetInset = -1; 18 | 19 | + if ( mAnimation != nullptr ) { 20 | + SLOGE("Got screen size %d, animation size %d", mWidth, mAnimation->width); 21 | + int origWidth = mAnimation->width; 22 | + if ( mAnimation->width*2 < mWidth ) { 23 | + SLOGE("Making animation bigger"); 24 | + mAnimation->width *= 2; 25 | + mAnimation->height *= 2; 26 | + } else if ( mWidth < mAnimation->width ) { 27 | + SLOGE("Making animation smaller"); 28 | + mAnimation->width /= 2; 29 | + mAnimation->height /= 2; 30 | + } 31 | + for (Animation::Part& part : mAnimation->parts) { 32 | + for(auto& frame: part.frames) { 33 | + if(frame.trimWidth == origWidth && frame.trimX == 0 && frame.trimY == 0) { 34 | + frame.trimWidth = mAnimation->width; 35 | + frame.trimHeight = mAnimation->height; 36 | + } 37 | + } 38 | + } 39 | + } 40 | + 41 | // Rotate the boot animation according to the value specified in the sysprop 42 | // ro.bootanim.set_orientation_. Four values are supported: ORIENTATION_0, 43 | // ORIENTATION_90, ORIENTATION_180 and ORIENTATION_270. 44 | -- 45 | 2.34.1 46 | 47 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_system_core/0005-Detect-allowed-sdcard-options-based-on-vndk.patch: -------------------------------------------------------------------------------- 1 | From e0b7c4b77ee65618af47717dddbdb7222b2f3b9f Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Tue, 14 Aug 2018 19:33:03 +0200 4 | Subject: [PATCH 05/26] Detect allowed sdcard options based on vndk 5 | 6 | Some kernel crashes when using too recent sdcardfs options 7 | 8 | Change-Id: I632e485f9b2a09a46d4a1fde2ea15217f8d92eff 9 | --- 10 | sdcard/sdcard.cpp | 8 +++++--- 11 | 1 file changed, 5 insertions(+), 3 deletions(-) 12 | 13 | diff --git a/sdcard/sdcard.cpp b/sdcard/sdcard.cpp 14 | index 622de5b7a..e580190e9 100644 15 | --- a/sdcard/sdcard.cpp 16 | +++ b/sdcard/sdcard.cpp 17 | @@ -32,6 +32,7 @@ 18 | #include 19 | #include 20 | #include 21 | +#include 22 | #include 23 | #include 24 | 25 | @@ -103,11 +104,12 @@ static bool sdcardfs_setup(const std::string& source_path, const std::string& de 26 | mode_t mask, bool derive_gid, bool default_normal, bool unshared_obb, 27 | bool use_esdfs) { 28 | // Add new options at the end of the vector. 29 | + int vndk = android::base::GetIntProperty("ro.vndk.version", 29); 30 | std::vector new_opts_list; 31 | if (multi_user) new_opts_list.push_back("multiuser,"); 32 | - if (derive_gid) new_opts_list.push_back("derive_gid,"); 33 | - if (default_normal) new_opts_list.push_back("default_normal,"); 34 | - if (unshared_obb) new_opts_list.push_back("unshared_obb,"); 35 | + if (derive_gid && vndk >= 27) new_opts_list.push_back("derive_gid,"); 36 | + if (default_normal && vndk >= 28) new_opts_list.push_back("default_normal,"); 37 | + if (unshared_obb && vndk >= 29) new_opts_list.push_back("unshared_obb,"); 38 | // Try several attempts, each time with one less option, to gracefully 39 | // handle older kernels that aren't updated yet. 40 | for (int i = 0; i <= new_opts_list.size(); ++i) { 41 | -- 42 | 2.34.1 43 | 44 | -------------------------------------------------------------------------------- /patches/pre/platform_packages_apps_Launcher3/01-Add-misssing-package-usage-stats-permission.patch: -------------------------------------------------------------------------------- 1 | From 8eb32d31f966b79f657bb5292a491e2518197539 Mon Sep 17 00:00:00 2001 2 | From: ChonDoit 3 | Date: Fri, 2 Feb 2024 17:01:50 -0300 4 | Subject: [PATCH] Add missing PAKAGE_USAGE_STATS permission 5 | 6 | --- 7 | AndroidManifest-common.xml | 1 + 8 | privapp_whitelist_com.android.launcher3-ext.xml | 3 ++- 9 | 2 files changed, 3 insertions(+), 1 deletion(-) 10 | 11 | diff --git a/AndroidManifest-common.xml b/AndroidManifest-common.xml 12 | index 617b1bb..a81391c 100644 13 | --- a/AndroidManifest-common.xml 14 | +++ b/AndroidManifest-common.xml 15 | @@ -53,6 +53,7 @@ 16 | 17 | 18 | 19 | + 20 | 21 | 22 | 23 | diff --git a/privapp_whitelist_com.android.launcher3-ext.xml b/privapp_whitelist_com.android.launcher3-ext.xml 24 | index 1994244..747f6e2 100644 25 | --- a/privapp_whitelist_com.android.launcher3-ext.xml 26 | +++ b/privapp_whitelist_com.android.launcher3-ext.xml 27 | @@ -21,7 +21,8 @@ 28 | 29 | 30 | 31 | - 32 | + 33 | + 34 | 35 | 36 | 37 | -- 38 | 2.34.1 39 | 40 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_system_apex/0001-Disable-O_DIRECT-for-old-kernels.patch: -------------------------------------------------------------------------------- 1 | From 5cea503e63b91024670a641c1ff02227113853db Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Tue, 7 May 2024 19:28:41 -0400 4 | Subject: [PATCH] Disable O_DIRECT for old kernels 5 | 6 | On old kernels, mounting over O_DIRECT over FBE ext4 leads to corrupted 7 | reads. 8 | "Old kernel" is hard to define, some 4.19 and 4.14 got the fix. 9 | The penalty for not using o_direct is a bit of performance/ram hit, so 10 | live with it 11 | 12 | Co-authored-by: Alberto Ponces 13 | Change-Id: I710e870bc467000547b00958b0818aaf0ddca072 14 | --- 15 | apexd/apexd_loop.cpp | 16 +++++++++++++++- 16 | 1 file changed, 15 insertions(+), 1 deletion(-) 17 | 18 | diff --git a/apexd/apexd_loop.cpp b/apexd/apexd_loop.cpp 19 | index e15a7fa8..464eca0f 100644 20 | --- a/apexd/apexd_loop.cpp 21 | +++ b/apexd/apexd_loop.cpp 22 | @@ -35,6 +35,7 @@ 23 | #include 24 | #include 25 | #include 26 | +#include 27 | #include 28 | #include 29 | 30 | @@ -351,7 +352,20 @@ Result ConfigureLoopDevice(const int device_fd, const std::string& target, 31 | * condition is now met. 32 | */ 33 | bool use_buffered_io = false; 34 | - unique_fd target_fd(open(target.c_str(), O_RDONLY | O_CLOEXEC | O_DIRECT)); 35 | + bool enable_odirect = false; 36 | + struct utsname uts; 37 | + unsigned int major, minor; 38 | + if (uname(&uts) == 0 && sscanf(uts.release, "%u.%u", &major, &minor) == 2) { 39 | + if(major > 4) enable_odirect = true; 40 | + if(major == 4 && minor > 19) enable_odirect = true; 41 | + } 42 | + unique_fd target_fd; 43 | + if (enable_odirect) { 44 | + target_fd = unique_fd(open(target.c_str(), O_RDONLY | O_CLOEXEC | O_DIRECT)); 45 | + } else { 46 | + target_fd = unique_fd(open(target.c_str(), O_RDONLY | O_CLOEXEC)); 47 | + } 48 | + //unique_fd target_fd(open(target.c_str(), O_RDONLY | O_CLOEXEC)); 49 | if (target_fd.get() == -1) { 50 | struct statfs stbuf; 51 | int saved_errno = errno; 52 | -- 53 | 2.34.1 54 | 55 | -------------------------------------------------------------------------------- /patches/personal/platform_frameworks_base/0020-SystemUI-Disable-blur-wakeup-animation.patch: -------------------------------------------------------------------------------- 1 | From e3205c87c55c37bb85cba1b51bbe6e84fb5aa17a Mon Sep 17 00:00:00 2001 2 | From: Danny Lin 3 | Date: Fri, 6 Nov 2020 12:52:59 -0800 4 | Subject: [PATCH 20/31] SystemUI: Disable blur wakeup animation 5 | 6 | This animation looks distracting and prevents the user from seeing 7 | anything during the unlock animation. 8 | 9 | Change-Id: I2c8ff9e6a9ec361595bc725d971a51e91acc13a2 10 | Signed-off-by: Pranav Vashi 11 | Signed-off-by: darkphnx 12 | Signed-off-by: offender6969 13 | Signed-off-by: darkphnx 14 | Signed-off-by: Roxor-007 15 | Signed-off-by: darkphnx 16 | Signed-off-by: Roxor-007 17 | Signed-off-by: darkphnx 18 | Signed-off-by: revolwoc 19 | Signed-off-by: darkphnx 20 | Signed-off-by: Ghosuto 21 | --- 22 | .../systemui/statusbar/NotificationShadeDepthController.kt | 2 +- 23 | 1 file changed, 1 insertion(+), 1 deletion(-) 24 | 25 | diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShadeDepthController.kt b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShadeDepthController.kt 26 | index 622ae427..ba039a10 100644 27 | --- a/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShadeDepthController.kt 28 | +++ b/packages/SystemUI/src/com/android/systemui/statusbar/NotificationShadeDepthController.kt 29 | @@ -72,7 +72,7 @@ class NotificationShadeDepthController @Inject constructor( 30 | configurationController: ConfigurationController 31 | ) : ShadeExpansionListener, Dumpable { 32 | companion object { 33 | - private const val WAKE_UP_ANIMATION_ENABLED = true 34 | + private const val WAKE_UP_ANIMATION_ENABLED = false 35 | private const val VELOCITY_SCALE = 100f 36 | private const val MAX_VELOCITY = 3000f 37 | private const val MIN_VELOCITY = -MAX_VELOCITY 38 | -- 39 | 2.47.0 40 | 41 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_frameworks_base/0014-Fix-brightness-range-not-being-complete-on-Samsung-d.patch: -------------------------------------------------------------------------------- 1 | From e59e6b83921f4094f154fb721c75b86cf863d471 Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Tue, 29 Sep 2020 22:40:10 +0200 4 | Subject: [PATCH 14/54] Fix brightness range not being complete on Samsung 5 | devices 6 | 7 | On some devices, minimum brightness is 0, which totally messes with 8 | Brightness computations (minimum float brightness becomes -1.0 instead 9 | of 0.0...). 10 | Cheat and have them report 1 as minimum instead, which fixes the slope 11 | 12 | Change-Id: I4d97cbc32490949e83272b81ec6320a5483310b1 13 | --- 14 | .../java/com/android/server/power/PowerManagerService.java | 6 ++++-- 15 | 1 file changed, 4 insertions(+), 2 deletions(-) 16 | 17 | diff --git a/services/core/java/com/android/server/power/PowerManagerService.java b/services/core/java/com/android/server/power/PowerManagerService.java 18 | index a172de0bb0ff..4244c03d8744 100644 19 | --- a/services/core/java/com/android/server/power/PowerManagerService.java 20 | +++ b/services/core/java/com/android/server/power/PowerManagerService.java 21 | @@ -1203,9 +1203,11 @@ public final class PowerManagerService extends SystemService 22 | 23 | if (min == INVALID_BRIGHTNESS_IN_CONFIG || max == INVALID_BRIGHTNESS_IN_CONFIG 24 | || def == INVALID_BRIGHTNESS_IN_CONFIG) { 25 | + int correctedMin = mContext.getResources().getInteger(com.android.internal.R.integer 26 | + .config_screenBrightnessSettingMinimum); 27 | + if(correctedMin == 0) correctedMin = 1; 28 | mScreenBrightnessMinimum = BrightnessSynchronizer.brightnessIntToFloat( 29 | - mContext.getResources().getInteger(com.android.internal.R.integer 30 | - .config_screenBrightnessSettingMinimum)); 31 | + correctedMin); 32 | mScreenBrightnessMaximum = BrightnessSynchronizer.brightnessIntToFloat( 33 | mContext.getResources().getInteger(com.android.internal.R.integer 34 | .config_screenBrightnessSettingMaximum)); 35 | -- 36 | 2.34.1 37 | 38 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_frameworks_base/0001-Disable-vendor-mismatch-warning.patch: -------------------------------------------------------------------------------- 1 | From 3e59ead9ac716dcdea0b9c0a9d7c966bca637de2 Mon Sep 17 00:00:00 2001 2 | From: Andy CrossGate Yan 3 | Date: Thu, 5 Apr 2018 10:01:19 +0800 4 | Subject: [PATCH 01/54] Disable vendor mismatch warning 5 | 6 | Change-Id: Ieb8fe91e2f02462f074312ed0f4885d183e9780b 7 | --- 8 | .../server/wm/ActivityTaskManagerService.java | 14 +------------- 9 | 1 file changed, 1 insertion(+), 13 deletions(-) 10 | 11 | diff --git a/services/core/java/com/android/server/wm/ActivityTaskManagerService.java b/services/core/java/com/android/server/wm/ActivityTaskManagerService.java 12 | index e283f3e8ef0e..ee9b04829617 100644 13 | --- a/services/core/java/com/android/server/wm/ActivityTaskManagerService.java 14 | +++ b/services/core/java/com/android/server/wm/ActivityTaskManagerService.java 15 | @@ -6290,19 +6290,7 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { 16 | 17 | if (!isBuildConsistent) { 18 | Slog.e(TAG, "Build fingerprint is not consistent, warning user"); 19 | - mUiHandler.post(() -> { 20 | - if (mShowDialogs) { 21 | - AlertDialog d = new BaseErrorDialog(mUiContext); 22 | - d.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ERROR); 23 | - d.setCancelable(false); 24 | - d.setTitle(mUiContext.getText(R.string.android_system_label)); 25 | - d.setMessage(mUiContext.getText(R.string.system_error_manufacturer)); 26 | - d.setButton(DialogInterface.BUTTON_POSITIVE, 27 | - mUiContext.getText(R.string.ok), 28 | - mUiHandler.obtainMessage(DISMISS_DIALOG_UI_MSG, d)); 29 | - d.show(); 30 | - } 31 | - }); 32 | + // Do not emit warning about vendor mismatch 33 | } 34 | } 35 | Trace.traceEnd(TRACE_TAG_WINDOW_MANAGER); 36 | -- 37 | 2.34.1 38 | 39 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_frameworks_av/0020-audiopolicy-Fix-broken-mic-while-video-recording-on-.patch: -------------------------------------------------------------------------------- 1 | From 969a349c2da0dd42f7f2064d1bbce0845c9fb052 Mon Sep 17 00:00:00 2001 2 | From: Alberto Ponces 3 | Date: Sun, 30 Apr 2023 23:29:04 +0100 4 | Subject: [PATCH 20/24] audiopolicy: Fix broken mic while video recording on 5 | some Exynos devices 6 | 7 | This should fix https://github.com/phhusson/treble_experimentations/issues/2021 and https://github.com/phhusson/treble_experimentations/issues/2384. 8 | Credits to @haridhayal11. 9 | --- 10 | .../common/managerdefinitions/src/Serializer.cpp | 7 +++++++ 11 | 1 file changed, 7 insertions(+) 12 | 13 | diff --git a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp 14 | index b9f71cc42b..77a96b47a4 100644 15 | --- a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp 16 | +++ b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp 17 | @@ -662,6 +662,9 @@ std::variant PolicySerializer::deserializesetSink(sink); 20 | 21 | + // This fixes broken mic while video record on some Exynos devices 22 | + bool disableBackMic = property_get_bool("persist.sys.phh.disable_back_mic", false); 23 | + 24 | std::string sourcesAttr = getXmlAttribute(cur, Attributes::sources); 25 | if (sourcesAttr.empty()) { 26 | ALOGE("%s: No %s found", __func__, Attributes::sources); 27 | @@ -678,6 +681,10 @@ std::variant PolicySerializer::deserializefindPortByTagName(trim(devTag)); 30 | } 31 | + if (disableBackMic && strcmp(devTag, "Built-In Back Mic") == 0) { 32 | + ALOGW("Skipping route source \"%s\" as it breaks video recording mic", devTag); 33 | + source = NULL; 34 | + } 35 | if (source == NULL) { 36 | if (false && !mIgnoreVendorExtensions) { 37 | ALOGE("%s: no source found with name \"%s\"", __func__, devTag); 38 | -- 39 | 2.34.1 40 | 41 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_frameworks_base/0005-Don-t-crash-if-there-is-IR-HAL-is-not-declared.patch: -------------------------------------------------------------------------------- 1 | From 269a11d58455c9cf084af39046dd81c9d03de36b Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Thu, 17 May 2018 20:28:35 +0200 4 | Subject: [PATCH 05/54] Don't crash if there is IR HAL is not declared 5 | 6 | Change-Id: I3afded27441bbee8244d5fda544b3e6d1238dc1b 7 | --- 8 | .../core/java/com/android/server/ConsumerIrService.java | 8 -------- 9 | .../core/jni/com_android_server_ConsumerIrService.cpp | 2 +- 10 | 2 files changed, 1 insertion(+), 9 deletions(-) 11 | 12 | diff --git a/services/core/java/com/android/server/ConsumerIrService.java b/services/core/java/com/android/server/ConsumerIrService.java 13 | index ee6d808aa549..be8e2bb95ece 100644 14 | --- a/services/core/java/com/android/server/ConsumerIrService.java 15 | +++ b/services/core/java/com/android/server/ConsumerIrService.java 16 | @@ -53,14 +53,6 @@ public class ConsumerIrService extends IConsumerIrService.Stub { 17 | mWakeLock.setReferenceCounted(true); 18 | 19 | mHasNativeHal = getHalService(); 20 | - 21 | - if (mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_CONSUMER_IR)) { 22 | - if (!mHasNativeHal) { 23 | - throw new RuntimeException("FEATURE_CONSUMER_IR present, but no IR HAL loaded!"); 24 | - } 25 | - } else if (mHasNativeHal) { 26 | - throw new RuntimeException("IR HAL present, but FEATURE_CONSUMER_IR is not set!"); 27 | - } 28 | } 29 | 30 | @Override 31 | diff --git a/services/core/jni/com_android_server_ConsumerIrService.cpp b/services/core/jni/com_android_server_ConsumerIrService.cpp 32 | index 63daa3503bd5..d068ec06fc14 100644 33 | --- a/services/core/jni/com_android_server_ConsumerIrService.cpp 34 | +++ b/services/core/jni/com_android_server_ConsumerIrService.cpp 35 | @@ -36,7 +36,7 @@ static sp mHal; 36 | 37 | static jboolean getHidlHalService(JNIEnv * /* env */, jobject /* obj */) { 38 | // TODO(b/31632518) 39 | - mHal = IConsumerIr::getService(); 40 | + mHal = IConsumerIr::tryGetService(); 41 | return mHal != nullptr; 42 | } 43 | 44 | -- 45 | 2.34.1 46 | 47 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_system_core/0026-Flattened-apexes-no-longer-exist-we-ll-deal-with-it-.patch: -------------------------------------------------------------------------------- 1 | From 31c5deb1b46d3a9e746f7f6536191e3ff5f28ddb Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Tue, 2 Apr 2024 16:53:08 -0400 4 | Subject: [PATCH 26/26] Flattened apexes no longer exist, we'll deal with it 5 | another way 6 | 7 | --- 8 | init/property_service.cpp | 22 +--------------------- 9 | 1 file changed, 1 insertion(+), 21 deletions(-) 10 | 11 | diff --git a/init/property_service.cpp b/init/property_service.cpp 12 | index 0c12512e0..be6ccaad3 100644 13 | --- a/init/property_service.cpp 14 | +++ b/init/property_service.cpp 15 | @@ -706,26 +706,6 @@ uint32_t InitPropertySet(const std::string& name, const std::string& value) { 16 | static Result load_properties_from_file(const char*, const char*, 17 | std::map*); 18 | 19 | -static bool kernel_supports_capex() { 20 | - //Put a threshold at >= 5.0 21 | - struct utsname buf; 22 | - uname(&buf); 23 | - const char *where = buf.release; 24 | - int a = atoi(where); 25 | - if(a >= 5) return true; 26 | - 27 | - // If there are vendor apexes, we most likely actually need them 28 | - auto dir = std::unique_ptr{opendir("/vendor/apex"), closedir}; 29 | - if (!dir) { 30 | - return false; 31 | - } 32 | - for (struct dirent* ent = readdir(dir.get()); ent; ent = readdir(dir.get())) { 33 | - if(strstr(ent->d_name, "apex")) return true; 34 | - } 35 | - 36 | - return false; 37 | -} 38 | - 39 | /* 40 | * Filter is used to decide which properties to load: NULL loads all keys, 41 | * "ro.foo.*" is a prefix match, and "ro.foo.bar" is an exact match. 42 | @@ -821,7 +801,7 @@ static void LoadProperties(char* data, const char* filter, const char* filename, 43 | const char *new_value = value; 44 | 45 | if(strcmp("ro.apex.updatable", key) == 0) { 46 | - new_value = kernel_supports_capex() ? "true" : "false"; 47 | + new_value = "true"; 48 | } 49 | if (it == properties->end()) { 50 | (*properties)[key] = new_value; 51 | -- 52 | 2.34.1 53 | 54 | -------------------------------------------------------------------------------- /patches/personal/platform_frameworks_base/0005-Allow-to-disable-expanded-media-player.patch: -------------------------------------------------------------------------------- 1 | From 93f8d2c8606d1cd40cbf1bc64763a4b966275d7e Mon Sep 17 00:00:00 2001 2 | From: minaripenguin 3 | Date: Sun, 4 Aug 2024 14:15:07 -0300 4 | Subject: [PATCH 05/31] Allow to disable expanded media player 5 | 6 | --- 7 | .../media/controls/ui/controller/MediaViewController.kt | 7 ++++++- 8 | 1 file changed, 6 insertions(+), 1 deletion(-) 9 | 10 | diff --git a/packages/SystemUI/src/com/android/systemui/media/controls/ui/controller/MediaViewController.kt b/packages/SystemUI/src/com/android/systemui/media/controls/ui/controller/MediaViewController.kt 11 | index ad7990b9..816a9e78 100644 12 | --- a/packages/SystemUI/src/com/android/systemui/media/controls/ui/controller/MediaViewController.kt 13 | +++ b/packages/SystemUI/src/com/android/systemui/media/controls/ui/controller/MediaViewController.kt 14 | @@ -18,6 +18,8 @@ package com.android.systemui.media.controls.ui.controller 15 | 16 | import android.content.Context 17 | import android.content.res.Configuration 18 | +import android.os.UserHandle 19 | +import android.provider.Settings 20 | import androidx.annotation.VisibleForTesting 21 | import androidx.constraintlayout.widget.ConstraintSet 22 | import androidx.constraintlayout.widget.ConstraintSet.MATCH_CONSTRAINT 23 | @@ -130,6 +132,9 @@ constructor( 24 | return transitionLayout?.translationY ?: 0.0f 25 | } 26 | 27 | + private val isCompactMode: Boolean = Settings.System.getIntForUser(context.contentResolver, 28 | + "qs_compact_media_player_mode", 1, UserHandle.USER_CURRENT) != 0 29 | + 30 | /** A callback for config changes */ 31 | private val configurationListener = 32 | object : ConfigurationController.ConfigurationListener { 33 | @@ -269,7 +274,7 @@ constructor( 34 | 35 | /** Get the constraintSet for a given expansion */ 36 | private fun constraintSetForExpansion(expansion: Float): ConstraintSet = 37 | - if (expansion > 0) expandedLayout else collapsedLayout 38 | + if (isCompactMode) collapsedLayout else expandedLayout 39 | 40 | /** Set the height of UMO background constraints. */ 41 | private fun setBackgroundHeights(height: Int) { 42 | -- 43 | 2.47.0 44 | 45 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_frameworks_av/0010-Add-a-property-to-force-camera-timestamp-source.patch: -------------------------------------------------------------------------------- 1 | From 4c3ab05d71508d747713809a6905ac8694091226 Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Tue, 19 May 2020 14:01:14 +0200 4 | Subject: [PATCH 10/24] Add a property to force camera timestamp source 5 | 6 | Some devices wrongly report their timesource 7 | Camera's timesource can either be CLOCK_MONOTONIC, or CLOCK_BOOTTIME 8 | The former doesn't increment in sleep, while the later does. 9 | There is a camera HAL property for that, though some devices don't 10 | report it properly. 11 | 12 | This issue happens on Xiaomi Redmi 7A, it needs to force the value to 1 13 | 14 | Add a property persist.sys.phh.camera.force_timestampsource to force 15 | timestamp source. 16 | --- 17 | .../libcameraservice/device3/Camera3Device.cpp | 12 ++++++++++-- 18 | 1 file changed, 10 insertions(+), 2 deletions(-) 19 | 20 | diff --git a/services/camera/libcameraservice/device3/Camera3Device.cpp b/services/camera/libcameraservice/device3/Camera3Device.cpp 21 | index 9792089009..abc3f8f084 100644 22 | --- a/services/camera/libcameraservice/device3/Camera3Device.cpp 23 | +++ b/services/camera/libcameraservice/device3/Camera3Device.cpp 24 | @@ -209,8 +209,16 @@ status_t Camera3Device::initializeCommonLocked() { 25 | mTimestampOffset = getMonoToBoottimeOffset(); 26 | camera_metadata_entry timestampSource = 27 | mDeviceInfo.find(ANDROID_SENSOR_INFO_TIMESTAMP_SOURCE); 28 | - if (timestampSource.count > 0 && timestampSource.data.u8[0] == 29 | - ANDROID_SENSOR_INFO_TIMESTAMP_SOURCE_REALTIME) { 30 | + int timestampSourceValue = 0; 31 | + if ((timestampSource.count > 0 && timestampSource.data.u8[0] == 32 | + ANDROID_SENSOR_INFO_TIMESTAMP_SOURCE_REALTIME)) { 33 | + timestampSourceValue = 1; 34 | + } 35 | + int forceTimestampSource = property_get_int32("persist.sys.phh.camera.force_timestampsource", -1); 36 | + //Don't override if it's -1, default value 37 | + if(forceTimestampSource == 0) timestampSourceValue = 0; 38 | + if(forceTimestampSource == 1) timestampSourceValue = 1; 39 | + if (timestampSourceValue == 1) { 40 | mDeviceTimeBaseIsRealtime = true; 41 | } 42 | 43 | -- 44 | 2.34.1 45 | 46 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_frameworks_base/0021-Automatically-detect-pick-up-sensor-so-that-an-overl.patch: -------------------------------------------------------------------------------- 1 | From bd0c7445a8e30b1834f167e8fb6844c5eaedf2dc Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Sat, 20 Mar 2021 14:31:01 +0100 4 | Subject: [PATCH 21/54] Automatically detect pick up sensor, so that an overlay 5 | is required for the sole purpose of enabling pulse doze on pick up sensor 6 | 7 | --- 8 | .../display/AmbientDisplayConfiguration.java | 19 +++++++++++++++++-- 9 | 1 file changed, 17 insertions(+), 2 deletions(-) 10 | 11 | diff --git a/core/java/android/hardware/display/AmbientDisplayConfiguration.java b/core/java/android/hardware/display/AmbientDisplayConfiguration.java 12 | index 47541ca16cda..28168b9208f5 100644 13 | --- a/core/java/android/hardware/display/AmbientDisplayConfiguration.java 14 | +++ b/core/java/android/hardware/display/AmbientDisplayConfiguration.java 15 | @@ -25,6 +25,9 @@ import android.text.TextUtils; 16 | import android.util.ArrayMap; 17 | import android.util.SparseArray; 18 | 19 | +import android.hardware.SensorManager; 20 | +import android.hardware.Sensor; 21 | + 22 | import com.android.internal.R; 23 | import com.android.internal.util.ArrayUtils; 24 | 25 | @@ -105,8 +108,20 @@ public class AmbientDisplayConfiguration { 26 | 27 | /** @hide */ 28 | public boolean dozePickupSensorAvailable() { 29 | - return mContext.getResources().getBoolean(R.bool.config_dozePulsePickup); 30 | - } 31 | + SensorManager sm = mContext.getSystemService(SensorManager.class); 32 | + boolean found = false; 33 | + if(sm == null) { 34 | + android.util.Log.d("PHH", "Failed getting sensor manager, can't detect pickup sensor"); 35 | + } else { 36 | + java.util.List sensors = sm.getSensorList(Sensor.TYPE_ALL); 37 | + for(Sensor s : sensors) { 38 | + if(Sensor.STRING_TYPE_PICK_UP_GESTURE.equals(s.getStringType())) { 39 | + found = true; 40 | + break; 41 | + } 42 | + } 43 | + } 44 | + return mContext.getResources().getBoolean(R.bool.config_dozePulsePickup) || found; } 45 | 46 | /** @hide */ 47 | public boolean tapGestureEnabled(int user) { 48 | -- 49 | 2.34.1 50 | 51 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_frameworks_base/0008-Re-order-services-so-that-it-works-even-without-qtag.patch: -------------------------------------------------------------------------------- 1 | From fac85e674d35e50ac18cd1cfdc185dd519d78765 Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Thu, 8 Nov 2018 23:04:03 +0100 4 | Subject: [PATCH 08/54] Re-order services so that it works even without qtaguid 5 | 6 | Change-Id: I0c0f527b3ae151d45c68f7ac6c205da3f34e74df 7 | --- 8 | .../android/server/net/NetworkPolicyManagerService.java | 8 ++++---- 9 | 1 file changed, 4 insertions(+), 4 deletions(-) 10 | 11 | diff --git a/services/core/java/com/android/server/net/NetworkPolicyManagerService.java b/services/core/java/com/android/server/net/NetworkPolicyManagerService.java 12 | index 18b495bfce5d..2aa005528859 100644 13 | --- a/services/core/java/com/android/server/net/NetworkPolicyManagerService.java 14 | +++ b/services/core/java/com/android/server/net/NetworkPolicyManagerService.java 15 | @@ -986,6 +986,10 @@ public class NetworkPolicyManagerService extends INetworkPolicyManager.Stub { 16 | Trace.traceBegin(Trace.TRACE_TAG_NETWORK, "systemReady"); 17 | final int oldPriority = Process.getThreadPriority(Process.myTid()); 18 | try { 19 | + mUsageStats = LocalServices.getService(UsageStatsManagerInternal.class); 20 | + mAppStandby = LocalServices.getService(AppStandbyInternal.class); 21 | + mActivityManagerInternal = LocalServices.getService(ActivityManagerInternal.class); 22 | + 23 | // Boost thread's priority during system server init 24 | Process.setThreadPriority(Process.THREAD_PRIORITY_FOREGROUND); 25 | if (!isBandwidthControlEnabled()) { 26 | @@ -993,10 +997,6 @@ public class NetworkPolicyManagerService extends INetworkPolicyManager.Stub { 27 | return; 28 | } 29 | 30 | - mUsageStats = LocalServices.getService(UsageStatsManagerInternal.class); 31 | - mAppStandby = LocalServices.getService(AppStandbyInternal.class); 32 | - mActivityManagerInternal = LocalServices.getService(ActivityManagerInternal.class); 33 | - 34 | synchronized (mUidRulesFirstLock) { 35 | synchronized (mNetworkPoliciesSecondLock) { 36 | updatePowerSaveAllowlistUL(); 37 | -- 38 | 2.34.1 39 | 40 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_frameworks_av/0008-There-are-three-SCO-devices.-Fallback-from-one-to-th.patch: -------------------------------------------------------------------------------- 1 | From d9af5eff09ab05b8c81c52077e1017ef0c381aab Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Mon, 13 Apr 2020 21:01:16 +0200 4 | Subject: [PATCH 08/24] There are three SCO devices. Fallback from one to the 5 | others if needed 6 | 7 | Change-Id: I414dcb6b154855c00cb8520b23dc1069827864b2 8 | --- 9 | .../managerdefinitions/src/HwModule.cpp | 21 +++++++++++++++++++ 10 | 1 file changed, 21 insertions(+) 11 | 12 | diff --git a/services/audiopolicy/common/managerdefinitions/src/HwModule.cpp b/services/audiopolicy/common/managerdefinitions/src/HwModule.cpp 13 | index 6696b45f03..3ea185d873 100644 14 | --- a/services/audiopolicy/common/managerdefinitions/src/HwModule.cpp 15 | +++ b/services/audiopolicy/common/managerdefinitions/src/HwModule.cpp 16 | @@ -321,6 +321,27 @@ sp HwModuleCollection::getModuleForDeviceType(audio_devices_t type, 17 | } 18 | } 19 | } 20 | + //We didn't find one? Ok but all SCOs are equivalent surely? 21 | + if(type == AUDIO_DEVICE_OUT_BLUETOOTH_SCO || 22 | + type == AUDIO_DEVICE_OUT_BLUETOOTH_SCO_HEADSET || 23 | + type == AUDIO_DEVICE_OUT_BLUETOOTH_SCO_CARKIT) { 24 | + ALOGE("Fallback SCO"); 25 | + if(type != AUDIO_DEVICE_OUT_BLUETOOTH_SCO) { 26 | + auto ret = getModuleForDeviceType(AUDIO_DEVICE_OUT_BLUETOOTH_SCO, encodedFormat); 27 | + ALOGE("Fallback SCO simple? %s", (ret != nullptr) ? "yes" : "no"); 28 | + if(ret != nullptr) return ret; 29 | + } 30 | + if(type != AUDIO_DEVICE_OUT_BLUETOOTH_SCO_HEADSET) { 31 | + auto ret = getModuleForDeviceType(AUDIO_DEVICE_OUT_BLUETOOTH_SCO_HEADSET, encodedFormat); 32 | + ALOGE("Fallback SCO headset? %s", (ret != nullptr) ? "yes" : "no"); 33 | + if(ret != nullptr) return ret; 34 | + } 35 | + if(type != AUDIO_DEVICE_OUT_BLUETOOTH_SCO_CARKIT) { 36 | + auto ret = getModuleForDeviceType(AUDIO_DEVICE_OUT_BLUETOOTH_SCO_CARKIT, encodedFormat); 37 | + ALOGE("Fallback SCO carkit? %s", (ret != nullptr) ? "yes" : "no"); 38 | + if(ret != nullptr) return ret; 39 | + } 40 | + } 41 | return nullptr; 42 | } 43 | 44 | -- 45 | 2.34.1 46 | 47 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_frameworks_opt_telephony/0004-Reintroduce-public-void-TelephonyMetrics.writeRilSen.patch: -------------------------------------------------------------------------------- 1 | From 68b31d894f3898314b118b21d633b27a75a47ad4 Mon Sep 17 00:00:00 2001 2 | From: ironydelerium <42721860+ironydelerium@users.noreply.github.com> 3 | Date: Fri, 31 Dec 2021 02:20:28 -0800 4 | Subject: [PATCH 04/16] Reintroduce 'public void 5 | TelephonyMetrics.writeRilSendSms(int, int, int, int)'. (#8) 6 | 7 | The MediaTek IMS package for Android Q, at the very least (likely for the rest, too) 8 | invoke this method in their `sendSms` method; Google, in their infinite wisdom, 9 | decided that this method needed a message ID passed in as well, changing the signature 10 | to 'public void TelephonyMetrics.writeRilSendSms(int, int, int, int, long)' and resulting 11 | in a MethodNotFoundException being raised in com.mediatek.ims, crashing it. 12 | 13 | Fixes https://github.com/phhusson/treble_experimentations/issues/2125. 14 | 15 | Co-authored-by: Sarah Vandomelen 16 | --- 17 | .../telephony/metrics/TelephonyMetrics.java | 13 +++++++++++++ 18 | 1 file changed, 13 insertions(+) 19 | 20 | diff --git a/src/java/com/android/internal/telephony/metrics/TelephonyMetrics.java b/src/java/com/android/internal/telephony/metrics/TelephonyMetrics.java 21 | index 3fdbfe0ed7..fb8011c3df 100644 22 | --- a/src/java/com/android/internal/telephony/metrics/TelephonyMetrics.java 23 | +++ b/src/java/com/android/internal/telephony/metrics/TelephonyMetrics.java 24 | @@ -2320,6 +2320,19 @@ public class TelephonyMetrics { 25 | smsSession.increaseExpectedResponse(); 26 | } 27 | 28 | + /** 29 | + * Write Send SMS event (backwards-compatible method for R and earlier IMS implementations) 30 | + * 31 | + * @param phoneId Phone id 32 | + * @param rilSerial RIL request serial number 33 | + * @param tech SMS RAT 34 | + * @param format SMS format. Either {@link SmsMessage#FORMAT_3GPP} or 35 | + * {@link SmsMessage#FORMAT_3GPP2}. 36 | + */ 37 | + public void writeRilSendSms(int phoneId, int rilSerial, int tech, int format) { 38 | + writeRilSendSms(phoneId, rilSerial, tech, format, 0); 39 | + } 40 | + 41 | /** 42 | * Write Send SMS event using ImsService. Expecting response from 43 | * {@link #writeOnSmsSolicitedResponse}. 44 | -- 45 | 2.34.1 46 | 47 | -------------------------------------------------------------------------------- /patches/personal/platform_packages_apps_SuperiorLab/0001-Android-P-animations.patch: -------------------------------------------------------------------------------- 1 | From 338c10896d1435e6ad10f4af6bdc245da976204c Mon Sep 17 00:00:00 2001 2 | From: ChonDoit 3 | Date: Tue, 27 Aug 2024 12:46:51 -0300 4 | Subject: [PATCH 01/14] Android P animations 5 | 6 | --- 7 | res/values/custom_strings.xml | 12 ++++++++++++ 8 | res/xml/superior_lab_misc.xml | 8 +++++++- 9 | 2 files changed, 19 insertions(+), 1 deletion(-) 10 | create mode 100644 res/values/custom_strings.xml 11 | 12 | diff --git a/res/values/custom_strings.xml b/res/values/custom_strings.xml 13 | new file mode 100644 14 | index 0000000..bcd374f 15 | --- /dev/null 16 | +++ b/res/values/custom_strings.xml 17 | @@ -0,0 +1,12 @@ 18 | + 19 | + 23 | + 24 | + 25 | + 26 | + Android P animation style 27 | + Enable Android P \"Default\" animations 28 | + 29 | + 30 | diff --git a/res/xml/superior_lab_misc.xml b/res/xml/superior_lab_misc.xml 31 | index d0f2f77..4411e31 100644 32 | --- a/res/xml/superior_lab_misc.xml 33 | +++ b/res/xml/superior_lab_misc.xml 34 | @@ -11,6 +11,12 @@ 35 | 37 | 38 | + 43 | + 44 | 50 | 51 | - 52 | \ No newline at end of file 53 | + 54 | -- 55 | 2.47.0 56 | 57 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_frameworks_av/0019-voip-Fix-high-pitched-voice-on-Qualcomm-devices.patch: -------------------------------------------------------------------------------- 1 | From 4f10be516e736e271a2cd57d50dbffa625f20c1f Mon Sep 17 00:00:00 2001 2 | From: ponces 3 | Date: Mon, 24 Oct 2022 09:38:34 +0100 4 | Subject: [PATCH 19/24] voip: Fix high pitched voice on Qualcomm devices 5 | 6 | --- 7 | .../common/managerdefinitions/src/Serializer.cpp | 9 +++++++++ 8 | 1 file changed, 9 insertions(+) 9 | 10 | diff --git a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp 11 | index 146c78b8f6..b9f71cc42b 100644 12 | --- a/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp 13 | +++ b/services/audiopolicy/common/managerdefinitions/src/Serializer.cpp 14 | @@ -252,6 +252,7 @@ private: 15 | std::string mChannelMasksSeparator = ","; 16 | std::string mSamplingRatesSeparator = ","; 17 | std::string mFlagsSeparator = "|"; 18 | + std::string mMixPortName = ""; 19 | 20 | // Children: ModulesTraits, VolumeTraits, SurroundSoundTraits (optional) 21 | }; 22 | @@ -436,6 +437,13 @@ PolicySerializer::deserialize( 23 | channelsMask = channelMasksFromString("AUDIO_CHANNEL_OUT_MONO", ","); 24 | } 25 | 26 | + // This breaks in-game voice chat and audio in some messaging apps causing it to play with a higher pitch and speed 27 | + bool disableStereoVoip = property_get_bool("persist.sys.phh.disable_stereo_voip", false); 28 | + if (disableStereoVoip && mMixPortName == "voip_rx") { 29 | + ALOGI("%s: disabling stereo support on voip_rx", __func__); 30 | + channelsMask = channelMasksFromString("AUDIO_CHANNEL_OUT_MONO", ","); 31 | + } 32 | + 33 | if (mIgnoreVendorExtensions && maybeVendorExtension(format)) { 34 | ALOGI("%s: vendor extension format \"%s\" skipped", __func__, format.c_str()); 35 | return NO_INIT; 36 | @@ -458,6 +466,7 @@ std::variant PolicySerializer::deserialize 3 | Date: Mon, 2 May 2022 17:44:28 -0400 4 | Subject: [PATCH 2/4] Ignore cancelled fingerprint events, they are expected, 5 | plus add more fingerprint enroll logs 6 | 7 | --- 8 | .../biometrics/fingerprint/FingerprintEnrollEnrolling.java | 3 +++ 9 | .../biometrics/fingerprint/FingerprintEnrollFindSensor.java | 1 + 10 | 2 files changed, 4 insertions(+) 11 | 12 | diff --git a/src/com/android/settings/biometrics/fingerprint/FingerprintEnrollEnrolling.java b/src/com/android/settings/biometrics/fingerprint/FingerprintEnrollEnrolling.java 13 | index 90b93461b9c..f84cb4d10c5 100644 14 | --- a/src/com/android/settings/biometrics/fingerprint/FingerprintEnrollEnrolling.java 15 | +++ b/src/com/android/settings/biometrics/fingerprint/FingerprintEnrollEnrolling.java 16 | @@ -794,6 +794,9 @@ public class FingerprintEnrollEnrolling extends BiometricsEnrollEnrolling { 17 | 18 | @Override 19 | public void onEnrollmentError(int errMsgId, CharSequence errString) { 20 | + android.util.Log.e("PHH-Enroll", "heyo " + errMsgId + ", " + errString , new Exception()); 21 | + if (errMsgId == 5) return; 22 | + 23 | onCancelEnrollment(errMsgId); 24 | dismissTouchDialogIfSfps(); 25 | } 26 | diff --git a/src/com/android/settings/biometrics/fingerprint/FingerprintEnrollFindSensor.java b/src/com/android/settings/biometrics/fingerprint/FingerprintEnrollFindSensor.java 27 | index 6b7538ae220..366cace6a0a 100644 28 | --- a/src/com/android/settings/biometrics/fingerprint/FingerprintEnrollFindSensor.java 29 | +++ b/src/com/android/settings/biometrics/fingerprint/FingerprintEnrollFindSensor.java 30 | @@ -371,6 +371,7 @@ public class FingerprintEnrollFindSensor extends BiometricEnrollBase implements 31 | 32 | @Override 33 | public void onEnrollmentError(int errMsgId, CharSequence errString) { 34 | + android.util.Log.e("PHH-Enroll", "heyo " + errMsgId + ", " + errString + ", " + mNextClicked, new Exception()); 35 | if (mNextClicked && errMsgId == FingerprintManager.FINGERPRINT_ERROR_CANCELED) { 36 | proceedToEnrolling(false /* cancelEnrollment */); 37 | } else { 38 | -- 39 | 2.34.1 40 | 41 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_frameworks_base/0043-Add-a-prop-to-use-linear-backlight-control.patch: -------------------------------------------------------------------------------- 1 | From 82bdbc47d1b956faf669c33232851a04071fe8f2 Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Mon, 30 Oct 2023 19:25:27 -0400 4 | Subject: [PATCH 43/54] Add a prop to use linear backlight control 5 | 6 | --- 7 | .../settings/brightness/BrightnessController.java | 10 ++++++++-- 8 | 1 file changed, 8 insertions(+), 2 deletions(-) 9 | 10 | diff --git a/packages/SystemUI/src/com/android/systemui/settings/brightness/BrightnessController.java b/packages/SystemUI/src/com/android/systemui/settings/brightness/BrightnessController.java 11 | index e92630fc67a2..7080e18e4223 100644 12 | --- a/packages/SystemUI/src/com/android/systemui/settings/brightness/BrightnessController.java 13 | +++ b/packages/SystemUI/src/com/android/systemui/settings/brightness/BrightnessController.java 14 | @@ -346,9 +346,15 @@ public class BrightnessController implements ToggleSlider.Listener, MirroredBrig 15 | : MetricsEvent.ACTION_BRIGHTNESS; 16 | minBacklight = mBrightnessMin; 17 | maxBacklight = mBrightnessMax; 18 | - final float valFloat = MathUtils.min( 19 | + float valFloat = MathUtils.min( 20 | convertGammaToLinearFloat(value, minBacklight, maxBacklight), 21 | maxBacklight); 22 | + if (android.os.SystemProperties.getBoolean("persist.sys.phh.linear_brightness", false)) { 23 | + android.util.Log.e("PHH", "Linear brightness val " + value + " from " + minBacklight + " to " + maxBacklight + " makes " + valFloat); 24 | + valFloat = value / 65536.0f; 25 | + } 26 | + final float finalValFloat = valFloat; 27 | + 28 | if (stopTracking) { 29 | // TODO(brightnessfloat): change to use float value instead. 30 | MetricsLogger.action(mContext, metric, 31 | @@ -359,7 +365,7 @@ public class BrightnessController implements ToggleSlider.Listener, MirroredBrig 32 | if (!tracking) { 33 | AsyncTask.execute(new Runnable() { 34 | public void run() { 35 | - mDisplayManager.setBrightness(mDisplayId, valFloat); 36 | + mDisplayManager.setBrightness(mDisplayId, finalValFloat); 37 | } 38 | }); 39 | } 40 | -- 41 | 2.34.1 42 | 43 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_system_bpf/0001-Support-no-bpf-usecase.patch: -------------------------------------------------------------------------------- 1 | From 2f853166adea13064fffb903a95c53ce79695a30 Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Wed, 13 Oct 2021 10:56:52 -0400 4 | Subject: [PATCH 1/3] Support no-bpf usecase 5 | 6 | Change-Id: I75a427a2a41aa4ab1104ad88a891bef0dc2d9c91 7 | --- 8 | bpfloader/BpfLoader.cpp | 20 ++++++++++++-------- 9 | 1 file changed, 12 insertions(+), 8 deletions(-) 10 | 11 | diff --git a/bpfloader/BpfLoader.cpp b/bpfloader/BpfLoader.cpp 12 | index 08fd72d..07bf6f3 100644 13 | --- a/bpfloader/BpfLoader.cpp 14 | +++ b/bpfloader/BpfLoader.cpp 15 | @@ -196,19 +196,15 @@ int main(int argc, char** argv) { 16 | // which could otherwise fail with ENOENT during object pinning or renaming, 17 | // due to ordering issues) 18 | for (const auto& location : locations) { 19 | - if (createSysFsBpfSubDir(location.prefix)) return 1; 20 | + if (createSysFsBpfSubDir(location.prefix)) { 21 | + goto fail; 22 | + } 23 | } 24 | 25 | // Load all ELF objects, create programs and maps, and pin them 26 | for (const auto& location : locations) { 27 | if (loadAllElfObjects(location) != 0) { 28 | - ALOGE("=== CRITICAL FAILURE LOADING BPF PROGRAMS FROM %s ===", location.dir); 29 | - ALOGE("If this triggers reliably, you're probably missing kernel options or patches."); 30 | - ALOGE("If this triggers randomly, you might be hitting some memory allocation " 31 | - "problems or startup script race."); 32 | - ALOGE("--- DO NOT EXPECT SYSTEM TO BOOT SUCCESSFULLY ---"); 33 | - sleep(20); 34 | - return 2; 35 | + goto fail; 36 | } 37 | } 38 | 39 | @@ -217,5 +213,13 @@ int main(int argc, char** argv) { 40 | return 1; 41 | } 42 | 43 | + return 0; 44 | +fail: 45 | + ALOGE("=== CRITICAL FAILURE LOADING BPF PROGRAMS ==="); 46 | + ALOGE("If this triggers reliably, you're probably missing kernel options or patches."); 47 | + ALOGE("If this triggers randomly, you might be hitting some memory allocation " 48 | + "problems or startup script race."); 49 | + ALOGE("--- DO NOT EXPECT SYSTEM TO BOOT SUCCESSFULLY ---"); 50 | + android::base::SetProperty("bpf.progs_loaded", "1"); 51 | return 0; 52 | } 53 | -- 54 | 2.34.1 55 | 56 | --------------------------------------------------------------------------------