diff --git a/patches/personal/device_phh_treble/04-Rework-securize-tweak.patch b/patches/personal/device_phh_treble/03-Rework-securize-tweak.patch similarity index 100% rename from patches/personal/device_phh_treble/04-Rework-securize-tweak.patch rename to patches/personal/device_phh_treble/03-Rework-securize-tweak.patch diff --git a/patches/personal/platform_vendor_aosp/04-Revert-Move-out-CertifiedPropsOverlay-and-partition-order-definiton.patch b/patches/personal/platform_vendor_aosp/04-Revert-Move-out-CertifiedPropsOverlay-and-partition-order-definiton.patch deleted file mode 100644 index d3b466c..0000000 --- a/patches/personal/platform_vendor_aosp/04-Revert-Move-out-CertifiedPropsOverlay-and-partition-order-definiton.patch +++ /dev/null @@ -1,120 +0,0 @@ -From dbf65b202dcf044382ad0ee43ac66bb9981d1b80 Mon Sep 17 00:00:00 2001 -From: MisterZtr -Date: Fri Jan 26 15:43:24 2024 +0300 -Subject: [PATCH] Revert "overlay: Move out CertifiedPropsOverlay and partition order definiton" - -This reverts commit b4a22409743f39f5bd381f62484ea7e5498f0bee. - -diff --git a/config/common.mk b/config/common.mk -index bd55ac78..67b121c5 100644 ---- a/config/common.mk -+++ b/config/common.mk -@@ -94,6 +94,10 @@ PRODUCT_COPY_FILES += \ - vendor/aosp/config/permissions/privapp-permissions-lineagehw.xml:$(TARGET_COPY_OUT_SYSTEM_EXT)/etc/permissions/privapp-permissions-lineagehw.xml - - # Overlay -+PRODUCT_COPY_FILES += \ -+ vendor/aosp/overlay/rro_packages/config-system_ext.xml:$(TARGET_COPY_OUT_SYSTEM_EXT)/overlay/config/config.xml \ -+ vendor/aosp/overlay/rro_packages/partition_order.xml:$(TARGET_COPY_OUT_PRODUCT)/overlay/partition_order.xml -+ - PRODUCT_PRODUCT_PROPERTIES += \ - ro.boot.vendor.overlay.theme=com.android.internal.systemui.navbar.gestural;com.google.android.systemui.gxoverlay - -@@ -221,6 +225,7 @@ PRODUCT_PACKAGE_OVERLAYS += \ - - PRODUCT_PACKAGES += \ - AndroidBlackThemeOverlay \ -+ CertifiedPropsOverlay \ - CustomFontPixelLauncherOverlay \ - DocumentsUIOverlay \ - NetworkStackOverlay \ -diff --git a/overlay/rro_packages/CertifiedPropsOverlay/Android.bp b/overlay/rro_packages/CertifiedPropsOverlay/Android.bp -new file mode 100644 -index 00000000..7c839f9c ---- /dev/null -+++ b/overlay/rro_packages/CertifiedPropsOverlay/Android.bp -@@ -0,0 +1,10 @@ -+// -+// Copyright (C) 2023 Paranoid Android -+// -+// SPDX-License-Identifier: Apache-2.0 -+// -+ -+runtime_resource_overlay { -+ name: "CertifiedPropsOverlay", -+ system_ext_specific: true, -+} -diff --git a/overlay/rro_packages/CertifiedPropsOverlay/AndroidManifest.xml b/overlay/rro_packages/CertifiedPropsOverlay/AndroidManifest.xml -new file mode 100644 -index 00000000..2e3624fc ---- /dev/null -+++ b/overlay/rro_packages/CertifiedPropsOverlay/AndroidManifest.xml -@@ -0,0 +1,10 @@ -+ -+ -+ -+ -+ -+ -diff --git a/overlay/rro_packages/CertifiedPropsOverlay/res/values/config.xml b/overlay/rro_packages/CertifiedPropsOverlay/res/values/config.xml -new file mode 100644 -index 00000000..1a32d8e2 ---- /dev/null -+++ b/overlay/rro_packages/CertifiedPropsOverlay/res/values/config.xml -@@ -0,0 +1,17 @@ -+ -+ -+ -+ -+ -+ PRODUCT:ferrari -+ DEVICE:ferrari -+ MANUFACTURER:Xiaomi -+ BRAND:xiaomi -+ MODEL:Mi 4i -+ FINGERPRINT:Xiaomi/ferrari/ferrari:5.0.2/LRX22G/V6.4.10.0.LXIMICB:user/release-keys -+ VERSION.SECURITY_PATCH:2019-08-05 -+ -+ -diff --git a/overlay/rro_packages/config-system_ext.xml b/overlay/rro_packages/config-system_ext.xml -new file mode 100644 -index 00000000..6271c411 ---- /dev/null -+++ b/overlay/rro_packages/config-system_ext.xml -@@ -0,0 +1,8 @@ -+ -+ -+ -+ -+ -diff --git a/overlay/rro_packages/partition_order.xml b/overlay/rro_packages/partition_order.xml -new file mode 100644 -index 00000000..d2914e07 ---- /dev/null -+++ b/overlay/rro_packages/partition_order.xml -@@ -0,0 +1,13 @@ -+ -+ -+ -+ -+ -+ -+ -+ -+ -+ --- -2.34.1 diff --git a/patches/personal/device_phh_treble/03-board-Set-BOARD_EXT4_SHARE_DUP_BLOCKS-explicitly.patch b/patches/slim/device_phh_treble/01-board-Set-BOARD_EXT4_SHARE_DUP_BLOCKS-explicitly.patch similarity index 90% rename from patches/personal/device_phh_treble/03-board-Set-BOARD_EXT4_SHARE_DUP_BLOCKS-explicitly.patch rename to patches/slim/device_phh_treble/01-board-Set-BOARD_EXT4_SHARE_DUP_BLOCKS-explicitly.patch index 27baaf7..dcb8e50 100644 --- a/patches/personal/device_phh_treble/03-board-Set-BOARD_EXT4_SHARE_DUP_BLOCKS-explicitly.patch +++ b/patches/slim/device_phh_treble/01-board-Set-BOARD_EXT4_SHARE_DUP_BLOCKS-explicitly.patch @@ -1,7 +1,7 @@ From d7b179f234d76c3acf7a723fc05f07efe9adc84c Mon Sep 17 00:00:00 2001 From: Andy CrossGate Yan Date: Sun, 8 Aug 2021 09:29:32 +0000 -Subject: [PATCH 5/6] board: Set BOARD_EXT4_SHARE_DUP_BLOCKS explicitly +Subject: [PATCH 1] board: Set BOARD_EXT4_SHARE_DUP_BLOCKS explicitly Change-Id: I725443154fabde548d2e6c1b072d34c27596c421 --- diff --git a/patches/slim/platform_vendor_gms/01-slim.patch b/patches/slim/platform_vendor_gms/01-slim.patch new file mode 100644 index 0000000..2a49746 --- /dev/null +++ b/patches/slim/platform_vendor_gms/01-slim.patch @@ -0,0 +1,38 @@ +diff --git a/common/common-vendor.mk b/common/common-vendor.mk +index a0fd3a7..df5b01c 100644 +--- a/common/common-vendor.mk ++++ b/common/common-vendor.mk +@@ -192,25 +192,18 @@ PRODUCT_PACKAGES += \ + GoogleTTS \ + LatinIMEGooglePrebuilt \ + LocationHistoryPrebuilt \ +- Maps \ + MarkupGoogle \ + ModuleMetadataGoogle \ + NgaResources \ +- Photos \ + PixelThemesStub \ + PixelThemesStub2022_and_newer \ + PrebuiltDeskClockGoogle \ +- PrebuiltGmail \ + SoundAmplifierPrebuilt \ + SoundPickerPrebuilt \ + SwitchAccessPrebuilt \ + TrichromeLibrary-Stub \ +- WallpaperEmojiPrebuilt \ + WebViewGoogle-Stub \ +- talkback \ + AICorePrebuilt \ +- AiWallpapers \ +- AndroidAutoStubPrebuilt \ + ConfigUpdater \ + DeviceIntelligenceNetworkPrebuilt \ + DevicePersonalizationPrebuiltPixel2023 \ +@@ -239,7 +232,6 @@ PRODUCT_PACKAGES += \ + SettingsIntelligenceGooglePrebuilt \ + SetupWizardPrebuilt \ + TurboPrebuilt \ +- Velvet \ + WallpaperEffect \ + WeatherPixelPrebuilt \ + WellbeingPrebuilt \ diff --git a/patches/trebledroid/platform_build/0001-Remove-init.vndk-nodef.rc.patch b/patches/trebledroid/platform_build/0001-Remove-init.vndk-nodef.rc.patch index 2dc1c1e..1545cf0 100644 --- a/patches/trebledroid/platform_build/0001-Remove-init.vndk-nodef.rc.patch +++ b/patches/trebledroid/platform_build/0001-Remove-init.vndk-nodef.rc.patch @@ -1,4 +1,4 @@ -From d1fd9a169f306f3c2ab34216b7763a9cd227c5aa Mon Sep 17 00:00:00 2001 +From 2c761f1b349683e9393c41f2d170aa4090f09c88 Mon Sep 17 00:00:00 2001 From: Andy CrossGate Yan Date: Wed, 8 Dec 2021 07:04:53 +0000 Subject: [PATCH 1/4] Remove init.vndk-nodef.rc diff --git a/patches/trebledroid/platform_build/0002-build-Remove-llkd.patch b/patches/trebledroid/platform_build/0002-build-Remove-llkd.patch index e9e64cd..74bdd3e 100644 --- a/patches/trebledroid/platform_build/0002-build-Remove-llkd.patch +++ b/patches/trebledroid/platform_build/0002-build-Remove-llkd.patch @@ -1,4 +1,4 @@ -From c739128901f7dc86cf6e6dbd682cfb5953c55ea2 Mon Sep 17 00:00:00 2001 +From 0f61dd6a9130e87b807b42bd715268186f2ceb3e Mon Sep 17 00:00:00 2001 From: Andy CrossGate Yan Date: Thu, 14 Oct 2021 12:20:52 +0000 Subject: [PATCH 2/4] build: Remove llkd diff --git a/patches/trebledroid/platform_build/0003-Include-vndk-v28-sepolicy-support.patch b/patches/trebledroid/platform_build/0003-Include-vndk-v28-sepolicy-support.patch index 6a5a166..a80868b 100644 --- a/patches/trebledroid/platform_build/0003-Include-vndk-v28-sepolicy-support.patch +++ b/patches/trebledroid/platform_build/0003-Include-vndk-v28-sepolicy-support.patch @@ -1,4 +1,4 @@ -From 4548fb7bd2baddbc6e869837fd0e9d924e846d98 Mon Sep 17 00:00:00 2001 +From dee022cf161b49ea30d6ea46ed0c23e9f13671dc Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Fri, 6 Oct 2023 19:11:22 -0400 Subject: [PATCH 3/4] Include vndk v28 sepolicy support diff --git a/patches/trebledroid/platform_frameworks_av/0001-APM-Restore-S-R-and-Q-behavior-respectively-for-tele.patch b/patches/trebledroid/platform_frameworks_av/0001-APM-Restore-S-R-and-Q-behavior-respectively-for-tele.patch index 1e851b4..6d02992 100644 --- a/patches/trebledroid/platform_frameworks_av/0001-APM-Restore-S-R-and-Q-behavior-respectively-for-tele.patch +++ b/patches/trebledroid/platform_frameworks_av/0001-APM-Restore-S-R-and-Q-behavior-respectively-for-tele.patch @@ -1,7 +1,7 @@ -From 0ce483b76b0639679445a8b502e2a02a7ddb3a08 Mon Sep 17 00:00:00 2001 +From 11d3723a8e59eb1a0ea72643583c56fea6799868 Mon Sep 17 00:00:00 2001 From: Peter Cai Date: Thu, 18 Aug 2022 15:44:46 -0400 -Subject: [PATCH 01/25] APM: Restore S, R and Q behavior respectively for +Subject: [PATCH 01/24] APM: Restore S, R and Q behavior respectively for telephony audio This conditionally reverts part of b2e5cb (T), 51c9cc (S) and afd4ce (R) diff --git a/patches/trebledroid/platform_frameworks_av/0002-Fix-BT-in-call-on-CAF-devices.patch b/patches/trebledroid/platform_frameworks_av/0002-Fix-BT-in-call-on-CAF-devices.patch index d2ddf97..43fb293 100644 --- a/patches/trebledroid/platform_frameworks_av/0002-Fix-BT-in-call-on-CAF-devices.patch +++ b/patches/trebledroid/platform_frameworks_av/0002-Fix-BT-in-call-on-CAF-devices.patch @@ -1,7 +1,7 @@ -From 067d1109e08d270389f9cda89b9bfd84cd658cdc Mon Sep 17 00:00:00 2001 +From 025f47f896e8143bcb25b72be5b8ff0e6cc560b4 Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Mon, 5 Aug 2019 18:09:50 +0200 -Subject: [PATCH 02/25] Fix BT in-call on CAF devices +Subject: [PATCH 02/24] Fix BT in-call on CAF devices See https://github.com/phhusson/treble_experimentations/issues/374 diff --git a/patches/trebledroid/platform_frameworks_av/0003-Add-partial-cam-id-is-hardcoded-support-for-Asus-ZF6.patch b/patches/trebledroid/platform_frameworks_av/0003-Add-partial-cam-id-is-hardcoded-support-for-Asus-ZF6.patch index f2d4e00..ddd58f5 100644 --- a/patches/trebledroid/platform_frameworks_av/0003-Add-partial-cam-id-is-hardcoded-support-for-Asus-ZF6.patch +++ b/patches/trebledroid/platform_frameworks_av/0003-Add-partial-cam-id-is-hardcoded-support-for-Asus-ZF6.patch @@ -1,7 +1,7 @@ -From c65401ae96b1876be58e5097f9eaae5143ceb179 Mon Sep 17 00:00:00 2001 +From 70219b88e4162a5dfe09048e455651b50c88dbe2 Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Tue, 1 Oct 2019 13:35:49 +0200 -Subject: [PATCH 03/25] Add (partial, cam id is hardcoded) support for Asus ZF6 +Subject: [PATCH 03/24] Add (partial, cam id is hardcoded) support for Asus ZF6 motor camera Change-Id: Iea6e1370780a1d16f728748d1d948d092532d8fe diff --git a/patches/trebledroid/platform_frameworks_av/0004-APM-Optionally-force-load-audio-policy-for-system-si.patch b/patches/trebledroid/platform_frameworks_av/0004-APM-Optionally-force-load-audio-policy-for-system-si.patch index d6a5c4d..3f7343a 100644 --- a/patches/trebledroid/platform_frameworks_av/0004-APM-Optionally-force-load-audio-policy-for-system-si.patch +++ b/patches/trebledroid/platform_frameworks_av/0004-APM-Optionally-force-load-audio-policy-for-system-si.patch @@ -1,7 +1,7 @@ -From d317cda34211e3d65dcad6cf358724b92910bc4a Mon Sep 17 00:00:00 2001 +From deec1d7231558483ad19a3f4631692c4e9357db3 Mon Sep 17 00:00:00 2001 From: Peter Cai Date: Wed, 24 Aug 2022 15:42:39 -0400 -Subject: [PATCH 04/25] APM: Optionally force-load audio policy for system-side +Subject: [PATCH 04/24] APM: Optionally force-load audio policy for system-side bt audio HAL Required to support our system-side bt audio implementation, i.e. diff --git a/patches/trebledroid/platform_frameworks_av/0005-APM-Remove-A2DP-audio-ports-from-the-primary-HAL.patch b/patches/trebledroid/platform_frameworks_av/0005-APM-Remove-A2DP-audio-ports-from-the-primary-HAL.patch index 8846934..4f44d22 100644 --- a/patches/trebledroid/platform_frameworks_av/0005-APM-Remove-A2DP-audio-ports-from-the-primary-HAL.patch +++ b/patches/trebledroid/platform_frameworks_av/0005-APM-Remove-A2DP-audio-ports-from-the-primary-HAL.patch @@ -1,7 +1,7 @@ -From 412b0b5ef674679daadf240da7d3a8b0f25cde89 Mon Sep 17 00:00:00 2001 +From 8bacda4dd850ade768ca0cc9f873964373dcf3b4 Mon Sep 17 00:00:00 2001 From: Peter Cai Date: Thu, 25 Aug 2022 13:30:29 -0400 -Subject: [PATCH 05/25] APM: Remove A2DP audio ports from the primary HAL +Subject: [PATCH 05/24] APM: Remove A2DP audio ports from the primary HAL These ports defined in the primary HAL are intended for A2DP offloading, however they do not work in general on GSIs, and will interfere with diff --git a/patches/trebledroid/platform_frameworks_av/0006-audiopolicy-try-again-with-trimmed-audio-port-name-i.patch b/patches/trebledroid/platform_frameworks_av/0006-audiopolicy-try-again-with-trimmed-audio-port-name-i.patch index 5948d8e..b590397 100644 --- a/patches/trebledroid/platform_frameworks_av/0006-audiopolicy-try-again-with-trimmed-audio-port-name-i.patch +++ b/patches/trebledroid/platform_frameworks_av/0006-audiopolicy-try-again-with-trimmed-audio-port-name-i.patch @@ -1,7 +1,7 @@ -From 440ae946c64ac6244140ab9eddb0a3958217776d Mon Sep 17 00:00:00 2001 +From 9cefac7680f34a755a85f1072c61b349e4f55af7 Mon Sep 17 00:00:00 2001 From: Peter Cai Date: Thu, 23 Jan 2020 11:13:43 +0800 -Subject: [PATCH 06/25] audiopolicy: try again with trimmed audio port name if +Subject: [PATCH 06/24] audiopolicy: try again with trimmed audio port name if not found * In Spreadtrum BSP, some audio routes may contain ports with extra diff --git a/patches/trebledroid/platform_frameworks_av/0007-camera-Implement-property-to-override-default-camera.patch b/patches/trebledroid/platform_frameworks_av/0007-camera-Implement-property-to-override-default-camera.patch index 41bdbe5..8d5746f 100644 --- a/patches/trebledroid/platform_frameworks_av/0007-camera-Implement-property-to-override-default-camera.patch +++ b/patches/trebledroid/platform_frameworks_av/0007-camera-Implement-property-to-override-default-camera.patch @@ -1,7 +1,7 @@ -From a457829cc8a6f29f3236ff2209ebf78d333800c5 Mon Sep 17 00:00:00 2001 +From 04f57f755d28b8a76c721edd9f0296fc68a03380 Mon Sep 17 00:00:00 2001 From: Peter Cai Date: Wed, 1 Jun 2022 16:56:46 -0400 -Subject: [PATCH 07/25] camera: Implement property to override default camera +Subject: [PATCH 07/24] camera: Implement property to override default camera Complement to the frameworks/base patch. diff --git a/patches/trebledroid/platform_frameworks_av/0008-There-are-three-SCO-devices.-Fallback-from-one-to-th.patch b/patches/trebledroid/platform_frameworks_av/0008-There-are-three-SCO-devices.-Fallback-from-one-to-th.patch index 5b0b30a..87ce98c 100644 --- a/patches/trebledroid/platform_frameworks_av/0008-There-are-three-SCO-devices.-Fallback-from-one-to-th.patch +++ b/patches/trebledroid/platform_frameworks_av/0008-There-are-three-SCO-devices.-Fallback-from-one-to-th.patch @@ -1,7 +1,7 @@ -From 50005d05fdebfc6504f0c6493f57179f4abf3419 Mon Sep 17 00:00:00 2001 +From ef1c279c270e72e1d90bad76d2f1570f3f4759f2 Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Mon, 13 Apr 2020 21:01:16 +0200 -Subject: [PATCH 08/25] There are three SCO devices. Fallback from one to the +Subject: [PATCH 08/24] There are three SCO devices. Fallback from one to the others if needed Change-Id: I414dcb6b154855c00cb8520b23dc1069827864b2 diff --git a/patches/trebledroid/platform_frameworks_av/0009-Add-persist.sys.phh.samsung.camera_ids-property-to-a.patch b/patches/trebledroid/platform_frameworks_av/0009-Add-persist.sys.phh.samsung.camera_ids-property-to-a.patch index 17da4f2..79afb4b 100644 --- a/patches/trebledroid/platform_frameworks_av/0009-Add-persist.sys.phh.samsung.camera_ids-property-to-a.patch +++ b/patches/trebledroid/platform_frameworks_av/0009-Add-persist.sys.phh.samsung.camera_ids-property-to-a.patch @@ -1,7 +1,7 @@ -From bace802dce1865ebe2170fb8d485dcdac788e3b5 Mon Sep 17 00:00:00 2001 +From 61bebb90f1a2770799d121a4155492c3888822eb Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Thu, 14 May 2020 19:54:55 +0200 -Subject: [PATCH 09/25] Add persist.sys.phh.samsung.camera_ids property to +Subject: [PATCH 09/24] Add persist.sys.phh.samsung.camera_ids property to access hidden Samsung cameras Change-Id: I2c7bf535272acc28ed2277e96c78ddd28a0b4593 diff --git a/patches/trebledroid/platform_frameworks_av/0010-Add-a-property-to-force-camera-timestamp-source.patch b/patches/trebledroid/platform_frameworks_av/0010-Add-a-property-to-force-camera-timestamp-source.patch index 50eae98..fc1bc95 100644 --- a/patches/trebledroid/platform_frameworks_av/0010-Add-a-property-to-force-camera-timestamp-source.patch +++ b/patches/trebledroid/platform_frameworks_av/0010-Add-a-property-to-force-camera-timestamp-source.patch @@ -1,7 +1,7 @@ -From 9d40546cff0d63cc2b90738a2f0d44123dc10017 Mon Sep 17 00:00:00 2001 +From 9a9328692e8b9e19a6f8b66b09ec149f72155eaf Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Tue, 19 May 2020 14:01:14 +0200 -Subject: [PATCH 10/25] Add a property to force camera timestamp source +Subject: [PATCH 10/24] Add a property to force camera timestamp source Some devices wrongly report their timesource Camera's timesource can either be CLOCK_MONOTONIC, or CLOCK_BOOTTIME diff --git a/patches/trebledroid/platform_frameworks_av/0011-FIH-devices-Fix-Earpiece-audio-output.patch b/patches/trebledroid/platform_frameworks_av/0011-FIH-devices-Fix-Earpiece-audio-output.patch index f72cf47..a0b265b 100644 --- a/patches/trebledroid/platform_frameworks_av/0011-FIH-devices-Fix-Earpiece-audio-output.patch +++ b/patches/trebledroid/platform_frameworks_av/0011-FIH-devices-Fix-Earpiece-audio-output.patch @@ -1,7 +1,7 @@ -From 0b7ccc5b861998d3716fe3417c8c8f572d362aa6 Mon Sep 17 00:00:00 2001 +From 12bf6d6a1bc903a970fa1844cf10f0a99bae5527 Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Tue, 24 Apr 2018 00:14:28 +0200 -Subject: [PATCH 11/25] FIH devices: Fix "Earpiece" audio output +Subject: [PATCH 11/24] FIH devices: Fix "Earpiece" audio output On some FIH devices (confirmed on Razer, and probably on Aquos SS2), Earpiece is not listed in attachedDevices, and devicePort's profile diff --git a/patches/trebledroid/platform_frameworks_av/0012-No-longer-make-re-assigning-legacy-audio-groups-fata.patch b/patches/trebledroid/platform_frameworks_av/0012-No-longer-make-re-assigning-legacy-audio-groups-fata.patch index e5ee037..6de5f27 100644 --- a/patches/trebledroid/platform_frameworks_av/0012-No-longer-make-re-assigning-legacy-audio-groups-fata.patch +++ b/patches/trebledroid/platform_frameworks_av/0012-No-longer-make-re-assigning-legacy-audio-groups-fata.patch @@ -1,7 +1,7 @@ -From 8c6c88927f564c168590cec478d1b915bd048c56 Mon Sep 17 00:00:00 2001 +From 555255b74b671c879ff24730be94682064893960 Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Sat, 12 Sep 2020 12:32:50 +0200 -Subject: [PATCH 12/25] No longer make re-assigning legacy audio groups fatal. +Subject: [PATCH 12/24] No longer make re-assigning legacy audio groups fatal. Mi9 declares AUDIO_STREAM_PATCH and AUDIO_STREAM_REROUTING which is defined by framework too diff --git a/patches/trebledroid/platform_frameworks_av/0013-Make-camera-IDs-filter-out-optional.patch b/patches/trebledroid/platform_frameworks_av/0013-Make-camera-IDs-filter-out-optional.patch index 7751b30..66efa79 100644 --- a/patches/trebledroid/platform_frameworks_av/0013-Make-camera-IDs-filter-out-optional.patch +++ b/patches/trebledroid/platform_frameworks_av/0013-Make-camera-IDs-filter-out-optional.patch @@ -1,7 +1,7 @@ -From fa0bb467c60fd07dbf3e1c91714553cc3473d3f3 Mon Sep 17 00:00:00 2001 +From 7d5202fa3c6695b6f2777b0439d556ada2a25563 Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Mon, 21 Dec 2020 20:19:11 +0100 -Subject: [PATCH 13/25] Make camera IDs filter-out optional +Subject: [PATCH 13/24] Make camera IDs filter-out optional Nowadays most people have Camera 2 apps, and would like to have all cameras, rather than limit which cameras are available. diff --git a/patches/trebledroid/platform_frameworks_av/0014-Support-Samsung-R-multi-cams.patch b/patches/trebledroid/platform_frameworks_av/0014-Support-Samsung-R-multi-cams.patch index 355ee7d..90d81d0 100644 --- a/patches/trebledroid/platform_frameworks_av/0014-Support-Samsung-R-multi-cams.patch +++ b/patches/trebledroid/platform_frameworks_av/0014-Support-Samsung-R-multi-cams.patch @@ -1,7 +1,7 @@ -From 3c945907c90ffd43562112b8e2a68f05d548ae68 Mon Sep 17 00:00:00 2001 +From fc237c765b88c235e1d1ddb00c7229d26f1fe986 Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Sat, 13 Mar 2021 14:20:03 -0500 -Subject: [PATCH 14/25] Support Samsung R multi-cams +Subject: [PATCH 14/24] Support Samsung R multi-cams Change-Id: If46f385e8dd16185cbf37ab083e6a1242e1d1555 --- diff --git a/patches/trebledroid/platform_frameworks_av/0015-Not-all-sources-in-a-route-are-valid.-Dont-ignore-th.patch b/patches/trebledroid/platform_frameworks_av/0015-Not-all-sources-in-a-route-are-valid.-Dont-ignore-th.patch index d39e08f..7ebcdf3 100644 --- a/patches/trebledroid/platform_frameworks_av/0015-Not-all-sources-in-a-route-are-valid.-Dont-ignore-th.patch +++ b/patches/trebledroid/platform_frameworks_av/0015-Not-all-sources-in-a-route-are-valid.-Dont-ignore-th.patch @@ -1,7 +1,7 @@ -From 669dc10ff7e3e348817b05df8266c6f6fc8cab58 Mon Sep 17 00:00:00 2001 +From 05d99516d1a6a87cfe43983be6273b1afa6fe48f Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Sun, 28 Mar 2021 18:54:47 +0200 -Subject: [PATCH 15/25] Not all sources in a route are valid. Dont ignore the +Subject: [PATCH 15/24] Not all sources in a route are valid. Dont ignore the whole route because of one broken source Change-Id: If8a51740e71bef3a4738262ad7b43a337b0ec36d diff --git a/patches/trebledroid/platform_frameworks_av/0016-Use-a-fake-volume-policy-when-none-has-been-found.patch b/patches/trebledroid/platform_frameworks_av/0016-Use-a-fake-volume-policy-when-none-has-been-found.patch index b0a1d62..55e1dae 100644 --- a/patches/trebledroid/platform_frameworks_av/0016-Use-a-fake-volume-policy-when-none-has-been-found.patch +++ b/patches/trebledroid/platform_frameworks_av/0016-Use-a-fake-volume-policy-when-none-has-been-found.patch @@ -1,7 +1,7 @@ -From 11afe94186d6e7ddecfaba83192b68b47e6e2989 Mon Sep 17 00:00:00 2001 +From 8414f4087b3242fc934c0d7bc5c070b08ea4c91e Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Sun, 28 Mar 2021 14:48:49 +0200 -Subject: [PATCH 16/25] Use a fake volume policy when none has been found +Subject: [PATCH 16/24] Use a fake volume policy when none has been found This is useful, because on Samsung devices, the "real" (=non-gsi-cheating) audio policy doesn't have any volume policy. diff --git a/patches/trebledroid/platform_frameworks_av/0017-Revert-Remove-support-for-audio-HAL-V2-from-the-fram.patch b/patches/trebledroid/platform_frameworks_av/0017-Revert-Remove-support-for-audio-HAL-V2-from-the-fram.patch index da09077..ec29a04 100644 --- a/patches/trebledroid/platform_frameworks_av/0017-Revert-Remove-support-for-audio-HAL-V2-from-the-fram.patch +++ b/patches/trebledroid/platform_frameworks_av/0017-Revert-Remove-support-for-audio-HAL-V2-from-the-fram.patch @@ -1,7 +1,7 @@ -From d61899abe87c2cd21536bc82d5232fe99ff740f5 Mon Sep 17 00:00:00 2001 +From aa034804e443cfea15fcd33d47b913455d673458 Mon Sep 17 00:00:00 2001 From: Andy CrossGate Yan Date: Mon, 11 Oct 2021 16:10:42 -0400 -Subject: [PATCH 17/25] Revert "Remove support for audio HAL V2 from the +Subject: [PATCH 17/24] Revert "Remove support for audio HAL V2 from the framework" This reverts commit cbf517f837f7bf8a59f3ff8aa1e0e3e19612e251. diff --git a/patches/trebledroid/platform_frameworks_av/0018-Add-a-prop-to-change-Samsung-flash-strength.patch b/patches/trebledroid/platform_frameworks_av/0018-Add-a-prop-to-change-Samsung-flash-strength.patch index 7322795..3810618 100644 --- a/patches/trebledroid/platform_frameworks_av/0018-Add-a-prop-to-change-Samsung-flash-strength.patch +++ b/patches/trebledroid/platform_frameworks_av/0018-Add-a-prop-to-change-Samsung-flash-strength.patch @@ -1,7 +1,7 @@ -From fce268c782f493033ece8a182b03d42bf393e64a Mon Sep 17 00:00:00 2001 +From 8cfaa1bf23ef4a99a7e08936ba78132215f01cef Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Sat, 16 Apr 2022 14:30:14 -0400 -Subject: [PATCH 18/25] Add a prop to change Samsung flash strength +Subject: [PATCH 18/24] Add a prop to change Samsung flash strength --- services/camera/libcameraservice/Android.bp | 2 ++ diff --git a/patches/trebledroid/platform_frameworks_av/0019-voip-Fix-high-pitched-voice-on-Qualcomm-devices.patch b/patches/trebledroid/platform_frameworks_av/0019-voip-Fix-high-pitched-voice-on-Qualcomm-devices.patch index 366cf28..c7d18d1 100644 --- a/patches/trebledroid/platform_frameworks_av/0019-voip-Fix-high-pitched-voice-on-Qualcomm-devices.patch +++ b/patches/trebledroid/platform_frameworks_av/0019-voip-Fix-high-pitched-voice-on-Qualcomm-devices.patch @@ -1,7 +1,7 @@ -From fb3cb1649c0b6cd989c1e5a860c1504691280d02 Mon Sep 17 00:00:00 2001 +From a0a14e10a7e073b426c39d4a11731a95549d35ce Mon Sep 17 00:00:00 2001 From: ponces Date: Mon, 24 Oct 2022 09:38:34 +0100 -Subject: [PATCH 19/25] voip: Fix high pitched voice on Qualcomm devices +Subject: [PATCH 19/24] voip: Fix high pitched voice on Qualcomm devices --- .../common/managerdefinitions/src/Serializer.cpp | 9 +++++++++ diff --git a/patches/trebledroid/platform_frameworks_av/0020-audiopolicy-Fix-broken-mic-while-video-recording-on-.patch b/patches/trebledroid/platform_frameworks_av/0020-audiopolicy-Fix-broken-mic-while-video-recording-on-.patch index e92a187..bc798f9 100644 --- a/patches/trebledroid/platform_frameworks_av/0020-audiopolicy-Fix-broken-mic-while-video-recording-on-.patch +++ b/patches/trebledroid/platform_frameworks_av/0020-audiopolicy-Fix-broken-mic-while-video-recording-on-.patch @@ -1,7 +1,7 @@ -From e258f80a705cb48b85fb0634490b31d52966745c Mon Sep 17 00:00:00 2001 +From 7d1e195d69b1373c12ef661a74855461671eec06 Mon Sep 17 00:00:00 2001 From: Alberto Ponces Date: Sun, 30 Apr 2023 23:29:04 +0100 -Subject: [PATCH 20/25] audiopolicy: Fix broken mic while video recording on +Subject: [PATCH 20/24] audiopolicy: Fix broken mic while video recording on some Exynos devices This should fix https://github.com/phhusson/treble_experimentations/issues/2021 and https://github.com/phhusson/treble_experimentations/issues/2384. diff --git a/patches/trebledroid/platform_frameworks_av/0021-Add-a-prop-to-disable-AUDIO_OUTPUT_FLAG_FAST-from-au.patch b/patches/trebledroid/platform_frameworks_av/0021-Add-a-prop-to-disable-AUDIO_OUTPUT_FLAG_FAST-from-au.patch index ec713f1..ac0ea60 100644 --- a/patches/trebledroid/platform_frameworks_av/0021-Add-a-prop-to-disable-AUDIO_OUTPUT_FLAG_FAST-from-au.patch +++ b/patches/trebledroid/platform_frameworks_av/0021-Add-a-prop-to-disable-AUDIO_OUTPUT_FLAG_FAST-from-au.patch @@ -1,7 +1,7 @@ -From 07ad0c41b88e662c020f22584218b4b3755fb659 Mon Sep 17 00:00:00 2001 +From 494571995e975191cbe6f4af70f3f3d477fa7322 Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Mon, 30 Oct 2023 10:30:58 -0400 -Subject: [PATCH 21/25] Add a prop to disable AUDIO_OUTPUT_FLAG_FAST from audio +Subject: [PATCH 21/24] Add a prop to disable AUDIO_OUTPUT_FLAG_FAST from audio policies, when CPU can't really handle that kind of load --- diff --git a/patches/trebledroid/platform_frameworks_av/0022-Add-a-prop-to-fix-echo-on-incoming-or-outgoing-calls.patch b/patches/trebledroid/platform_frameworks_av/0022-Add-a-prop-to-fix-echo-on-incoming-or-outgoing-calls.patch index 37e7236..c9707c3 100644 --- a/patches/trebledroid/platform_frameworks_av/0022-Add-a-prop-to-fix-echo-on-incoming-or-outgoing-calls.patch +++ b/patches/trebledroid/platform_frameworks_av/0022-Add-a-prop-to-fix-echo-on-incoming-or-outgoing-calls.patch @@ -1,7 +1,7 @@ -From 431f84a224a0fea8776f0a691e792b70a8c379b3 Mon Sep 17 00:00:00 2001 +From d6085eba13430b40a3beec9d580d04aaedffd8b5 Mon Sep 17 00:00:00 2001 From: Alberto Ponces Date: Sun, 5 Nov 2023 15:18:03 +0000 -Subject: [PATCH 22/25] Add a prop to fix echo on incoming or outgoing calls +Subject: [PATCH 22/24] Add a prop to fix echo on incoming or outgoing calls May even fix audio calls altogether. diff --git a/patches/trebledroid/platform_frameworks_av/0023-Include-Samsung-AIDL-camera-ids.patch b/patches/trebledroid/platform_frameworks_av/0023-Include-Samsung-AIDL-camera-ids.patch index 5a6653c..dcb5941 100644 --- a/patches/trebledroid/platform_frameworks_av/0023-Include-Samsung-AIDL-camera-ids.patch +++ b/patches/trebledroid/platform_frameworks_av/0023-Include-Samsung-AIDL-camera-ids.patch @@ -1,7 +1,7 @@ -From f3ef47c293f03715731ed9a74f41d5bb3c079f82 Mon Sep 17 00:00:00 2001 +From c98769ef855e2c97c2f41eaf22471aa589054e10 Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Wed, 7 Feb 2024 05:06:32 -0500 -Subject: [PATCH 23/25] Include Samsung AIDL camera ids +Subject: [PATCH 23/24] Include Samsung AIDL camera ids --- services/camera/libcameraservice/Android.bp | 1 + diff --git a/patches/trebledroid/platform_frameworks_av/0024-Allow-using-camera-modes-declared-in-Samsung-proprie.patch b/patches/trebledroid/platform_frameworks_av/0024-Allow-using-camera-modes-declared-in-Samsung-proprie.patch index 692bf25..caaa246 100644 --- a/patches/trebledroid/platform_frameworks_av/0024-Allow-using-camera-modes-declared-in-Samsung-proprie.patch +++ b/patches/trebledroid/platform_frameworks_av/0024-Allow-using-camera-modes-declared-in-Samsung-proprie.patch @@ -1,7 +1,7 @@ -From eb886c17450be22f5172242c9aacf506a707733c Mon Sep 17 00:00:00 2001 +From 108065355623d9e2e6421962780d9b61258df231 Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Sat, 10 Feb 2024 09:30:19 -0500 -Subject: [PATCH 24/25] Allow using camera modes declared in Samsung +Subject: [PATCH 24/24] Allow using camera modes declared in Samsung proprietary values --- @@ -9,7 +9,7 @@ Subject: [PATCH 24/25] Allow using camera modes declared in Samsung 1 file changed, 53 insertions(+), 26 deletions(-) diff --git a/services/camera/libcameraservice/utils/SessionConfigurationUtils.cpp b/services/camera/libcameraservice/utils/SessionConfigurationUtils.cpp -index 3be8e15161..2b03d33eca 100644 +index 384f53e23d..cbe43b1a83 100644 --- a/services/camera/libcameraservice/utils/SessionConfigurationUtils.cpp +++ b/services/camera/libcameraservice/utils/SessionConfigurationUtils.cpp @@ -168,35 +168,62 @@ bool roundBufferDimensionNearest(int32_t width, int32_t height, diff --git a/patches/trebledroid/platform_frameworks_av/0025-libcameraservice-Use-the-correct-vendor-tag-id-type-.patch b/patches/trebledroid/platform_frameworks_av/0025-libcameraservice-Use-the-correct-vendor-tag-id-type-.patch deleted file mode 100644 index a2af985..0000000 --- a/patches/trebledroid/platform_frameworks_av/0025-libcameraservice-Use-the-correct-vendor-tag-id-type-.patch +++ /dev/null @@ -1,48 +0,0 @@ -From afc4c7a1679bc9697b3c4e2e4ec6c3d7bc57d22b Mon Sep 17 00:00:00 2001 -From: danielml -Date: Tue, 26 Mar 2024 11:49:00 +0100 -Subject: [PATCH 25/25] libcameraservice: Use the correct vendor tag id type on - filterParameters - -This fixes an overflow caused by using the `int` type, thus breaking -the camera on cases where the actual vendor tag id is bigger than the -maximum value `int` can hold. - -Test: Open camera, make sure that preview shows correctly and that - there are no vendor tag errors in logs. -Change-Id: Ia00e9e3fcc737bfaf0a917f11690f15d686441ba -Signed-off-by: danielml ---- - .../camera/libcameraservice/utils/SessionConfigurationUtils.cpp | 2 +- - .../camera/libcameraservice/utils/SessionConfigurationUtils.h | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/services/camera/libcameraservice/utils/SessionConfigurationUtils.cpp b/services/camera/libcameraservice/utils/SessionConfigurationUtils.cpp -index 2b03d33eca..cbe43b1a83 100644 ---- a/services/camera/libcameraservice/utils/SessionConfigurationUtils.cpp -+++ b/services/camera/libcameraservice/utils/SessionConfigurationUtils.cpp -@@ -1160,7 +1160,7 @@ status_t mapRequestTemplateToAidl(camera_request_template_t templateId, - } - - void filterParameters(const CameraMetadata& src, const CameraMetadata& deviceInfo, -- int vendorTagId, CameraMetadata& dst) { -+ metadata_vendor_id_t vendorTagId, CameraMetadata& dst) { - const CameraMetadata params(src); - camera_metadata_ro_entry_t availableSessionKeys = deviceInfo.find( - ANDROID_REQUEST_AVAILABLE_SESSION_KEYS); -diff --git a/services/camera/libcameraservice/utils/SessionConfigurationUtils.h b/services/camera/libcameraservice/utils/SessionConfigurationUtils.h -index 29e3eca9af..5b2ea5c06f 100644 ---- a/services/camera/libcameraservice/utils/SessionConfigurationUtils.h -+++ b/services/camera/libcameraservice/utils/SessionConfigurationUtils.h -@@ -177,7 +177,7 @@ status_t mapRequestTemplateToAidl(camera_request_template_t templateId, - aidl::android::hardware::camera::device::RequestTemplate* tempId /*out*/); - - void filterParameters(const CameraMetadata& src, const CameraMetadata& deviceInfo, -- int vendorTagId, CameraMetadata& dst); -+ metadata_vendor_id_t vendorTagId, CameraMetadata& dst); - - constexpr int32_t MAX_SURFACES_PER_STREAM = 4; - --- -2.25.1 - diff --git a/patches/trebledroid/platform_frameworks_base/0001-Disable-vendor-mismatch-warning.patch b/patches/trebledroid/platform_frameworks_base/0001-Disable-vendor-mismatch-warning.patch index 8278787..efcc1a7 100644 --- a/patches/trebledroid/platform_frameworks_base/0001-Disable-vendor-mismatch-warning.patch +++ b/patches/trebledroid/platform_frameworks_base/0001-Disable-vendor-mismatch-warning.patch @@ -1,7 +1,7 @@ -From 1e9101cb05a625fe34cad85d36808403fa07e6e9 Mon Sep 17 00:00:00 2001 +From a19424066ce434fc6e9ae67b074faddbcb783def Mon Sep 17 00:00:00 2001 From: Andy CrossGate Yan Date: Thu, 5 Apr 2018 10:01:19 +0800 -Subject: [PATCH 01/51] Disable vendor mismatch warning +Subject: [PATCH 01/53] Disable vendor mismatch warning Change-Id: Ieb8fe91e2f02462f074312ed0f4885d183e9780b --- diff --git a/patches/trebledroid/platform_frameworks_base/0002-Fallback-to-stupid-autobrightness-if-brightness-valu.patch b/patches/trebledroid/platform_frameworks_base/0002-Fallback-to-stupid-autobrightness-if-brightness-valu.patch index 08667cc..08a026c 100644 --- a/patches/trebledroid/platform_frameworks_base/0002-Fallback-to-stupid-autobrightness-if-brightness-valu.patch +++ b/patches/trebledroid/platform_frameworks_base/0002-Fallback-to-stupid-autobrightness-if-brightness-valu.patch @@ -1,7 +1,7 @@ -From 9cc241b77fa8b8c9fc87e4e2a2fda2199e917965 Mon Sep 17 00:00:00 2001 +From e58cce34f1f5620e56c6f087e21b400e99d64b6f Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Tue, 5 Oct 2021 17:59:16 -0400 -Subject: [PATCH 02/51] Fallback to stupid autobrightness if brightness values +Subject: [PATCH 02/53] Fallback to stupid autobrightness if brightness values are broken This is needed because of: diff --git a/patches/trebledroid/platform_frameworks_base/0003-Fix-env-empty-string-ANDROID_STORAGE.patch b/patches/trebledroid/platform_frameworks_base/0003-Fix-env-empty-string-ANDROID_STORAGE.patch index db1d17f..e498462 100644 --- a/patches/trebledroid/platform_frameworks_base/0003-Fix-env-empty-string-ANDROID_STORAGE.patch +++ b/patches/trebledroid/platform_frameworks_base/0003-Fix-env-empty-string-ANDROID_STORAGE.patch @@ -1,7 +1,7 @@ -From 3c97761832e1f00d2e1f135e381eb8596dcaecd2 Mon Sep 17 00:00:00 2001 +From beb480fd4732310043c26b8a6138de8271f87077 Mon Sep 17 00:00:00 2001 From: Raphael Mounier Date: Sat, 6 Aug 2022 18:08:36 +0200 -Subject: [PATCH 03/51] Fix env empty string - ANDROID_STORAGE +Subject: [PATCH 03/53] Fix env empty string - ANDROID_STORAGE 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 --- diff --git a/patches/trebledroid/platform_frameworks_base/0005-Don-t-crash-if-there-is-IR-HAL-is-not-declared.patch b/patches/trebledroid/platform_frameworks_base/0005-Don-t-crash-if-there-is-IR-HAL-is-not-declared.patch index 38b4027..d772087 100644 --- a/patches/trebledroid/platform_frameworks_base/0005-Don-t-crash-if-there-is-IR-HAL-is-not-declared.patch +++ b/patches/trebledroid/platform_frameworks_base/0005-Don-t-crash-if-there-is-IR-HAL-is-not-declared.patch @@ -1,7 +1,7 @@ -From cf95007923bc00daa88a2831843ff5ebc962f494 Mon Sep 17 00:00:00 2001 +From 70160ebb6a27f0175dcf7e9fd8d0c0ab50bdd374 Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Thu, 17 May 2018 20:28:35 +0200 -Subject: [PATCH 05/51] Don't crash if there is IR HAL is not declared +Subject: [PATCH 05/53] Don't crash if there is IR HAL is not declared Change-Id: I3afded27441bbee8244d5fda544b3e6d1238dc1b --- diff --git a/patches/trebledroid/platform_frameworks_base/0007-Show-APN-Settings-for-CDMA-carriers.patch b/patches/trebledroid/platform_frameworks_base/0007-Show-APN-Settings-for-CDMA-carriers.patch index ceb3d93..a28f1d6 100644 --- a/patches/trebledroid/platform_frameworks_base/0007-Show-APN-Settings-for-CDMA-carriers.patch +++ b/patches/trebledroid/platform_frameworks_base/0007-Show-APN-Settings-for-CDMA-carriers.patch @@ -1,7 +1,7 @@ -From fb3ecd3b2970432f3934e35c148b3c6d62247536 Mon Sep 17 00:00:00 2001 +From 687b310c1d5efaeff91b8d22b46cf00cd1ff8ca3 Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Mon, 6 Aug 2018 12:49:00 +0200 -Subject: [PATCH 07/51] Show APN Settings for CDMA carriers +Subject: [PATCH 07/53] Show APN Settings for CDMA carriers --- telephony/java/android/telephony/CarrierConfigManager.java | 2 +- diff --git a/patches/trebledroid/platform_frameworks_base/0008-Re-order-services-so-that-it-works-even-without-qtag.patch b/patches/trebledroid/platform_frameworks_base/0008-Re-order-services-so-that-it-works-even-without-qtag.patch index 57ca6e9..5e5345a 100644 --- a/patches/trebledroid/platform_frameworks_base/0008-Re-order-services-so-that-it-works-even-without-qtag.patch +++ b/patches/trebledroid/platform_frameworks_base/0008-Re-order-services-so-that-it-works-even-without-qtag.patch @@ -1,7 +1,7 @@ -From 19c6edf7f1e5400a14cca614bdaceedc978f1702 Mon Sep 17 00:00:00 2001 +From d415de83300beb6baba9036f53578a417399f055 Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Thu, 8 Nov 2018 23:04:03 +0100 -Subject: [PATCH 08/51] Re-order services so that it works even without qtaguid +Subject: [PATCH 08/53] Re-order services so that it works even without qtaguid Change-Id: I0c0f527b3ae151d45c68f7ac6c205da3f34e74df --- diff --git a/patches/trebledroid/platform_frameworks_base/0009-Support-samsung-Pie-and-Q-light-hal.patch b/patches/trebledroid/platform_frameworks_base/0009-Support-samsung-Pie-and-Q-light-hal.patch index 4977106..92cd7d2 100644 --- a/patches/trebledroid/platform_frameworks_base/0009-Support-samsung-Pie-and-Q-light-hal.patch +++ b/patches/trebledroid/platform_frameworks_base/0009-Support-samsung-Pie-and-Q-light-hal.patch @@ -1,7 +1,7 @@ -From 80afd3d6cef39f0fc453cbfd8c7ff341688b6b44 Mon Sep 17 00:00:00 2001 +From 6b4454bad9c829e49bebe5549df174c5cd19e2bf Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Sun, 24 Mar 2019 23:05:14 +0100 -Subject: [PATCH 09/51] Support samsung Pie and Q light hal +Subject: [PATCH 09/53] Support samsung Pie and Q light hal Change-Id: I01f94acd7d0672733e48854d80368f9ac6f861c6 --- diff --git a/patches/trebledroid/platform_frameworks_base/0010-Add-support-for-samsung-touch-physical-and-hover-pro.patch b/patches/trebledroid/platform_frameworks_base/0010-Add-support-for-samsung-touch-physical-and-hover-pro.patch index 3ec25bf..d2e5859 100644 --- a/patches/trebledroid/platform_frameworks_base/0010-Add-support-for-samsung-touch-physical-and-hover-pro.patch +++ b/patches/trebledroid/platform_frameworks_base/0010-Add-support-for-samsung-touch-physical-and-hover-pro.patch @@ -1,7 +1,7 @@ -From b06b4ccceeddb268e04408bd2743f8e4a8780e6d Mon Sep 17 00:00:00 2001 +From b36739e8a9e5ac6e2e2a0ae55dd06322ae13a673 Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Mon, 12 Aug 2019 23:08:26 +0200 -Subject: [PATCH 10/51] Add support for samsung touch, physical and hover +Subject: [PATCH 10/53] Add support for samsung touch, physical and hover proximity sensor as fallback to real proximity sensor Change-Id: I7a0f8b4665c802140d19197d850b77b2a7ac1865 diff --git a/patches/trebledroid/platform_frameworks_base/0011-Always-allow-overriding-the-number-of-work-profiles.patch b/patches/trebledroid/platform_frameworks_base/0011-Always-allow-overriding-the-number-of-work-profiles.patch index d465f81..ad5d30f 100644 --- a/patches/trebledroid/platform_frameworks_base/0011-Always-allow-overriding-the-number-of-work-profiles.patch +++ b/patches/trebledroid/platform_frameworks_base/0011-Always-allow-overriding-the-number-of-work-profiles.patch @@ -1,7 +1,7 @@ -From aca6e1eace210e60fa9f4fc196d76629a61ac549 Mon Sep 17 00:00:00 2001 +From 073f240c3e100e4d586fa52c36e4f886c0d48a99 Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Sun, 5 Apr 2020 16:32:46 +0200 -Subject: [PATCH 11/51] Always allow overriding the number of work profiles +Subject: [PATCH 11/53] Always allow overriding the number of work profiles Change-Id: I6eb09aa71663c6fbe7563e3038bffcabdba0ff6a --- @@ -9,10 +9,10 @@ Change-Id: I6eb09aa71663c6fbe7563e3038bffcabdba0ff6a 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/services/core/java/com/android/server/pm/UserManagerService.java b/services/core/java/com/android/server/pm/UserManagerService.java -index c48eccf2aac5..071d4a75ebcd 100644 +index 6f75a96c05db..c7b305cf120b 100644 --- a/services/core/java/com/android/server/pm/UserManagerService.java +++ b/services/core/java/com/android/server/pm/UserManagerService.java -@@ -7555,12 +7555,8 @@ public class UserManagerService extends IUserManager.Stub { +@@ -7560,12 +7560,8 @@ public class UserManagerService extends IUserManager.Stub { */ private static int getMaxUsersOfTypePerParent(UserTypeDetails userTypeDetails) { final int defaultMax = userTypeDetails.getMaxAllowedPerParent(); diff --git a/patches/trebledroid/platform_frameworks_base/0012-HOME-deserves-to-wake-up-devices-just-as-well-as-bac.patch b/patches/trebledroid/platform_frameworks_base/0012-HOME-deserves-to-wake-up-devices-just-as-well-as-bac.patch index 91e8677..f6f3232 100644 --- a/patches/trebledroid/platform_frameworks_base/0012-HOME-deserves-to-wake-up-devices-just-as-well-as-bac.patch +++ b/patches/trebledroid/platform_frameworks_base/0012-HOME-deserves-to-wake-up-devices-just-as-well-as-bac.patch @@ -1,7 +1,7 @@ -From 5783aac75b27fffd798be5f132d3b7f42a3e344e Mon Sep 17 00:00:00 2001 +From 5ff40982bbd7819521add91c473949b440b6724d Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Sat, 6 Jun 2020 18:21:56 +0200 -Subject: [PATCH 12/51] HOME deserves to wake-up devices just as well as back +Subject: [PATCH 12/53] HOME deserves to wake-up devices just as well as back and menu Change-Id: Ia562bafd8c620d00c17e8eb338e4701c6c4a3c3a diff --git a/patches/trebledroid/platform_frameworks_base/0014-Fix-brightness-range-not-being-complete-on-Samsung-d.patch b/patches/trebledroid/platform_frameworks_base/0014-Fix-brightness-range-not-being-complete-on-Samsung-d.patch index 6bcecbf..43d845c 100644 --- a/patches/trebledroid/platform_frameworks_base/0014-Fix-brightness-range-not-being-complete-on-Samsung-d.patch +++ b/patches/trebledroid/platform_frameworks_base/0014-Fix-brightness-range-not-being-complete-on-Samsung-d.patch @@ -1,7 +1,7 @@ -From 6da5d40fb7e20fabcc65201afe9769a7310eb7e0 Mon Sep 17 00:00:00 2001 +From a002ba714f71626b2e1d4037620da677818e537a Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Tue, 29 Sep 2020 22:40:10 +0200 -Subject: [PATCH 14/51] Fix brightness range not being complete on Samsung +Subject: [PATCH 14/53] Fix brightness range not being complete on Samsung devices On some devices, minimum brightness is 0, which totally messes with diff --git a/patches/trebledroid/platform_frameworks_base/0015-Re-implement-fnmatch-like-behaviour-for-RRO-java-sid.patch b/patches/trebledroid/platform_frameworks_base/0015-Re-implement-fnmatch-like-behaviour-for-RRO-java-sid.patch index 1fa71c6..7e88df4 100644 --- a/patches/trebledroid/platform_frameworks_base/0015-Re-implement-fnmatch-like-behaviour-for-RRO-java-sid.patch +++ b/patches/trebledroid/platform_frameworks_base/0015-Re-implement-fnmatch-like-behaviour-for-RRO-java-sid.patch @@ -1,7 +1,7 @@ -From 34fc24102978184eba88717083db434ba75c4e33 Mon Sep 17 00:00:00 2001 +From b8ba4cc5473a230511655e171f685748ac9ae85e Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Sun, 25 Oct 2020 23:57:26 +0100 -Subject: [PATCH 15/51] Re-implement fnmatch-like behaviour for RRO java-side +Subject: [PATCH 15/53] Re-implement fnmatch-like behaviour for RRO java-side T: Also apply to FrameworkParsingPackageUtils (@PeterCxy) diff --git a/patches/trebledroid/platform_frameworks_base/0016-Remove-useless-notification-about-console-service-be.patch b/patches/trebledroid/platform_frameworks_base/0016-Remove-useless-notification-about-console-service-be.patch index 63442d2..adc8ddd 100644 --- a/patches/trebledroid/platform_frameworks_base/0016-Remove-useless-notification-about-console-service-be.patch +++ b/patches/trebledroid/platform_frameworks_base/0016-Remove-useless-notification-about-console-service-be.patch @@ -1,7 +1,7 @@ -From 4aa77233388e253361f9dc141c314c78749997be Mon Sep 17 00:00:00 2001 +From c19f3e4dedbb4de99ccc2cd9097dd21d5fcd232c Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Fri, 11 Dec 2020 14:41:09 +0100 -Subject: [PATCH 16/51] Remove useless notification about "console" service +Subject: [PATCH 16/53] Remove useless notification about "console" service being running --- diff --git a/patches/trebledroid/platform_frameworks_base/0017-Revert-Remove-unused-SystemProperties.set.patch b/patches/trebledroid/platform_frameworks_base/0017-Revert-Remove-unused-SystemProperties.set.patch index 0b56ac2..c515cb2 100644 --- a/patches/trebledroid/platform_frameworks_base/0017-Revert-Remove-unused-SystemProperties.set.patch +++ b/patches/trebledroid/platform_frameworks_base/0017-Revert-Remove-unused-SystemProperties.set.patch @@ -1,7 +1,7 @@ -From 475fcbf3767aec9b0426f97cbaefe8fbadba1222 Mon Sep 17 00:00:00 2001 +From 837acaf32b6cd799ba474ba9b438d56aa274aa2a Mon Sep 17 00:00:00 2001 From: Peter Cai Date: Wed, 16 Dec 2020 21:24:12 +0800 -Subject: [PATCH 17/51] Revert "Remove unused SystemProperties.set" +Subject: [PATCH 17/53] Revert "Remove unused SystemProperties.set" This reverts commit debb4616ef67f9ed5054eca51ec58592358ff55f. diff --git a/patches/trebledroid/platform_frameworks_base/0018-TelephonyManager-bring-back-getNetworkClass.patch b/patches/trebledroid/platform_frameworks_base/0018-TelephonyManager-bring-back-getNetworkClass.patch index 23918a4..e1698e2 100644 --- a/patches/trebledroid/platform_frameworks_base/0018-TelephonyManager-bring-back-getNetworkClass.patch +++ b/patches/trebledroid/platform_frameworks_base/0018-TelephonyManager-bring-back-getNetworkClass.patch @@ -1,7 +1,7 @@ -From 78efd9275235b4385f6cd5268069ba293ea0d85d Mon Sep 17 00:00:00 2001 +From d96c8fc10f82c5f113a62d071693d34bb16cab81 Mon Sep 17 00:00:00 2001 From: Peter Cai Date: Wed, 16 Dec 2020 13:46:15 +0800 -Subject: [PATCH 18/51] TelephonyManager: bring back getNetworkClass() +Subject: [PATCH 18/53] TelephonyManager: bring back getNetworkClass() This partially reverts commit c058cac051ab083dc7fb7ea6aa85699110b2e9bf. diff --git a/patches/trebledroid/platform_frameworks_base/0019-TelephonyManager-add-API-annotations-for-setTelephon.patch b/patches/trebledroid/platform_frameworks_base/0019-TelephonyManager-add-API-annotations-for-setTelephon.patch index 5663217..ace3101 100644 --- a/patches/trebledroid/platform_frameworks_base/0019-TelephonyManager-add-API-annotations-for-setTelephon.patch +++ b/patches/trebledroid/platform_frameworks_base/0019-TelephonyManager-add-API-annotations-for-setTelephon.patch @@ -1,7 +1,7 @@ -From 432009330f5eccde819692f613b686e3c2fe62d3 Mon Sep 17 00:00:00 2001 +From 1017569a02cfee23faae4efc97d8d3f48ce9ab54 Mon Sep 17 00:00:00 2001 From: Peter Cai Date: Wed, 16 Dec 2020 21:26:45 +0800 -Subject: [PATCH 19/51] TelephonyManager: add API annotations for +Subject: [PATCH 19/53] TelephonyManager: add API annotations for setTelephonyProperty * This method was added back by reverting commit diff --git a/patches/trebledroid/platform_frameworks_base/0020-Fix-Wakelock-issue.patch b/patches/trebledroid/platform_frameworks_base/0020-Fix-Wakelock-issue.patch index 6cfec50..72e2646 100644 --- a/patches/trebledroid/platform_frameworks_base/0020-Fix-Wakelock-issue.patch +++ b/patches/trebledroid/platform_frameworks_base/0020-Fix-Wakelock-issue.patch @@ -1,7 +1,7 @@ -From e93d61a31dcf9c2af406dc7ccc78a840ff300575 Mon Sep 17 00:00:00 2001 +From 3c9fe8e7661ccb9f90ad8376b030afde9b42cb28 Mon Sep 17 00:00:00 2001 From: Alberto Ponces Date: Tue, 2 Feb 2021 10:20:51 +0000 -Subject: [PATCH 20/51] Fix Wakelock issue +Subject: [PATCH 20/53] Fix Wakelock issue Prevent SystemUI crash due to "WakeLock under-locked Doze" (issue #12) by only releasing a wakelock that was not already released --- diff --git a/patches/trebledroid/platform_frameworks_base/0021-Automatically-detect-pick-up-sensor-so-that-an-overl.patch b/patches/trebledroid/platform_frameworks_base/0021-Automatically-detect-pick-up-sensor-so-that-an-overl.patch index 13bce97..06df335 100644 --- a/patches/trebledroid/platform_frameworks_base/0021-Automatically-detect-pick-up-sensor-so-that-an-overl.patch +++ b/patches/trebledroid/platform_frameworks_base/0021-Automatically-detect-pick-up-sensor-so-that-an-overl.patch @@ -1,7 +1,7 @@ -From f818799df4f75db19d4b2ae88fd7fa532f72928b Mon Sep 17 00:00:00 2001 +From d3ab3a871dddb30b4689d908977eadca097da9b5 Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Sat, 20 Mar 2021 14:31:01 +0100 -Subject: [PATCH 21/51] Automatically detect pick up sensor, so that an overlay +Subject: [PATCH 21/53] Automatically detect pick up sensor, so that an overlay is required for the sole purpose of enabling pulse doze on pick up sensor --- diff --git a/patches/trebledroid/platform_frameworks_base/0022-Catch-broken-mainBuiltInDisplayCutoutRectApproximati.patch b/patches/trebledroid/platform_frameworks_base/0022-Catch-broken-mainBuiltInDisplayCutoutRectApproximati.patch index 9e6b6fb..5919b30 100644 --- a/patches/trebledroid/platform_frameworks_base/0022-Catch-broken-mainBuiltInDisplayCutoutRectApproximati.patch +++ b/patches/trebledroid/platform_frameworks_base/0022-Catch-broken-mainBuiltInDisplayCutoutRectApproximati.patch @@ -1,7 +1,7 @@ -From 9a12eff5c76bd855b0687f9ba76b5398abfd727f Mon Sep 17 00:00:00 2001 +From 067aec96d45a742d5f30c6d06f707560b6d3eec9 Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Tue, 23 Mar 2021 19:43:26 +0100 -Subject: [PATCH 22/51] Catch broken mainBuiltInDisplayCutoutRectApproximation +Subject: [PATCH 22/53] Catch broken mainBuiltInDisplayCutoutRectApproximation Some devices (Redmi Note 9T) have: mainBuiltInDisplayCutoutRectApproximation = @android:mainBuiltInDisplayCutout diff --git a/patches/trebledroid/platform_frameworks_base/0023-backlight-Fix-backlight-control-on-Galaxy-S9.patch b/patches/trebledroid/platform_frameworks_base/0023-backlight-Fix-backlight-control-on-Galaxy-S9.patch index 166c061..fc8b51f 100644 --- a/patches/trebledroid/platform_frameworks_base/0023-backlight-Fix-backlight-control-on-Galaxy-S9.patch +++ b/patches/trebledroid/platform_frameworks_base/0023-backlight-Fix-backlight-control-on-Galaxy-S9.patch @@ -1,7 +1,7 @@ -From 5a779616bac07395d4ae23eb3d37c65716836804 Mon Sep 17 00:00:00 2001 +From 28998297e27c5870e12d8a7ec295af86429438ad Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Sat, 24 Mar 2018 08:01:48 +0100 -Subject: [PATCH 23/51] backlight: Fix backlight control on Galaxy S9(+) +Subject: [PATCH 23/53] backlight: Fix backlight control on Galaxy S9(+) Change-Id: I1fbbb47939c377597ef8ad6b88b2acea5f4acaa6 diff --git a/patches/trebledroid/platform_frameworks_base/0024-Revert-Switch-long-press-power-behavior-in-AOSP.patch b/patches/trebledroid/platform_frameworks_base/0024-Revert-Switch-long-press-power-behavior-in-AOSP.patch index d85b3b0..45a3279 100644 --- a/patches/trebledroid/platform_frameworks_base/0024-Revert-Switch-long-press-power-behavior-in-AOSP.patch +++ b/patches/trebledroid/platform_frameworks_base/0024-Revert-Switch-long-press-power-behavior-in-AOSP.patch @@ -1,7 +1,7 @@ -From 3c07e6dfdc94e725dc87507afee240a4c54607f5 Mon Sep 17 00:00:00 2001 +From 97ee3edc12404e29712b3c9b7845f4f5cfcb2e27 Mon Sep 17 00:00:00 2001 From: Andy CrossGate Yan Date: Sat, 4 Sep 2021 08:26:30 +0000 -Subject: [PATCH 24/51] Revert "Switch long-press power behavior in AOSP." +Subject: [PATCH 24/53] Revert "Switch long-press power behavior in AOSP." This reverts commit 803c77a0a24624111944832098c6f65158051dc4. --- diff --git a/patches/trebledroid/platform_frameworks_base/0026-Dynamically-resize-boot-animation-to-match-screen-si.patch b/patches/trebledroid/platform_frameworks_base/0026-Dynamically-resize-boot-animation-to-match-screen-si.patch index 3f73304..75d3efb 100644 --- a/patches/trebledroid/platform_frameworks_base/0026-Dynamically-resize-boot-animation-to-match-screen-si.patch +++ b/patches/trebledroid/platform_frameworks_base/0026-Dynamically-resize-boot-animation-to-match-screen-si.patch @@ -1,7 +1,7 @@ -From e51afbbdce1f7b30e62a4733ab8affec5f6ab9ca Mon Sep 17 00:00:00 2001 +From f97395ff3d55a939f7f824bceda8995df10eb86a Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Mon, 20 Dec 2021 15:01:41 -0500 -Subject: [PATCH 26/51] Dynamically resize boot animation to match screen size +Subject: [PATCH 26/53] Dynamically resize boot animation to match screen size Change-Id: I54e49fc6b8c670103852e212d1416e27ff976205 --- diff --git a/patches/trebledroid/platform_frameworks_base/0027-Revert-Remove-more-FDE-methods-from-StorageManager.patch b/patches/trebledroid/platform_frameworks_base/0027-Revert-Remove-more-FDE-methods-from-StorageManager.patch index b5b6e9b..1c14c7b 100644 --- a/patches/trebledroid/platform_frameworks_base/0027-Revert-Remove-more-FDE-methods-from-StorageManager.patch +++ b/patches/trebledroid/platform_frameworks_base/0027-Revert-Remove-more-FDE-methods-from-StorageManager.patch @@ -1,7 +1,7 @@ -From 503ee11691c9fa1427c9d34af41e0e34d37fa528 Mon Sep 17 00:00:00 2001 +From fd4c57b94ed4adf219fe5fcf1f3b8e5db0440151 Mon Sep 17 00:00:00 2001 From: Andy CrossGate Yan Date: Sat, 15 Oct 2022 09:33:56 +0000 -Subject: [PATCH 27/51] Revert "Remove more FDE methods from StorageManager" +Subject: [PATCH 27/53] Revert "Remove more FDE methods from StorageManager" This reverts commit bd13f84152449a3ead6fa8604fd31f48c0224676. diff --git a/patches/trebledroid/platform_frameworks_base/0029-Set-old-fingerprint-sensors-to-security-strong.patch b/patches/trebledroid/platform_frameworks_base/0029-Set-old-fingerprint-sensors-to-security-strong.patch index 915e6ae..913ecb9 100644 --- a/patches/trebledroid/platform_frameworks_base/0029-Set-old-fingerprint-sensors-to-security-strong.patch +++ b/patches/trebledroid/platform_frameworks_base/0029-Set-old-fingerprint-sensors-to-security-strong.patch @@ -1,7 +1,7 @@ -From f60ff0cae71ec0c41ec41a4a775a7d90b1bcc3ad Mon Sep 17 00:00:00 2001 +From 3eedecf13b716614699d6edd14d292ebd60942ab Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Sat, 3 Dec 2022 17:13:24 -0500 -Subject: [PATCH 29/51] Set old fingerprint sensors to security "strong" +Subject: [PATCH 29/53] Set old fingerprint sensors to security "strong" This allows removing config_biometric_sensors from overlays, which led to Pixels not booting, because they are using AIDL biometric sensor, and diff --git a/patches/trebledroid/platform_frameworks_base/0030-Call-Samsung-s-ISehSysInputDev-to-report-screen-stat.patch b/patches/trebledroid/platform_frameworks_base/0030-Call-Samsung-s-ISehSysInputDev-to-report-screen-stat.patch index 8848ec3..c3e22b2 100644 --- a/patches/trebledroid/platform_frameworks_base/0030-Call-Samsung-s-ISehSysInputDev-to-report-screen-stat.patch +++ b/patches/trebledroid/platform_frameworks_base/0030-Call-Samsung-s-ISehSysInputDev-to-report-screen-stat.patch @@ -1,7 +1,7 @@ -From 1174c244ae1acc819b9faf77eb2e4555efc0d637 Mon Sep 17 00:00:00 2001 +From fcfe8aa9e7436ba8bb8c5045870043c38aa412e6 Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Wed, 14 Dec 2022 17:21:00 -0500 -Subject: [PATCH 30/51] Call Samsung's ISehSysInputDev to report screen state +Subject: [PATCH 30/53] Call Samsung's ISehSysInputDev to report screen state to touchscreen driver This fixes touchscreen not waking up on Galaxy F23 @@ -11,19 +11,19 @@ This fixes touchscreen not waking up on Galaxy F23 2 files changed, 32 insertions(+) diff --git a/services/core/Android.bp b/services/core/Android.bp -index f5a80d80f271..575da5d97d0c 100644 +index 7b2f337c1c34..af915b90421f 100644 --- a/services/core/Android.bp +++ b/services/core/Android.bp -@@ -204,6 +204,7 @@ java_library_static { - "com_android_wm_shell_flags_lib", +@@ -205,6 +205,7 @@ java_library_static { "com.android.server.utils_aconfig-java", "service-jobscheduler-deviceidle.flags-aconfig-java", + "vendor.aospa.biometrics.face", + "vendor.samsung.hardware.sysinput-V1.2-java", // HIDL ], javac_shard_size: 50, javacflags: [ diff --git a/services/core/java/com/android/server/display/LocalDisplayAdapter.java b/services/core/java/com/android/server/display/LocalDisplayAdapter.java -index 22898a65c5de..f9dbd91e6b5a 100644 +index 22898a65c5de..ddafe1805c17 100644 --- a/services/core/java/com/android/server/display/LocalDisplayAdapter.java +++ b/services/core/java/com/android/server/display/LocalDisplayAdapter.java @@ -35,6 +35,7 @@ import android.os.Trace; @@ -37,7 +37,7 @@ index 22898a65c5de..f9dbd91e6b5a 100644 @@ -55,6 +56,8 @@ import com.android.server.display.notifications.DisplayNotificationManager; import com.android.server.lights.LightsManager; import com.android.server.lights.LogicalLight; - + +import vendor.samsung.hardware.sysinput.V1_1.ISehSysInputDev; + import java.io.PrintWriter; @@ -49,19 +49,20 @@ index 22898a65c5de..f9dbd91e6b5a 100644 new DisplayEventReceiver.FrameRateOverride[0]; + private boolean triedSamsungHal = false; + private ISehSysInputDev samsungSysinput = null; - + LocalDisplayDevice(IBinder displayToken, long physicalDisplayId, SurfaceControl.StaticDisplayInfo staticDisplayInfo, -@@ -850,16 +855,42 @@ final class LocalDisplayAdapter extends DisplayAdapter { +@@ -850,16 +855,43 @@ final class LocalDisplayAdapter extends DisplayAdapter { } } - + + if (!triedSamsungHal) { + triedSamsungHal = true; + try { + samsungSysinput = ISehSysInputDev.getService(); + } catch(Throwable t) {} + } ++ final int mode = getPowerModeForState(state); Trace.traceBegin(Trace.TRACE_TAG_POWER, "setDisplayState(" + "id=" + physicalDisplayId @@ -93,8 +94,9 @@ index 22898a65c5de..f9dbd91e6b5a 100644 + } + setCommittedState(state); - + // If we're entering a suspended (but not OFF) power state and we + -- 2.25.1 diff --git a/patches/trebledroid/platform_frameworks_base/0031-Try-catch-around-constrainNitsAndBacklightArrays-and.patch b/patches/trebledroid/platform_frameworks_base/0031-Try-catch-around-constrainNitsAndBacklightArrays-and.patch index ce6a123..f09d6ea 100644 --- a/patches/trebledroid/platform_frameworks_base/0031-Try-catch-around-constrainNitsAndBacklightArrays-and.patch +++ b/patches/trebledroid/platform_frameworks_base/0031-Try-catch-around-constrainNitsAndBacklightArrays-and.patch @@ -1,7 +1,7 @@ -From 1decc4c97995159562c0a1366fd86a41456ea520 Mon Sep 17 00:00:00 2001 +From a9a1a2e4fc8d53a581509310f6e7efc2f5d94d0c Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Fri, 2 Jun 2023 19:19:31 -0400 -Subject: [PATCH 31/51] Try catch around constrainNitsAndBacklightArrays, and +Subject: [PATCH 31/53] Try catch around constrainNitsAndBacklightArrays, and falls back to dumb curve. It crashes on Xperia 1 IV. --- diff --git a/patches/trebledroid/platform_frameworks_base/0032-Add-Mediatek-power-hints-on-touch.patch b/patches/trebledroid/platform_frameworks_base/0032-Add-Mediatek-power-hints-on-touch.patch index 0f05578..5056734 100644 --- a/patches/trebledroid/platform_frameworks_base/0032-Add-Mediatek-power-hints-on-touch.patch +++ b/patches/trebledroid/platform_frameworks_base/0032-Add-Mediatek-power-hints-on-touch.patch @@ -1,7 +1,7 @@ -From 5a52c279e884ccbc44dd0e6f9c5412daf6dc87af Mon Sep 17 00:00:00 2001 +From ddc6939402736786c2cc5d68943d26381c89072e Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Sat, 17 Jun 2023 08:31:55 -0400 -Subject: [PATCH 32/51] Add Mediatek power hints on touch +Subject: [PATCH 32/53] Add Mediatek power hints on touch Mediatek has multiple HALs (which existed concurrently), so it is a bit of a mess. @@ -30,10 +30,10 @@ diff --git a/services/core/Android.bp b/services/core/Android.bp index 575da5d97d0c..0d202cad8502 100644 --- a/services/core/Android.bp +++ b/services/core/Android.bp -@@ -204,7 +204,9 @@ java_library_static { - "com_android_wm_shell_flags_lib", +@@ -205,7 +205,9 @@ java_library_static { "com.android.server.utils_aconfig-java", "service-jobscheduler-deviceidle.flags-aconfig-java", + "vendor.aospa.biometrics.face", - "vendor.samsung.hardware.sysinput-V1.2-java", // HIDL + // HIDL + "vendor.mediatek.hardware.mtkpower-V1.1-java", diff --git a/patches/trebledroid/platform_frameworks_base/0033-Detect-Moto-dynamic-hardware-feature.patch b/patches/trebledroid/platform_frameworks_base/0033-Detect-Moto-dynamic-hardware-feature.patch index e9a9980..87ceeff 100644 --- a/patches/trebledroid/platform_frameworks_base/0033-Detect-Moto-dynamic-hardware-feature.patch +++ b/patches/trebledroid/platform_frameworks_base/0033-Detect-Moto-dynamic-hardware-feature.patch @@ -1,7 +1,7 @@ -From 6cbd956e84ce543e18dd8106f1d5e8265df68502 Mon Sep 17 00:00:00 2001 +From ccc4c4c5cb2b17324bf2fe052c1b2ffe3dd805df Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Wed, 5 Jul 2023 10:50:36 -0400 -Subject: [PATCH 33/51] Detect Moto dynamic hardware feature +Subject: [PATCH 33/53] Detect Moto dynamic hardware feature Moto added a custom node in sysconfig XMLs: diff --git a/patches/trebledroid/platform_frameworks_base/0034-Restore-getSimStateForSlotIndex-in-SubscriptionManag.patch b/patches/trebledroid/platform_frameworks_base/0034-Restore-getSimStateForSlotIndex-in-SubscriptionManag.patch index 8887340..e6fbdb1 100644 --- a/patches/trebledroid/platform_frameworks_base/0034-Restore-getSimStateForSlotIndex-in-SubscriptionManag.patch +++ b/patches/trebledroid/platform_frameworks_base/0034-Restore-getSimStateForSlotIndex-in-SubscriptionManag.patch @@ -1,7 +1,7 @@ -From b75e2b34a2197cea744c39f4dc286b39fec5fd34 Mon Sep 17 00:00:00 2001 +From fa6b56fbae57658a1fea3f8d512dcdcc96f07b73 Mon Sep 17 00:00:00 2001 From: Andy CrossGate Yan Date: Wed, 2 Aug 2023 20:59:53 +0800 -Subject: [PATCH 34/51] Restore getSimStateForSlotIndex in SubscriptionManager +Subject: [PATCH 34/53] Restore getSimStateForSlotIndex in SubscriptionManager MTK IMS still needs it here diff --git a/patches/trebledroid/platform_frameworks_base/0035-Add-runWithCleanCallingIdentity-variant-with-both-ex.patch b/patches/trebledroid/platform_frameworks_base/0035-Add-runWithCleanCallingIdentity-variant-with-both-ex.patch index 1c2cf49..aab1bb2 100644 --- a/patches/trebledroid/platform_frameworks_base/0035-Add-runWithCleanCallingIdentity-variant-with-both-ex.patch +++ b/patches/trebledroid/platform_frameworks_base/0035-Add-runWithCleanCallingIdentity-variant-with-both-ex.patch @@ -1,7 +1,7 @@ -From 7c46cbce0bbd442cc859c744bcc682cc7de290f2 Mon Sep 17 00:00:00 2001 +From 40210f1196af168dedaa7e815e00cc19d263265d Mon Sep 17 00:00:00 2001 From: Andy CrossGate Yan Date: Sat, 12 Aug 2023 20:11:17 +0800 -Subject: [PATCH 35/51] Add runWithCleanCallingIdentity variant with both +Subject: [PATCH 35/53] Add runWithCleanCallingIdentity variant with both executor and return value This complements the fixup to ImsPhoneCallTracker (in fw/o/t) for U diff --git a/patches/trebledroid/platform_frameworks_base/0036-Catch-NPE-in-SystemUI.patch b/patches/trebledroid/platform_frameworks_base/0036-Catch-NPE-in-SystemUI.patch index 22e2fb5..79ab400 100644 --- a/patches/trebledroid/platform_frameworks_base/0036-Catch-NPE-in-SystemUI.patch +++ b/patches/trebledroid/platform_frameworks_base/0036-Catch-NPE-in-SystemUI.patch @@ -1,7 +1,7 @@ -From 215e209a48c17495c86fd37db72c61f593c35a10 Mon Sep 17 00:00:00 2001 +From d39336566f6914e7097780237a2ac07132a54b2f Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Fri, 6 Oct 2023 10:57:13 -0400 -Subject: [PATCH 36/51] Catch NPE in SystemUI +Subject: [PATCH 36/53] Catch NPE in SystemUI No idea why it triggers, but it crashes SystemUI on boot for my TV device diff --git a/patches/trebledroid/platform_frameworks_base/0037-Once-we-integrate-Samsung-Power-hal-in-libpowermanag.patch b/patches/trebledroid/platform_frameworks_base/0037-Once-we-integrate-Samsung-Power-hal-in-libpowermanag.patch index d051604..06ba9dd 100644 --- a/patches/trebledroid/platform_frameworks_base/0037-Once-we-integrate-Samsung-Power-hal-in-libpowermanag.patch +++ b/patches/trebledroid/platform_frameworks_base/0037-Once-we-integrate-Samsung-Power-hal-in-libpowermanag.patch @@ -1,7 +1,7 @@ -From 9982e4f6b9976e1919b7c28f5b2d2615d1b8da63 Mon Sep 17 00:00:00 2001 +From 297d07d36bb51b81c8cf64356247de27fc92aac0 Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Mon, 27 Dec 2021 17:57:11 -0500 -Subject: [PATCH 37/51] Once we integrate Samsung Power hal in libpowermanager, +Subject: [PATCH 37/53] Once we integrate Samsung Power hal in libpowermanager, libpowermanager and its deps require linking against vendor.samsung.hardware.miscpower@2.0 diff --git a/patches/trebledroid/platform_frameworks_base/0038-FOD-support-for-Asus-Samsung-recent-Xiaomi-and-RedMa.patch b/patches/trebledroid/platform_frameworks_base/0038-FOD-support-for-Asus-Samsung-recent-Xiaomi-and-RedMa.patch index fac6462..6a9e561 100644 --- a/patches/trebledroid/platform_frameworks_base/0038-FOD-support-for-Asus-Samsung-recent-Xiaomi-and-RedMa.patch +++ b/patches/trebledroid/platform_frameworks_base/0038-FOD-support-for-Asus-Samsung-recent-Xiaomi-and-RedMa.patch @@ -38,10 +38,10 @@ diff --git a/packages/SystemUI/Android.bp b/packages/SystemUI/Android.bp index 32167401a36b..3c45953fbfb8 100644 --- a/packages/SystemUI/Android.bp +++ b/packages/SystemUI/Android.bp -@@ -206,6 +206,10 @@ android_library { - "motion_tool_lib", +@@ -207,6 +207,10 @@ android_library { "notification_flags_lib", "bcsmartspace-google", + "vendor.lineage.powershare-V1.0-java", + "vendor.goodix.hardware.biometrics.fingerprint-V2.1-java", + "vendor.xiaomi.hw.touchfeature-V1.0-java", + "vendor.xiaomi.hardware.fingerprintextension-V1.0-java", diff --git a/patches/trebledroid/platform_frameworks_base/0040-Ignore-cgroup-creation-errors.patch b/patches/trebledroid/platform_frameworks_base/0040-Ignore-cgroup-creation-errors.patch index 853037b..f00d189 100644 --- a/patches/trebledroid/platform_frameworks_base/0040-Ignore-cgroup-creation-errors.patch +++ b/patches/trebledroid/platform_frameworks_base/0040-Ignore-cgroup-creation-errors.patch @@ -1,7 +1,7 @@ -From fe52d3a130ad3d0e1198fe9ed70527236bc05d85 Mon Sep 17 00:00:00 2001 +From 9b15ddef0bedf49eb9c501fc9432ed2e6670a2c9 Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Wed, 18 Oct 2023 16:53:40 -0400 -Subject: [PATCH 40/51] Ignore cgroup creation errors +Subject: [PATCH 40/53] Ignore cgroup creation errors For old kernels who don't have those modern cgroups --- diff --git a/patches/trebledroid/platform_frameworks_base/0041-Samsung-tablets-use-SW_MACHINE_COVER-rather-than-SW_.patch b/patches/trebledroid/platform_frameworks_base/0041-Samsung-tablets-use-SW_MACHINE_COVER-rather-than-SW_.patch index 65b8478..77178ce 100644 --- a/patches/trebledroid/platform_frameworks_base/0041-Samsung-tablets-use-SW_MACHINE_COVER-rather-than-SW_.patch +++ b/patches/trebledroid/platform_frameworks_base/0041-Samsung-tablets-use-SW_MACHINE_COVER-rather-than-SW_.patch @@ -1,7 +1,7 @@ -From ea904693336675333d3536e86b98f0e89f066671 Mon Sep 17 00:00:00 2001 +From 00ed1fd6ae62146a44414a9e16ba6a14ed8409d3 Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Wed, 18 Oct 2023 16:57:34 -0400 -Subject: [PATCH 41/51] Samsung tablets use SW_MACHINE_COVER rather than SW_LID +Subject: [PATCH 41/53] Samsung tablets use SW_MACHINE_COVER rather than SW_LID So check whether SW_MACHINE_COVER is declared, then use it Otherwise stick to SW_LID diff --git a/patches/trebledroid/platform_frameworks_base/0042-Revert-Removed-IWLAN-legacy-mode-support.patch b/patches/trebledroid/platform_frameworks_base/0042-Revert-Removed-IWLAN-legacy-mode-support.patch index 858d83d..c4b6813 100644 --- a/patches/trebledroid/platform_frameworks_base/0042-Revert-Removed-IWLAN-legacy-mode-support.patch +++ b/patches/trebledroid/platform_frameworks_base/0042-Revert-Removed-IWLAN-legacy-mode-support.patch @@ -1,7 +1,7 @@ -From 43a11656f6f70e3a3c3037bd91e535120780f309 Mon Sep 17 00:00:00 2001 +From 1386df08ed6ed94879c65d7c595a39069a84de78 Mon Sep 17 00:00:00 2001 From: Alberto Ponces Date: Fri, 20 Oct 2023 09:26:19 +0000 -Subject: [PATCH 42/51] Revert "Removed IWLAN legacy mode support" +Subject: [PATCH 42/53] Revert "Removed IWLAN legacy mode support" This reverts commit 2832dee607ab33eee688abea206f4adfcfc896f1. --- diff --git a/patches/trebledroid/platform_frameworks_base/0043-Add-a-prop-to-use-linear-backlight-control.patch b/patches/trebledroid/platform_frameworks_base/0043-Add-a-prop-to-use-linear-backlight-control.patch index 283993f..e480d67 100644 --- a/patches/trebledroid/platform_frameworks_base/0043-Add-a-prop-to-use-linear-backlight-control.patch +++ b/patches/trebledroid/platform_frameworks_base/0043-Add-a-prop-to-use-linear-backlight-control.patch @@ -1,7 +1,7 @@ -From 90b7513cbbc99c7e2de0cf51b5bbc69c45a2fce2 Mon Sep 17 00:00:00 2001 +From 873378fdd8df0b833c8ac1c11942840ae6f5a430 Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Mon, 30 Oct 2023 19:25:27 -0400 -Subject: [PATCH 43/51] Add a prop to use linear backlight control +Subject: [PATCH 43/53] Add a prop to use linear backlight control --- .../settings/brightness/BrightnessController.java | 10 ++++++++-- diff --git a/patches/trebledroid/platform_frameworks_base/0044-Add-support-for-Samsung-full-brightness-on-their-AID.patch b/patches/trebledroid/platform_frameworks_base/0044-Add-support-for-Samsung-full-brightness-on-their-AID.patch index 5c1f0e2..6c32524 100644 --- a/patches/trebledroid/platform_frameworks_base/0044-Add-support-for-Samsung-full-brightness-on-their-AID.patch +++ b/patches/trebledroid/platform_frameworks_base/0044-Add-support-for-Samsung-full-brightness-on-their-AID.patch @@ -1,7 +1,7 @@ -From fcc7bdc34b889a27f209a3a031535267093e2317 Mon Sep 17 00:00:00 2001 +From a1ee02b67023827ddcbfb57846efb86626640e7f Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Sun, 10 Dec 2023 18:04:49 -0500 -Subject: [PATCH 44/51] Add support for Samsung full brightness on their AIDL +Subject: [PATCH 44/53] Add support for Samsung full brightness on their AIDL HAL --- diff --git a/patches/trebledroid/platform_frameworks_base/0045-Add-Samsung-sysinput.patch b/patches/trebledroid/platform_frameworks_base/0045-Add-Samsung-sysinput.patch index b0dc97b..20bba4a 100644 --- a/patches/trebledroid/platform_frameworks_base/0045-Add-Samsung-sysinput.patch +++ b/patches/trebledroid/platform_frameworks_base/0045-Add-Samsung-sysinput.patch @@ -1,7 +1,7 @@ -From 3312f8e2aba6491a3740dfa1a26520b64c7983d9 Mon Sep 17 00:00:00 2001 +From 06be0253e82f2b5057b3a4f2cb75644339606cca Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Mon, 29 Jan 2024 17:07:07 -0500 -Subject: [PATCH 45/51] Add Samsung sysinput +Subject: [PATCH 45/53] Add Samsung sysinput --- services/core/Android.bp | 1 + diff --git a/patches/trebledroid/platform_frameworks_base/0046-Bunch-of-FOD-stuff-commonize-refreshing-the-services.patch b/patches/trebledroid/platform_frameworks_base/0046-Bunch-of-FOD-stuff-commonize-refreshing-the-services.patch index e4fcbaa..e6ce7b1 100644 --- a/patches/trebledroid/platform_frameworks_base/0046-Bunch-of-FOD-stuff-commonize-refreshing-the-services.patch +++ b/patches/trebledroid/platform_frameworks_base/0046-Bunch-of-FOD-stuff-commonize-refreshing-the-services.patch @@ -1,7 +1,7 @@ -From 4ea8bf16b09efa429affed2df6348899845d3688 Mon Sep 17 00:00:00 2001 +From 9ad3c32417dfe8f440bdbe5c13e72081b6cae87a Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Mon, 29 Jan 2024 17:15:38 -0500 -Subject: [PATCH 46/51] Bunch of FOD stuff -- commonize refreshing the +Subject: [PATCH 46/53] Bunch of FOD stuff -- commonize refreshing the services, start supporting AIDL Samsung --- diff --git a/patches/trebledroid/platform_frameworks_base/0047-Some-Samsung-devices-use-SW_FLIP-0x15-rather-than-SW.patch b/patches/trebledroid/platform_frameworks_base/0047-Some-Samsung-devices-use-SW_FLIP-0x15-rather-than-SW.patch index df51a12..418c5ee 100644 --- a/patches/trebledroid/platform_frameworks_base/0047-Some-Samsung-devices-use-SW_FLIP-0x15-rather-than-SW.patch +++ b/patches/trebledroid/platform_frameworks_base/0047-Some-Samsung-devices-use-SW_FLIP-0x15-rather-than-SW.patch @@ -1,7 +1,7 @@ -From 3cbdeea0a18aab35b665192e717ef5d2f5dc2482 Mon Sep 17 00:00:00 2001 +From b36f3f8416d472ce27b092edead4a0f03e4d0a8c Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Sun, 4 Feb 2024 18:01:07 -0500 -Subject: [PATCH 47/51] Some Samsung devices use SW_FLIP 0x15 rather than +Subject: [PATCH 47/53] Some Samsung devices use SW_FLIP 0x15 rather than SW_MACHINE_COVER 0x10, so use that --- diff --git a/patches/trebledroid/platform_frameworks_base/0048-Include-vendor.samsung.hardware.radio.network-V1-jav.patch b/patches/trebledroid/platform_frameworks_base/0048-Include-vendor.samsung.hardware.radio.network-V1-jav.patch index 774427d..0957f6d 100644 --- a/patches/trebledroid/platform_frameworks_base/0048-Include-vendor.samsung.hardware.radio.network-V1-jav.patch +++ b/patches/trebledroid/platform_frameworks_base/0048-Include-vendor.samsung.hardware.radio.network-V1-jav.patch @@ -1,7 +1,7 @@ -From aa9161df39f0bb6b846b8c61b3819dd95de6a5b2 Mon Sep 17 00:00:00 2001 +From d3e51f5be6d37cd717b65387bf86af8f3fd8d0dd Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Wed, 21 Feb 2024 12:41:46 -0500 -Subject: [PATCH 48/51] Include vendor.samsung.hardware.radio.network-V1-java +Subject: [PATCH 48/53] Include vendor.samsung.hardware.radio.network-V1-java in base libs, will be used by f/o/telephony --- diff --git a/patches/trebledroid/platform_frameworks_base/0049-Include-vendor.samsung.hardware.radio-V2.2-java-HIDL.patch b/patches/trebledroid/platform_frameworks_base/0049-Include-vendor.samsung.hardware.radio-V2.2-java-HIDL.patch index 66ce1c0..1887599 100644 --- a/patches/trebledroid/platform_frameworks_base/0049-Include-vendor.samsung.hardware.radio-V2.2-java-HIDL.patch +++ b/patches/trebledroid/platform_frameworks_base/0049-Include-vendor.samsung.hardware.radio-V2.2-java-HIDL.patch @@ -1,7 +1,7 @@ -From 7c19a4c0c61fb7f8138b9cbc52fb1f2e537ed260 Mon Sep 17 00:00:00 2001 +From 2e7d40a3b5fabc6de11de7c7149629fcda0cba38 Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Wed, 21 Feb 2024 16:19:47 -0500 -Subject: [PATCH 49/51] Include vendor.samsung.hardware.radio-V2.2-java HIDL in +Subject: [PATCH 49/53] Include vendor.samsung.hardware.radio-V2.2-java HIDL in base libs, will be used by f/o/telephony --- diff --git a/patches/trebledroid/platform_frameworks_base/0050-Allow-signature-spoofing-for-microG-Companion-Servic.patch b/patches/trebledroid/platform_frameworks_base/0050-Allow-signature-spoofing-for-microG-Companion-Servic.patch index 6eff185..4b88183 100644 --- a/patches/trebledroid/platform_frameworks_base/0050-Allow-signature-spoofing-for-microG-Companion-Servic.patch +++ b/patches/trebledroid/platform_frameworks_base/0050-Allow-signature-spoofing-for-microG-Companion-Servic.patch @@ -1,7 +1,7 @@ -From 3ca9e6601b43308aa1159b08e4c67e4163011c7f Mon Sep 17 00:00:00 2001 +From 9851d034b5d9d56d146fb07bf6caf91944109259 Mon Sep 17 00:00:00 2001 From: LuK1337 Date: Mon, 19 Feb 2024 16:20:04 +0100 -Subject: [PATCH 50/51] Allow signature spoofing for microG Companion/Services +Subject: [PATCH 50/53] Allow signature spoofing for microG Companion/Services This patch enables signature spoofing when the following conditions are met: diff --git a/patches/trebledroid/platform_frameworks_base/0051-Revert-Remove-deprecated-IRadio-1.4-APIs-and-referen.patch b/patches/trebledroid/platform_frameworks_base/0051-Revert-Remove-deprecated-IRadio-1.4-APIs-and-referen.patch index fad7024..9dd3ea8 100644 --- a/patches/trebledroid/platform_frameworks_base/0051-Revert-Remove-deprecated-IRadio-1.4-APIs-and-referen.patch +++ b/patches/trebledroid/platform_frameworks_base/0051-Revert-Remove-deprecated-IRadio-1.4-APIs-and-referen.patch @@ -1,7 +1,7 @@ -From 56dbc7a37f530a09b2751c3f4d6ee80a6fd46f68 Mon Sep 17 00:00:00 2001 +From 048e042cbcd5d86a65aa5703b04583dac0d80589 Mon Sep 17 00:00:00 2001 From: Alberto Ponces Date: Sun, 31 Mar 2024 23:38:19 +0000 -Subject: [PATCH 51/51] Revert "Remove deprecated IRadio <1.4 APIs and +Subject: [PATCH 51/53] Revert "Remove deprecated IRadio <1.4 APIs and references" This reverts commit 4d53aa0caec7029bf6c9b5789c1708bc4bb71b76. diff --git a/patches/trebledroid/platform_frameworks_base/0052-Don-t-crash-system_server-if-we-fail-to-parse-dynami.patch b/patches/trebledroid/platform_frameworks_base/0052-Don-t-crash-system_server-if-we-fail-to-parse-dynami.patch new file mode 100644 index 0000000..989b7c9 --- /dev/null +++ b/patches/trebledroid/platform_frameworks_base/0052-Don-t-crash-system_server-if-we-fail-to-parse-dynami.patch @@ -0,0 +1,42 @@ +From 45770ed87625015255b52ada38a4058a837f55ad Mon Sep 17 00:00:00 2001 +From: Pierre-Hugues Husson +Date: Wed, 17 Apr 2024 04:49:18 -0400 +Subject: [PATCH 52/53] Don't crash system_server if we fail to parse dynamic + udfps position + +--- + .../fingerprint/aidl/FingerprintProvider.java | 18 +++++++++++------- + 1 file changed, 11 insertions(+), 7 deletions(-) + +diff --git a/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintProvider.java b/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintProvider.java +index d5905f1735fd..55c9e6dfd059 100644 +--- a/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintProvider.java ++++ b/services/core/java/com/android/server/biometrics/sensors/fingerprint/aidl/FingerprintProvider.java +@@ -214,13 +214,17 @@ android.util.Log.e("PHH-Enroll", "Poping AIDL fp provider"); + android.util.Log.e("PHH-Enroll", " - " + loc.sensorLocationX + ", " + loc.sensorLocationY + ", " +loc.sensorRadius + ", disp =" + loc.display + ", shape " + loc.sensorShape); + } + if (locations.length == 1 && locations[0].sensorLocationX == 0) { +- int[] otherValues = com.android.server.biometrics.AuthService.dynamicUdfpsProps(context); +- if (otherValues.length > 0) { +- SensorLocation loc = new SensorLocation(); +- loc.sensorLocationX = otherValues[0]; +- loc.sensorLocationY = otherValues[1]; +- loc.sensorRadius = otherValues[2]; +- locations[0] = loc; ++ try { ++ int[] otherValues = com.android.server.biometrics.AuthService.dynamicUdfpsProps(context); ++ if (otherValues.length > 0) { ++ SensorLocation loc = new SensorLocation(); ++ loc.sensorLocationX = otherValues[0]; ++ loc.sensorLocationY = otherValues[1]; ++ loc.sensorRadius = otherValues[2]; ++ locations[0] = loc; ++ } ++ } catch(Throwable t) { ++ android.util.Log.e("PHH-Enroll", "FingerprintProvider dynamicUdfpsProps", t); + } + } + +-- +2.25.1 + diff --git a/patches/trebledroid/platform_frameworks_base/0053-Add-a-prop-to-disable-animation-in-for-sysui-media-c.patch b/patches/trebledroid/platform_frameworks_base/0053-Add-a-prop-to-disable-animation-in-for-sysui-media-c.patch new file mode 100644 index 0000000..b87c6ee --- /dev/null +++ b/patches/trebledroid/platform_frameworks_base/0053-Add-a-prop-to-disable-animation-in-for-sysui-media-c.patch @@ -0,0 +1,34 @@ +From 1bae8b5afdc90051d7156b5f4e9b6e4aa0e440a9 Mon Sep 17 00:00:00 2001 +From: Pierre-Hugues Husson +Date: Wed, 8 May 2024 11:55:07 -0400 +Subject: [PATCH 53/53] Add a prop to disable animation in for sysui media + carousel + +--- + .../systemui/media/controls/ui/MediaCarouselController.kt | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/packages/SystemUI/src/com/android/systemui/media/controls/ui/MediaCarouselController.kt b/packages/SystemUI/src/com/android/systemui/media/controls/ui/MediaCarouselController.kt +index 992eeca77e54..f8fed58d2553 100644 +--- a/packages/SystemUI/src/com/android/systemui/media/controls/ui/MediaCarouselController.kt ++++ b/packages/SystemUI/src/com/android/systemui/media/controls/ui/MediaCarouselController.kt +@@ -22,6 +22,7 @@ import android.content.Intent + import android.content.res.ColorStateList + import android.content.res.Configuration + import android.database.ContentObserver ++import android.os.SystemProperties; + import android.provider.Settings + import android.provider.Settings.ACTION_MEDIA_CONTROLS_SETTINGS + import android.util.Log +@@ -1047,7 +1048,7 @@ constructor( + desiredHostState.showsOnlyActiveMedia + + for (mediaPlayer in MediaPlayerData.players()) { +- if (animate) { ++ if (animate && !SystemProperties.getBoolean("persist.sys.phh.no_media_carousel_animation", false)) { + mediaPlayer.mediaViewController.animatePendingStateChange( + duration = duration, + delay = startDelay +-- +2.25.1 + diff --git a/patches/trebledroid/platform_frameworks_native/0001-On-Samsung-we-need-to-send-a-hack-message-to-HAL-to-.patch b/patches/trebledroid/platform_frameworks_native/0001-On-Samsung-we-need-to-send-a-hack-message-to-HAL-to-.patch index 62ea508..a069172 100644 --- a/patches/trebledroid/platform_frameworks_native/0001-On-Samsung-we-need-to-send-a-hack-message-to-HAL-to-.patch +++ b/patches/trebledroid/platform_frameworks_native/0001-On-Samsung-we-need-to-send-a-hack-message-to-HAL-to-.patch @@ -1,7 +1,7 @@ From dc6c9ae247d0165c3d2dd8f582d2c0d07245d273 Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Wed, 14 Aug 2019 23:37:10 +0200 -Subject: [PATCH 01/11] On Samsung, we need to send a hack-message to HAL to +Subject: [PATCH 01/12] On Samsung, we need to send a hack-message to HAL to get all Sensors Change-Id: Id6a1fa48340de61c418493668e9abd22c2599376 diff --git a/patches/trebledroid/platform_frameworks_native/0002-Matching-an-input-with-a-display-uses-uniqueId.patch b/patches/trebledroid/platform_frameworks_native/0002-Matching-an-input-with-a-display-uses-uniqueId.patch index ebb44f2..0d94ce4 100644 --- a/patches/trebledroid/platform_frameworks_native/0002-Matching-an-input-with-a-display-uses-uniqueId.patch +++ b/patches/trebledroid/platform_frameworks_native/0002-Matching-an-input-with-a-display-uses-uniqueId.patch @@ -1,7 +1,7 @@ From c2f74204f669cf12ff1ae959ddc62131882d6957 Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Thu, 22 Oct 2020 23:22:46 +0200 -Subject: [PATCH 02/11] Matching an input with a display uses uniqueId +Subject: [PATCH 02/12] Matching an input with a display uses uniqueId Not all devices have a `location`, notably bluetooth devices. However, we might still want to associate them with a screen, diff --git a/patches/trebledroid/platform_frameworks_native/0003-unshared_oob-didn-t-exist-in-O-P-so-detect-its-suppo.patch b/patches/trebledroid/platform_frameworks_native/0003-unshared_oob-didn-t-exist-in-O-P-so-detect-its-suppo.patch index 287b3ad..bb7f95c 100644 --- a/patches/trebledroid/platform_frameworks_native/0003-unshared_oob-didn-t-exist-in-O-P-so-detect-its-suppo.patch +++ b/patches/trebledroid/platform_frameworks_native/0003-unshared_oob-didn-t-exist-in-O-P-so-detect-its-suppo.patch @@ -1,7 +1,7 @@ From a35b282d16105908905b0e8e3cf1151656d9f712 Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Tue, 5 Jan 2021 23:44:00 +0100 -Subject: [PATCH 03/11] unshared_oob didn't exist in O/P, so detect its +Subject: [PATCH 03/12] unshared_oob didn't exist in O/P, so detect its supported based on vndk version --- diff --git a/patches/trebledroid/platform_frameworks_native/0004-Remove-Samsung-system-permission-on-sensors.patch b/patches/trebledroid/platform_frameworks_native/0004-Remove-Samsung-system-permission-on-sensors.patch index 173de85..c8ccf2c 100644 --- a/patches/trebledroid/platform_frameworks_native/0004-Remove-Samsung-system-permission-on-sensors.patch +++ b/patches/trebledroid/platform_frameworks_native/0004-Remove-Samsung-system-permission-on-sensors.patch @@ -1,7 +1,7 @@ From f10364bd82674d6bf6852a954e967b6fa1053c75 Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Wed, 31 Mar 2021 23:36:03 +0200 -Subject: [PATCH 04/11] Remove Samsung system permission on sensors +Subject: [PATCH 04/12] Remove Samsung system permission on sensors --- libs/sensor/Sensor.cpp | 1 + diff --git a/patches/trebledroid/platform_frameworks_native/0005-Mark-accelerometer-input-as-sensor-exclusively-if-th.patch b/patches/trebledroid/platform_frameworks_native/0005-Mark-accelerometer-input-as-sensor-exclusively-if-th.patch index 9f6f420..01dd43e 100644 --- a/patches/trebledroid/platform_frameworks_native/0005-Mark-accelerometer-input-as-sensor-exclusively-if-th.patch +++ b/patches/trebledroid/platform_frameworks_native/0005-Mark-accelerometer-input-as-sensor-exclusively-if-th.patch @@ -1,7 +1,7 @@ From c13559ccae038d52310f1fedc28152b7a1d5a40f Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Sun, 12 Dec 2021 08:45:36 -0500 -Subject: [PATCH 05/11] Mark accelerometer input as sensor exclusively if there +Subject: [PATCH 05/12] Mark accelerometer input as sensor exclusively if there are ABS axis The reason this is needed is that on -fucked up- Xiami Mi A2 Lite and diff --git a/patches/trebledroid/platform_frameworks_native/0006-MIUI13-devices-hide-their-vibrator-HAL-behind-non-de.patch b/patches/trebledroid/platform_frameworks_native/0006-MIUI13-devices-hide-their-vibrator-HAL-behind-non-de.patch index 4afb11a..d34ca9d 100644 --- a/patches/trebledroid/platform_frameworks_native/0006-MIUI13-devices-hide-their-vibrator-HAL-behind-non-de.patch +++ b/patches/trebledroid/platform_frameworks_native/0006-MIUI13-devices-hide-their-vibrator-HAL-behind-non-de.patch @@ -1,7 +1,7 @@ From 14a43928ba29a099d0e250c03ef4b338e13364ca Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Fri, 25 Mar 2022 05:37:56 -0400 -Subject: [PATCH 06/11] MIUI13 devices hide their vibrator HAL behind +Subject: [PATCH 06/12] MIUI13 devices hide their vibrator HAL behind non-default name: "vibratorfeature" --- diff --git a/patches/trebledroid/platform_frameworks_native/0007-powermanager-Add-support-Samsung-miscpower-HAL.patch b/patches/trebledroid/platform_frameworks_native/0007-powermanager-Add-support-Samsung-miscpower-HAL.patch index b7d4c04..1688bfb 100644 --- a/patches/trebledroid/platform_frameworks_native/0007-powermanager-Add-support-Samsung-miscpower-HAL.patch +++ b/patches/trebledroid/platform_frameworks_native/0007-powermanager-Add-support-Samsung-miscpower-HAL.patch @@ -1,7 +1,7 @@ From e530843ac0424a589b387221ba90fbafd9bc4f83 Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Mon, 27 Dec 2021 18:00:43 -0500 -Subject: [PATCH 07/11] powermanager: Add support Samsung miscpower HAL +Subject: [PATCH 07/12] powermanager: Add support Samsung miscpower HAL Several various configurations need to be supported: - Android Pie vendors have a android.hardware.power HIDL default + "miscpower" diff --git a/patches/trebledroid/platform_frameworks_native/0008-FOD-support-for-Samsung-and-Asus.patch b/patches/trebledroid/platform_frameworks_native/0008-FOD-support-for-Samsung-and-Asus.patch index b1fbeed..9dcb890 100644 --- a/patches/trebledroid/platform_frameworks_native/0008-FOD-support-for-Samsung-and-Asus.patch +++ b/patches/trebledroid/platform_frameworks_native/0008-FOD-support-for-Samsung-and-Asus.patch @@ -1,7 +1,7 @@ From 59048f78707c2eaaaecfb2212453aaf83487fd3c Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Sun, 18 Dec 2022 18:17:30 -0500 -Subject: [PATCH 08/11] FOD support for Samsung and Asus +Subject: [PATCH 08/12] FOD support for Samsung and Asus --- libs/gui/BLASTBufferQueue.cpp | 20 ++++++++++++++-- diff --git a/patches/trebledroid/platform_frameworks_native/0009-Add-MTK-GED-KPI-support-to-fix-broken-Mediatek-gpufr.patch b/patches/trebledroid/platform_frameworks_native/0009-Add-MTK-GED-KPI-support-to-fix-broken-Mediatek-gpufr.patch index fd30c59..1d35994 100644 --- a/patches/trebledroid/platform_frameworks_native/0009-Add-MTK-GED-KPI-support-to-fix-broken-Mediatek-gpufr.patch +++ b/patches/trebledroid/platform_frameworks_native/0009-Add-MTK-GED-KPI-support-to-fix-broken-Mediatek-gpufr.patch @@ -1,7 +1,7 @@ From 32012640712bc3a0818f36a39cbbba2a6997c49c Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Sat, 25 Nov 2023 08:15:28 -0500 -Subject: [PATCH 09/11] Add MTK GED KPI support to fix broken Mediatek gpufreq +Subject: [PATCH 09/12] Add MTK GED KPI support to fix broken Mediatek gpufreq Mediatek GPU scheduler likes to have the timestamps of the frames to be able to adjust DVFS. diff --git a/patches/trebledroid/platform_frameworks_native/0010-Fix-loading-unnamed-GLES.patch b/patches/trebledroid/platform_frameworks_native/0010-Fix-loading-unnamed-GLES.patch index a7f97d4..25b82fa 100644 --- a/patches/trebledroid/platform_frameworks_native/0010-Fix-loading-unnamed-GLES.patch +++ b/patches/trebledroid/platform_frameworks_native/0010-Fix-loading-unnamed-GLES.patch @@ -1,7 +1,7 @@ From 6361fa57ff323a124442f57aa02f37cf314f6867 Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Wed, 20 Dec 2023 09:48:04 -0500 -Subject: [PATCH 10/11] Fix loading unnamed GLES +Subject: [PATCH 10/12] Fix loading unnamed GLES Normally Android loads libGLES_${ro.hardware.egl}.so But up to Android 14, it was allowed not to set ro.hardware.egl diff --git a/patches/trebledroid/platform_frameworks_native/0011-Increase-SW_MAX-4.patch b/patches/trebledroid/platform_frameworks_native/0011-Increase-SW_MAX-4.patch index c2396de..8111014 100644 --- a/patches/trebledroid/platform_frameworks_native/0011-Increase-SW_MAX-4.patch +++ b/patches/trebledroid/platform_frameworks_native/0011-Increase-SW_MAX-4.patch @@ -1,7 +1,7 @@ From 9244db7472836e5ffeea05b61117b0895b6ec370 Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Sat, 3 Feb 2024 07:38:33 -0500 -Subject: [PATCH 11/11] Increase SW_MAX *= 4 +Subject: [PATCH 11/12] Increase SW_MAX *= 4 We increase the size of SW_MAX for two reasons: 1. SW_MACHINE_COVER which is SW_MAX is ignored, guessing an off by one diff --git a/patches/trebledroid/platform_frameworks_native/0012-Disable-gpuservice-on-old-BPF-less-kernel.patch b/patches/trebledroid/platform_frameworks_native/0012-Disable-gpuservice-on-old-BPF-less-kernel.patch new file mode 100644 index 0000000..cb16ce0 --- /dev/null +++ b/patches/trebledroid/platform_frameworks_native/0012-Disable-gpuservice-on-old-BPF-less-kernel.patch @@ -0,0 +1,26 @@ +From 470070680f5ba495f1f9571fcc8b30af2bc7ad19 Mon Sep 17 00:00:00 2001 +From: Pierre-Hugues Husson +Date: Tue, 7 May 2024 22:34:40 +0000 +Subject: [PATCH 12/12] Disable gpuservice on old BPF-less kernel + +Change-Id: I8e1626e2e9d12ee0dc03d758799bc88085899476 +--- + services/gpuservice/gpumem/GpuMem.cpp | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/services/gpuservice/gpumem/GpuMem.cpp b/services/gpuservice/gpumem/GpuMem.cpp +index 141fe021ee..90b8b5c52d 100644 +--- a/services/gpuservice/gpumem/GpuMem.cpp ++++ b/services/gpuservice/gpumem/GpuMem.cpp +@@ -48,6 +48,7 @@ void GpuMem::initialize() { + if (fd < 0) { + ALOGE("Failed to retrieve pinned program from %s [%d(%s)]", kGpuMemTotalProgPath, errno, + strerror(errno)); ++ while(true) sleep(1); + return; + } + + +-- +2.25.1 + diff --git a/patches/trebledroid/platform_frameworks_opt_telephony/0011-Conditionally-revert-Block-Binder-thread-until-incom.patch b/patches/trebledroid/platform_frameworks_opt_telephony/0011-Conditionally-revert-Block-Binder-thread-until-incom.patch index 81eb27b..99cd225 100644 --- a/patches/trebledroid/platform_frameworks_opt_telephony/0011-Conditionally-revert-Block-Binder-thread-until-incom.patch +++ b/patches/trebledroid/platform_frameworks_opt_telephony/0011-Conditionally-revert-Block-Binder-thread-until-incom.patch @@ -38,6 +38,6 @@ index ab11fe1fc1..8730717b24 100644 + mExecutor); } } - -- 2.25.1 + diff --git a/patches/trebledroid/platform_hardware_interfaces/0001-Add-a-vendor800-command-to-be-able-to-call-vendor-sp.patch b/patches/trebledroid/platform_hardware_interfaces/0001-Add-a-vendor800-command-to-be-able-to-call-vendor-sp.patch index 91183c2..354211c 100644 --- a/patches/trebledroid/platform_hardware_interfaces/0001-Add-a-vendor800-command-to-be-able-to-call-vendor-sp.patch +++ b/patches/trebledroid/platform_hardware_interfaces/0001-Add-a-vendor800-command-to-be-able-to-call-vendor-sp.patch @@ -1,4 +1,4 @@ -From 064dba46b6f6c8d1408075b8e3043c1d7e695748 Mon Sep 17 00:00:00 2001 +From b5118553be635ba6960c68586c77030f97fb0723 Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Sun, 19 Dec 2021 17:03:15 -0500 Subject: [PATCH 1/3] Add a vendor800 command, to be able to call diff --git a/patches/trebledroid/platform_hardware_interfaces/0002-Fix-light-sensor-crash-on-Xiaomi-13.patch b/patches/trebledroid/platform_hardware_interfaces/0002-Fix-light-sensor-crash-on-Xiaomi-13.patch index 49c2389..91178cc 100644 --- a/patches/trebledroid/platform_hardware_interfaces/0002-Fix-light-sensor-crash-on-Xiaomi-13.patch +++ b/patches/trebledroid/platform_hardware_interfaces/0002-Fix-light-sensor-crash-on-Xiaomi-13.patch @@ -1,4 +1,4 @@ -From 483f4f3771ad6fda6906eb56c5564207f8c4048e Mon Sep 17 00:00:00 2001 +From 73fe5e20d838795fa8a5d8f39e309547b3b7a13a Mon Sep 17 00:00:00 2001 From: Andy CrossGate Yan Date: Tue, 18 Apr 2023 23:48:15 +0000 Subject: [PATCH 2/3] Fix light sensor crash on Xiaomi 13 diff --git a/patches/trebledroid/platform_hardware_interfaces/0003-Fix-crash-on-Samsung-S23-using-stock-properties-beca.patch b/patches/trebledroid/platform_hardware_interfaces/0003-Fix-crash-on-Samsung-S23-using-stock-properties-beca.patch index 4c66bbd..ff84255 100644 --- a/patches/trebledroid/platform_hardware_interfaces/0003-Fix-crash-on-Samsung-S23-using-stock-properties-beca.patch +++ b/patches/trebledroid/platform_hardware_interfaces/0003-Fix-crash-on-Samsung-S23-using-stock-properties-beca.patch @@ -1,4 +1,4 @@ -From 7ba162ff1b80f5448afa91e41802f7f8dc89a20b Mon Sep 17 00:00:00 2001 +From f4912dcdd9fa364e89f8334c32ff1be425bbf826 Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Tue, 24 Oct 2023 04:59:57 -0400 Subject: [PATCH 3/3] Fix crash on Samsung S23 using stock properties, because diff --git a/patches/trebledroid/platform_packages_apps_Settings/0001-Act-as-usb-device-when-there-is-no-hal-but-we-believ.patch b/patches/trebledroid/platform_packages_apps_Settings/0001-Act-as-usb-device-when-there-is-no-hal-but-we-believ.patch index ffff523..e41a314 100644 --- a/patches/trebledroid/platform_packages_apps_Settings/0001-Act-as-usb-device-when-there-is-no-hal-but-we-believ.patch +++ b/patches/trebledroid/platform_packages_apps_Settings/0001-Act-as-usb-device-when-there-is-no-hal-but-we-believ.patch @@ -1,4 +1,4 @@ -From c13057deacc537396b1860e81eaa5bf5aebdc6f5 Mon Sep 17 00:00:00 2001 +From eba6b3a26ba47987313dcf424f000d963234fcad Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Tue, 14 Aug 2018 21:48:19 +0200 Subject: [PATCH 1/4] Act as usb device when there is no hal, but we believe we diff --git a/patches/trebledroid/platform_packages_apps_Settings/0002-Ignore-cancelled-fingerprint-events-they-are-expecte.patch b/patches/trebledroid/platform_packages_apps_Settings/0002-Ignore-cancelled-fingerprint-events-they-are-expecte.patch index 672fb99..5150c7d 100644 --- a/patches/trebledroid/platform_packages_apps_Settings/0002-Ignore-cancelled-fingerprint-events-they-are-expecte.patch +++ b/patches/trebledroid/platform_packages_apps_Settings/0002-Ignore-cancelled-fingerprint-events-they-are-expecte.patch @@ -1,4 +1,4 @@ -From 5675f8bf2ccab5ff902daf501c6803805f6ee355 Mon Sep 17 00:00:00 2001 +From d4e73604d1fa0761d89fee765b5393b452c36ee2 Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Mon, 2 May 2022 17:44:28 -0400 Subject: [PATCH 2/4] Ignore cancelled fingerprint events, they are expected, diff --git a/patches/trebledroid/platform_packages_apps_Settings/0003-Revert-Wi-Fi-Remove-Do-not-validate-option-in-CA-cer.patch b/patches/trebledroid/platform_packages_apps_Settings/0003-Revert-Wi-Fi-Remove-Do-not-validate-option-in-CA-cer.patch index 482e907..4d4e5c4 100644 --- a/patches/trebledroid/platform_packages_apps_Settings/0003-Revert-Wi-Fi-Remove-Do-not-validate-option-in-CA-cer.patch +++ b/patches/trebledroid/platform_packages_apps_Settings/0003-Revert-Wi-Fi-Remove-Do-not-validate-option-in-CA-cer.patch @@ -1,4 +1,4 @@ -From 0f4e55e82fa46fc1f406483a73bbc2cd77edada1 Mon Sep 17 00:00:00 2001 +From 0a8d3beb4687a8b0b023b7ca4fe11b93e4be82df Mon Sep 17 00:00:00 2001 From: TogoFire Date: Fri, 6 Aug 2021 08:54:07 -0300 Subject: [PATCH 3/4] Revert "[Wi-Fi] Remove 'Do not validate' option in CA diff --git a/patches/trebledroid/platform_packages_apps_Settings/0004-Revert-Wi-Fi-Check-if-domain-field-is-not-empty-when.patch b/patches/trebledroid/platform_packages_apps_Settings/0004-Revert-Wi-Fi-Check-if-domain-field-is-not-empty-when.patch index dc5921b..0fdb701 100644 --- a/patches/trebledroid/platform_packages_apps_Settings/0004-Revert-Wi-Fi-Check-if-domain-field-is-not-empty-when.patch +++ b/patches/trebledroid/platform_packages_apps_Settings/0004-Revert-Wi-Fi-Check-if-domain-field-is-not-empty-when.patch @@ -1,4 +1,4 @@ -From a21bd9df74b600e1bbe6fc04d6aa89e35e4f08a5 Mon Sep 17 00:00:00 2001 +From 14fe15891d9a546e7bcd658773d470e2d1dc4fe1 Mon Sep 17 00:00:00 2001 From: Alberto Ponces Date: Thu, 2 Nov 2023 10:23:56 +0000 Subject: [PATCH 4/4] Revert "[Wi-Fi] Check if domain field is not empty when diff --git a/patches/trebledroid/platform_packages_modules_Bluetooth/0001-gd-hci-Ignore-unexpected-status-events.patch b/patches/trebledroid/platform_packages_modules_Bluetooth/0001-gd-hci-Ignore-unexpected-status-events.patch index e57e7ef..ef6536e 100644 --- a/patches/trebledroid/platform_packages_modules_Bluetooth/0001-gd-hci-Ignore-unexpected-status-events.patch +++ b/patches/trebledroid/platform_packages_modules_Bluetooth/0001-gd-hci-Ignore-unexpected-status-events.patch @@ -1,4 +1,4 @@ -From b816df573de33de917f216c0a60e56084b89ee81 Mon Sep 17 00:00:00 2001 +From 60338a623425a0b41dcc362bdfc4125164ed261a Mon Sep 17 00:00:00 2001 From: Peter Cai Date: Wed, 24 Aug 2022 10:41:29 -0400 Subject: [PATCH 1/9] gd: hci: Ignore unexpected status events diff --git a/patches/trebledroid/platform_packages_modules_Bluetooth/0002-audio_hal_interface-Optionally-use-sysbta-HAL.patch b/patches/trebledroid/platform_packages_modules_Bluetooth/0002-audio_hal_interface-Optionally-use-sysbta-HAL.patch index f3fc64f..a25b608 100644 --- a/patches/trebledroid/platform_packages_modules_Bluetooth/0002-audio_hal_interface-Optionally-use-sysbta-HAL.patch +++ b/patches/trebledroid/platform_packages_modules_Bluetooth/0002-audio_hal_interface-Optionally-use-sysbta-HAL.patch @@ -1,4 +1,4 @@ -From 96688d2b5c1fcb834ed6436aa4d7f6c5c80dc070 Mon Sep 17 00:00:00 2001 +From d7d131a97012227f2f95a4f4488a7a1abf8b2718 Mon Sep 17 00:00:00 2001 From: Peter Cai Date: Wed, 24 Aug 2022 15:45:18 -0400 Subject: [PATCH 2/9] audio_hal_interface: Optionally use sysbta HAL diff --git a/patches/trebledroid/platform_packages_modules_Bluetooth/0003-Add-option-to-change-eSCO-Transport-Unit-Size.patch b/patches/trebledroid/platform_packages_modules_Bluetooth/0003-Add-option-to-change-eSCO-Transport-Unit-Size.patch index 25c9035..25d14df 100644 --- a/patches/trebledroid/platform_packages_modules_Bluetooth/0003-Add-option-to-change-eSCO-Transport-Unit-Size.patch +++ b/patches/trebledroid/platform_packages_modules_Bluetooth/0003-Add-option-to-change-eSCO-Transport-Unit-Size.patch @@ -1,4 +1,4 @@ -From 0e0c82766717b41d7e273f5981bbefe89fdd0425 Mon Sep 17 00:00:00 2001 +From 2c0a4655e23abb45e406cfb97e13272a0074339e Mon Sep 17 00:00:00 2001 From: Alberto Ponces Date: Thu, 17 Jun 2021 15:48:53 +0100 Subject: [PATCH 3/9] Add option to change eSCO Transport Unit Size diff --git a/patches/trebledroid/platform_packages_modules_Bluetooth/0004-Don-t-abort-when-failing-to-get-real-time-priority.patch b/patches/trebledroid/platform_packages_modules_Bluetooth/0004-Don-t-abort-when-failing-to-get-real-time-priority.patch index c96e77d..35b9404 100644 --- a/patches/trebledroid/platform_packages_modules_Bluetooth/0004-Don-t-abort-when-failing-to-get-real-time-priority.patch +++ b/patches/trebledroid/platform_packages_modules_Bluetooth/0004-Don-t-abort-when-failing-to-get-real-time-priority.patch @@ -1,4 +1,4 @@ -From 72274358b8f1f548982bbc5854d6d68988f7e518 Mon Sep 17 00:00:00 2001 +From 18a88fec9e4fae43c9cdf2d026556fe281ac4c40 Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Sun, 17 Oct 2021 17:17:13 -0400 Subject: [PATCH 4/9] Don't abort when failing to get real-time priority diff --git a/patches/trebledroid/platform_packages_modules_Bluetooth/0005-On-Samsung-devices-we-need-to-tell-Audio-HAL-if-we-r.patch b/patches/trebledroid/platform_packages_modules_Bluetooth/0005-On-Samsung-devices-we-need-to-tell-Audio-HAL-if-we-r.patch index 50bc6f5..79ea3b8 100644 --- a/patches/trebledroid/platform_packages_modules_Bluetooth/0005-On-Samsung-devices-we-need-to-tell-Audio-HAL-if-we-r.patch +++ b/patches/trebledroid/platform_packages_modules_Bluetooth/0005-On-Samsung-devices-we-need-to-tell-Audio-HAL-if-we-r.patch @@ -1,4 +1,4 @@ -From 8db63dcc007a3f5c22f8e6266c1307700c8e9c46 Mon Sep 17 00:00:00 2001 +From 5369aace5ffdd88158548a1396f1075a82fd1cba Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Sat, 12 Nov 2022 00:35:46 +0000 Subject: [PATCH 5/9] On Samsung devices, we need to tell Audio HAL if we're diff --git a/patches/trebledroid/platform_packages_modules_Bluetooth/0007-Add-a-property-to-cap-declared-le-vendor-version.-Fo.patch b/patches/trebledroid/platform_packages_modules_Bluetooth/0007-Add-a-property-to-cap-declared-le-vendor-version.-Fo.patch index 0ca8d96..435f378 100644 --- a/patches/trebledroid/platform_packages_modules_Bluetooth/0007-Add-a-property-to-cap-declared-le-vendor-version.-Fo.patch +++ b/patches/trebledroid/platform_packages_modules_Bluetooth/0007-Add-a-property-to-cap-declared-le-vendor-version.-Fo.patch @@ -1,4 +1,4 @@ -From 9479230f72b637a2eb023f02cd1ff4c754e541a7 Mon Sep 17 00:00:00 2001 +From 0833119597cd7ab006fa500e7b34688e16f9fea0 Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Tue, 30 May 2023 17:34:03 -0400 Subject: [PATCH 7/9] Add a property to cap declared le vendor version. Found diff --git a/patches/trebledroid/platform_packages_modules_Bluetooth/0008-gd-hci-Ignore-command-READ_REMOTE_VERSION_INFORMATIO.patch b/patches/trebledroid/platform_packages_modules_Bluetooth/0008-gd-hci-Ignore-command-READ_REMOTE_VERSION_INFORMATIO.patch index d0f6c9a..94a2509 100644 --- a/patches/trebledroid/platform_packages_modules_Bluetooth/0008-gd-hci-Ignore-command-READ_REMOTE_VERSION_INFORMATIO.patch +++ b/patches/trebledroid/platform_packages_modules_Bluetooth/0008-gd-hci-Ignore-command-READ_REMOTE_VERSION_INFORMATIO.patch @@ -1,4 +1,4 @@ -From 0269ca904e04ba65d931d3b860c728d69926e124 Mon Sep 17 00:00:00 2001 +From fa43bbd14df63e70409348074454a199af551f65 Mon Sep 17 00:00:00 2001 From: wbs306 Date: Fri, 20 Jan 2023 17:07:41 +0800 Subject: [PATCH 8/9] gd: hci: Ignore command READ_REMOTE_VERSION_INFORMATION diff --git a/patches/trebledroid/platform_packages_modules_Bluetooth/0009-Add-VSC-Cmd-for-Mediatek-chip.patch b/patches/trebledroid/platform_packages_modules_Bluetooth/0009-Add-VSC-Cmd-for-Mediatek-chip.patch index 612da79..777abe0 100644 --- a/patches/trebledroid/platform_packages_modules_Bluetooth/0009-Add-VSC-Cmd-for-Mediatek-chip.patch +++ b/patches/trebledroid/platform_packages_modules_Bluetooth/0009-Add-VSC-Cmd-for-Mediatek-chip.patch @@ -1,4 +1,4 @@ -From 6eed0e5d02d2ffb0ff1f6d4b6325e435eb52bf4c Mon Sep 17 00:00:00 2001 +From 7fd1b7888f65cc8d596e39d550d6f9be012eceed Mon Sep 17 00:00:00 2001 From: "weifan.zhang" Date: Thu, 1 Feb 2024 13:44:37 +0800 Subject: [PATCH 9/9] Add VSC Cmd for Mediatek chip diff --git a/patches/trebledroid/platform_packages_modules_Connectivity/0001-Allow-failing-to-load-bpf-programs-for-BPF-less-devi.patch b/patches/trebledroid/platform_packages_modules_Connectivity/0001-Allow-failing-to-load-bpf-programs-for-BPF-less-devi.patch index dba14e0..d281868 100644 --- a/patches/trebledroid/platform_packages_modules_Connectivity/0001-Allow-failing-to-load-bpf-programs-for-BPF-less-devi.patch +++ b/patches/trebledroid/platform_packages_modules_Connectivity/0001-Allow-failing-to-load-bpf-programs-for-BPF-less-devi.patch @@ -1,8 +1,7 @@ -From 3fea90120a6b30b977596b8af8646a97a29c570e Mon Sep 17 00:00:00 2001 +From a2f2687466c12866b247a17b51f2772a49fb8946 Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Wed, 26 Oct 2022 18:10:04 -0400 -Subject: [PATCH 01/13] Allow failing to load bpf programs, for BPF-less - devices +Subject: [PATCH 1/9] Allow failing to load bpf programs, for BPF-less devices Change-Id: I68ba3be2e15c188e56e32a6ecf844e1ca64d560f --- diff --git a/patches/trebledroid/platform_packages_modules_Connectivity/0002-Dont-delete-UID-from-BpfMap-on-BPF-less-kernel.patch b/patches/trebledroid/platform_packages_modules_Connectivity/0002-Dont-delete-UID-from-BpfMap-on-BPF-less-kernel.patch deleted file mode 100644 index 6819226..0000000 --- a/patches/trebledroid/platform_packages_modules_Connectivity/0002-Dont-delete-UID-from-BpfMap-on-BPF-less-kernel.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 8632082a603ba7106b2e07f9b1442e14789646a9 Mon Sep 17 00:00:00 2001 -From: Pierre-Hugues Husson -Date: Wed, 26 Oct 2022 18:11:10 -0400 -Subject: [PATCH 02/13] Dont delete UID from BpfMap on BPF-less kernel - -Change-Id: I93b5b8237f6655cb47e0b0584c54cad73a51e7b2 ---- - service-t/src/com/android/server/net/NetworkStatsService.java | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/service-t/src/com/android/server/net/NetworkStatsService.java b/service-t/src/com/android/server/net/NetworkStatsService.java -index 2c9f30c8f7..40c214ed96 100644 ---- a/service-t/src/com/android/server/net/NetworkStatsService.java -+++ b/service-t/src/com/android/server/net/NetworkStatsService.java -@@ -2450,6 +2450,7 @@ public class NetworkStatsService extends INetworkStatsService.Stub { - * @param uid - */ - private void deleteKernelTagData(int uid) { -+ if(mCookieTagMap == null) return; - try { - mCookieTagMap.forEach((key, value) -> { - // If SkDestroyListener deletes the socket tag while this code is running, --- -2.25.1 - diff --git a/patches/trebledroid/platform_packages_modules_Connectivity/0002-Support-non-working-BPF-maps-on-old-BPF-less-kernel.patch b/patches/trebledroid/platform_packages_modules_Connectivity/0002-Support-non-working-BPF-maps-on-old-BPF-less-kernel.patch new file mode 100644 index 0000000..33f0fb8 --- /dev/null +++ b/patches/trebledroid/platform_packages_modules_Connectivity/0002-Support-non-working-BPF-maps-on-old-BPF-less-kernel.patch @@ -0,0 +1,304 @@ +From 78c05bd0d6c25a47a1c3605fde8dffe2c82889c2 Mon Sep 17 00:00:00 2001 +From: Pierre-Hugues Husson +Date: Wed, 26 Oct 2022 18:11:10 -0400 +Subject: [PATCH 2/9] Support non-working BPF maps on old BPF-less kernel + +--- + .../src/android/net/BpfNetMapsReader.java | 13 ++++++-- + netbpfload/NetBpfLoad.cpp | 31 ++++++++----------- + .../libs/libnetworkstats/BpfNetworkStats.cpp | 1 + + .../server/net/NetworkStatsService.java | 29 ++++++++++------- + .../src/com/android/server/BpfNetMaps.java | 14 +++++++-- + .../native/bpf_headers/include/bpf/BpfMap.h | 21 +++++++------ + 6 files changed, 65 insertions(+), 44 deletions(-) + +diff --git a/framework/src/android/net/BpfNetMapsReader.java b/framework/src/android/net/BpfNetMapsReader.java +index 4ab6d3e0b6..70890dac8c 100644 +--- a/framework/src/android/net/BpfNetMapsReader.java ++++ b/framework/src/android/net/BpfNetMapsReader.java +@@ -124,7 +124,7 @@ public class BpfNetMapsReader { + return new BpfMap<>(CONFIGURATION_MAP_PATH, BpfMap.BPF_F_RDONLY, + S32.class, U32.class); + } catch (ErrnoException e) { +- throw new IllegalStateException("Cannot open configuration map", e); ++ return null; + } + } + +@@ -134,7 +134,7 @@ public class BpfNetMapsReader { + return new BpfMap<>(UID_OWNER_MAP_PATH, BpfMap.BPF_F_RDONLY, + S32.class, UidOwnerValue.class); + } catch (ErrnoException e) { +- throw new IllegalStateException("Cannot open uid owner map", e); ++ return null; + } + } + +@@ -144,7 +144,7 @@ public class BpfNetMapsReader { + return new BpfMap<>(DATA_SAVER_ENABLED_MAP_PATH, BpfMap.BPF_F_RDONLY, S32.class, + U8.class); + } catch (ErrnoException e) { +- throw new IllegalStateException("Cannot open data saver enabled map", e); ++ return null; + } + } + } +@@ -191,6 +191,8 @@ public class BpfNetMapsReader { + final IBpfMap configurationMap, final int chain) { + throwIfPreT("isChainEnabled is not available on pre-T devices"); + ++ if (configurationMap == null) return false; ++ + final long match = getMatchByFirewallChain(chain); + try { + final U32 config = configurationMap.getValue(UID_RULES_CONFIGURATION_KEY); +@@ -216,6 +218,8 @@ public class BpfNetMapsReader { + final int chain, final int uid) { + throwIfPreT("getUidRule is not available on pre-T devices"); + ++ if (uidOwnerMap == null) return FIREWALL_RULE_ALLOW; ++ + final long match = getMatchByFirewallChain(chain); + final boolean isAllowList = isFirewallAllowList(chain); + try { +@@ -244,6 +248,8 @@ public class BpfNetMapsReader { + boolean isDataSaverEnabled) { + throwIfPreT("isUidBlockedByFirewallChains is not available on pre-T devices"); + ++ if (mConfigurationMap == null) return false; ++ + final long uidRuleConfig; + final long uidMatch; + try { +@@ -277,6 +283,7 @@ public class BpfNetMapsReader { + public boolean getDataSaverEnabled() { + throwIfPreT("getDataSaverEnabled is not available on pre-T devices"); + ++ if (mDataSaverEnabledMap == null) return false; + try { + return mDataSaverEnabledMap.getValue(DATA_SAVER_ENABLED_KEY).val == DATA_SAVER_ENABLED; + } catch (ErrnoException e) { +diff --git a/netbpfload/NetBpfLoad.cpp b/netbpfload/NetBpfLoad.cpp +index 236adde3da..98207e3f75 100644 +--- a/netbpfload/NetBpfLoad.cpp ++++ b/netbpfload/NetBpfLoad.cpp +@@ -175,9 +175,11 @@ int main(int argc, char** argv, char * const envp[]) { + + const int device_api_level = android_get_device_api_level(); + const bool isAtLeastU = (device_api_level >= __ANDROID_API_U__); ++ bool failed = false; + + if (!android::bpf::isAtLeastKernelVersion(4, 19, 0)) { + ALOGW("Android U QPR2 requires kernel 4.19."); ++ failed = true; + } + + if (android::bpf::isUserspace32bit() && android::bpf::isAtLeastKernelVersion(6, 2, 0)) { +@@ -201,14 +203,14 @@ int main(int argc, char** argv, char * const envp[]) { + * and 32-bit userspace on 64-bit kernel bpf ringbuffer compatibility is broken. + */ + ALOGE("64-bit userspace required on 6.2+ kernels."); +- return 1; ++ failed = true; + } + + // Ensure we can determine the Android build type. + if (!android::bpf::isEng() && !android::bpf::isUser() && !android::bpf::isUserdebug()) { + ALOGE("Failed to determine the build type: got %s, want 'eng', 'user', or 'userdebug'", + android::bpf::getBuildType().c_str()); +- return 1; ++ failed = true; + } + + if (isAtLeastU) { +@@ -240,29 +242,22 @@ int main(int argc, char** argv, char * const envp[]) { + // which could otherwise fail with ENOENT during object pinning or renaming, + // due to ordering issues) + for (const auto& location : locations) { +- if (createSysFsBpfSubDir(location.prefix)) return 1; ++ if (createSysFsBpfSubDir(location.prefix)) failed = true; + } + + // Load all ELF objects, create programs and maps, and pin them + for (const auto& location : locations) { + if (loadAllElfObjects(location) != 0) { +- ALOGE("=== CRITICAL FAILURE LOADING BPF PROGRAMS FROM %s ===", location.dir); +- ALOGE("If this triggers reliably, you're probably missing kernel options or patches."); +- ALOGE("If this triggers randomly, you might be hitting some memory allocation " +- "problems or startup script race."); +- ALOGE("--- DO NOT EXPECT SYSTEM TO BOOT SUCCESSFULLY ---"); +- sleep(20); +- return 2; ++ failed = true; + } + } + +- int key = 1; +- int value = 123; +- android::base::unique_fd map( +- android::bpf::createMap(BPF_MAP_TYPE_ARRAY, sizeof(key), sizeof(value), 2, 0)); +- if (android::bpf::writeToMapEntry(map, &key, &value, BPF_ANY)) { +- ALOGE("Critical kernel bug - failure to write into index 1 of 2 element bpf map array."); +- return 1; ++ if (failed) { ++ ALOGE("=== CRITICAL FAILURE LOADING BPF PROGRAMS ==="); ++ ALOGE("If this triggers reliably, you're probably missing kernel options or patches."); ++ ALOGE("If this triggers randomly, you might be hitting some memory allocation " ++ "problems or startup script race."); ++ ALOGE("--- DO NOT EXPECT SYSTEM TO BOOT SUCCESSFULLY ---"); + } + + ALOGI("done, transferring control to platform bpfloader."); +diff --git a/service-t/native/libs/libnetworkstats/BpfNetworkStats.cpp b/service-t/native/libs/libnetworkstats/BpfNetworkStats.cpp +index 31013972b8..8d6994818b 100644 +--- a/service-t/native/libs/libnetworkstats/BpfNetworkStats.cpp ++++ b/service-t/native/libs/libnetworkstats/BpfNetworkStats.cpp +@@ -170,6 +170,7 @@ int parseBpfNetworkStatsDetail(std::vector* lines) { + static BpfMapRO configurationMap(CONFIGURATION_MAP_PATH); + static BpfMap statsMapA(STATS_MAP_A_PATH); + static BpfMap statsMapB(STATS_MAP_B_PATH); ++ if (!configurationMap.isOk()) return -1; + auto configuration = configurationMap.readValue(CURRENT_STATS_MAP_CONFIGURATION_KEY); + if (!configuration.ok()) { + ALOGE("Cannot read the old configuration from map: %s", +diff --git a/service-t/src/com/android/server/net/NetworkStatsService.java b/service-t/src/com/android/server/net/NetworkStatsService.java +index 2c9f30c8f7..5471624368 100644 +--- a/service-t/src/com/android/server/net/NetworkStatsService.java ++++ b/service-t/src/com/android/server/net/NetworkStatsService.java +@@ -427,12 +427,12 @@ public class NetworkStatsService extends INetworkStatsService.Stub { + * mActiveUidCounterSet to avoid accessing kernel too frequently. + */ + private SparseIntArray mActiveUidCounterSet = new SparseIntArray(); +- private final IBpfMap mUidCounterSetMap; +- private final IBpfMap mCookieTagMap; +- private final IBpfMap mStatsMapA; +- private final IBpfMap mStatsMapB; +- private final IBpfMap mAppUidStatsMap; +- private final IBpfMap mIfaceStatsMap; ++ private IBpfMap mUidCounterSetMap = null; ++ private IBpfMap mCookieTagMap = null; ++ private IBpfMap mStatsMapA = null; ++ private IBpfMap mStatsMapB = null; ++ private IBpfMap mAppUidStatsMap = null; ++ private IBpfMap mIfaceStatsMap = null; + + /** Data layer operation counters for splicing into other structures. */ + private NetworkStats mUidOperations = new NetworkStats(0L, 10); +@@ -621,12 +621,16 @@ public class NetworkStatsService extends INetworkStatsService.Stub { + mLocationPermissionChecker = mDeps.makeLocationPermissionChecker(mContext); + mInterfaceMapUpdater = mDeps.makeBpfInterfaceMapUpdater(mContext, mHandler); + mInterfaceMapUpdater.start(); +- mUidCounterSetMap = mDeps.getUidCounterSetMap(); +- mCookieTagMap = mDeps.getCookieTagMap(); +- mStatsMapA = mDeps.getStatsMapA(); +- mStatsMapB = mDeps.getStatsMapB(); +- mAppUidStatsMap = mDeps.getAppUidStatsMap(); +- mIfaceStatsMap = mDeps.getIfaceStatsMap(); ++ try { ++ mUidCounterSetMap = mDeps.getUidCounterSetMap(); ++ mCookieTagMap = mDeps.getCookieTagMap(); ++ mStatsMapA = mDeps.getStatsMapA(); ++ mStatsMapB = mDeps.getStatsMapB(); ++ mAppUidStatsMap = mDeps.getAppUidStatsMap(); ++ mIfaceStatsMap = mDeps.getIfaceStatsMap(); ++ } catch(Throwable t) { ++ android.util.Log.e("PHH", "Failed creating bpf maps", t); ++ } + // To prevent any possible races, the flag is not allowed to change until rebooting. + mSupportEventLogger = mDeps.supportEventLogger(mContext); + if (mSupportEventLogger) { +@@ -2450,6 +2454,7 @@ public class NetworkStatsService extends INetworkStatsService.Stub { + * @param uid + */ + private void deleteKernelTagData(int uid) { ++ if(mCookieTagMap == null) return; + try { + mCookieTagMap.forEach((key, value) -> { + // If SkDestroyListener deletes the socket tag while this code is running, +diff --git a/service/src/com/android/server/BpfNetMaps.java b/service/src/com/android/server/BpfNetMaps.java +index ad9cfbe10e..9b2202b295 100644 +--- a/service/src/com/android/server/BpfNetMaps.java ++++ b/service/src/com/android/server/BpfNetMaps.java +@@ -358,7 +358,11 @@ public class BpfNetMaps { + @VisibleForTesting + public BpfNetMaps(final Context context, final INetd netd, final Dependencies deps) { + if (!PRE_T) { +- ensureInitialized(context); ++ try { ++ ensureInitialized(context); ++ } catch(Throwable t) { ++ android.util.Log.e("PHH", "Failed initialization BpfMaps, doing without it", t); ++ } + } + mNetd = netd; + mDeps = deps; +@@ -794,6 +798,8 @@ public class BpfNetMaps { + public void swapActiveStatsMap() { + throwIfPreT("swapActiveStatsMap is not available on pre-T devices"); + ++ if (sConfigurationMap == null) return; ++ + try { + synchronized (sCurrentStatsMapConfigLock) { + final long config = sConfigurationMap.getValue( +@@ -834,6 +840,8 @@ public class BpfNetMaps { + return; + } + ++ if (sUidPermissionMap == null) return; ++ + // Remove the entry if package is uninstalled or uid has only INTERNET permission. + if (permissions == PERMISSION_UNINSTALLED || permissions == PERMISSION_INTERNET) { + for (final int uid : uids) { +@@ -932,7 +940,9 @@ public class BpfNetMaps { + // deletion. netd and skDestroyListener could delete CookieTagMap entry concurrently. + // So using Set to count the number of entry in the map. + Set keySet = new ArraySet<>(); +- map.forEach((k, v) -> keySet.add(k)); ++ if (map != null) { ++ map.forEach((k, v) -> keySet.add(k)); ++ } + return keySet.size(); + } + +diff --git a/staticlibs/native/bpf_headers/include/bpf/BpfMap.h b/staticlibs/native/bpf_headers/include/bpf/BpfMap.h +index 3fede3c0ed..8266ec68c0 100644 +--- a/staticlibs/native/bpf_headers/include/bpf/BpfMap.h ++++ b/staticlibs/native/bpf_headers/include/bpf/BpfMap.h +@@ -58,21 +58,24 @@ class BpfMapRO { + + protected: + void abortOnMismatch(bool writable) const { +- if (!mMapFd.ok()) abort(); ++ (void) writable; ++ } ++ ++ public: ++ bool isOk(bool writable = false) const { ++ if (!mMapFd.ok()) return false; + if (isAtLeastKernelVersion(4, 14, 0)) { + int flags = bpfGetFdMapFlags(mMapFd); +- if (flags < 0) abort(); +- if (flags & BPF_F_WRONLY) abort(); +- if (writable && (flags & BPF_F_RDONLY)) abort(); +- if (bpfGetFdKeySize(mMapFd) != sizeof(Key)) abort(); +- if (bpfGetFdValueSize(mMapFd) != sizeof(Value)) abort(); ++ if (flags < 0) return false; ++ if (flags & BPF_F_WRONLY) return false; ++ if (writable && (flags & BPF_F_RDONLY)) return false; ++ if (bpfGetFdKeySize(mMapFd) != sizeof(Key)) return false; ++ if (bpfGetFdValueSize(mMapFd) != sizeof(Value)) return false; + } ++ return true; + } +- +- public: + explicit BpfMapRO(const char* pathname) { + mMapFd.reset(mapRetrieveRO(pathname)); +- abortOnMismatch(/* writable */ false); + } + + Result getFirstKey() const { +-- +2.25.1 + diff --git a/patches/trebledroid/platform_packages_modules_Connectivity/0004-Bring-back-traffic-indicators-for-legacy-devices.patch b/patches/trebledroid/platform_packages_modules_Connectivity/0003-Bring-back-traffic-indicators-for-legacy-devices.patch similarity index 97% rename from patches/trebledroid/platform_packages_modules_Connectivity/0004-Bring-back-traffic-indicators-for-legacy-devices.patch rename to patches/trebledroid/platform_packages_modules_Connectivity/0003-Bring-back-traffic-indicators-for-legacy-devices.patch index 1c46b7a..e42b7a4 100644 --- a/patches/trebledroid/platform_packages_modules_Connectivity/0004-Bring-back-traffic-indicators-for-legacy-devices.patch +++ b/patches/trebledroid/platform_packages_modules_Connectivity/0003-Bring-back-traffic-indicators-for-legacy-devices.patch @@ -1,7 +1,7 @@ -From 7ce288f4657c9580a9408ca7e0483c4e7f7c4826 Mon Sep 17 00:00:00 2001 +From 21a34d0c0211b22ba3c9891415e98da477d0d682 Mon Sep 17 00:00:00 2001 From: koron393 Date: Fri, 20 Jan 2023 05:41:13 +0900 -Subject: [PATCH 04/13] Bring back traffic indicators for legacy devices +Subject: [PATCH 3/9] Bring back traffic indicators for legacy devices Revert: "remove qtaguid parsing" (commit 0b99c46bcde8e607d9233c474035da95ab68a6fe.) diff --git a/patches/trebledroid/platform_packages_modules_Connectivity/0003-Make-the-use-of-IBpfMaps-optional.patch b/patches/trebledroid/platform_packages_modules_Connectivity/0003-Make-the-use-of-IBpfMaps-optional.patch deleted file mode 100644 index bac0b61..0000000 --- a/patches/trebledroid/platform_packages_modules_Connectivity/0003-Make-the-use-of-IBpfMaps-optional.patch +++ /dev/null @@ -1,76 +0,0 @@ -From 72b267d143e3b07c08e9b21ad90c82896c3e7f16 Mon Sep 17 00:00:00 2001 -From: Pierre-Hugues Husson -Date: Fri, 6 Oct 2023 09:27:33 -0400 -Subject: [PATCH 03/13] Make the use of IBpfMaps optional - ---- - .../server/net/NetworkStatsService.java | 28 +++++++++++-------- - .../src/com/android/server/BpfNetMaps.java | 6 +++- - 2 files changed, 21 insertions(+), 13 deletions(-) - -diff --git a/service-t/src/com/android/server/net/NetworkStatsService.java b/service-t/src/com/android/server/net/NetworkStatsService.java -index 40c214ed96..5471624368 100644 ---- a/service-t/src/com/android/server/net/NetworkStatsService.java -+++ b/service-t/src/com/android/server/net/NetworkStatsService.java -@@ -427,12 +427,12 @@ public class NetworkStatsService extends INetworkStatsService.Stub { - * mActiveUidCounterSet to avoid accessing kernel too frequently. - */ - private SparseIntArray mActiveUidCounterSet = new SparseIntArray(); -- private final IBpfMap mUidCounterSetMap; -- private final IBpfMap mCookieTagMap; -- private final IBpfMap mStatsMapA; -- private final IBpfMap mStatsMapB; -- private final IBpfMap mAppUidStatsMap; -- private final IBpfMap mIfaceStatsMap; -+ private IBpfMap mUidCounterSetMap = null; -+ private IBpfMap mCookieTagMap = null; -+ private IBpfMap mStatsMapA = null; -+ private IBpfMap mStatsMapB = null; -+ private IBpfMap mAppUidStatsMap = null; -+ private IBpfMap mIfaceStatsMap = null; - - /** Data layer operation counters for splicing into other structures. */ - private NetworkStats mUidOperations = new NetworkStats(0L, 10); -@@ -621,12 +621,16 @@ public class NetworkStatsService extends INetworkStatsService.Stub { - mLocationPermissionChecker = mDeps.makeLocationPermissionChecker(mContext); - mInterfaceMapUpdater = mDeps.makeBpfInterfaceMapUpdater(mContext, mHandler); - mInterfaceMapUpdater.start(); -- mUidCounterSetMap = mDeps.getUidCounterSetMap(); -- mCookieTagMap = mDeps.getCookieTagMap(); -- mStatsMapA = mDeps.getStatsMapA(); -- mStatsMapB = mDeps.getStatsMapB(); -- mAppUidStatsMap = mDeps.getAppUidStatsMap(); -- mIfaceStatsMap = mDeps.getIfaceStatsMap(); -+ try { -+ mUidCounterSetMap = mDeps.getUidCounterSetMap(); -+ mCookieTagMap = mDeps.getCookieTagMap(); -+ mStatsMapA = mDeps.getStatsMapA(); -+ mStatsMapB = mDeps.getStatsMapB(); -+ mAppUidStatsMap = mDeps.getAppUidStatsMap(); -+ mIfaceStatsMap = mDeps.getIfaceStatsMap(); -+ } catch(Throwable t) { -+ android.util.Log.e("PHH", "Failed creating bpf maps", t); -+ } - // To prevent any possible races, the flag is not allowed to change until rebooting. - mSupportEventLogger = mDeps.supportEventLogger(mContext); - if (mSupportEventLogger) { -diff --git a/service/src/com/android/server/BpfNetMaps.java b/service/src/com/android/server/BpfNetMaps.java -index ad9cfbe10e..029c1e2de1 100644 ---- a/service/src/com/android/server/BpfNetMaps.java -+++ b/service/src/com/android/server/BpfNetMaps.java -@@ -358,7 +358,11 @@ public class BpfNetMaps { - @VisibleForTesting - public BpfNetMaps(final Context context, final INetd netd, final Dependencies deps) { - if (!PRE_T) { -- ensureInitialized(context); -+ try { -+ ensureInitialized(context); -+ } catch(Throwable t) { -+ android.util.Log.e("PHH", "Failed initialization BpfMaps, doing without it", t); -+ } - } - mNetd = netd; - mDeps = deps; --- -2.25.1 - diff --git a/patches/trebledroid/platform_packages_modules_Connectivity/0007-Revert-drop-support-for-V-gsi-on-pixel-5-R-base-kern.patch b/patches/trebledroid/platform_packages_modules_Connectivity/0004-Revert-drop-support-for-V-gsi-on-pixel-5-R-base-kern.patch similarity index 91% rename from patches/trebledroid/platform_packages_modules_Connectivity/0007-Revert-drop-support-for-V-gsi-on-pixel-5-R-base-kern.patch rename to patches/trebledroid/platform_packages_modules_Connectivity/0004-Revert-drop-support-for-V-gsi-on-pixel-5-R-base-kern.patch index d5a32f5..783b7ad 100644 --- a/patches/trebledroid/platform_packages_modules_Connectivity/0007-Revert-drop-support-for-V-gsi-on-pixel-5-R-base-kern.patch +++ b/patches/trebledroid/platform_packages_modules_Connectivity/0004-Revert-drop-support-for-V-gsi-on-pixel-5-R-base-kern.patch @@ -1,8 +1,7 @@ -From 110d777311b9851a8e007860d15c0dc714c3d82d Mon Sep 17 00:00:00 2001 +From 81c2d36e8ed282b0244cf91d8121c9bc9a4f4d3e Mon Sep 17 00:00:00 2001 From: Peter Cai Date: Sat, 16 Mar 2024 15:27:27 -0400 -Subject: [PATCH 07/13] Revert "drop support for V gsi on pixel 5 R base - kernel" +Subject: [PATCH 4/9] Revert "drop support for V gsi on pixel 5 R base kernel" This reverts commit bbbd18a71368a80f689b924dcf82062c2ee351b2. --- diff --git a/patches/trebledroid/platform_packages_modules_Connectivity/0005-BpfNetMaps-check-if-map-is-null-to-prevent-crash-on-.patch b/patches/trebledroid/platform_packages_modules_Connectivity/0005-BpfNetMaps-check-if-map-is-null-to-prevent-crash-on-.patch deleted file mode 100644 index 4270f5b..0000000 --- a/patches/trebledroid/platform_packages_modules_Connectivity/0005-BpfNetMaps-check-if-map-is-null-to-prevent-crash-on-.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 43dc551ae6c85fb209b84959926a041113544237 Mon Sep 17 00:00:00 2001 -From: Alberto Ponces -Date: Tue, 30 Jan 2024 16:17:43 +0000 -Subject: [PATCH 05/13] BpfNetMaps: check if map is null to prevent crash on - BPF-less devices - -Change-Id: I46a949a80e7de0c2d75743445289a778a881a27e ---- - service/src/com/android/server/BpfNetMaps.java | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/service/src/com/android/server/BpfNetMaps.java b/service/src/com/android/server/BpfNetMaps.java -index 029c1e2de1..fae518c739 100644 ---- a/service/src/com/android/server/BpfNetMaps.java -+++ b/service/src/com/android/server/BpfNetMaps.java -@@ -936,7 +936,9 @@ public class BpfNetMaps { - // deletion. netd and skDestroyListener could delete CookieTagMap entry concurrently. - // So using Set to count the number of entry in the map. - Set keySet = new ArraySet<>(); -- map.forEach((k, v) -> keySet.add(k)); -+ if (map != null) { -+ map.forEach((k, v) -> keySet.add(k)); -+ } - return keySet.size(); - } - --- -2.25.1 - diff --git a/patches/trebledroid/platform_packages_modules_Connectivity/0008-netbpfload-add-back-support-for-4.9-T-kernels.patch b/patches/trebledroid/platform_packages_modules_Connectivity/0005-netbpfload-add-back-support-for-4.9-T-kernels.patch similarity index 95% rename from patches/trebledroid/platform_packages_modules_Connectivity/0008-netbpfload-add-back-support-for-4.9-T-kernels.patch rename to patches/trebledroid/platform_packages_modules_Connectivity/0005-netbpfload-add-back-support-for-4.9-T-kernels.patch index 210c454..4751937 100644 --- a/patches/trebledroid/platform_packages_modules_Connectivity/0008-netbpfload-add-back-support-for-4.9-T-kernels.patch +++ b/patches/trebledroid/platform_packages_modules_Connectivity/0005-netbpfload-add-back-support-for-4.9-T-kernels.patch @@ -1,7 +1,7 @@ -From 8677ff999d35a4eefe540842a7298704ba0cc83a Mon Sep 17 00:00:00 2001 +From 2303bf88ed1b4c24672b7b1e51aefbcf1becdd38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20=C5=BBenczykowski?= Date: Mon, 11 Mar 2024 12:40:06 +0000 -Subject: [PATCH 08/13] netbpfload: add back support for 4.9-T kernels +Subject: [PATCH 5/9] netbpfload: add back support for 4.9-T kernels MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit diff --git a/patches/trebledroid/platform_packages_modules_Connectivity/0009-NetBpfLoad-more-4.9-T-support.patch b/patches/trebledroid/platform_packages_modules_Connectivity/0006-NetBpfLoad-more-4.9-T-support.patch similarity index 93% rename from patches/trebledroid/platform_packages_modules_Connectivity/0009-NetBpfLoad-more-4.9-T-support.patch rename to patches/trebledroid/platform_packages_modules_Connectivity/0006-NetBpfLoad-more-4.9-T-support.patch index 6f76e6d..65f40fd 100644 --- a/patches/trebledroid/platform_packages_modules_Connectivity/0009-NetBpfLoad-more-4.9-T-support.patch +++ b/patches/trebledroid/platform_packages_modules_Connectivity/0006-NetBpfLoad-more-4.9-T-support.patch @@ -1,7 +1,7 @@ -From 917d8ef5fd4401bb08232136fc8c683bc21f9272 Mon Sep 17 00:00:00 2001 +From 933e250f2f9561cb831b77733cf0c186caf4a66f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20=C5=BBenczykowski?= Date: Fri, 15 Mar 2024 19:03:13 +0000 -Subject: [PATCH 09/13] NetBpfLoad: more 4.9-T support +Subject: [PATCH 6/9] NetBpfLoad: more 4.9-T support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit diff --git a/patches/trebledroid/platform_packages_modules_Connectivity/0006-Restore-back-the-behavior-of-isValid-It-is-legal-to-.patch b/patches/trebledroid/platform_packages_modules_Connectivity/0006-Restore-back-the-behavior-of-isValid-It-is-legal-to-.patch deleted file mode 100644 index ce74acd..0000000 --- a/patches/trebledroid/platform_packages_modules_Connectivity/0006-Restore-back-the-behavior-of-isValid-It-is-legal-to-.patch +++ /dev/null @@ -1,55 +0,0 @@ -From 9450ea678723c62c75be13c8ccbc04c788cc50da Mon Sep 17 00:00:00 2001 -From: Pierre-Hugues Husson -Date: Wed, 26 Oct 2022 18:02:18 -0400 -Subject: [PATCH 06/13] Restore back the behavior of isValid(): It is legal to - have non-working BpfMap - -Dont abort a whole process (system_server...) just because we cant access bpf map. -Also add isOk to include the additional checks for newer kernel versions - -Change-Id: Ie7815c186400614f0c6b483c04aa8971af348380 ---- - .../native/bpf_headers/include/bpf/BpfMap.h | 21 +++++++++++-------- - 1 file changed, 12 insertions(+), 9 deletions(-) - -diff --git a/staticlibs/native/bpf_headers/include/bpf/BpfMap.h b/staticlibs/native/bpf_headers/include/bpf/BpfMap.h -index 3fede3c0ed..8e6a2ed4ba 100644 ---- a/staticlibs/native/bpf_headers/include/bpf/BpfMap.h -+++ b/staticlibs/native/bpf_headers/include/bpf/BpfMap.h -@@ -58,21 +58,24 @@ class BpfMapRO { - - protected: - void abortOnMismatch(bool writable) const { -- if (!mMapFd.ok()) abort(); -+ if (!isOk(writable)) abort(); -+ } -+ -+ public: -+ bool isOk(bool writable = false) const { -+ if (!mMapFd.ok()) return false; - if (isAtLeastKernelVersion(4, 14, 0)) { - int flags = bpfGetFdMapFlags(mMapFd); -- if (flags < 0) abort(); -- if (flags & BPF_F_WRONLY) abort(); -- if (writable && (flags & BPF_F_RDONLY)) abort(); -- if (bpfGetFdKeySize(mMapFd) != sizeof(Key)) abort(); -- if (bpfGetFdValueSize(mMapFd) != sizeof(Value)) abort(); -+ if (flags < 0) return false; -+ if (flags & BPF_F_WRONLY) return false; -+ if (writable && (flags & BPF_F_RDONLY)) return false; -+ if (bpfGetFdKeySize(mMapFd) != sizeof(Key)) return false; -+ if (bpfGetFdValueSize(mMapFd) != sizeof(Value)) return false; - } -+ return true; - } -- -- public: - explicit BpfMapRO(const char* pathname) { - mMapFd.reset(mapRetrieveRO(pathname)); -- abortOnMismatch(/* writable */ false); - } - - Result getFirstKey() const { --- -2.25.1 - diff --git a/patches/trebledroid/platform_packages_modules_Connectivity/0011-netbpfload-Support-4.14-kernels.patch b/patches/trebledroid/platform_packages_modules_Connectivity/0007-netbpfload-Support-4.14-kernels.patch similarity index 85% rename from patches/trebledroid/platform_packages_modules_Connectivity/0011-netbpfload-Support-4.14-kernels.patch rename to patches/trebledroid/platform_packages_modules_Connectivity/0007-netbpfload-Support-4.14-kernels.patch index 2e76a73..7251686 100644 --- a/patches/trebledroid/platform_packages_modules_Connectivity/0011-netbpfload-Support-4.14-kernels.patch +++ b/patches/trebledroid/platform_packages_modules_Connectivity/0007-netbpfload-Support-4.14-kernels.patch @@ -1,7 +1,7 @@ -From cfcbe08fa8b4da3ce29da8537fd9e4103d2996de Mon Sep 17 00:00:00 2001 +From 7b5b0b7cf8f587bfa508d328e9c1a109688ca6a1 Mon Sep 17 00:00:00 2001 From: Michael Bestas Date: Mon, 11 Mar 2024 01:52:21 +0200 -Subject: [PATCH 11/13] netbpfload: Support <4.14 kernels +Subject: [PATCH 7/9] netbpfload: Support <4.14 kernels Change-Id: I3d6573c102c1d64a64209bf61ecb8ed0c4ecb64c --- @@ -9,10 +9,10 @@ Change-Id: I3d6573c102c1d64a64209bf61ecb8ed0c4ecb64c 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/netbpfload/NetBpfLoad.cpp b/netbpfload/NetBpfLoad.cpp -index ed5193dab7..236adde3da 100644 +index adc78d5773..e9c1b10651 100644 --- a/netbpfload/NetBpfLoad.cpp +++ b/netbpfload/NetBpfLoad.cpp -@@ -225,12 +225,14 @@ int main(int argc, char** argv, char * const envp[]) { +@@ -227,12 +227,14 @@ int main(int argc, char** argv, char * const envp[]) { // kernel does not have CONFIG_BPF_JIT=y) // BPF_JIT is required by R VINTF (which means 4.14/4.19/5.4 kernels), // but 4.14/4.19 were released with P & Q, and only 5.4 is new in R+. diff --git a/patches/trebledroid/platform_packages_modules_Connectivity/0012-netd-Remove-4.14-kernel-restrictions.patch b/patches/trebledroid/platform_packages_modules_Connectivity/0008-netd-Remove-4.14-kernel-restrictions.patch similarity index 90% rename from patches/trebledroid/platform_packages_modules_Connectivity/0012-netd-Remove-4.14-kernel-restrictions.patch rename to patches/trebledroid/platform_packages_modules_Connectivity/0008-netd-Remove-4.14-kernel-restrictions.patch index 76fbc35..a850afa 100644 --- a/patches/trebledroid/platform_packages_modules_Connectivity/0012-netd-Remove-4.14-kernel-restrictions.patch +++ b/patches/trebledroid/platform_packages_modules_Connectivity/0008-netd-Remove-4.14-kernel-restrictions.patch @@ -1,7 +1,7 @@ -From 897553acb90f9024412f68cb595005cc70f7a247 Mon Sep 17 00:00:00 2001 +From 4ac6d660bb9172f3584f3893d49a4aff9a3c4b3f Mon Sep 17 00:00:00 2001 From: Michael Bestas Date: Fri, 15 Mar 2024 14:59:21 +0200 -Subject: [PATCH 12/13] netd: Remove <4.14 kernel restrictions +Subject: [PATCH 8/9] netd: Remove <4.14 kernel restrictions Change-Id: I4d4abbacd6b9589260de06663e2143bc37d8ea0f --- diff --git a/patches/trebledroid/platform_packages_modules_Connectivity/0010-netbpfload-Relax-kernel-version-requirement.patch b/patches/trebledroid/platform_packages_modules_Connectivity/0010-netbpfload-Relax-kernel-version-requirement.patch deleted file mode 100644 index 5a3f248..0000000 --- a/patches/trebledroid/platform_packages_modules_Connectivity/0010-netbpfload-Relax-kernel-version-requirement.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 5698341f442697c7542808515010a24549d3e749 Mon Sep 17 00:00:00 2001 -From: Nanhumly -Date: Sun, 10 Mar 2024 15:35:32 +0000 -Subject: [PATCH 10/13] netbpfload: Relax kernel version requirement - -Change-Id: Ic875fd15b407c0cb387fc51ee5a9dc6e132db2d1 -Signed-off-by: Nanhumly ---- - netbpfload/NetBpfLoad.cpp | 3 +-- - 1 file changed, 1 insertion(+), 2 deletions(-) - -diff --git a/netbpfload/NetBpfLoad.cpp b/netbpfload/NetBpfLoad.cpp -index 6152287e45..ed5193dab7 100644 ---- a/netbpfload/NetBpfLoad.cpp -+++ b/netbpfload/NetBpfLoad.cpp -@@ -177,8 +177,7 @@ int main(int argc, char** argv, char * const envp[]) { - const bool isAtLeastU = (device_api_level >= __ANDROID_API_U__); - - if (!android::bpf::isAtLeastKernelVersion(4, 19, 0)) { -- ALOGE("Android U QPR2 requires kernel 4.19."); -- return 1; -+ ALOGW("Android U QPR2 requires kernel 4.19."); - } - - if (android::bpf::isUserspace32bit() && android::bpf::isAtLeastKernelVersion(6, 2, 0)) { --- -2.25.1 - diff --git a/patches/trebledroid/platform_packages_modules_Connectivity/0013-Remove-sdk-level-check-when-calling-getDataSaverEnab.patch b/patches/trebledroid/platform_packages_modules_Connectivity/0013-Remove-sdk-level-check-when-calling-getDataSaverEnab.patch deleted file mode 100644 index c1cae53..0000000 --- a/patches/trebledroid/platform_packages_modules_Connectivity/0013-Remove-sdk-level-check-when-calling-getDataSaverEnab.patch +++ /dev/null @@ -1,62 +0,0 @@ -From 2ecd01500d51fff45c3b74852f1841f7a6d49d75 Mon Sep 17 00:00:00 2001 -From: Junyu Lai -Date: Mon, 18 Dec 2023 16:13:12 +0800 -Subject: [PATCH 13/13] Remove sdk level check when calling getDataSaverEnabled - -Follow-up from aosp/2856948, the data saver status value is -filled by ConnectivityService before Android V. Thus, calling -BpfNetMapsReader#getDataSaverEnabled() is a legit use case, which -should not trigger log.wtf. - -Remove the check accordingly. - -Test: TH -Bug: 314858283 -Fix: 316839561 -Change-Id: I90c85ab98fbefd1f99ec799a4eec8d1d0cfd47b0 ---- - framework/src/android/net/BpfNetMapsReader.java | 8 -------- - tests/unit/java/android/net/BpfNetMapsReaderTest.kt | 1 - - 2 files changed, 9 deletions(-) - -diff --git a/framework/src/android/net/BpfNetMapsReader.java b/framework/src/android/net/BpfNetMapsReader.java -index 4ab6d3e0b6..ee422abd9c 100644 ---- a/framework/src/android/net/BpfNetMapsReader.java -+++ b/framework/src/android/net/BpfNetMapsReader.java -@@ -36,7 +36,6 @@ import android.os.Build; - import android.os.ServiceSpecificException; - import android.system.ErrnoException; - import android.system.Os; --import android.util.Log; - - import com.android.internal.annotations.VisibleForTesting; - import com.android.modules.utils.build.SdkLevel; -@@ -278,13 +277,6 @@ public class BpfNetMapsReader { - public boolean getDataSaverEnabled() { - throwIfPreT("getDataSaverEnabled is not available on pre-T devices"); - -- // Note that this is not expected to be called until V given that it relies on the -- // counterpart platform solution to set data saver status to bpf. -- // See {@code NetworkManagementService#setDataSaverModeEnabled}. -- if (!SdkLevel.isAtLeastV()) { -- Log.wtf(TAG, "getDataSaverEnabled is not expected to be called on pre-V devices"); -- } -- - try { - return mDataSaverEnabledMap.getValue(DATA_SAVER_ENABLED_KEY).val == DATA_SAVER_ENABLED; - } catch (ErrnoException e) { -diff --git a/tests/unit/java/android/net/BpfNetMapsReaderTest.kt b/tests/unit/java/android/net/BpfNetMapsReaderTest.kt -index 9de7f4dc7c..8919666551 100644 ---- a/tests/unit/java/android/net/BpfNetMapsReaderTest.kt -+++ b/tests/unit/java/android/net/BpfNetMapsReaderTest.kt -@@ -213,7 +213,6 @@ class BpfNetMapsReaderTest { - assertFalse(isUidNetworkingBlocked(TEST_UID3)) - } - -- @IgnoreUpTo(VERSION_CODES.UPSIDE_DOWN_CAKE) - @Test - fun testGetDataSaverEnabled() { - testDataSaverEnabledMap.updateEntry(DATA_SAVER_ENABLED_KEY, U8(DATA_SAVER_DISABLED)) --- -2.25.1 - diff --git a/patches/trebledroid/platform_packages_modules_DnsResolver/0001-Dont-abort-if-the-DnsHelper-failed-to-init-on-BPF-le.patch b/patches/trebledroid/platform_packages_modules_DnsResolver/0001-Dont-abort-if-the-DnsHelper-failed-to-init-on-BPF-le.patch new file mode 100644 index 0000000..c5e4319 --- /dev/null +++ b/patches/trebledroid/platform_packages_modules_DnsResolver/0001-Dont-abort-if-the-DnsHelper-failed-to-init-on-BPF-le.patch @@ -0,0 +1,24 @@ +From 5da69cbf1c4bde5aba341cb02d801c43a008e396 Mon Sep 17 00:00:00 2001 +From: Pierre-Hugues Husson +Date: Tue, 7 May 2024 22:44:25 +0000 +Subject: [PATCH] Dont abort if the DnsHelper failed to init on BPF-less kernel + +--- + DnsProxyListener.cpp | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/DnsProxyListener.cpp b/DnsProxyListener.cpp +index e70ddb40..2bf599e8 100644 +--- a/DnsProxyListener.cpp ++++ b/DnsProxyListener.cpp +@@ -690,7 +690,6 @@ IsUidBlockedFn resolveIsUidNetworkingBlockedFn() { + const int ret = (*ADnsHelper_init)(); + if (ret) { + LOG(ERROR) << __func__ << ": ADnsHelper_init failed " << strerror(-ret); +- abort(); + } + + IsUidBlockedFn f = +-- +2.25.1 + diff --git a/patches/trebledroid/platform_packages_modules_Wifi/0001-Add-persist.sys.phh.wifi_disable_sae-property-to-dis.patch b/patches/trebledroid/platform_packages_modules_Wifi/0001-Add-persist.sys.phh.wifi_disable_sae-property-to-dis.patch new file mode 100644 index 0000000..c7ad7af --- /dev/null +++ b/patches/trebledroid/platform_packages_modules_Wifi/0001-Add-persist.sys.phh.wifi_disable_sae-property-to-dis.patch @@ -0,0 +1,37 @@ +From b28cb024741e06a50b31389f8f7e553ffc4a4d86 Mon Sep 17 00:00:00 2001 +From: Pierre-Hugues Husson +Date: Wed, 21 Feb 2024 17:26:07 -0500 +Subject: [PATCH] Add persist.sys.phh.wifi_disable_sae property to disable + WPA2=>WPA3 upgrades + +Change-Id: I72a0133e986f2c745af3c915ed65d7b540d2119b +--- + service/java/com/android/server/wifi/WifiGlobals.java | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/service/java/com/android/server/wifi/WifiGlobals.java b/service/java/com/android/server/wifi/WifiGlobals.java +index 1725ed7cec..25e7846b5c 100644 +--- a/service/java/com/android/server/wifi/WifiGlobals.java ++++ b/service/java/com/android/server/wifi/WifiGlobals.java +@@ -56,7 +56,7 @@ public class WifiGlobals { + private final AtomicBoolean mIsWepAllowed = new AtomicBoolean(false); + + // These are read from the overlay, cache them after boot up. +- private final boolean mIsWpa3SaeUpgradeEnabled; ++ private boolean mIsWpa3SaeUpgradeEnabled; + private final boolean mIsWpa3SaeUpgradeOffloadEnabled; + private final boolean mIsOweUpgradeEnabled; + private final boolean mFlushAnqpCacheOnWifiToggleOffEvent; +@@ -98,6 +98,9 @@ public class WifiGlobals { + + mIsWpa3SaeUpgradeEnabled = mContext.getResources() + .getBoolean(R.bool.config_wifiSaeUpgradeEnabled); ++ var prop = android.os.SystemProperties.get("persist.sys.phh.wifi_disable_sae", null); ++ if (prop != null && "true".equals(prop)) ++ mIsWpa3SaeUpgradeEnabled = false; + mIsWpa3SaeUpgradeOffloadEnabled = mContext.getResources() + .getBoolean(R.bool.config_wifiSaeUpgradeOffloadEnabled); + mIsOweUpgradeEnabled = mContext.getResources() +-- +2.25.1 + diff --git a/patches/trebledroid/platform_system_apex/0001-Disable-O_DIRECT-for-old-kernels.patch b/patches/trebledroid/platform_system_apex/0001-Disable-O_DIRECT-for-old-kernels.patch new file mode 100644 index 0000000..38a3501 --- /dev/null +++ b/patches/trebledroid/platform_system_apex/0001-Disable-O_DIRECT-for-old-kernels.patch @@ -0,0 +1,54 @@ +From 4d3925eb9d2d2ce31012df8a9e320f77fdbff888 Mon Sep 17 00:00:00 2001 +From: Pierre-Hugues Husson +Date: Tue, 7 May 2024 19:28:41 -0400 +Subject: [PATCH] Disable O_DIRECT for old kernels + +On old kernels, mounting over O_DIRECT over FBE ext4 leads to corrupted +reads. +"Old kernel" is hard to define, some 4.19 and 4.14 got the fix. +The penalty for not using o_direct is a bit of performance/ram hit, so +live with it + +Co-authored-by: Alberto Ponces +Change-Id: I710e870bc467000547b00958b0818aaf0ddca072 +--- + apexd/apexd_loop.cpp | 16 +++++++++++++++- + 1 file changed, 15 insertions(+), 1 deletion(-) + +diff --git a/apexd/apexd_loop.cpp b/apexd/apexd_loop.cpp +index 1ae573d8..b613c7c9 100644 +--- a/apexd/apexd_loop.cpp ++++ b/apexd/apexd_loop.cpp +@@ -35,6 +35,7 @@ + #include + #include + #include ++#include + #include + #include + +@@ -351,7 +352,20 @@ Result ConfigureLoopDevice(const int device_fd, const std::string& target, + * condition is now met. + */ + bool use_buffered_io = false; +- unique_fd target_fd(open(target.c_str(), O_RDONLY | O_CLOEXEC | O_DIRECT)); ++ bool enable_odirect = false; ++ struct utsname uts; ++ unsigned int major, minor; ++ if (uname(&uts) == 0 && sscanf(uts.release, "%u.%u", &major, &minor) == 2) { ++ if(major > 4) enable_odirect = true; ++ if(major == 4 && minor > 19) enable_odirect = true; ++ } ++ unique_fd target_fd; ++ if (enable_odirect) { ++ target_fd = unique_fd(open(target.c_str(), O_RDONLY | O_CLOEXEC | O_DIRECT)); ++ } else { ++ target_fd = unique_fd(open(target.c_str(), O_RDONLY | O_CLOEXEC)); ++ } ++ //unique_fd target_fd(open(target.c_str(), O_RDONLY | O_CLOEXEC)); + if (target_fd.get() == -1) { + struct statfs stbuf; + int saved_errno = errno; +-- +2.25.1 + diff --git a/patches/trebledroid/platform_system_core/0001-Let-system-override-ro.apex.updatable.patch b/patches/trebledroid/platform_system_core/0001-Let-system-override-ro.apex.updatable.patch deleted file mode 100644 index 919968a..0000000 --- a/patches/trebledroid/platform_system_core/0001-Let-system-override-ro.apex.updatable.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 02bf32399883458ae31c7aa802a9f4568f13ce07 Mon Sep 17 00:00:00 2001 -From: Pierre-Hugues Husson -Date: Wed, 23 Feb 2022 17:37:47 -0500 -Subject: [PATCH 01/25] Let system override ro.apex.updatable - -APEX are broken because of a kernel bug in Android 10 devices -So we have system set ro.apex.updatable = false -However, vendor can override system, which prevents us from setting this -to false -So, ignore the override policy for this prop ---- - init/property_service.cpp | 8 ++++++-- - 1 file changed, 6 insertions(+), 2 deletions(-) - -diff --git a/init/property_service.cpp b/init/property_service.cpp -index 013924778..5bc71afae 100644 ---- a/init/property_service.cpp -+++ b/init/property_service.cpp -@@ -801,8 +801,12 @@ static void LoadProperties(char* data, const char* filter, const char* filename, - } else if (it->second != value) { - LOG(WARNING) << "Overriding previous property '" << key << "':'" << it->second - << "' with new value '" << value << "'"; -- it->second = value; -- } -+ if(strcmp("ro.apex.updatable", key) == 0) { -+ LOG(WARNING) << "... Ignored"; -+ } else { -+ it->second = value; -+ } -+ } - } else { - LOG(ERROR) << "Do not have permissions to set '" << key << "' to '" << value - << "' in property file '" << filename << "': " << error; --- -2.25.1 - diff --git a/patches/trebledroid/platform_system_core/0002-Don-t-abandon-creating-property-tree-if-there-is-a-c.patch b/patches/trebledroid/platform_system_core/0002-Don-t-abandon-creating-property-tree-if-there-is-a-c.patch deleted file mode 100644 index ba9560a..0000000 --- a/patches/trebledroid/platform_system_core/0002-Don-t-abandon-creating-property-tree-if-there-is-a-c.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 4fd9ce801d88b2baa4ec23fa0038edd6b20e4d6b Mon Sep 17 00:00:00 2001 -From: Pierre-Hugues Husson -Date: Sun, 18 Oct 2020 18:14:47 +0200 -Subject: [PATCH 02/25] Don't abandon creating property tree if there is a - conflict, and hope for the best - -Change-Id: I194c815fdd58bfb84aaf7db02b8f0d00b4db21e8 ---- - .../libpropertyinfoserializer/property_info_serializer.cpp | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/property_service/libpropertyinfoserializer/property_info_serializer.cpp b/property_service/libpropertyinfoserializer/property_info_serializer.cpp -index 803657ab8..ecdd0be20 100644 ---- a/property_service/libpropertyinfoserializer/property_info_serializer.cpp -+++ b/property_service/libpropertyinfoserializer/property_info_serializer.cpp -@@ -19,6 +19,7 @@ - #include "property_info_parser/property_info_parser.h" - - #include -+#include - - #include "trie_builder.h" - #include "trie_serializer.h" -@@ -34,7 +35,7 @@ bool BuildTrie(const std::vector& property_info, - - for (const auto& [name, context, type, is_exact] : property_info) { - if (!trie_builder.AddToTrie(name, context, type, is_exact, error)) { -- return false; -+ std::cerr << "Failed adding " << name << " to property trie... let's hope for the best" << std::endl; - } - } - --- -2.25.1 - diff --git a/patches/trebledroid/platform_system_core/0003-init-Do-not-start-console-service-when-debuggable.patch b/patches/trebledroid/platform_system_core/0003-init-Do-not-start-console-service-when-debuggable.patch deleted file mode 100644 index 91751d2..0000000 --- a/patches/trebledroid/platform_system_core/0003-init-Do-not-start-console-service-when-debuggable.patch +++ /dev/null @@ -1,31 +0,0 @@ -From ae93c494a57f764c4731cac8dcfc20156d54dfe4 Mon Sep 17 00:00:00 2001 -From: Isaac Chen -Date: Wed, 23 Jun 2021 13:07:30 +0800 -Subject: [PATCH 03/25] init: Do not start console service when debuggable - -Google added a check for this in R, when it's running it will show a -notification about that performance is impacted. - -Signed-off-by: Isaac Chen -Change-Id: I34cfd6b42d3b9aee4b3e63181480cfb8b1255f29 ---- - rootdir/init.rc | 3 --- - 1 file changed, 3 deletions(-) - -diff --git a/rootdir/init.rc b/rootdir/init.rc -index 317f80908..9dc09ea4a 100644 ---- a/rootdir/init.rc -+++ b/rootdir/init.rc -@@ -1290,9 +1290,6 @@ on property:ro.debuggable=1 - # Give reads to anyone for the accessibility trace folder on debug builds. - chmod 0775 /data/misc/a11ytrace - --on init && property:ro.debuggable=1 -- start console -- - on userspace-reboot-requested - # TODO(b/135984674): reset all necessary properties here. - setprop sys.boot_completed "" --- -2.25.1 - diff --git a/patches/trebledroid/platform_system_core/0004-Panic-into-recovery-rather-than-bootloader.patch b/patches/trebledroid/platform_system_core/0004-Panic-into-recovery-rather-than-bootloader.patch deleted file mode 100644 index 08ec7fb..0000000 --- a/patches/trebledroid/platform_system_core/0004-Panic-into-recovery-rather-than-bootloader.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 98c2114b1a5faaaacd6bb86eca308c92273f83b4 Mon Sep 17 00:00:00 2001 -From: Pierre-Hugues Husson -Date: Wed, 4 Sep 2019 21:11:48 +0200 -Subject: [PATCH 04/25] Panic into recovery rather than bootloader - -Getting last_kmsg/pstore from bootloader isn't possible for other people -than the OEM, but we have TWRP to access last_kmsg/pstore - -Change-Id: If04bb6572dc66677d7b44f7d302b2d69ce526200 ---- - init/reboot_utils.cpp | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/init/reboot_utils.cpp b/init/reboot_utils.cpp -index 547b1869f..dd0fbbfe8 100644 ---- a/init/reboot_utils.cpp -+++ b/init/reboot_utils.cpp -@@ -37,7 +37,7 @@ - namespace android { - namespace init { - --static std::string init_fatal_reboot_target = "bootloader"; -+static std::string init_fatal_reboot_target = "recovery"; - static bool init_fatal_panic = false; - - // this needs to read the /proc/* files directly because it is called before --- -2.25.1 - diff --git a/patches/trebledroid/platform_system_core/0005-Detect-allowed-sdcard-options-based-on-vndk.patch b/patches/trebledroid/platform_system_core/0005-Detect-allowed-sdcard-options-based-on-vndk.patch deleted file mode 100644 index 84e7d72..0000000 --- a/patches/trebledroid/platform_system_core/0005-Detect-allowed-sdcard-options-based-on-vndk.patch +++ /dev/null @@ -1,43 +0,0 @@ -From 165100f3f5aae06a067dbea93d43856881485fd2 Mon Sep 17 00:00:00 2001 -From: Pierre-Hugues Husson -Date: Tue, 14 Aug 2018 19:33:03 +0200 -Subject: [PATCH 05/25] Detect allowed sdcard options based on vndk - -Some kernel crashes when using too recent sdcardfs options - -Change-Id: I632e485f9b2a09a46d4a1fde2ea15217f8d92eff ---- - sdcard/sdcard.cpp | 8 +++++--- - 1 file changed, 5 insertions(+), 3 deletions(-) - -diff --git a/sdcard/sdcard.cpp b/sdcard/sdcard.cpp -index 622de5b7a..e580190e9 100644 ---- a/sdcard/sdcard.cpp -+++ b/sdcard/sdcard.cpp -@@ -32,6 +32,7 @@ - #include - #include - #include -+#include - #include - #include - -@@ -103,11 +104,12 @@ static bool sdcardfs_setup(const std::string& source_path, const std::string& de - mode_t mask, bool derive_gid, bool default_normal, bool unshared_obb, - bool use_esdfs) { - // Add new options at the end of the vector. -+ int vndk = android::base::GetIntProperty("ro.vndk.version", 29); - std::vector new_opts_list; - if (multi_user) new_opts_list.push_back("multiuser,"); -- if (derive_gid) new_opts_list.push_back("derive_gid,"); -- if (default_normal) new_opts_list.push_back("default_normal,"); -- if (unshared_obb) new_opts_list.push_back("unshared_obb,"); -+ if (derive_gid && vndk >= 27) new_opts_list.push_back("derive_gid,"); -+ if (default_normal && vndk >= 28) new_opts_list.push_back("default_normal,"); -+ if (unshared_obb && vndk >= 29) new_opts_list.push_back("unshared_obb,"); - // Try several attempts, each time with one less option, to gracefully - // handle older kernels that aren't updated yet. - for (int i = 0; i <= new_opts_list.size(); ++i) { --- -2.25.1 - diff --git a/patches/trebledroid/platform_system_core/0006-Ugly-but-secure-Set-dev-uinput-as-0666-to-fix-finger.patch b/patches/trebledroid/platform_system_core/0006-Ugly-but-secure-Set-dev-uinput-as-0666-to-fix-finger.patch deleted file mode 100644 index b8ae702..0000000 --- a/patches/trebledroid/platform_system_core/0006-Ugly-but-secure-Set-dev-uinput-as-0666-to-fix-finger.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 090481ad1c5944ef13065c442969c970c36e5a54 Mon Sep 17 00:00:00 2001 -From: Pierre-Hugues Husson -Date: Fri, 1 Nov 2019 18:22:13 +0100 -Subject: [PATCH 06/25] Ugly but secure: Set /dev/uinput as 0666 to fix - fingerprint sensor on some devices - -cf https://github.com/phhusson/device_phh_treble/pull/122/commits/e000d69c286b6686777ea6f1867f379e30273e48 -This is safe because even though it's 0666, its SELinux policy is very -tight, and only bluetooth HAL, shell (and fingerprint HAL on Xiaomi) can -access it. - -Change-Id: Id374e781957927d5604cb96c7a39b3fb28b3a6c5 ---- - rootdir/ueventd.rc | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/rootdir/ueventd.rc b/rootdir/ueventd.rc -index 3927501a4..d0ab3f7bb 100644 ---- a/rootdir/ueventd.rc -+++ b/rootdir/ueventd.rc -@@ -60,7 +60,7 @@ subsystem vfio - - # these should not be world writable - /dev/uhid 0660 uhid uhid --/dev/uinput 0660 uhid uhid -+/dev/uinput 0666 uhid uhid - /dev/rtc0 0640 system system - /dev/tty0 0660 root system - /dev/graphics/* 0660 root graphics --- -2.25.1 - diff --git a/patches/trebledroid/platform_system_core/0007-Revert-Set-system-xbin-permissions-to-750.patch b/patches/trebledroid/platform_system_core/0007-Revert-Set-system-xbin-permissions-to-750.patch deleted file mode 100644 index 36f9688..0000000 --- a/patches/trebledroid/platform_system_core/0007-Revert-Set-system-xbin-permissions-to-750.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 708e8037cae2cd6e152d6f60a899d5ff1b1757f0 Mon Sep 17 00:00:00 2001 -From: Alberto Ponces -Date: Tue, 1 Feb 2022 13:48:35 +0000 -Subject: [PATCH 07/25] Revert "Set /system/xbin permissions to 750." - -This reverts commit 42a1a126e554a8bca31d0afc832848b7b0fa1f4e. - -Change-Id: I277def5153616d6f00bc877e6170b7fed7cd799d ---- - libcutils/fs_config.cpp | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/libcutils/fs_config.cpp b/libcutils/fs_config.cpp -index 919be2ff2..9ab7f4305 100644 ---- a/libcutils/fs_config.cpp -+++ b/libcutils/fs_config.cpp -@@ -83,7 +83,7 @@ static const struct fs_path_config android_dirs[] = { - { 00751, AID_ROOT, AID_SHELL, 0, "system/bin" }, - { 00755, AID_ROOT, AID_ROOT, 0, "system/etc/ppp" }, - { 00755, AID_ROOT, AID_SHELL, 0, "system/vendor" }, -- { 00750, AID_ROOT, AID_SHELL, 0, "system/xbin" }, -+ { 00751, AID_ROOT, AID_SHELL, 0, "system/xbin" }, - { 00751, AID_ROOT, AID_SHELL, 0, "system/apex/*/bin" }, - { 00750, AID_ROOT, AID_SYSTEM, 0, "system_ext/apex/com.android.tethering/bin/for-system" }, - { 00751, AID_ROOT, AID_SHELL, 0, "system_ext/bin" }, --- -2.25.1 - diff --git a/patches/trebledroid/platform_system_core/0008-Add-my-own-OTA-mechanism-going-over-data.patch b/patches/trebledroid/platform_system_core/0008-Add-my-own-OTA-mechanism-going-over-data.patch deleted file mode 100644 index 181ff42..0000000 --- a/patches/trebledroid/platform_system_core/0008-Add-my-own-OTA-mechanism-going-over-data.patch +++ /dev/null @@ -1,136 +0,0 @@ -From 9e3f7a09dd752b965eef383ff9b30f41d041ffa4 Mon Sep 17 00:00:00 2001 -From: Pierre-Hugues Husson -Date: Sat, 22 Jan 2022 14:34:45 -0500 -Subject: [PATCH 08/25] Add my own OTA mechanism going over /data - -Change-Id: I9cacff2d761affa0376b4bb8ca63353a9d95b5de ---- - fs_mgr/libfiemap/image_manager.cpp | 2 +- - init/selinux.cpp | 64 ++++++++++++++++++++++++++++++ - 2 files changed, 65 insertions(+), 1 deletion(-) - -diff --git a/fs_mgr/libfiemap/image_manager.cpp b/fs_mgr/libfiemap/image_manager.cpp -index c416f4df4..b8eba80aa 100644 ---- a/fs_mgr/libfiemap/image_manager.cpp -+++ b/fs_mgr/libfiemap/image_manager.cpp -@@ -156,7 +156,7 @@ bool ImageManager::MetadataDirIsTest() const { - } - - bool ImageManager::IsUnreliablePinningAllowed() const { -- return IsSubdir(data_dir_, "/data/gsi/dsu/") || MetadataDirIsTest(); -+ return IsSubdir(data_dir_, "/data/gsi/dsu/") || MetadataDirIsTest() || IsSubdir(data_dir_, "/data/gsi/phh/"); - } - - FiemapStatus ImageManager::CreateBackingImage( -diff --git a/init/selinux.cpp b/init/selinux.cpp -index 1f211ddfa..bd7f02df8 100644 ---- a/init/selinux.cpp -+++ b/init/selinux.cpp -@@ -58,6 +58,9 @@ - #include - #include - #include -+#include -+#include -+#include - - #include - #include -@@ -71,12 +74,16 @@ - #include - #include - #include -+#include -+#include -+#include - - #include "block_dev_initializer.h" - #include "debug_ramdisk.h" - #include "reboot_utils.h" - #include "snapuserd_transition.h" - #include "util.h" -+#include "switch_root.h" - - using namespace std::string_literals; - -@@ -85,6 +92,7 @@ using android::base::Timer; - using android::base::unique_fd; - using android::fs_mgr::AvbHandle; - using android::snapshot::SnapshotManager; -+using android::fiemap::IImageManager; - - namespace android { - namespace init { -@@ -732,6 +740,60 @@ void LoadSelinuxPolicyMicrodroid() { - LoadSelinuxPolicy(policy); - } - -+static void setupPhhOta() { -+ setenv("PHH_STEP2", (char*)"1", 1); -+ if(getenv("PHH_OTA")) return; -+ setenv("PHH_STEP3", (char*)"1", 1); -+ -+ std::string phh_ota; -+ if(!base::ReadFileToString("/metadata/phh/img", &phh_ota)) return; -+ const char *slot = "a"; -+ if(phh_ota.c_str()[0] == 'b') -+ slot = "b"; -+ setenv("PHH_OTA_SLOT", (char*)slot, 1); -+ setenv("PHH_STEP4", (char*)"1", 1); -+ -+ std::string imageNameStr = "system_otaphh_"s + slot; -+ -+ BlockDevInitializer block_dev_init; -+ block_dev_init.InitDeviceMapper(); -+ block_dev_init.InitDevices({"userdata"}); -+ -+ auto images = IImageManager::Open("phh", 0ms); -+ std::string blockDev; -+ android::fs_mgr::PartitionOpener opener; -+ if(!images->MapImageWithDeviceMapper(opener, imageNameStr, &blockDev)) return; -+ -+ // For some reason, I can't get block_dev_init to find system_otaphh_X, so construct it ourselves -+ int major = atoi(blockDev.c_str()); -+ const char *minorStr = strstr(blockDev.c_str(), ":")+1; -+ int minor = atoi(minorStr); -+ int eee = mknod("/dev/root-otaphh", 0644 | S_IFBLK, makedev(major, minor)); -+ -+ base::WriteStringToFile("phh mknod returned " + std::to_string(eee) + " of " + std::to_string(major) + " " + std::to_string(minor), "/dev/kmsg"); -+ setenv("PHH_STEP5", (char*)"1", 1); -+ -+ umount2("/debug_ramdisk", 0); -+ umount2("/debug_ramdisk", MNT_DETACH); -+ int mountRes = mount("/dev/root-otaphh", "/debug_ramdisk", "ext4", MS_RDONLY, ""); -+ putenv((char*)"PHH_OTA=1"); -+ base::WriteStringToFile("phh_ota setup " + blockDev, "/dev/kmsg"); -+ base::WriteStringToFile("phh mount returned " + std::to_string(mountRes), "/dev/kmsg"); -+ base::WriteStringToFile("errno is " + std::to_string(errno), "/dev/kmsg"); -+ -+ if(mountRes != 0) return; -+ -+ SwitchRoot("/debug_ramdisk"); -+ -+ const char* path = "/system/bin/init"; -+ const char* args[] = {path, "selinux_setup", nullptr}; -+ auto fd = open("/dev/kmsg", O_WRONLY | O_CLOEXEC); -+ dup2(fd, STDOUT_FILENO); -+ dup2(fd, STDERR_FILENO); -+ close(fd); -+ execv(path, const_cast(args)); -+} -+ - // The SELinux setup process is carefully orchestrated around snapuserd. Policy - // must be loaded off dynamic partitions, and during an OTA, those partitions - // cannot be read without snapuserd. But, with kernel-privileged snapuserd -@@ -748,6 +810,8 @@ void LoadSelinuxPolicyMicrodroid() { - // - // After this sequence, it is safe to enable enforcing mode and continue booting. - void LoadSelinuxPolicyAndroid() { -+ setenv("PHH_STEP1", (char*)"1", 1); -+ setupPhhOta(); - MountMissingSystemPartitions(); - - LOG(INFO) << "Opening SELinux policy"; --- -2.25.1 - diff --git a/patches/trebledroid/platform_system_core/0009-fs_mgr-Keep-allowing-encryptable-fstab-flag.patch b/patches/trebledroid/platform_system_core/0009-fs_mgr-Keep-allowing-encryptable-fstab-flag.patch deleted file mode 100644 index 0b5dfb5..0000000 --- a/patches/trebledroid/platform_system_core/0009-fs_mgr-Keep-allowing-encryptable-fstab-flag.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 967250f16f16ca0880e7805fb4696287aebec22f Mon Sep 17 00:00:00 2001 -From: Alberto Ponces -Date: Mon, 3 Oct 2022 13:50:36 +0100 -Subject: [PATCH 09/25] fs_mgr: Keep allowing encryptable fstab flag - -Some users still use "encryptable" flag while being unencrypted. Let them still boot their devices. - -Change-Id: Id2554d6563a869bb5bcf39c67b0322484bdab0c9 ---- - fs_mgr/libfstab/fstab.cpp | 10 ---------- - 1 file changed, 10 deletions(-) - -diff --git a/fs_mgr/libfstab/fstab.cpp b/fs_mgr/libfstab/fstab.cpp -index 443017a26..ea2137fdc 100644 ---- a/fs_mgr/libfstab/fstab.cpp -+++ b/fs_mgr/libfstab/fstab.cpp -@@ -323,16 +323,6 @@ bool ParseFsMgrFlags(const std::string& flags, FstabEntry* entry) { - } - } - -- // FDE is no longer supported, so reject "encryptable" when used without -- // "vold_managed". For now skip this check when in recovery mode, since -- // some recovery fstabs still contain the FDE options since they didn't do -- // anything in recovery mode anyway (except possibly to cause the -- // reservation of a crypto footer) and thus never got removed. -- if (entry->fs_mgr_flags.crypt && !entry->fs_mgr_flags.vold_managed && !InRecovery()) { -- LERROR << "FDE is no longer supported; 'encryptable' can only be used for adoptable " -- "storage"; -- return false; -- } - return true; - } - --- -2.25.1 - diff --git a/patches/trebledroid/platform_system_core/0010-FDE-is-dead.-Fallback-FDE-to-no-encryption-and-FDE-F.patch b/patches/trebledroid/platform_system_core/0010-FDE-is-dead.-Fallback-FDE-to-no-encryption-and-FDE-F.patch deleted file mode 100644 index bbcada7..0000000 --- a/patches/trebledroid/platform_system_core/0010-FDE-is-dead.-Fallback-FDE-to-no-encryption-and-FDE-F.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 02dca4bf5ad952281a8268dbfc99c55137479e80 Mon Sep 17 00:00:00 2001 -From: Pierre-Hugues Husson -Date: Thu, 10 Nov 2022 13:30:50 -0500 -Subject: [PATCH 10/25] FDE is dead. Fallback FDE to no encryption, and FDE+FBE - to FBE - ---- - fs_mgr/libfstab/fstab.cpp | 7 +++---- - 1 file changed, 3 insertions(+), 4 deletions(-) - -diff --git a/fs_mgr/libfstab/fstab.cpp b/fs_mgr/libfstab/fstab.cpp -index ea2137fdc..f58584501 100644 ---- a/fs_mgr/libfstab/fstab.cpp -+++ b/fs_mgr/libfstab/fstab.cpp -@@ -187,7 +187,7 @@ bool ParseFsMgrFlags(const std::string& flags, FstabEntry* entry) { - #undef CheckFlag - - // Then handle flags that take an argument. -- if (StartsWith(flag, "encryptable=")) { -+ if (StartsWith(flag, "encryptable=") || StartsWith(flag, "forceencrypt=")) { - // The "encryptable" flag identifies adoptable storage volumes. The - // argument to this flag is ignored, but it should be "userdata". - // -@@ -197,9 +197,8 @@ bool ParseFsMgrFlags(const std::string& flags, FstabEntry* entry) { - // storage volumes. Today, FDE is no longer supported, leaving only - // the adoptable storage volume meaning for this flag. - entry->fs_mgr_flags.crypt = true; -- } else if (StartsWith(flag, "forceencrypt=") || StartsWith(flag, "forcefdeorfbe=")) { -- LERROR << "flag no longer supported: " << flag; -- return false; -+ } else if (StartsWith(flag, "forcefdeorfbe=")) { -+ ParseFileEncryption("aes-256-xts:aes-256-cts", entry); - } else if (StartsWith(flag, "voldmanaged=")) { - // The voldmanaged flag is followed by an = and the label, a colon and the partition - // number or the word "auto", e.g. voldmanaged=sdcard:3 --- -2.25.1 - diff --git a/patches/trebledroid/platform_system_core/0011-Let-system-override-adb-secure-props-so-we-dont-get-.patch b/patches/trebledroid/platform_system_core/0011-Let-system-override-adb-secure-props-so-we-dont-get-.patch deleted file mode 100644 index 0ac1390..0000000 --- a/patches/trebledroid/platform_system_core/0011-Let-system-override-adb-secure-props-so-we-dont-get-.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 0bc9224a3ec50288f239641662622f40e27224bb Mon Sep 17 00:00:00 2001 -From: Pierre-Hugues Husson -Date: Fri, 9 Dec 2022 13:57:10 -0500 -Subject: [PATCH 11/25] Let system override adb/secure props, so we dont get - stuck in ro.adb.secure=1 vendors - ---- - init/property_service.cpp | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/init/property_service.cpp b/init/property_service.cpp -index 5bc71afae..da838c631 100644 ---- a/init/property_service.cpp -+++ b/init/property_service.cpp -@@ -801,7 +801,7 @@ static void LoadProperties(char* data, const char* filter, const char* filename, - } else if (it->second != value) { - LOG(WARNING) << "Overriding previous property '" << key << "':'" << it->second - << "' with new value '" << value << "'"; -- if(strcmp("ro.apex.updatable", key) == 0) { -+ if(strcmp("ro.apex.updatable", key) == 0 || strstr(key, "adb") || strstr(key, "secure")) { - LOG(WARNING) << "... Ignored"; - } else { - it->second = value; --- -2.25.1 - diff --git a/patches/trebledroid/platform_system_core/0012-Allow-apex-on-5.0-kernels.-This-is-needed-because-on.patch b/patches/trebledroid/platform_system_core/0012-Allow-apex-on-5.0-kernels.-This-is-needed-because-on.patch deleted file mode 100644 index 26752c5..0000000 --- a/patches/trebledroid/platform_system_core/0012-Allow-apex-on-5.0-kernels.-This-is-needed-because-on.patch +++ /dev/null @@ -1,55 +0,0 @@ -From 52dc4bc9575304a26faf29cba9ea580495a49965 Mon Sep 17 00:00:00 2001 -From: Pierre-Hugues Husson -Date: Fri, 28 Apr 2023 12:29:05 -0400 -Subject: [PATCH 12/25] Allow apex on > 5.0 kernels. This is needed because on - Pixels, camera HAL are exclusively in vendor apex - -Change-Id: I334cde4c5557b0ff70d550205c5bb727d4b5dbf5 ---- - init/property_service.cpp | 16 +++++++++++++++- - 1 file changed, 15 insertions(+), 1 deletion(-) - -diff --git a/init/property_service.cpp b/init/property_service.cpp -index da838c631..00a3f5751 100644 ---- a/init/property_service.cpp -+++ b/init/property_service.cpp -@@ -64,6 +64,8 @@ - #include - #include - #include -+#include -+ - #include "debug_ramdisk.h" - #include "epoll.h" - #include "init.h" -@@ -704,6 +706,16 @@ uint32_t InitPropertySet(const std::string& name, const std::string& value) { - static Result load_properties_from_file(const char*, const char*, - std::map*); - -+static bool kernel_supports_capex() { -+ //Put a threshold at >= 5.0 -+ struct utsname buf; -+ uname(&buf); -+ const char *where = buf.release; -+ int a = atoi(where); -+ if(a <= 4) return false; -+ return true; -+} -+ - /* - * Filter is used to decide which properties to load: NULL loads all keys, - * "ro.foo.*" is a prefix match, and "ro.foo.bar" is an exact match. -@@ -801,7 +813,9 @@ static void LoadProperties(char* data, const char* filter, const char* filename, - } else if (it->second != value) { - LOG(WARNING) << "Overriding previous property '" << key << "':'" << it->second - << "' with new value '" << value << "'"; -- if(strcmp("ro.apex.updatable", key) == 0 || strstr(key, "adb") || strstr(key, "secure")) { -+ if(strcmp("ro.apex.updatable", key) == 0 && !kernel_supports_capex()) { -+ LOG(WARNING) << "... Ignored apex by kernel version"; -+ } else if(strstr(key, "adb") || strstr(key, "secure")) { - LOG(WARNING) << "... Ignored"; - } else { - it->second = value; --- -2.25.1 - diff --git a/patches/trebledroid/platform_system_core/0013-watchdogd-Support-pinging-two-watchdogs.patch b/patches/trebledroid/platform_system_core/0013-watchdogd-Support-pinging-two-watchdogs.patch deleted file mode 100644 index 025295c..0000000 --- a/patches/trebledroid/platform_system_core/0013-watchdogd-Support-pinging-two-watchdogs.patch +++ /dev/null @@ -1,78 +0,0 @@ -From 0c6fbefe5d67a53d083287610bb7b7acf9f7dea2 Mon Sep 17 00:00:00 2001 -From: Pierre-Hugues Husson -Date: Sat, 27 May 2023 05:36:21 -0400 -Subject: [PATCH 13/25] watchdogd: Support pinging two watchdogs - ---- - watchdogd/watchdogd.cpp | 33 +++++++++++++++++++++++++++++++++ - 1 file changed, 33 insertions(+) - -diff --git a/watchdogd/watchdogd.cpp b/watchdogd/watchdogd.cpp -index 5dc41e6b8..69abb4e2b 100644 ---- a/watchdogd/watchdogd.cpp -+++ b/watchdogd/watchdogd.cpp -@@ -20,12 +20,15 @@ - #include - #include - #include -+#include - - #include - - #define DEV_NAME "/dev/watchdog" -+#define DEV_NAME2 "/dev/watchdog1" - - int main(int argc, char** argv) { -+ struct stat st_buf; - android::base::InitLogging(argv, &android::base::KernelLogger); - - int interval = 10; -@@ -42,6 +45,13 @@ int main(int argc, char** argv) { - return 1; - } - -+ int fd2 = open(DEV_NAME2, O_RDWR | O_CLOEXEC); -+ fstat(fd2, &st_buf); -+ if ((st_buf.st_mode & S_IFMT) != S_IFCHR) { -+ close(fd2); -+ fd2 = -1; -+ } -+ - int timeout = interval + margin; - int ret = ioctl(fd, WDIOC_SETTIMEOUT, &timeout); - if (ret) { -@@ -61,8 +71,31 @@ int main(int argc, char** argv) { - } - } - -+ if(fd2 >= 0) { -+ int interval2 = interval; -+ ret = ioctl(fd2, WDIOC_SETTIMEOUT, &timeout); -+ if (ret) { -+ PLOG(ERROR) << "Failed to set2 timeout to " << timeout; -+ ret = ioctl(fd, WDIOC_GETTIMEOUT, &timeout); -+ if (ret) { -+ PLOG(ERROR) << "Failed to get timeout"; -+ } else { -+ if (timeout > margin) { -+ interval2 = timeout - margin; -+ } else { -+ interval2 = 1; -+ } -+ LOG(WARNING) << "Adjusted interval to timeout returned by driver: " -+ << "timeout " << timeout << ", interval " << interval2 << ", margin " -+ << margin; -+ } -+ } -+ if(interval2 < interval) interval = interval2; -+ } -+ - while (true) { - write(fd, "", 1); -+ if (fd2 >= 0) write(fd2, "", 1); - sleep(interval); - } - } --- -2.25.1 - diff --git a/patches/trebledroid/platform_system_core/0014-healthd-offline-charger-fix-screen-off-3-3.patch b/patches/trebledroid/platform_system_core/0014-healthd-offline-charger-fix-screen-off-3-3.patch deleted file mode 100644 index e658fe0..0000000 --- a/patches/trebledroid/platform_system_core/0014-healthd-offline-charger-fix-screen-off-3-3.patch +++ /dev/null @@ -1,229 +0,0 @@ -From 453faab2e29773ba6fb393e80dea826148e1629b Mon Sep 17 00:00:00 2001 -From: Raphael Mounier -Date: Sun, 21 May 2023 16:15:42 +0200 -Subject: [PATCH 14/25] healthd : offline charger fix screen off 3/3 - -When the phone is charging, the animation never turns off on huawei phones (kernel 4.9). This patch allows you to turn it off by setting the brightness to 0. This problem may also exist on other phone models. - -The charge service must be started with the root user to be able to access -/sys/class/leds/lcd_backlight0 .... - -You must also set the following selinux rules: - -attribute sysfs_backlight_attr; -allow load sysfs_backlight_attr:file rw_file_perms; ---- - healthd/healthd_draw.cpp | 82 ++++++++++++++++++- - healthd/healthd_draw.h | 6 ++ - healthd/healthd_mode_charger.cpp | 26 +++++- - .../charger/healthd_mode_charger.h | 1 + - 4 files changed, 108 insertions(+), 7 deletions(-) - -diff --git a/healthd/healthd_draw.cpp b/healthd/healthd_draw.cpp -index 7c7931944..2266233e1 100644 ---- a/healthd/healthd_draw.cpp -+++ b/healthd/healthd_draw.cpp -@@ -15,18 +15,28 @@ - */ - - #include -+#include - #include - #include -+#include -+#include - - #include "healthd_draw.h" - -+ - #if !defined(__ANDROID_VNDK__) - #include "charger.sysprop.h" - #endif - --#define LOGE(x...) KLOG_ERROR("charger", x); --#define LOGW(x...) KLOG_WARNING("charger", x); --#define LOGV(x...) KLOG_DEBUG("charger", x); -+#define HARDWARE_MODEL "ro.hardware" -+ -+#define LOGE(x...) KLOG_ERROR("charger", x); fprintf(stderr,x); -+#define LOGW(x...) KLOG_WARNING("charger", x); fprintf(stderr,x); -+#define LOGV(x...) KLOG_DEBUG("charger", x); fprintf(stderr,x); -+ -+using ::android::base::ReadFileToString; -+using ::android::base::WriteStringToFile; -+ - - static bool get_split_screen() { - #if !defined(__ANDROID_VNDK__) -@@ -73,10 +83,41 @@ HealthdDraw::HealthdDraw(animation* anim) - (res = gr_init_font(anim->text_clock.font_file.c_str(), &anim->text_clock.font)) < 0) { - LOGE("Could not load time font (%d)\n", res); - } -+ - if (!anim->text_percent.font_file.empty() && - (res = gr_init_font(anim->text_percent.font_file.c_str(), &anim->text_percent.font)) < 0) { - LOGE("Could not load percent font (%d)\n", res); - } -+ -+ // Try to find kirin/huawei hardware -+ char prop_hardware[PROPERTY_VALUE_MAX] = {}; -+ -+ is_kirin = false; -+ if (property_get(HARDWARE_MODEL, prop_hardware, "") > 0) { -+ if (!strcmp(prop_hardware,"hi3660") -+ || !strcmp(prop_hardware,"hi3670") -+ || !strcmp(prop_hardware,"hi6250") -+ || !strcmp(prop_hardware,"kirin")) -+ { -+ LOGV("Kirin Huawei found\n"); -+ is_kirin=true; -+ -+ mMaxBrightness=4095; -+ std::string content_str; -+ -+ if (ReadFileToString("/sys/class/leds/lcd_backlight0/max_brightness", &content_str)) { -+ mMaxBrightness = std::stoi(content_str); -+ } -+ else { -+ if (ReadFileToString("/sys/class/leds/lcd_backlight/max_brightness", &content_str)) { -+ mMaxBrightness = std::stoi(content_str); -+ } -+ } -+ -+ // Set max brightness -+ set_brightness(mMaxBrightness); -+ } -+ } - } - - HealthdDraw::~HealthdDraw() {} -@@ -94,9 +135,42 @@ void HealthdDraw::redraw_screen(const animation* batt_anim, GRSurface* surf_unkn - gr_flip(); - } - -+void HealthdDraw::set_brightness(uint32_t value) { -+ LOGV("Kirin - Try to set brightness to %d\n",value) -+ if (WriteStringToFile(std::to_string(value), "/sys/class/leds/lcd_backlight0/brightness")==false) { -+ LOGW("Kirin - WriteStringToFile failed lcd_backlight0, unable to set brightness (lcd_backlight0)\n"); -+ if (WriteStringToFile(std::to_string(0), "/sys/class/leds/lcd_backlight/brightness")==false) { -+ LOGE("Kirin - WriteStringToFile failed lcd_backlight, unable to set brightness (lcd_backlight)\n"); -+ } -+ } -+} -+ -+ - void HealthdDraw::blank_screen(bool blank, int drm) { -+ - if (!graphics_available) return; -- gr_fb_blank(blank, drm); -+ -+ bool bmulti=gr_has_multiple_connectors(); -+ -+ if (bmulti && (drm==1)) { -+ KLOG_WARNING("charger", "minui graphic backend don't support multi-connector for blank screen\n"); -+ } -+ -+ if (is_kirin) { -+ if (blank==true) { -+ LOGV("Kirin - clear screen\n") -+ //clear_screen(); -+ //gr_flip(); -+ set_brightness(0); -+ } -+ else { -+ set_brightness(mMaxBrightness); -+ } -+ } -+ else { -+ LOGV("Blank screen with minui api)\n"); -+ gr_fb_blank(blank, drm); -+ } - } - - // support screen rotation for foldable phone -diff --git a/healthd/healthd_draw.h b/healthd/healthd_draw.h -index 016db8e07..e8e51748d 100644 ---- a/healthd/healthd_draw.h -+++ b/healthd/healthd_draw.h -@@ -84,9 +84,15 @@ class HealthdDraw { - // true if minui init'ed OK, false if minui init failed - bool graphics_available; - -+ // true if kirin found -+ bool is_kirin; -+ uint32_t mMaxBrightness; -+ - private: - // Configures font using given animation. - HealthdDraw(animation* anim); -+ // Set brightness -+ void set_brightness(uint32_t value); - }; - - #endif // HEALTHD_DRAW_H -diff --git a/healthd/healthd_mode_charger.cpp b/healthd/healthd_mode_charger.cpp -index 26af13b31..0d4ba32ff 100644 ---- a/healthd/healthd_mode_charger.cpp -+++ b/healthd/healthd_mode_charger.cpp -@@ -93,9 +93,9 @@ char* locale; - - #define LAST_KMSG_MAX_SZ (32 * 1024) - --#define LOGE(x...) KLOG_ERROR("charger", x); --#define LOGW(x...) KLOG_WARNING("charger", x); --#define LOGV(x...) KLOG_DEBUG("charger", x); -+#define LOGE(x...) KLOG_ERROR("charger", x); fprintf(stderr,x); -+#define LOGW(x...) KLOG_WARNING("charger", x); fprintf(stderr,x); -+#define LOGV(x...) KLOG_DEBUG("charger", x); fprintf(stderr,x); - - namespace android { - -@@ -301,6 +301,23 @@ void Charger::BlankSecScreen() { - } - } - -+void Charger::UpdateLedState() { -+ -+ if (!have_battery_state_) return; -+ if (health_info_.battery_level == 0 && health_info_.battery_status == BatteryStatus::UNKNOWN) return ; -+ -+ // TODO set led with battery_level in % (0->100%) -+ LOGV("Battery level = %d\n",health_info_.battery_level); -+ -+ /* -+ /sys/class/leds/red/brightness -+ /sys/class/leds/green/brightness -+ /sys/class/leds/blue/brightness -+ */ -+ -+} -+ -+ - void Charger::UpdateScreenState(int64_t now) { - int disp_time; - -@@ -609,6 +626,9 @@ void Charger::OnHeartbeat() { - * screen transitions (animations, etc) - */ - UpdateScreenState(now); -+ -+ // Update Led color -+ UpdateLedState(); - } - - void Charger::OnHealthInfoChanged(const ChargerHealthInfo& health_info) { -diff --git a/healthd/include_charger/charger/healthd_mode_charger.h b/healthd/include_charger/charger/healthd_mode_charger.h -index c463b92aa..50267ffee 100644 ---- a/healthd/include_charger/charger/healthd_mode_charger.h -+++ b/healthd/include_charger/charger/healthd_mode_charger.h -@@ -103,6 +103,7 @@ class Charger { - void ProcessHallSensor(int code); - void HandleInputState(int64_t now); - void HandlePowerSupplyState(int64_t now); -+ void UpdateLedState(); - int InputCallback(int fd, unsigned int epevents); - void InitHealthdDraw(); - void InitAnimation(); --- -2.25.1 - diff --git a/patches/trebledroid/platform_system_core/0015-Disable-quotas-on-legacy-devices-with-encryption-dis.patch b/patches/trebledroid/platform_system_core/0015-Disable-quotas-on-legacy-devices-with-encryption-dis.patch deleted file mode 100644 index 948d9af..0000000 --- a/patches/trebledroid/platform_system_core/0015-Disable-quotas-on-legacy-devices-with-encryption-dis.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 49955d0ca66ae3843f43b5bc49cbe8aa9ddcae74 Mon Sep 17 00:00:00 2001 -From: Pierre-Hugues Husson -Date: Tue, 6 Jun 2023 16:17:11 +0100 -Subject: [PATCH 15/25] Disable quotas on legacy devices with encryption - disabled - -Source: https://t.me/phhtreblebuilders/20521 and https://t.me/phhtreblebuilders/20546 ---- - fs_mgr/fs_mgr.cpp | 7 +++++++ - 1 file changed, 7 insertions(+) - -diff --git a/fs_mgr/fs_mgr.cpp b/fs_mgr/fs_mgr.cpp -index af2b35a2f..9448b9711 100644 ---- a/fs_mgr/fs_mgr.cpp -+++ b/fs_mgr/fs_mgr.cpp -@@ -378,6 +378,13 @@ static void tune_quota(const std::string& blk_device, const FstabEntry& entry, - return; - } - -+ // There is no relation between quotas and encryption disabled, it's just that encryption -+ // being disabled shows that the device is pretty old, so quotas might be broken on it -+ if (!entry.fs_mgr_flags.file_encryption) { -+ LINFO << "Disabling quotas on legacy devices with encryption disabled"; -+ want_quota = false; -+ } -+ - if (!tune2fs_available()) { - LERROR << "Unable to " << (want_quota ? "enable" : "disable") << " quotas on " << blk_device - << " because " TUNE2FS_BIN " is missing"; --- -2.25.1 - diff --git a/patches/trebledroid/platform_system_core/0016-Add-vendor-firmware_mnt.-Moto-Razr-2019-look-for-fir.patch b/patches/trebledroid/platform_system_core/0016-Add-vendor-firmware_mnt.-Moto-Razr-2019-look-for-fir.patch deleted file mode 100644 index 03d5db9..0000000 --- a/patches/trebledroid/platform_system_core/0016-Add-vendor-firmware_mnt.-Moto-Razr-2019-look-for-fir.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 5ffbd9c3845f498c3ab68aaa469785ef6e3e6321 Mon Sep 17 00:00:00 2001 -From: Pierre-Hugues Husson -Date: Tue, 11 Jul 2023 14:52:40 -0400 -Subject: [PATCH 16/25] Add /vendor/firmware_mnt. Moto Razr 2019 look for - firmwares (modem, sensors, ...) there - ---- - rootdir/ueventd.rc | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/rootdir/ueventd.rc b/rootdir/ueventd.rc -index d0ab3f7bb..39e8fe9eb 100644 ---- a/rootdir/ueventd.rc -+++ b/rootdir/ueventd.rc -@@ -1,7 +1,7 @@ - import /vendor/etc/ueventd.rc - import /odm/etc/ueventd.rc - --firmware_directories /etc/firmware/ /odm/firmware/ /vendor/firmware/ /firmware/image/ -+firmware_directories /etc/firmware/ /odm/firmware/ /vendor/firmware/ /firmware/image/ /vendor/firmware_mnt/image/ - uevent_socket_rcvbuf_size 16M - - subsystem graphics --- -2.25.1 - diff --git a/patches/trebledroid/platform_system_core/0018-Fix-support-for-devices-without-cgroupv2-support.patch b/patches/trebledroid/platform_system_core/0018-Fix-support-for-devices-without-cgroupv2-support.patch deleted file mode 100644 index a4d5ee2..0000000 --- a/patches/trebledroid/platform_system_core/0018-Fix-support-for-devices-without-cgroupv2-support.patch +++ /dev/null @@ -1,36 +0,0 @@ -From c0fb445273722f04f2729026e50e2d334cef338a Mon Sep 17 00:00:00 2001 -From: Pierre-Hugues Husson -Date: Wed, 26 Oct 2022 17:59:11 -0400 -Subject: [PATCH 18/25] Fix support for devices without cgroupv2 support - -This is technically a revert of 1bd1746447. -The warning inside the commit doesn't really apply to us, because the -devices without cgroupv2 simply won't freeze processes at all -(which is in itself an issue, but a different one) ---- - init/service.cpp | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/init/service.cpp b/init/service.cpp -index eb24dd593..4dfaf3137 100644 ---- a/init/service.cpp -+++ b/init/service.cpp -@@ -703,12 +703,15 @@ Result Service::Start() { - limit_percent_ != -1 || !limit_property_.empty(); - errno = -createProcessGroup(uid(), pid_, use_memcg); - if (errno != 0) { -+ PLOG(ERROR) << "createProcessGroup(" << uid() << ", " << pid_ << ") failed for service '" << name_ << "'"; -+#if 0 - Result result = cgroups_activated.Write(kActivatingCgroupsFailed); - if (!result.ok()) { - return Error() << "Sending notification failed: " << result.error(); - } - return Error() << "createProcessGroup(" << uid() << ", " << pid_ << ", " << use_memcg - << ") failed for service '" << name_ << "': " << strerror(errno); -+#endif - } - - // When the blkio controller is mounted in the v1 hierarchy, NormalIoPriority is --- -2.25.1 - diff --git a/patches/trebledroid/platform_system_core/0019-Disable-project_quota-on-old-devices-but-new-enough-.patch b/patches/trebledroid/platform_system_core/0019-Disable-project_quota-on-old-devices-but-new-enough-.patch deleted file mode 100644 index 68b8d20..0000000 --- a/patches/trebledroid/platform_system_core/0019-Disable-project_quota-on-old-devices-but-new-enough-.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 14291211bca68a335c7e78c8185eeaddee31dea2 Mon Sep 17 00:00:00 2001 -From: Pierre-Hugues Husson -Date: Fri, 6 Oct 2023 19:01:27 -0400 -Subject: [PATCH 19/25] Disable project_quota on old devices but new enough to - have encryption (they do keep quota support) - ---- - fs_mgr/fs_mgr.cpp | 8 ++++++++ - 1 file changed, 8 insertions(+) - -diff --git a/fs_mgr/fs_mgr.cpp b/fs_mgr/fs_mgr.cpp -index 9448b9711..20469b772 100644 ---- a/fs_mgr/fs_mgr.cpp -+++ b/fs_mgr/fs_mgr.cpp -@@ -385,6 +385,14 @@ static void tune_quota(const std::string& blk_device, const FstabEntry& entry, - want_quota = false; - } - -+ struct utsname uts; -+ unsigned int major, minor; -+ -+ if ((uname(&uts) == 0) && (sscanf(uts.release, "%u.%u", &major, &minor) == 2)) { -+ if(major < 4) want_projid = false; -+ if(major == 4 && minor < 9) want_projid = false; -+ } -+ - if (!tune2fs_available()) { - LERROR << "Unable to " << (want_quota ? "enable" : "disable") << " quotas on " << blk_device - << " because " TUNE2FS_BIN " is missing"; --- -2.25.1 - diff --git a/patches/trebledroid/platform_system_core/0020-fix-Nubia-6-series-custom-rc-action-prop-validation.patch b/patches/trebledroid/platform_system_core/0020-fix-Nubia-6-series-custom-rc-action-prop-validation.patch deleted file mode 100644 index 2a892b6..0000000 --- a/patches/trebledroid/platform_system_core/0020-fix-Nubia-6-series-custom-rc-action-prop-validation.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 194cd60e03d05871c3735a818f30d427aecedd2e Mon Sep 17 00:00:00 2001 -From: Huy Hoang <38396158+boydaihungst@users.noreply.github.com> -Date: Thu, 19 Oct 2023 07:06:55 +0700 -Subject: [PATCH 20/25] fix: Nubia 6 series custom rc action prop validation - ---- - init/action_parser.cpp | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/init/action_parser.cpp b/init/action_parser.cpp -index 49fe24a43..f683790e9 100644 ---- a/init/action_parser.cpp -+++ b/init/action_parser.cpp -@@ -47,6 +47,7 @@ bool IsActionableProperty(Subcontext* subcontext, const std::string& prop_name) - "init.svc.vendor.", "ro.vendor.", "persist.vendor.", - "vendor.", "init.svc.odm.", "ro.odm.", - "persist.odm.", "odm.", "ro.boot.", -+ "nubia.perf." - }; - - for (const auto& prefix : kPartnerPrefixes) { --- -2.25.1 - diff --git a/patches/trebledroid/platform_system_core/0021-HACK-Ignore-errors-when-setting-fscrypt-directory.-S.patch b/patches/trebledroid/platform_system_core/0021-HACK-Ignore-errors-when-setting-fscrypt-directory.-S.patch deleted file mode 100644 index fe8f5c8..0000000 --- a/patches/trebledroid/platform_system_core/0021-HACK-Ignore-errors-when-setting-fscrypt-directory.-S.patch +++ /dev/null @@ -1,33 +0,0 @@ -From b235def6f3f9772248330e0ee97fa6ecb6c60509 Mon Sep 17 00:00:00 2001 -From: Pierre-Hugues Husson -Date: Thu, 23 Nov 2023 11:05:20 -0500 -Subject: [PATCH 21/25] HACK: Ignore errors when setting fscrypt directory. - Some devices fail to set it on first boot, but is happy later (?!?) - ---- - init/builtins.cpp | 8 ++++++-- - 1 file changed, 6 insertions(+), 2 deletions(-) - -diff --git a/init/builtins.cpp b/init/builtins.cpp -index a95a4a315..7558f4dff 100644 ---- a/init/builtins.cpp -+++ b/init/builtins.cpp -@@ -430,9 +430,13 @@ static Result make_dir_with_options(const MkdirOptions& options) { - } - } - if (IsFbeEnabled()) { -+ //TODO FIXME -+//01-01 06:10:54.928 477 477 E vold : Failed to set encryption policy of /data/data to be0c03668ef1fddc v1 modes 127/4 flags 0x0: Invalid argument -+//01-01 06:10:55.927 0 0 W : c2 477 ext4_process_policy: Policy inconsistent with encryption context -+//01-01 06:10:55.927 0 0 E : c2 477 vold: Failed to set encryption policy of /data/data to be0c03668ef1fddc v1 modes 127/4 flags 0x0: Invalid argument -+ - if (!FscryptSetDirectoryPolicy(ref_basename, options.fscrypt_action, options.target)) { -- return reboot_into_recovery( -- {"--prompt_and_wipe_data", "--reason=set_policy_failed:"s + options.target}); -+ return {}; - } - } - return {}; --- -2.25.1 - diff --git a/patches/trebledroid/platform_system_core/0022-Keep-our-own-version-of-ro.logd.kernel.-We-do-want-l.patch b/patches/trebledroid/platform_system_core/0022-Keep-our-own-version-of-ro.logd.kernel.-We-do-want-l.patch deleted file mode 100644 index 57e3230..0000000 --- a/patches/trebledroid/platform_system_core/0022-Keep-our-own-version-of-ro.logd.kernel.-We-do-want-l.patch +++ /dev/null @@ -1,26 +0,0 @@ -From c71c3eedc3130cfc59db986812c8e5b5491d797c Mon Sep 17 00:00:00 2001 -From: Pierre-Hugues Husson -Date: Sat, 25 Nov 2023 09:51:14 -0500 -Subject: [PATCH 22/25] Keep our own version of ro.logd.kernel. We do want - logcat -b kernel, unlike what OEM set from their vendor - ---- - init/property_service.cpp | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/init/property_service.cpp b/init/property_service.cpp -index 00a3f5751..3f82ca76a 100644 ---- a/init/property_service.cpp -+++ b/init/property_service.cpp -@@ -815,7 +815,7 @@ static void LoadProperties(char* data, const char* filter, const char* filename, - << "' with new value '" << value << "'"; - if(strcmp("ro.apex.updatable", key) == 0 && !kernel_supports_capex()) { - LOG(WARNING) << "... Ignored apex by kernel version"; -- } else if(strstr(key, "adb") || strstr(key, "secure")) { -+ } else if(strstr(key, "adb") || strstr(key, "secure") || strstr(key, "ro.logd.kernel")) { - LOG(WARNING) << "... Ignored"; - } else { - it->second = value; --- -2.25.1 - diff --git a/patches/trebledroid/platform_system_core/0023-Keep-capex-when-there-are-vendor-apexes.patch b/patches/trebledroid/platform_system_core/0023-Keep-capex-when-there-are-vendor-apexes.patch deleted file mode 100644 index 511f4ba..0000000 --- a/patches/trebledroid/platform_system_core/0023-Keep-capex-when-there-are-vendor-apexes.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 2848b639e7468e880024b1acb7e2c94557d72dc9 Mon Sep 17 00:00:00 2001 -From: Pierre-Hugues Husson -Date: Tue, 16 Jan 2024 10:30:57 -0500 -Subject: [PATCH 23/25] Keep capex when there are vendor apexes - -When disabling APEX on Linux < 5, we might break some vendor APEXes -For instance Pixel 4a on Linux 4.14. -If there is a vendor apex, enable APEX anyway. ---- - init/property_service.cpp | 14 ++++++++++++-- - 1 file changed, 12 insertions(+), 2 deletions(-) - -diff --git a/init/property_service.cpp b/init/property_service.cpp -index 3f82ca76a..3bb2bfa10 100644 ---- a/init/property_service.cpp -+++ b/init/property_service.cpp -@@ -712,8 +712,18 @@ static bool kernel_supports_capex() { - uname(&buf); - const char *where = buf.release; - int a = atoi(where); -- if(a <= 4) return false; -- return true; -+ if(a >= 5) return true; -+ -+ // If there are vendor apexes, we most likely actually need them -+ auto dir = std::unique_ptr{opendir("/vendor/apex"), closedir}; -+ if (!dir) { -+ return false; -+ } -+ for (struct dirent* ent = readdir(dir.get()); ent; ent = readdir(dir.get())) { -+ if(strstr(ent->d_name, "apex")) return true; -+ } -+ -+ return false; - } - - /* --- -2.25.1 - diff --git a/patches/trebledroid/platform_system_core/0024-When-setting-ro.apex.updatable-actually-set-the-valu.patch b/patches/trebledroid/platform_system_core/0024-When-setting-ro.apex.updatable-actually-set-the-valu.patch deleted file mode 100644 index af83536..0000000 --- a/patches/trebledroid/platform_system_core/0024-When-setting-ro.apex.updatable-actually-set-the-valu.patch +++ /dev/null @@ -1,50 +0,0 @@ -From 1ba034d319ab5f749b746c0b6f80e0a8aad6da2a Mon Sep 17 00:00:00 2001 -From: Pierre-Hugues Husson -Date: Thu, 25 Jan 2024 15:20:10 -0500 -Subject: [PATCH 24/25] When setting ro.apex.updatable, actually set the value - -Before this change, we were only changing the override, but on newest -Android 14 vendor, they don't explicitly set ro.apex.updatable=true -so there is no override. -But we do want apex for them (notably for vendor apex), -hence always set based on kernel version. - -This fixes boot on Samsung Galaxy S24 ---- - init/property_service.cpp | 13 +++++++++---- - 1 file changed, 9 insertions(+), 4 deletions(-) - -diff --git a/init/property_service.cpp b/init/property_service.cpp -index 3bb2bfa10..ea7a026c2 100644 ---- a/init/property_service.cpp -+++ b/init/property_service.cpp -@@ -818,17 +818,22 @@ static void LoadProperties(char* data, const char* filter, const char* filename, - std::string error; - if (CheckPermissions(key, value, context, cr, &error) == PROP_SUCCESS) { - auto it = properties->find(key); -+ const char *new_value = value; -+ -+ if(strcmp("ro.apex.updatable", key) == 0) { -+ new_value = kernel_supports_capex() ? "true" : "false"; -+ } - if (it == properties->end()) { -- (*properties)[key] = value; -- } else if (it->second != value) { -+ (*properties)[key] = new_value; -+ } else if (it->second != new_value) { - LOG(WARNING) << "Overriding previous property '" << key << "':'" << it->second - << "' with new value '" << value << "'"; -- if(strcmp("ro.apex.updatable", key) == 0 && !kernel_supports_capex()) { -+ if(strcmp("ro.apex.updatable", key) == 0) { - LOG(WARNING) << "... Ignored apex by kernel version"; - } else if(strstr(key, "adb") || strstr(key, "secure") || strstr(key, "ro.logd.kernel")) { - LOG(WARNING) << "... Ignored"; - } else { -- it->second = value; -+ it->second = new_value; - } - } - } else { --- -2.25.1 - diff --git a/patches/trebledroid/platform_system_core/0025-If-AVB-fails-ignore-disable-AVB.patch b/patches/trebledroid/platform_system_core/0025-If-AVB-fails-ignore-disable-AVB.patch deleted file mode 100644 index 429ae0b..0000000 --- a/patches/trebledroid/platform_system_core/0025-If-AVB-fails-ignore-disable-AVB.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 21058edc46d62c00a7065a5c7c5529b57c17e975 Mon Sep 17 00:00:00 2001 -From: Pierre-Hugues Husson -Date: Sun, 31 Mar 2024 17:18:05 -0400 -Subject: [PATCH 25/25] If AVB fails, ignore/disable AVB - -DO NOT INCLUDE THIS PATCH If you want to run GSIs on a locked bootloader - -This is needed on Honor View 10 which declares "avb" in fstab while -being AVB1.0 ---- - init/first_stage_mount.cpp | 14 +++++++++++++- - 1 file changed, 13 insertions(+), 1 deletion(-) - -diff --git a/init/first_stage_mount.cpp b/init/first_stage_mount.cpp -index 43f58ba78..593bf7f95 100644 ---- a/init/first_stage_mount.cpp -+++ b/init/first_stage_mount.cpp -@@ -267,7 +267,19 @@ bool FirstStageMountVBootV2::DoFirstStageMount() { - return true; - } - -- if (!MountPartitions()) return false; -+ if (!MountPartitions()) { -+ // Cheat and disable avb -+ for(auto& part: fstab_) { -+ part.avb_keys = ""; -+ part.fs_mgr_flags.avb = false; -+ LOG(ERROR) << "Failed Mouting partitions with avb. Retrying without it."; -+ if (!MountPartitions()) { -+ LOG(ERROR) << "... still failed"; -+ return false; -+ } -+ } -+ -+ } - - return true; - } --- -2.25.1 - diff --git a/patches/trebledroid/platform_system_sepolicy/0001-Revert-Remove-28.0-compat-support.patch b/patches/trebledroid/platform_system_sepolicy/0001-Revert-Remove-28.0-compat-support.patch index 40ae2bd..cd25fd7 100644 --- a/patches/trebledroid/platform_system_sepolicy/0001-Revert-Remove-28.0-compat-support.patch +++ b/patches/trebledroid/platform_system_sepolicy/0001-Revert-Remove-28.0-compat-support.patch @@ -1,7 +1,7 @@ From 6b24c854ac27f040cddfb179665c7c76e283a04a Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Fri, 6 Oct 2023 08:25:11 -0400 -Subject: [PATCH] Revert "Remove 28.0 compat support" +Subject: [PATCH 1/2] Revert "Remove 28.0 compat support" This reverts commit d16612cd8aed0de2ca889174f1a7033137260ecd. diff --git a/patches/trebledroid/platform_system_sepolicy/0002-Fix-sepolicy-for-kernel-5.10-that-doesn-t-support-bp.patch b/patches/trebledroid/platform_system_sepolicy/0002-Fix-sepolicy-for-kernel-5.10-that-doesn-t-support-bp.patch new file mode 100644 index 0000000..3eda2a7 --- /dev/null +++ b/patches/trebledroid/platform_system_sepolicy/0002-Fix-sepolicy-for-kernel-5.10-that-doesn-t-support-bp.patch @@ -0,0 +1,31 @@ +From 1325469b711fdc09abe04aa5a07dd30a1b1e1e4c Mon Sep 17 00:00:00 2001 +From: danielzhang130 <37479705+danielzhang130@users.noreply.github.com> +Date: Fri, 12 Apr 2024 13:01:08 -0400 +Subject: [PATCH 2/2] Fix sepolicy for kernel < 5.10 that doesn't support bpf + file context (#1) + +Change-Id: I877bd90b1dc74c9d2f7713c70fd9aebd92331085 + +Signed-off-by: Daniel Zhang +--- + private/network_stack.te | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/private/network_stack.te b/private/network_stack.te +index 7587c1f46..9e6bd4b12 100644 +--- a/private/network_stack.te ++++ b/private/network_stack.te +@@ -61,8 +61,8 @@ hal_client_domain(network_stack, hal_tetheroffload) + allow network_stack self:netlink_netfilter_socket create_socket_perms_no_ioctl; + allow network_stack network_stack_service:service_manager find; + # allow Tethering(network_stack process) to run/update/read the eBPF maps to offload tethering traffic by eBPF. +-allow network_stack { fs_bpf_net_private fs_bpf_net_shared fs_bpf_netd_readonly fs_bpf_netd_shared fs_bpf_tethering }:dir search; +-allow network_stack { fs_bpf_net_private fs_bpf_net_shared fs_bpf_netd_readonly fs_bpf_netd_shared fs_bpf_tethering }:file { getattr read write }; ++allow network_stack { fs_bpf fs_bpf_net_private fs_bpf_net_shared fs_bpf_netd_readonly fs_bpf_netd_shared fs_bpf_tethering }:dir search; ++allow network_stack { fs_bpf fs_bpf_net_private fs_bpf_net_shared fs_bpf_netd_readonly fs_bpf_netd_shared fs_bpf_tethering }:file { getattr read write }; + allow network_stack bpfloader:bpf { map_read map_write prog_run }; + # allow Tethering(network_stack process) to read flag value in tethering_u_or_later_native namespace + get_prop(network_stack, device_config_tethering_u_or_later_native_prop) +-- +2.25.1 +