├── .github ├── ISSUE_TEMPLATE │ └── config.yml └── workflows │ ├── build.yml │ ├── release.yml │ └── sync.yml ├── patch.sh ├── patches ├── personal │ ├── platform_build │ │ ├── 0001-Remove-su-from-vanilla-builds.patch │ │ └── 0002-product-Exclude-AOSP-apn-list-on-custom-builds.patch │ ├── device_phh_treble │ │ └── 0001-Import-vendor-gapps.patch │ ├── platform_packages_apps_ThemePicker │ │ ├── 0002-Specify-we-read-and-write-launcher-settings.patch │ │ └── 0001-ThemePicker-Override-WallpaperCropper.patch │ ├── platform_packages_apps_Settings │ │ └── 0001-Export-FaceEnrollFinish-activity-to-Sense.patch │ ├── platform_packages_apps_Launcher3 │ │ ├── 0002-Disable-QSB-on-first-screen-by-default.patch │ │ └── 0003-Properly-expose-GridCustomizationsProvider.patch │ └── platform_frameworks_base │ │ └── 0003-SystemUI-use-Style.SPRITZ-by-default.patch ├── trebledroid │ ├── platform_build │ │ ├── 0003-Include-vndk-v28-sepolicy-support.patch │ │ └── 0002-build-Remove-llkd.patch │ ├── platform_system_linkerconfig │ │ └── 0001-Disable-vndklite-handling.patch │ ├── platform_packages_modules_vndk │ │ ├── 0002-Revert-Remove-VNDK-v28.patch │ │ └── 0001-Revert-Removing-vndk-apex-v29.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_frameworks_base │ │ ├── 0043-Add-Samsung-sysinput.patch │ │ ├── 0009-Support-samsung-Pie-and-Q-light-hal.patch │ │ ├── 0047-Include-vendor.samsung.hardware.radio-V2.2-java-HIDL.patch │ │ ├── 0046-Include-vendor.samsung.hardware.radio.network-V1-jav.patch │ │ ├── 0036-Once-we-integrate-Samsung-Power-hal-in-libpowermanag.patch │ │ ├── 0012-HOME-deserves-to-wake-up-devices-just-as-well-as-bac.patch │ │ ├── 0055-Not-all-kernel-support-splicing-pipes-or-is-it-socke.patch │ │ ├── 0003-Fix-env-empty-string-ANDROID_STORAGE.patch │ │ ├── 0016-Remove-useless-notification-about-console-service-be.patch │ │ ├── 0007-Show-APN-Settings-for-CDMA-carriers.patch │ │ ├── 0013-Some-devices-have-proximity-sensor-reporting-NaN-as-.patch │ │ ├── 0035-Catch-NPE-in-SystemUI.patch │ │ ├── 0024-Allow-disabling-of-fingerprint-cleanups-needed-on-so.patch │ │ ├── 0004-Relax-requirement-for-visible-flag-to-sdcards.patch │ │ ├── 0023-Revert-Switch-long-press-power-behavior-in-AOSP.patch │ │ ├── 0033-Restore-getSimStateForSlotIndex-in-SubscriptionManag.patch │ │ ├── 0011-Always-allow-overriding-the-number-of-work-profiles.patch │ │ ├── 0027-SystemUI-Use-AVCProfileMain-for-screen-recorder.patch │ │ ├── 0019-TelephonyManager-add-API-annotations-for-setTelephon.patch │ │ ├── 0050-Add-a-prop-to-disable-animation-in-for-sysui-media-c.patch │ │ ├── 0002-Fallback-to-stupid-autobrightness-if-brightness-valu.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 │ │ ├── 0025-Dynamically-resize-boot-animation-to-match-screen-si.patch │ │ ├── 0054-HintManagerService-Generate-dummy-mSupportInfo-for-n.patch │ │ ├── 0020-Automatically-detect-pick-up-sensor-so-that-an-overl.patch │ │ ├── 0053-Allow-spoofing-signingInfo-for-microG-Companion-Serv.patch │ │ ├── 0008-Re-order-services-so-that-it-works-even-without-qtag.patch │ │ └── 0052-Add-support-for-treating-virtual-biometric-sensors-a.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 │ │ ├── 0012-Fix-secilc-on-Moto-One-Action.patch │ │ ├── 0009-Allow-sys-vm-watermark_scale_factor-conflict-seen-on.patch │ │ ├── 0011-Fix-conflicting-sepolicy-for-compaction_proactivenes.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_system_bpf │ │ ├── 0001-Support-no-bpf-usecase.patch │ │ ├── 0002-Additional-bpf-less-handling.patch │ │ └── 0003-Prepare-for-the-future-making-bpfloader.rs-fails-all.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 │ │ ├── 0006-MIUI13-devices-hide-their-vibrator-HAL-behind-non-de.patch │ │ ├── 0005-Mark-accelerometer-input-as-sensor-exclusively-if-th.patch │ │ ├── 0002-Matching-an-input-with-a-display-uses-uniqueId.patch │ │ └── 0010-Fix-loading-unnamed-GLES.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 │ │ ├── 0004-Panic-into-recovery-rather-than-bootloader.patch │ │ ├── 0003-init-Do-not-start-console-service-when-debuggable.patch │ │ ├── 0017-Ignore-dm-verity-setup-issues.patch │ │ ├── 0019-Disable-project_quota-on-old-devices-but-new-enough-.patch │ │ ├── 0011-Let-system-override-adb-secure-props-so-we-dont-get-.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 │ │ ├── 0007-Revert-Set-system-xbin-permissions-to-750.patch │ │ ├── 0015-Disable-quotas-on-legacy-devices-with-encryption-dis.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_packages_modules_DnsResolver │ │ └── 0001-Dont-abort-if-the-DnsHelper-failed-to-init-on-BPF-le.patch │ ├── platform_bootable_recovery │ │ └── 0001-Don-t-reboot-if-we-couldn-t-get-bootctrl.patch │ ├── platform_packages_modules_Connectivity │ │ ├── 0007-Revert-netdupdatable-add-back-abort-on-init-fail.patch │ │ ├── 0006-More-bpf-errors-ignore-there-are-some-4.14-without-t.patch │ │ ├── 0005-netd-Remove-4.14-kernel-restrictions.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 │ │ └── 0009-Some-additional-handling-of-bpf-less-device.patch │ ├── platform_packages_modules_Wifi │ │ └── 0001-Add-persist.sys.phh.wifi_disable_sae-property-to-dis.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 │ │ ├── 0005-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 │ │ ├── 0007-When-logging-UiccSlot-ignore-error-if-we-cant-print-.patch │ │ └── 0004-Reintroduce-public-void-TelephonyMetrics.writeRilSen.patch │ ├── platform_frameworks_av │ │ ├── 0015-Not-all-sources-in-a-route-are-valid.-Dont-ignore-th.patch │ │ ├── 0020-Add-a-prop-to-disable-AUDIO_OUTPUT_FLAG_FAST-from-au.patch │ │ ├── 0012-No-longer-make-re-assigning-legacy-audio-groups-fata.patch │ │ ├── 0016-Use-a-fake-volume-policy-when-none-has-been-found.patch │ │ ├── 0019-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 │ │ └── 0018-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_Bluetooth │ │ ├── 0008-gd-hci-Ignore-command-READ_REMOTE_VERSION_INFORMATIO.patch │ │ ├── 0002-Don-t-crash-on-status-UNSUPPORTED_REMOTE_OR_LMP_FEAT.patch │ │ ├── 0003-Add-option-to-change-eSCO-Transport-Unit-Size.patch │ │ └── 0007-Add-a-property-to-cap-declared-le-vendor-version.-Fo.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 └── staging │ └── platform_frameworks_base │ └── 0003-reduce-blur-radius-to-avoid-blur-artifacts.patch ├── README.md ├── config └── ota.json └── sync.sh /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | -------------------------------------------------------------------------------- /patch.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | patches="$(readlink -f -- $1)" 6 | tree="$2" 7 | 8 | for project in $(cd $patches/patches/$tree; echo *); do 9 | p="$(tr _ / <<<$project |sed -e 's;platform/;;g')" 10 | [ "$p" == build ] && p=build/make 11 | [ "$p" == treble/app ] && p=treble_app 12 | [ "$p" == vendor/hardware/overlay ] && p=vendor/hardware_overlay 13 | pushd $p 1>/dev/null 14 | for patch in $patches/patches/$tree/$project/*.patch; do 15 | git am $patch || exit 16 | done 17 | popd 1>/dev/null 18 | done 19 | -------------------------------------------------------------------------------- /patches/personal/platform_build/0001-Remove-su-from-vanilla-builds.patch: -------------------------------------------------------------------------------- 1 | From f4130284d9134668fdcb892f61a22e025d0adbe1 Mon Sep 17 00:00:00 2001 2 | From: Victor Bo 3 | Date: Sat, 14 Dec 2019 23:46:34 +0200 4 | Subject: [PATCH 1/2] Remove su from vanilla builds 5 | 6 | --- 7 | target/product/base_system.mk | 1 - 8 | 1 file changed, 1 deletion(-) 9 | 10 | diff --git a/target/product/base_system.mk b/target/product/base_system.mk 11 | index 5c4ef33284..551510c4d1 100644 12 | --- a/target/product/base_system.mk 13 | +++ b/target/product/base_system.mk 14 | @@ -535,7 +535,6 @@ PRODUCT_PACKAGES_DEBUG := \ 15 | ss \ 16 | start_with_lockagent \ 17 | strace \ 18 | - su \ 19 | sanitizer-status \ 20 | tracepath \ 21 | tracepath6 \ 22 | -- 23 | 2.43.0 24 | 25 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_build/0003-Include-vndk-v28-sepolicy-support.patch: -------------------------------------------------------------------------------- 1 | From 95aaad8650b769a9283074ef2defd7a763af7dcf 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/3] 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 38f3f5b802..8d0c201dc0 100644 12 | --- a/core/config.mk 13 | +++ b/core/config.mk 14 | @@ -874,6 +874,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 := \ 18 | + 28.0 \ 19 | 29.0 \ 20 | 30.0 \ 21 | 31.0 \ 22 | -- 23 | 2.43.0 24 | 25 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_system_linkerconfig/0001-Disable-vndklite-handling.patch: -------------------------------------------------------------------------------- 1 | From 7a3ab3b90a62e19b7917315f1ccca3d2dd84c62c 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.43.0 26 | 27 | -------------------------------------------------------------------------------- /patches/personal/device_phh_treble/0001-Import-vendor-gapps.patch: -------------------------------------------------------------------------------- 1 | From ed3a3f8462d27c6d3b9156554d3cd5cf08375cf0 Mon Sep 17 00:00:00 2001 2 | From: Alberto Ponces 3 | Date: Tue, 21 Feb 2023 22:51:12 +0000 4 | Subject: [PATCH 1/2] Import vendor/gapps 5 | 6 | --- 7 | generate.sh | 2 +- 8 | 1 file changed, 1 insertion(+), 1 deletion(-) 9 | 10 | diff --git a/generate.sh b/generate.sh 11 | index 8f24152..50912a8 100644 12 | --- a/generate.sh 13 | +++ b/generate.sh 14 | @@ -26,7 +26,7 @@ for part in a ab;do 15 | optional_base="" 16 | if [ "$apps" == "gapps" ];then 17 | apps_suffix="g" 18 | - apps_script='$(call inherit-product, device/phh/treble/gapps.mk)' 19 | + apps_script='$(call inherit-product, vendor/gapps/common/common-vendor.mk)' 20 | apps_name="with GApps" 21 | fi 22 | if [ "$apps" == "gapps-go" ];then 23 | -- 24 | 2.43.0 25 | 26 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_packages_modules_vndk/0002-Revert-Remove-VNDK-v28.patch: -------------------------------------------------------------------------------- 1 | From aaefe6673b4b2ffa27fdbf4bfe287c5e43f27825 Mon Sep 17 00:00:00 2001 2 | From: Alberto Ponces 3 | Date: Tue, 25 Mar 2025 22:45:30 +0000 4 | Subject: [PATCH 2/2] Revert "Remove VNDK v28" 5 | 6 | This reverts commit 2c33d53b0d14c9654b361942a916dfe7ed3739db. 7 | --- 8 | apex/Android.bp | 7 +++++++ 9 | 1 file changed, 7 insertions(+) 10 | 11 | diff --git a/apex/Android.bp b/apex/Android.bp 12 | index ca076b8..9151ceb 100644 13 | --- a/apex/Android.bp 14 | +++ b/apex/Android.bp 15 | @@ -77,3 +77,10 @@ apex_vndk { 16 | vndk_version: "29", 17 | system_ext_specific: true, 18 | } 19 | + 20 | +apex_vndk { 21 | + name: "com.android.vndk.v28", 22 | + defaults: ["vndk-apex-defaults"], 23 | + vndk_version: "28", 24 | + system_ext_specific: true, 25 | +} 26 | -- 27 | 2.43.0 28 | 29 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_system_netd/0004-Don-t-abort-in-case-of-cgroup-bpf-setup-fail-since-s.patch: -------------------------------------------------------------------------------- 1 | From e3d473da238397ecde7809f5852d6ecfad405754 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 d27fd76a..b2f98c4f 100644 13 | --- a/server/main.cpp 14 | +++ b/server/main.cpp 15 | @@ -142,7 +142,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.43.0 26 | 27 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_build/0002-build-Remove-llkd.patch: -------------------------------------------------------------------------------- 1 | From f1ef1867a6ac2c5503ccba52d504b04c7ca2a9f9 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/3] 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 5c4ef33284..cb1b32a7fe 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 | llndk_libs \ 23 | lmkd \ 24 | LocalTransport \ 25 | -- 26 | 2.43.0 27 | 28 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_frameworks_base/0043-Add-Samsung-sysinput.patch: -------------------------------------------------------------------------------- 1 | From e6e3978b2d4b7e2eeb636378356fbf55ea35fa0f 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 43/55] 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 b79ed8473638..3a5714bf699e 100644 12 | --- a/services/core/Android.bp 13 | +++ b/services/core/Android.bp 14 | @@ -274,6 +274,7 @@ java_library_static { 15 | "vendor.xiaomi.hardware.fingerprintextension-V1.0-java", 16 | 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.43.0 24 | 25 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_packages_modules_vndk/0001-Revert-Removing-vndk-apex-v29.patch: -------------------------------------------------------------------------------- 1 | From 53fe8fa9a7bdbb02e4d85a46f7912c1082fdad03 Mon Sep 17 00:00:00 2001 2 | From: Alberto Ponces 3 | Date: Tue, 25 Mar 2025 22:45:11 +0000 4 | Subject: [PATCH 1/2] Revert "Removing vndk apex v29" 5 | 6 | This reverts commit 6e5941919349d389970de0012e738698fe07ec88. 7 | --- 8 | apex/Android.bp | 7 +++++++ 9 | 1 file changed, 7 insertions(+) 10 | 11 | diff --git a/apex/Android.bp b/apex/Android.bp 12 | index 8f194df..ca076b8 100644 13 | --- a/apex/Android.bp 14 | +++ b/apex/Android.bp 15 | @@ -70,3 +70,10 @@ apex_vndk { 16 | vndk_version: "30", 17 | system_ext_specific: true, 18 | } 19 | + 20 | +apex_vndk { 21 | + name: "com.android.vndk.v29", 22 | + defaults: ["vndk-apex-defaults"], 23 | + vndk_version: "29", 24 | + system_ext_specific: true, 25 | +} 26 | -- 27 | 2.43.0 28 | 29 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_system_vold/0005-Every-voldmanaged-storage-is-adoptable.patch: -------------------------------------------------------------------------------- 1 | From ed65dcb668db10201a08b5ebd48773117ff0c6ae 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 5/6] 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 bdce76ed..dc0464c5 100644 12 | --- a/main.cpp 13 | +++ b/main.cpp 14 | @@ -277,7 +277,7 @@ static int process_config(VolumeManager* vm, VoldConfigs* configs) { 15 | std::string nickname(entry.label); 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.43.0 25 | 26 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_external_selinux/0001-Increase-default-log_level-to-get-actual-selinux-err.patch: -------------------------------------------------------------------------------- 1 | From 9b7ebad7558da43ff1e47c63a398be290776b03b 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/12] 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 f3102ca9..29862fd8 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.43.0 26 | 27 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_system_vold/0003-Don-t-unmount-rw-system.sh-binds.patch: -------------------------------------------------------------------------------- 1 | From 040f73d9e268a98341c8f74b5957d4a5c2547401 Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Mon, 29 Nov 2021 17:49:13 -0500 4 | Subject: [PATCH 3/6] 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 49a8b2b8..dd6bf66f 100644 13 | --- a/VolumeManager.cpp 14 | +++ b/VolumeManager.cpp 15 | @@ -1067,6 +1067,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.43.0 25 | 26 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_system_vold/0001-Allow-deletion-of-symlink.patch: -------------------------------------------------------------------------------- 1 | From 3f44d58b9857b04d3a43272674b255d3a83e1ebf 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/6] 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 563dd4fc..ea455a81 100644 13 | --- a/FsCrypt.cpp 14 | +++ b/FsCrypt.cpp 15 | @@ -427,6 +427,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.43.0 25 | 26 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_frameworks_base/0009-Support-samsung-Pie-and-Q-light-hal.patch: -------------------------------------------------------------------------------- 1 | From 0d37b14b7c67729c0c8f35cc967ff77a7c41ce14 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/55] 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 2606a5aca277..364bd920799a 100644 13 | --- a/services/core/jni/Android.bp 14 | +++ b/services/core/jni/Android.bp 15 | @@ -207,6 +207,8 @@ cc_defaults { 16 | "android_location_flags_c_lib", 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.43.0 26 | 27 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_system_bpf/0001-Support-no-bpf-usecase.patch: -------------------------------------------------------------------------------- 1 | From d1244d9c9a9870ad7534cd1830cdc198c8089b43 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 | loader/Loader.cpp | 3 +-- 9 | 1 file changed, 1 insertion(+), 2 deletions(-) 10 | 11 | diff --git a/loader/Loader.cpp b/loader/Loader.cpp 12 | index 940ce19..883202b 100644 13 | --- a/loader/Loader.cpp 14 | +++ b/loader/Loader.cpp 15 | @@ -991,8 +991,7 @@ void legacyBpfLoader() { 16 | ALOGE("If this triggers randomly, you might be hitting some memory allocation " 17 | "problems or startup script race."); 18 | ALOGE("--- DO NOT EXPECT SYSTEM TO BOOT SUCCESSFULLY ---"); 19 | - sleep(20); 20 | - exit(121); 21 | + return; 22 | } 23 | } 24 | } 25 | -- 26 | 2.43.0 27 | 28 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_system_bpf/0002-Additional-bpf-less-handling.patch: -------------------------------------------------------------------------------- 1 | From 46d8a14c3ce9a313455d8e3083969a1fe81464cd Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Mon, 16 Jun 2025 16:24:02 -0400 4 | Subject: [PATCH 2/3] Additional bpf-less handling 5 | 6 | Change-Id: I889334a28d8d484cef9d9e8a8e0ea0aa2c0b47ac 7 | --- 8 | loader/Loader.cpp | 3 ++- 9 | 1 file changed, 2 insertions(+), 1 deletion(-) 10 | 11 | diff --git a/loader/Loader.cpp b/loader/Loader.cpp 12 | index 883202b..464e490 100644 13 | --- a/loader/Loader.cpp 14 | +++ b/loader/Loader.cpp 15 | @@ -977,7 +977,8 @@ void initLogging() { 16 | void createBpfFsSubDirectories() { 17 | for (const auto& location : android::bpf::locations) { 18 | if (android::bpf::createSysFsBpfSubDir(location.prefix)) { 19 | - exit(120); 20 | + ALOGE("=== CRITICIL FAILURE creating BPF subdir %s", location.prefix); 21 | + //exit(120); 22 | } 23 | } 24 | } 25 | -- 26 | 2.43.0 27 | 28 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_frameworks_native/0012-Disable-gpuservice-on-old-BPF-less-kernel.patch: -------------------------------------------------------------------------------- 1 | From 4d5a256ca283a34ab6a3cea4f6d8bfe98aa7d95a 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/16] 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 d0783df109..cdc4094b27 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.43.0 25 | 26 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_system_core/0016-Add-vendor-firmware_mnt.-Moto-Razr-2019-look-for-fir.patch: -------------------------------------------------------------------------------- 1 | From 34b8e5c40e7461325dc65a28f57668aeb5e42e92 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/28] 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.43.0 26 | 27 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_frameworks_base/0047-Include-vendor.samsung.hardware.radio-V2.2-java-HIDL.patch: -------------------------------------------------------------------------------- 1 | From 3b2a43e221feedfda6ac5b35c13fb469e63c44f3 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 47/55] 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 df041ccf1d4a..71c1bf8456ec 100644 13 | --- a/Android.bp 14 | +++ b/Android.bp 15 | @@ -232,6 +232,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-V5-java", 21 | "android.hardware.radio.ims-V4-java", 22 | "android.hardware.radio.messaging-V5-java", 23 | -- 24 | 2.43.0 25 | 26 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_frameworks_base/0046-Include-vendor.samsung.hardware.radio.network-V1-jav.patch: -------------------------------------------------------------------------------- 1 | From 724781d7311a54974362583cd3617f94a4705e36 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 46/55] 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 e7c20418bcef..df041ccf1d4a 100644 13 | --- a/Android.bp 14 | +++ b/Android.bp 15 | @@ -239,6 +239,7 @@ java_library { 16 | "android.hardware.radio.network-V5-java", 17 | "android.hardware.radio.sim-V5-java", 18 | "android.hardware.radio.voice-V5-java", 19 | + "vendor.samsung.hardware.radio.network-V1-java", 20 | "android.hardware.thermal-V1.0-java-constants", 21 | "android.hardware.thermal-V1.0-java", 22 | "android.hardware.thermal-V1.1-java", 23 | -- 24 | 2.43.0 25 | 26 | -------------------------------------------------------------------------------- /patches/personal/platform_packages_apps_ThemePicker/0002-Specify-we-read-and-write-launcher-settings.patch: -------------------------------------------------------------------------------- 1 | From e809815da68dc7465c53ac0140eb49eb987a8c5a Mon Sep 17 00:00:00 2001 2 | From: Luca Stefani 3 | Date: Fri, 1 Nov 2019 23:17:08 +0100 4 | Subject: [PATCH 2/3] Specify we read and write launcher settings 5 | 6 | Change-Id: Ifc8196588443b007602118389ca76d34ab531f14 7 | --- 8 | AndroidManifest.xml | 3 +++ 9 | 1 file changed, 3 insertions(+) 10 | 11 | diff --git a/AndroidManifest.xml b/AndroidManifest.xml 12 | index 46f364cf..5f74c5a7 100755 13 | --- a/AndroidManifest.xml 14 | +++ b/AndroidManifest.xml 15 | @@ -60,6 +60,9 @@ 16 | 17 | 18 | 19 | + 20 | + 21 | + 22 | 3 | Date: Thu, 19 Oct 2023 07:06:55 +0700 4 | Subject: [PATCH 20/28] 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.43.0 24 | 25 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_system_netd/0003-Support-no-bpf-usecase.patch: -------------------------------------------------------------------------------- 1 | From 4f14ccdfa5065c517130504403b40cf7aefadad0 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 48d0c509..13538dd2 100644 13 | --- a/server/Controllers.cpp 14 | +++ b/server/Controllers.cpp 15 | @@ -326,7 +326,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.43.0 26 | 27 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_packages_modules_DnsResolver/0001-Dont-abort-if-the-DnsHelper-failed-to-init-on-BPF-le.patch: -------------------------------------------------------------------------------- 1 | From 05a5a585bcac9ab40729372515ca106c8d58aa61 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 | 2 +- 8 | 1 file changed, 1 insertion(+), 1 deletion(-) 9 | 10 | diff --git a/DnsProxyListener.cpp b/DnsProxyListener.cpp 11 | index 302cfd99..515d3b55 100644 12 | --- a/DnsProxyListener.cpp 13 | +++ b/DnsProxyListener.cpp 14 | @@ -693,7 +693,7 @@ IsUidBlockedFn resolveIsUidNetworkingBlockedFn() { 15 | // On S/Sv2 this can fail if tethering apex is too old, ignore it. 16 | if (ret == -EOPNOTSUPP && !isAtLeastT()) return nullptr; 17 | LOG(ERROR) << __func__ << ": ADnsHelper_init failed " << strerror(-ret); 18 | - abort(); 19 | + return nullptr; 20 | } 21 | 22 | // Related BPF maps were only mainlined from T. 23 | -- 24 | 2.43.0 25 | 26 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_bootable_recovery/0001-Don-t-reboot-if-we-couldn-t-get-bootctrl.patch: -------------------------------------------------------------------------------- 1 | From 1cda85388da9fef2821bc014886f1ed2ff4bf674 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.43.0 26 | 27 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_frameworks_base/0036-Once-we-integrate-Samsung-Power-hal-in-libpowermanag.patch: -------------------------------------------------------------------------------- 1 | From 32cc9343396b84e525df16465cda86277bbd0699 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 36/55] 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 364bd920799a..457f2c245820 100644 15 | --- a/services/core/jni/Android.bp 16 | +++ b/services/core/jni/Android.bp 17 | @@ -209,6 +209,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.43.0 27 | 28 | -------------------------------------------------------------------------------- /patches/personal/platform_packages_apps_ThemePicker/0001-ThemePicker-Override-WallpaperCropper.patch: -------------------------------------------------------------------------------- 1 | From 2d52dc64c1c1518858f1af99a0e0911f700ccb59 Mon Sep 17 00:00:00 2001 2 | From: Michael W 3 | Date: Wed, 6 Apr 2022 21:57:11 +0200 4 | Subject: [PATCH 1/3] ThemePicker: Override WallpaperCropper 5 | 6 | * We don't need two apps doing the same 7 | 8 | Co-authored-by: Michael Bestas 9 | Change-Id: I49421ff17649c8ada4511035b776070dbf4e854a 10 | --- 11 | Android.bp | 2 +- 12 | 1 file changed, 1 insertion(+), 1 deletion(-) 13 | 14 | diff --git a/Android.bp b/Android.bp 15 | index 5efee517..be7e93e6 100644 16 | --- a/Android.bp 17 | +++ b/Android.bp 18 | @@ -151,6 +151,6 @@ android_app { 19 | platform_apis: true, 20 | manifest: "AndroidManifest.xml", 21 | additional_manifests: [":WallpaperPicker2_Manifest"], 22 | - overrides: ["WallpaperPicker", "WallpaperPicker2"], 23 | + overrides: ["WallpaperCropper", "WallpaperPicker", "WallpaperPicker2"], 24 | static_libs: ["ThemePickerApplicationLib"], 25 | } 26 | -- 27 | 2.43.0 28 | 29 | -------------------------------------------------------------------------------- /patches/personal/platform_packages_apps_Settings/0001-Export-FaceEnrollFinish-activity-to-Sense.patch: -------------------------------------------------------------------------------- 1 | From 0d27252700621a6c1e930863980f131903562c13 Mon Sep 17 00:00:00 2001 2 | From: Chris Crump 3 | Date: Sun, 30 Oct 2022 04:04:59 -0400 4 | Subject: [PATCH 1/2] Export FaceEnrollFinish activity to Sense 5 | 6 | Sense calls this activity after enroll is completed 7 | 8 | Change-Id: I4d756d9eb91f07bf86f2a96deee465aa256608fc 9 | --- 10 | AndroidManifest.xml | 2 +- 11 | 1 file changed, 1 insertion(+), 1 deletion(-) 12 | 13 | diff --git a/AndroidManifest.xml b/AndroidManifest.xml 14 | index ed19890456f..6659fbfe5d5 100644 15 | --- a/AndroidManifest.xml 16 | +++ b/AndroidManifest.xml 17 | @@ -2904,7 +2904,7 @@ 18 | android:screenOrientation="portrait"/> 19 | 20 | 25 | 26 | -- 27 | 2.43.0 28 | 29 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_system_core/0004-Panic-into-recovery-rather-than-bootloader.patch: -------------------------------------------------------------------------------- 1 | From 29f66d7a6ac37754565c62e141b7309a889b22cc Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Wed, 4 Sep 2019 21:11:48 +0200 4 | Subject: [PATCH 04/28] Panic into recovery rather than bootloader 5 | 6 | Getting last_kmsg/pstore from bootloader isn't possible for other people 7 | than the OEM, but we have TWRP to access last_kmsg/pstore 8 | 9 | Change-Id: If04bb6572dc66677d7b44f7d302b2d69ce526200 10 | --- 11 | init/reboot_utils.cpp | 2 +- 12 | 1 file changed, 1 insertion(+), 1 deletion(-) 13 | 14 | diff --git a/init/reboot_utils.cpp b/init/reboot_utils.cpp 15 | index 547b1869f..dd0fbbfe8 100644 16 | --- a/init/reboot_utils.cpp 17 | +++ b/init/reboot_utils.cpp 18 | @@ -37,7 +37,7 @@ 19 | namespace android { 20 | namespace init { 21 | 22 | -static std::string init_fatal_reboot_target = "bootloader"; 23 | +static std::string init_fatal_reboot_target = "recovery"; 24 | static bool init_fatal_panic = false; 25 | 26 | // this needs to read the /proc/* files directly because it is called before 27 | -- 28 | 2.43.0 29 | 30 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_external_selinux/0008-Improve-SELinux-policy-workaround-on-device-phh-treb.patch: -------------------------------------------------------------------------------- 1 | From dec53c534c0f87542bf91f5a2a566e62a4fc321c Mon Sep 17 00:00:00 2001 2 | From: ponces 3 | Date: Mon, 7 Nov 2022 16:14:20 +0000 4 | Subject: [PATCH 08/12] 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 2e7465a0..27e1a51a 100644 14 | --- a/libsepol/cil/src/cil_build_ast.c 15 | +++ b/libsepol/cil/src/cil_build_ast.c 16 | @@ -186,7 +186,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.43.0 26 | 27 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_external_selinux/0010-Allow-conflict-on-fuseblk.patch: -------------------------------------------------------------------------------- 1 | From 0b16587cc78e1e951aaa53a6acab1036224afce4 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/12] 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 29f4559c..9b0a51dc 100644 12 | --- a/libsepol/cil/src/cil_post.c 13 | +++ b/libsepol/cil/src/cil_post.c 14 | @@ -518,7 +518,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.43.0 25 | 26 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_frameworks_base/0012-HOME-deserves-to-wake-up-devices-just-as-well-as-bac.patch: -------------------------------------------------------------------------------- 1 | From 4657740fe7a5be10742de76a74365e1f11ba49ce 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/55] 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 ad43c7b7cdc3..f10e57156635 100644 14 | --- a/core/java/android/view/KeyEvent.java 15 | +++ b/core/java/android/view/KeyEvent.java 16 | @@ -2569,6 +2569,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.43.0 26 | 27 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_external_selinux/0006-Allow-mismatches-of-exfat-genfscon.patch: -------------------------------------------------------------------------------- 1 | From de4119ff06090d77bf12ae4d6111194d3d870940 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/12] 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 b462649d..ecc704e0 100644 12 | --- a/libsepol/cil/src/cil_post.c 13 | +++ b/libsepol/cil/src/cil_post.c 14 | @@ -509,6 +509,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.43.0 27 | 28 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_frameworks_base/0055-Not-all-kernel-support-splicing-pipes-or-is-it-socke.patch: -------------------------------------------------------------------------------- 1 | From 0e5c2dc6b4ed27952a8dbe0f47efe90f07182e2e Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Mon, 16 Jun 2025 17:19:47 -0400 4 | Subject: [PATCH 55/55] Not all kernel support splicing pipes (or is it 5 | sockets?), so gracefully fallback to dumb userspace copy when splice() fails 6 | 7 | Fixes adb install on Pixel 1 8 | 9 | Change-Id: I835bac3496900fe02348a5aed3f1ecb9ff16cd20 10 | --- 11 | core/java/android/os/FileUtils.java | 1 - 12 | 1 file changed, 1 deletion(-) 13 | 14 | diff --git a/core/java/android/os/FileUtils.java b/core/java/android/os/FileUtils.java 15 | index 14005b31903a..31f0ff0d42ea 100644 16 | --- a/core/java/android/os/FileUtils.java 17 | +++ b/core/java/android/os/FileUtils.java 18 | @@ -479,7 +479,6 @@ public final class FileUtils { 19 | return copyInternalSpliceSocket(in, out, count, signal, executor, listener); 20 | } 21 | } catch (ErrnoException e) { 22 | - throw e.rethrowAsIOException(); 23 | } 24 | } 25 | 26 | -- 27 | 2.43.0 28 | 29 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_packages_modules_Connectivity/0007-Revert-netdupdatable-add-back-abort-on-init-fail.patch: -------------------------------------------------------------------------------- 1 | From 6051e813665e8b6bfb2ea2d6cf9d8802f4ade5a5 Mon Sep 17 00:00:00 2001 2 | From: Alberto Ponces 3 | Date: Thu, 20 Jun 2024 12:38:58 +0100 4 | Subject: [PATCH 7/9] Revert "netdupdatable: add back abort() on init() fail" 5 | 6 | This reverts commit ff845a642bc988f960c77ac60664560f8cdc7ee3. 7 | --- 8 | bpf/netd/NetdUpdatable.cpp | 4 ++-- 9 | 1 file changed, 2 insertions(+), 2 deletions(-) 10 | 11 | diff --git a/bpf/netd/NetdUpdatable.cpp b/bpf/netd/NetdUpdatable.cpp 12 | index 3b15916398..8b9e5a759c 100644 13 | --- a/bpf/netd/NetdUpdatable.cpp 14 | +++ b/bpf/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.43.0 28 | 29 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_system_core/0003-init-Do-not-start-console-service-when-debuggable.patch: -------------------------------------------------------------------------------- 1 | From 18eb220aa727e3a010b1f63240074cbadb40bf28 Mon Sep 17 00:00:00 2001 2 | From: Isaac Chen 3 | Date: Wed, 23 Jun 2021 13:07:30 +0800 4 | Subject: [PATCH 03/28] init: Do not start console service when debuggable 5 | 6 | Google added a check for this in R, when it's running it will show a 7 | notification about that performance is impacted. 8 | 9 | Signed-off-by: Isaac Chen 10 | Change-Id: I34cfd6b42d3b9aee4b3e63181480cfb8b1255f29 11 | --- 12 | rootdir/init.rc | 3 --- 13 | 1 file changed, 3 deletions(-) 14 | 15 | diff --git a/rootdir/init.rc b/rootdir/init.rc 16 | index 471059bc8..0019c38d6 100644 17 | --- a/rootdir/init.rc 18 | +++ b/rootdir/init.rc 19 | @@ -1315,9 +1315,6 @@ on property:ro.debuggable=1 20 | # Give reads to anyone for the accessibility trace folder on debug builds. 21 | chmod 0775 /data/misc/a11ytrace 22 | 23 | -on init && property:ro.debuggable=1 24 | - start console 25 | - 26 | # Multi-Gen LRU Experiment 27 | on property:persist.device_config.mglru_native.lru_gen_config=none 28 | write /sys/kernel/mm/lru_gen/enabled 0 29 | -- 30 | 2.43.0 31 | 32 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_frameworks_base/0003-Fix-env-empty-string-ANDROID_STORAGE.patch: -------------------------------------------------------------------------------- 1 | From 8b7b08f2c0201a78bce0591c20c639132e7563ae 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/55] 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 69540c42a742..5202d15f7f7f 100644 13 | --- a/core/java/android/os/Environment.java 14 | +++ b/core/java/android/os/Environment.java 15 | @@ -1544,7 +1544,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.43.0 26 | 27 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_frameworks_native/0003-unshared_oob-didn-t-exist-in-O-P-so-detect-its-suppo.patch: -------------------------------------------------------------------------------- 1 | From 482e7c1f8d6f9715f8013348b8f1538887c8e26a 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/16] 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.43.0 26 | 27 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_external_selinux/0012-Fix-secilc-on-Moto-One-Action.patch: -------------------------------------------------------------------------------- 1 | From 6638f24ae61490f3a25c47a8b531309fd93d8e76 Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Mon, 6 Jan 2025 16:07:53 -0500 4 | Subject: [PATCH 12/12] Fix secilc on Moto One Action 5 | 6 | This is an extension of I66339857634ebfdba359f12a99dfd0bff709d80b 7 | "Fix boot on Moto devices using unknown class" 8 | --- 9 | libsepol/cil/src/cil_build_ast.c | 8 ++++++++ 10 | 1 file changed, 8 insertions(+) 11 | 12 | diff --git a/libsepol/cil/src/cil_build_ast.c b/libsepol/cil/src/cil_build_ast.c 13 | index 27e1a51a..42f6157c 100644 14 | --- a/libsepol/cil/src/cil_build_ast.c 15 | +++ b/libsepol/cil/src/cil_build_ast.c 16 | @@ -250,6 +250,14 @@ int cil_gen_ordered(struct cil_db *db, struct cil_tree_node *parse_current, stru 17 | 18 | int rc = SEPOL_ERR; 19 | 20 | + { 21 | + const char* path = cil_tree_get_cil_path(parse_current); 22 | + if(strstr(path, "vendor/")) { 23 | + cil_clear_node(ast_node); 24 | + return SEPOL_OK; 25 | + } 26 | + } 27 | + 28 | if (db == NULL || parse_current == NULL || ast_node == NULL) { 29 | goto exit; 30 | } 31 | -- 32 | 2.43.0 33 | 34 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_packages_modules_Connectivity/0006-More-bpf-errors-ignore-there-are-some-4.14-without-t.patch: -------------------------------------------------------------------------------- 1 | From 175bea16b93bc421df438bdf183b954f567d461b Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Wed, 15 May 2024 05:56:59 -0400 4 | Subject: [PATCH 6/9] More bpf errors ignore -- there are some 4.14 without the 5 | bpf jit file 6 | 7 | --- 8 | bpf/loader/NetBpfLoad.cpp | 3 +-- 9 | 1 file changed, 1 insertion(+), 2 deletions(-) 10 | 11 | diff --git a/bpf/loader/NetBpfLoad.cpp b/bpf/loader/NetBpfLoad.cpp 12 | index 6fcfb942d2..b88b3bf56a 100644 13 | --- a/bpf/loader/NetBpfLoad.cpp 14 | +++ b/bpf/loader/NetBpfLoad.cpp 15 | @@ -1850,8 +1850,7 @@ static int doLoad(char** argv, char * const envp[]) { 16 | // but we need 0 (enabled) 17 | // (this writeFile is known to fail on at least 4.19, but always defaults to 0 on 18 | // pre-5.13, on 5.13+ it depends on CONFIG_BPF_UNPRIV_DEFAULT_OFF) 19 | - if (writeProcSysFile("/proc/sys/kernel/unprivileged_bpf_disabled", "0\n") && 20 | - isAtLeastKernelVersion(5, 13, 0)) { 21 | + if (writeProcSysFile("/proc/sys/kernel/unprivileged_bpf_disabled", "0\n")) { 22 | failed = true; 23 | } 24 | } 25 | -- 26 | 2.43.0 27 | 28 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_system_bpf/0003-Prepare-for-the-future-making-bpfloader.rs-fails-all.patch: -------------------------------------------------------------------------------- 1 | From 422ee042ffcc06176e91d36b88c60d3f5cbfd788 Mon Sep 17 00:00:00 2001 2 | From: Pierre-Hugues Husson 3 | Date: Mon, 16 Jun 2025 16:24:19 -0400 4 | Subject: [PATCH 3/3] Prepare for the future: making bpfloader.rs fails all 5 | non-panic 6 | 7 | Change-Id: I79d413dc4b7626e2a196317e4e58572f61863a30 8 | --- 9 | loader/bpfloader.rs | 4 ++-- 10 | 1 file changed, 2 insertions(+), 2 deletions(-) 11 | 12 | diff --git a/loader/bpfloader.rs b/loader/bpfloader.rs 13 | index 48f7319..68d9635 100644 14 | --- a/loader/bpfloader.rs 15 | +++ b/loader/bpfloader.rs 16 | @@ -267,9 +267,9 @@ fn load_libbpf_progs() { 17 | for file_desc in FILE_ARR { 18 | if let Err(e) = libbpf_worker(file_desc) { 19 | if file_desc.critical { 20 | - panic!("Error when loading {0}: {e}", file_desc.filename); 21 | + error!("'critical' Error when loading {0}: {e}\n", file_desc.filename); 22 | } else { 23 | - error!("Error when loading {0}: {e}", file_desc.filename); 24 | + error!("Error when loading {0}: {e}\n", file_desc.filename); 25 | } 26 | }; 27 | } 28 | -- 29 | 2.43.0 30 | 31 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_system_core/0017-Ignore-dm-verity-setup-issues.patch: -------------------------------------------------------------------------------- 1 | From 2a4413ef0a19a2a9372e8f6fd5bd002999660043 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/28] 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 6b413f6d6..5a7a78e3d 100644 18 | --- a/init/first_stage_mount.cpp 19 | +++ b/init/first_stage_mount.cpp 20 | @@ -450,7 +450,6 @@ bool FirstStageMountVBootV2::MountPartition(const Fstab::iterator& begin, bool e 21 | } 22 | if (!SetUpDmVerity(&(*begin))) { 23 | PLOG(ERROR) << "Failed to setup verity for '" << begin->mount_point << "'"; 24 | - return false; 25 | } 26 | 27 | bool mounted = (fs_mgr_do_mount_one(*begin) == 0); 28 | -- 29 | 2.43.0 30 | 31 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_system_netd/0001-Huawei-Kirin-960-accept-broken-rpfilter-match.patch: -------------------------------------------------------------------------------- 1 | From 4935247b9b6e0e5c104c4cf28383eb1eb00d11db 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 b159d958..c41fe7ac 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.43.0 29 | 30 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # TrebleDroid AOSP GSI 2 | 3 | ## Build 4 | To get started with building AOSP GSI, you'll need to get familiar with [Git and Repo](https://source.android.com/source/using-repo.html) as well as [How to build a GSI](https://github.com/phhusson/treble_experimentations/wiki/How-to-build-a-GSI%3F). 5 | - Create a new working directory for your AOSP build and navigate to it: 6 | ``` 7 | mkdir aosp; cd aosp 8 | ``` 9 | - Clone this repo: 10 | ``` 11 | git clone https://github.com/ponces/treble_aosp -b android-16.0 12 | ``` 13 | - Finally, start the build script: 14 | ``` 15 | bash treble_aosp/build.sh 16 | ``` 17 | 18 | ## Issues 19 | [Open issue](https://github.com/ponces/treble_aosp/issues/new/choose) 20 | 21 | ## Credits 22 | These people have helped this project in some way or another, so they should be the ones who receive all the credit: 23 | - [phhusson](https://github.com/phhusson) 24 | - [AndyYan](https://github.com/AndyCGYan) 25 | - [eremitein](https://github.com/eremitein) 26 | - [kdrag0n](https://github.com/kdrag0n) 27 | - [Peter Cai](https://github.com/PeterCxy) 28 | - [haridhayal11](https://github.com/haridhayal11) 29 | - [sooti](https://github.com/sooti) 30 | - [Iceows](https://github.com/Iceows) 31 | - [ChonDoit](https://github.com/ChonDoit) 32 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_frameworks_base/0016-Remove-useless-notification-about-console-service-be.patch: -------------------------------------------------------------------------------- 1 | From c09dc67ac6186201acfdfcb71ca2e83f5510e84b 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/55] 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 59c5e0e7fc2c..d709e586caa4 100644 13 | --- a/services/core/java/com/android/server/am/ActivityManagerService.java 14 | +++ b/services/core/java/com/android/server/am/ActivityManagerService.java 15 | @@ -5272,7 +5272,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.43.0 26 | 27 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_frameworks_native/0013-SurfaceFlinger-Disable-SF-HWC-backpressure.patch: -------------------------------------------------------------------------------- 1 | From 63611905e880387a55485dad452416ed1e7741fd 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/16] 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 42a77fd844..9772ecc0fc 100644 12 | --- a/services/surfaceflinger/SurfaceFlinger.cpp 13 | +++ b/services/surfaceflinger/SurfaceFlinger.cpp 14 | @@ -2723,7 +2723,8 @@ bool SurfaceFlinger::commit(PhysicalDisplayId pacesetterId, 15 | } 16 | } 17 | 18 | - if (pacesetterFrameTarget.wouldBackpressureHwc()) { 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.43.0 26 | 27 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_system_core/0019-Disable-project_quota-on-old-devices-but-new-enough-.patch: -------------------------------------------------------------------------------- 1 | From 511fe6b64d2a20562f6993af06684800e1d65912 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/28] 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 b4ea91172..8b6785c99 100644 13 | --- a/fs_mgr/fs_mgr.cpp 14 | +++ b/fs_mgr/fs_mgr.cpp 15 | @@ -381,6 +381,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.43.0 32 | 33 | -------------------------------------------------------------------------------- /patches/personal/platform_packages_apps_Launcher3/0002-Disable-QSB-on-first-screen-by-default.patch: -------------------------------------------------------------------------------- 1 | From 3183b90fe5c0802487272f293bc8c055aa6e6da1 Mon Sep 17 00:00:00 2001 2 | From: Arne Coucheron 3 | Date: Wed, 28 Jun 2017 02:20:46 +0200 4 | Subject: [PATCH 2/3] Disable QSB on first screen by default 5 | 6 | Change-Id: I24f1682cbad10610f04f7b8ada238b43addd23da 7 | --- 8 | src_build_config/com/android/launcher3/BuildConfig.java | 2 +- 9 | 1 file changed, 1 insertion(+), 1 deletion(-) 10 | 11 | diff --git a/src_build_config/com/android/launcher3/BuildConfig.java b/src_build_config/com/android/launcher3/BuildConfig.java 12 | index 6d4f56d655..2630ec130f 100644 13 | --- a/src_build_config/com/android/launcher3/BuildConfig.java 14 | +++ b/src_build_config/com/android/launcher3/BuildConfig.java 15 | @@ -24,7 +24,7 @@ public final class BuildConfig { 16 | * Flag to state if the QSB is on the first screen and placed on the top, 17 | * this can be overwritten in other launchers with a different value, if needed. 18 | */ 19 | - public static final boolean QSB_ON_FIRST_SCREEN = true; 20 | + public static final boolean QSB_ON_FIRST_SCREEN = false; 21 | 22 | /** 23 | * Flag to state if the widget on the top of the first screen should be shown. 24 | -- 25 | 2.43.0 26 | 27 | -------------------------------------------------------------------------------- /patches/staging/platform_frameworks_base/0003-reduce-blur-radius-to-avoid-blur-artifacts.patch: -------------------------------------------------------------------------------- 1 | From 8f6e4bce80d7af06d6b4b6f7b3c90d443689d3ba Mon Sep 17 00:00:00 2001 2 | From: rmp22 <195054967+rmp22@users.noreply.github.com> 3 | Date: Wed, 2 Jul 2025 09:20:33 +0800 4 | Subject: [PATCH 3/4] reduce blur radius to avoid blur artifacts 5 | 6 | 60px on 411dp device 7 | 8 | Change-Id: I0505866cb0d64a2b64107f646ccf6f7e5fafd2d3 9 | Signed-off-by: rmp22 <195054967+rmp22@users.noreply.github.com> 10 | --- 11 | packages/SystemUI/res/values/dimens.xml | 2 +- 12 | 1 file changed, 1 insertion(+), 1 deletion(-) 13 | 14 | diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml 15 | index 27f52eb3c723..c7c9941ee830 100644 16 | --- a/packages/SystemUI/res/values/dimens.xml 17 | +++ b/packages/SystemUI/res/values/dimens.xml 18 | @@ -1282,7 +1282,7 @@ 19 | @dimen/max_window_blur_radius 20 | 21 | 22 | - 34dp 23 | + 23.36dp 24 | 25 | 26 | 0px 27 | -- 28 | 2.43.0 29 | 30 | -------------------------------------------------------------------------------- /patches/personal/platform_packages_apps_Launcher3/0003-Properly-expose-GridCustomizationsProvider.patch: -------------------------------------------------------------------------------- 1 | From d5355a8a08d7f7cfa2e5632b8bd11b1b7614fa49 Mon Sep 17 00:00:00 2001 2 | From: Luca Stefani 3 | Date: Fri, 1 Nov 2019 23:17:59 +0100 4 | Subject: [PATCH 3/3] Properly expose GridCustomizationsProvider 5 | 6 | Change-Id: I8268a215257ae0e399c56ac8b44cdfdff8cc92a0 7 | --- 8 | AndroidManifest-common.xml | 4 +++- 9 | 1 file changed, 3 insertions(+), 1 deletion(-) 10 | 11 | diff --git a/AndroidManifest-common.xml b/AndroidManifest-common.xml 12 | index 46f0e41cdb..f728b76176 100644 13 | --- a/AndroidManifest-common.xml 14 | +++ b/AndroidManifest-common.xml 15 | @@ -136,7 +136,9 @@ 16 | android:name="com.android.launcher3.graphics.LauncherCustomizationProvider" 17 | android:authorities="${applicationId}.grid_control" 18 | android:permission="android.permission.BIND_WALLPAPER" 19 | - android:exported="true" /> 20 | + android:exported="true" 21 | + android:writePermission="${packageName}.permission.WRITE_SETTINGS" 22 | + android:readPermission="${packageName}.permission.READ_SETTINGS"/> 23 | 24 | 19 | - 5 20 | + 1 21 | 22 | 23 | 500 24 | @@ -1188,7 +1188,7 @@ 25 | 1 - Mute toggle 26 | 2 - Global actions menu 27 | --> 28 | - 2 29 | + 1 30 | 31 | Getting latest upstream version" 20 | aosp=$(curl -sL https://github.com/TrebleDroid/treble_manifest/raw/$TD_BRANCH/replace.xml | grep -oP "${TD_BRANCH}.0_r\d+" | head -1) 21 | 22 | echo "--> Initializing workspace" 23 | repo init -u https://android.googlesource.com/platform/manifest -b "$aosp" 24 | echo 25 | 26 | echo "--> Preparing local manifest" 27 | if [ -d .repo/local_manifests ]; then 28 | (cd .repo/local_manifests; git fetch; git reset --hard; git checkout origin/$TD_BRANCH) 29 | else 30 | git clone https://github.com/TrebleDroid/treble_manifest .repo/local_manifests -b $TD_BRANCH 31 | fi 32 | echo 33 | } 34 | 35 | syncRepos() { 36 | echo "--> Syncing repos" 37 | repo sync -c --force-sync --no-clone-bundle --no-tags -j$(nproc --ignore=2) || repo sync -c --force-sync --no-clone-bundle --no-tags -j$(nproc --ignore=2) 38 | echo 39 | } 40 | 41 | generatePatches() { 42 | echo "--> Generating patches" 43 | rm -rf patches.zip 44 | curl -sfL https://github.com/TrebleDroid/treble_experimentations/raw/master/list-patches.sh -o list-patches.sh 45 | bash list-patches.sh 46 | mkdir -p $OUTPUT_DIR 47 | mv patches.zip $OUTPUT_DIR/patches.zip 48 | echo 49 | } 50 | 51 | updatePatches() { 52 | echo "--> Updating patches" 53 | unzip $OUTPUT_DIR/patches.zip -d $OUTPUT_DIR/patches 54 | cp -r $OUTPUT_DIR/patches/patches $BUILD_ROOT/patches/trebledroid 55 | echo 56 | } 57 | 58 | START=$(date +%s) 59 | 60 | initRepos 61 | syncRepos 62 | generatePatches 63 | #updatePatches 64 | 65 | END=$(date +%s) 66 | ELAPSEDM=$(($(($END-$START))/60)) 67 | ELAPSEDS=$(($(($END-$START))-$ELAPSEDM*60)) 68 | 69 | echo "--> Syncbot completed in $ELAPSEDM minutes and $ELAPSEDS seconds" 70 | echo 71 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_frameworks_base/0025-Dynamically-resize-boot-animation-to-match-screen-si.patch: -------------------------------------------------------------------------------- 1 | From 1e4a4aecaf137869731e2b4cd8d566845c1ca959 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 25/55] 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 b0070c5faa36..af3afa7668a0 100644 13 | --- a/cmds/bootanimation/BootAnimation.cpp 14 | +++ b/cmds/bootanimation/BootAnimation.cpp 15 | @@ -578,6 +578,28 @@ status_t BootAnimation::initDisplaysAndSurfaces() { 16 | display.initHeight = display.height = h; 17 | mTargetInset = -1; 18 | 19 | + if ( mAnimation != nullptr ) { 20 | + SLOGE("Got screen size %d, animation size %d", display.width, mAnimation->width); 21 | + int origWidth = mAnimation->width; 22 | + if ( mAnimation->width*2 < display.width ) { 23 | + SLOGE("Making animation bigger"); 24 | + mAnimation->width *= 2; 25 | + mAnimation->height *= 2; 26 | + } else if ( display.width < 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.43.0 46 | 47 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_frameworks_base/0054-HintManagerService-Generate-dummy-mSupportInfo-for-n.patch: -------------------------------------------------------------------------------- 1 | From f0c25cd128a01c3805207b83d422149b170e88a8 Mon Sep 17 00:00:00 2001 2 | From: electimon 3 | Date: Tue, 1 Apr 2025 14:00:10 -0400 4 | Subject: [PATCH 54/55] HintManagerService: Generate dummy mSupportInfo for non 5 | power AIDL devices 6 | 7 | * Before it would generate dummy info when the IPower AIDL version 8 | was too old. Now we will generate it when IPower is just completely 9 | unavailable as well, avoiding a crash from accessing an 10 | uninitialized mSupportInfo. 11 | 12 | test: sailfish boot :D 13 | Change-Id: Ibf43d0bfea9fd6cdeae35248e4dde58c01d3ef3b 14 | Signed-off-by: electimon 15 | --- 16 | .../com/android/server/power/hint/HintManagerService.java | 5 +++++ 17 | 1 file changed, 5 insertions(+) 18 | 19 | diff --git a/services/core/java/com/android/server/power/hint/HintManagerService.java b/services/core/java/com/android/server/power/hint/HintManagerService.java 20 | index 1cf24fcd8594..b84ddc956b11 100644 21 | --- a/services/core/java/com/android/server/power/hint/HintManagerService.java 22 | +++ b/services/core/java/com/android/server/power/hint/HintManagerService.java 23 | @@ -335,6 +335,8 @@ public final class HintManagerService extends SystemService { 24 | } catch (RemoteException e) { 25 | throw new IllegalStateException("Could not contact PowerHAL!", e); 26 | } 27 | + } else { 28 | + mSupportInfo = getDummySupportInfo(); 29 | } 30 | mDefaultCpuHeadroomCalculationWindowMillis = 31 | new CpuHeadroomParamsInternal().calculationWindowMillis; 32 | @@ -379,7 +381,10 @@ public final class HintManagerService extends SystemService { 33 | } catch (RemoteException e) { 34 | throw new IllegalStateException("Could not contact PowerHAL!", e); 35 | } 36 | + return getDummySupportInfo(); 37 | + } 38 | 39 | + private SupportInfo getDummySupportInfo() { 40 | SupportInfo supportInfo = new SupportInfo(); 41 | supportInfo.usesSessions = isHintSessionSupported(); 42 | // Global boosts & modes aren't currently relevant for HMS clients 43 | -- 44 | 2.43.0 45 | 46 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_system_core/0026-Flattened-apexes-no-longer-exist-we-ll-deal-with-it-.patch: -------------------------------------------------------------------------------- 1 | From fb27001a801e87d70dd158f1406cc1fc747e5032 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/28] 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 5c3beeb83..6be46436a 100644 13 | --- a/init/property_service.cpp 14 | +++ b/init/property_service.cpp 15 | @@ -704,26 +704,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 | @@ -819,7 +799,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.43.0 53 | 54 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_frameworks_base/0020-Automatically-detect-pick-up-sensor-so-that-an-overl.patch: -------------------------------------------------------------------------------- 1 | From 029c63575ff808f36a9729168cb4515e6373bf3e 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 20/55] 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 063f5545dd71..79e72f48f7f2 100644 13 | --- a/core/java/android/hardware/display/AmbientDisplayConfiguration.java 14 | +++ b/core/java/android/hardware/display/AmbientDisplayConfiguration.java 15 | @@ -28,6 +28,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 | @@ -111,8 +114,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.43.0 50 | 51 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_frameworks_av/0010-Add-a-property-to-force-camera-timestamp-source.patch: -------------------------------------------------------------------------------- 1 | From 5624fa13fe5eb8195f68b23b764064fe526707ec 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/25] 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 4da892fae2..4c42bc5840 100644 22 | --- a/services/camera/libcameraservice/device3/Camera3Device.cpp 23 | +++ b/services/camera/libcameraservice/device3/Camera3Device.cpp 24 | @@ -234,8 +234,16 @@ status_t Camera3Device::initializeCommonLocked(sp manager 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.43.0 45 | 46 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_frameworks_av/0008-There-are-three-SCO-devices.-Fallback-from-one-to-th.patch: -------------------------------------------------------------------------------- 1 | From 884123d101853d6e6699db16092368e812591313 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/25] 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 2d8231a3e1..1f1064ee44 100644 14 | --- a/services/audiopolicy/common/managerdefinitions/src/HwModule.cpp 15 | +++ b/services/audiopolicy/common/managerdefinitions/src/HwModule.cpp 16 | @@ -331,6 +331,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.43.0 46 | 47 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_frameworks_opt_telephony/0004-Reintroduce-public-void-TelephonyMetrics.writeRilSen.patch: -------------------------------------------------------------------------------- 1 | From 4b2c5bf0ebc327c478c348364c2f0996d3ee60cc 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/12] 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.43.0 46 | 47 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_frameworks_base/0053-Allow-spoofing-signingInfo-for-microG-Companion-Serv.patch: -------------------------------------------------------------------------------- 1 | From 44bd0c75938612340a9a23764156a4ff4025d19d Mon Sep 17 00:00:00 2001 2 | From: Jonathan Klee 3 | Date: Thu, 12 Dec 2024 15:27:57 +0100 4 | Subject: [PATCH 53/55] Allow spoofing signingInfo for microG 5 | Companion/Services 6 | 7 | - Spoof PackageInfo signingInfo + signatures so that 8 | G suite apps do not complain anymore. 9 | 10 | Change-Id: I86f182c9e1d18b0e997803842577a90ef740cfd1 11 | Signed-off-by: althafvly 12 | --- 13 | .../java/com/android/server/pm/ComputerEngine.java | 13 +++++++++++++ 14 | 1 file changed, 13 insertions(+) 15 | 16 | diff --git a/services/core/java/com/android/server/pm/ComputerEngine.java b/services/core/java/com/android/server/pm/ComputerEngine.java 17 | index e73128ce30a5..14836d6bcc6c 100644 18 | --- a/services/core/java/com/android/server/pm/ComputerEngine.java 19 | +++ b/services/core/java/com/android/server/pm/ComputerEngine.java 20 | @@ -170,6 +170,7 @@ import java.io.FileOutputStream; 21 | import java.io.IOException; 22 | import java.io.PrintWriter; 23 | import java.nio.charset.StandardCharsets; 24 | +import java.security.cert.CertificateException; 25 | import java.util.ArrayList; 26 | import java.util.Arrays; 27 | import java.util.Collection; 28 | @@ -1583,6 +1584,18 @@ public class ComputerEngine implements Computer { 29 | 30 | generateFakeSignature(p).ifPresent(fakeSignature -> { 31 | packageInfo.signatures = new Signature[]{fakeSignature}; 32 | + try { 33 | + packageInfo.signingInfo = new SigningInfo( 34 | + new SigningDetails( 35 | + packageInfo.signatures, 36 | + SigningDetails.SignatureSchemeVersion.SIGNING_BLOCK_V3, 37 | + SigningDetails.toSigningKeys(packageInfo.signatures), 38 | + null 39 | + ) 40 | + ); 41 | + } catch (CertificateException e) { 42 | + Slog.e(TAG, "Caught an exception when creating signing keys: ", e); 43 | + } 44 | }); 45 | 46 | return packageInfo; 47 | -- 48 | 2.43.0 49 | 50 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_frameworks_av/0018-voip-Fix-high-pitched-voice-on-Qualcomm-devices.patch: -------------------------------------------------------------------------------- 1 | From 3805ebcf3760a4c57c9a1d23d7a7b9a9d2be822b Mon Sep 17 00:00:00 2001 2 | From: ponces 3 | Date: Mon, 24 Oct 2022 09:38:34 +0100 4 | Subject: [PATCH 18/25] 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 2cbf8d089ff..da5200ba463 100644 14 | --- a/src/com/android/settings/biometrics/fingerprint/FingerprintEnrollEnrolling.java 15 | +++ b/src/com/android/settings/biometrics/fingerprint/FingerprintEnrollEnrolling.java 16 | @@ -860,6 +860,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 aeb0dac97c4..82d1e9c07d6 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.43.0 40 | 41 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_frameworks_base/0008-Re-order-services-so-that-it-works-even-without-qtag.patch: -------------------------------------------------------------------------------- 1 | From 636a8cd78ba912ab59485549909a653f721fa353 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/55] 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 1d376b4bdfd5..b7f8d48c4fe6 100644 13 | --- a/services/core/java/com/android/server/net/NetworkPolicyManagerService.java 14 | +++ b/services/core/java/com/android/server/net/NetworkPolicyManagerService.java 15 | @@ -1026,6 +1026,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 | @@ -1033,10 +1037,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 | mUseMeteredFirewallChains = Flags.useMeteredFirewallChains(); 35 | mUseDifferentDelaysForBackgroundChain = Flags.useDifferentDelaysForBackgroundChain(); 36 | mNeverApplyRulesToCoreUids = Flags.neverApplyRulesToCoreUids(); 37 | -- 38 | 2.43.0 39 | 40 | -------------------------------------------------------------------------------- /patches/trebledroid/platform_frameworks_base/0052-Add-support-for-treating-virtual-biometric-sensors-a.patch: -------------------------------------------------------------------------------- 1 | From 00c324dbe0870152faf6668344a3aa0806310a94 Mon Sep 17 00:00:00 2001 2 | From: Peter Cai 3 | Date: Sat, 21 Dec 2024 11:04:35 -0500 4 | Subject: [PATCH 52/55] Add support for treating virtual biometric sensors as 5 | real ones 6 | 7 | This happens on Unihertz Jelly Max. They forgot to change their sensor 8 | instance name from "virtual" to something else. 9 | 10 | Change-Id: I106d41cd078e6b1e354c72ec35fa240a44397c5e 11 | --- 12 | .../fingerprint/FingerprintSensorConfigurations.java | 7 ++++++- 13 | 1 file changed, 6 insertions(+), 1 deletion(-) 14 | 15 | diff --git a/core/java/android/hardware/fingerprint/FingerprintSensorConfigurations.java b/core/java/android/hardware/fingerprint/FingerprintSensorConfigurations.java 16 | index 586830c8d189..d7fcfdb6df2b 100644 17 | --- a/core/java/android/hardware/fingerprint/FingerprintSensorConfigurations.java 18 | +++ b/core/java/android/hardware/fingerprint/FingerprintSensorConfigurations.java 19 | @@ -29,6 +29,7 @@ import android.os.Parcel; 20 | import android.os.Parcelable; 21 | import android.os.RemoteException; 22 | import android.os.ServiceManager; 23 | +import android.os.SystemProperties; 24 | import android.util.Log; 25 | import android.util.Slog; 26 | 27 | @@ -172,6 +173,10 @@ public class FingerprintSensorConfigurations implements Parcelable { 28 | * @return real fqName 29 | */ 30 | public static String remapFqName(String fqName) { 31 | + if (SystemProperties.getBoolean("persist.sys.phh.virtual_sensors_are_real", false)) { 32 | + return fqName; 33 | + } 34 | + 35 | if (!fqName.contains(IFingerprint.DESCRIPTOR + "/virtual")) { 36 | return fqName; //no remap needed for real hardware HAL 37 | } else { 38 | @@ -185,7 +190,7 @@ public class FingerprintSensorConfigurations implements Parcelable { 39 | * @return aidl interface 40 | */ 41 | public static IFingerprint getIFingerprint(String fqName) { 42 | - if (fqName.contains("virtual")) { 43 | + if (fqName.contains("virtual") && !SystemProperties.getBoolean("persist.sys.phh.virtual_sensors_are_real", false)) { 44 | String fqNameMapped = remapFqName(fqName); 45 | Slog.i(TAG, "getIFingerprint fqName is mapped: " + fqName + "->" + fqNameMapped); 46 | try { 47 | -- 48 | 2.43.0 49 | 50 | --------------------------------------------------------------------------------