From 617bdc624e884a8213a2e97568641b2d692e0850 Mon Sep 17 00:00:00 2001 From: Alberto Ponces Date: Fri, 20 Oct 2023 17:01:39 +0000 Subject: [PATCH] feat: Sync with latest sources of TrebleDroid --- ...0001-Disable-vendor-mismatch-warning.patch | 2 +- ...id-autobrightness-if-brightness-valu.patch | 2 +- ...Fix-env-empty-string-ANDROID_STORAGE.patch | 2 +- ...uirement-for-visible-flag-to-sdcards.patch | 2 +- ...h-if-there-is-IR-HAL-is-not-declared.patch | 2 +- ...istent-property-to-override-the-defa.patch | 2 +- ...-Show-APN-Settings-for-CDMA-carriers.patch | 2 +- ...s-so-that-it-works-even-without-qtag.patch | 2 +- ...-Support-samsung-Pie-and-Q-light-hal.patch | 2 +- ...samsung-touch-physical-and-hover-pro.patch | 2 +- ...erriding-the-number-of-work-profiles.patch | 2 +- ...-wake-up-devices-just-as-well-as-bac.patch | 2 +- ...e-proximity-sensor-reporting-NaN-as-.patch | 2 +- ...ange-not-being-complete-on-Samsung-d.patch | 2 +- ...atch-like-behaviour-for-RRO-java-sid.patch | 2 +- ...otification-about-console-service-be.patch | 2 +- ...t-Remove-unused-SystemProperties.set.patch | 2 +- ...nyManager-bring-back-getNetworkClass.patch | 2 +- ...-add-API-annotations-for-setTelephon.patch | 2 +- .../0020-Fix-Wakelock-issue.patch | 2 +- ...tect-pick-up-sensor-so-that-an-overl.patch | 2 +- ...nBuiltInDisplayCutoutRectApproximati.patch | 2 +- ...t-Fix-backlight-control-on-Galaxy-S9.patch | 2 +- ...ch-long-press-power-behavior-in-AOSP.patch | 2 +- ...of-fingerprint-cleanups-needed-on-so.patch | 2 +- ...ze-boot-animation-to-match-screen-si.patch | 2 +- ...more-FDE-methods-from-StorageManager.patch | 2 +- ...e-AVCProfileMain-for-screen-recorder.patch | 2 +- ...ngerprint-sensors-to-security-strong.patch | 2 +- ...SehSysInputDev-to-report-screen-stat.patch | 2 +- ...-constrainNitsAndBacklightArrays-and.patch | 2 +- ...32-Add-Mediatek-power-hints-on-touch.patch | 2 +- ...Detect-Moto-dynamic-hardware-feature.patch | 2 +- ...ateForSlotIndex-in-SubscriptionManag.patch | 2 +- ...CallingIdentity-variant-with-both-ex.patch | 2 +- .../0036-Catch-NPE-in-SystemUI.patch | 2 +- ...d-support-for-app-signature-spoofing.patch | 2 +- ...e-Samsung-Power-hal-in-libpowermanag.patch | 2 +- ...Asus-Samsung-and-recent-Xiaomi-devic.patch | 2 +- ...UI-Add-MTK-s-brightness-path-for-FOD.patch | 2 +- ...htness-slider-curve-for-some-devices.patch | 2 +- .../0042-Ignore-cgroup-creation-errors.patch | 2 +- ...use-SW_MACHINE_COVER-rather-than-SW_.patch | 2 +- ...rt-Removed-IWLAN-legacy-mode-support.patch | 82 ++++ ...d-nubia-red-magic-6-series-udfps-fod.patch | 176 +++++++ .../0046-fix-finger-up-cmd-code.patch | 25 + ...t-for-Asus-Samsung-and-recent-Xiaomi.patch | 26 ++ ...roller-Do-not-override-default-calli.patch | 2 +- ...ot-call-onUssdRelease-for-Huawei-RIL.patch | 2 +- ...ng-too-long-to-fit-into-a-91-chars-p.patch | 2 +- ...ic-void-TelephonyMetrics.writeRilSen.patch | 2 +- ...ength-for-huawei-kirin-hi6250-hi3670.patch | 2 +- ...ward-port-support-for-forceCognitive.patch | 2 +- ...ue-to-setPreferredNetworkType-for-RI.patch | 2 +- ...-Fix-NPE-with-1.0-and-1.1-CardStatus.patch | 2 +- ...vert-Block-Binder-thread-until-incom.patch | 2 +- ...cSlot-ignore-error-if-we-cant-print-.patch | 2 +- ...rt-Removed-IWLAN-legacy-mode-support.patch | 439 ++++++++++++++++++ ...-hci-Ignore-unexpected-status-events.patch | 2 +- ..._interface-Optionally-use-sysbta-HAL.patch | 6 +- ...n-to-change-eSCO-Transport-Unit-Size.patch | 2 +- ...en-failing-to-get-real-time-priority.patch | 8 +- ...es-we-need-to-tell-Audio-HAL-if-we-r.patch | 2 +- ...o-disable-some-features-commands-sta.patch | 2 +- ...o-cap-declared-le-vendor-version.-Fo.patch | 2 +- 65 files changed, 813 insertions(+), 65 deletions(-) create mode 100644 patches/trebledroid/platform_frameworks_base/0044-Revert-Removed-IWLAN-legacy-mode-support.patch create mode 100644 patches/trebledroid/platform_frameworks_base/0045-add-nubia-red-magic-6-series-udfps-fod.patch create mode 100644 patches/trebledroid/platform_frameworks_base/0046-fix-finger-up-cmd-code.patch create mode 100644 patches/trebledroid/platform_frameworks_base/0047-fixup-FOD-support-for-Asus-Samsung-and-recent-Xiaomi.patch create mode 100644 patches/trebledroid/platform_frameworks_opt_telephony/0011-Revert-Removed-IWLAN-legacy-mode-support.patch 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 919996be..cb24b240 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 d5569f56dc1bb217a3c20620f4c719b67e0b7e26 Mon Sep 17 00:00:00 2001 From: Andy CrossGate Yan Date: Thu, 5 Apr 2018 10:01:19 +0800 -Subject: [PATCH 01/43] Disable vendor mismatch warning +Subject: [PATCH 01/47] 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 c1c4ca88..a65052de 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 7a43cefe8c152ffd8819a2be104a096961db3f97 Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Tue, 5 Oct 2021 17:59:16 -0400 -Subject: [PATCH 02/43] Fallback to stupid autobrightness if brightness values +Subject: [PATCH 02/47] 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 156a2223..3a988d4a 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 03c19dc430fa6b954fdef5346d49cd645add594c Mon Sep 17 00:00:00 2001 From: Raphael Mounier Date: Sat, 6 Aug 2022 18:08:36 +0200 -Subject: [PATCH 03/43] Fix env empty string - ANDROID_STORAGE +Subject: [PATCH 03/47] 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/0004-Relax-requirement-for-visible-flag-to-sdcards.patch b/patches/trebledroid/platform_frameworks_base/0004-Relax-requirement-for-visible-flag-to-sdcards.patch index 85500a79..6374a088 100644 --- a/patches/trebledroid/platform_frameworks_base/0004-Relax-requirement-for-visible-flag-to-sdcards.patch +++ b/patches/trebledroid/platform_frameworks_base/0004-Relax-requirement-for-visible-flag-to-sdcards.patch @@ -1,7 +1,7 @@ From d9abd48f34ce986611e9bebed54555add08f14aa Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Tue, 28 Nov 2017 18:28:04 +0100 -Subject: [PATCH 04/43] Relax requirement for visible flag to sdcards +Subject: [PATCH 04/47] Relax requirement for visible flag to sdcards The vast majority of sdcard readers are stable enough to be declared by the API. (I see no counter-example) 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 6b58d112..a0b8f4c8 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 20e7ad25ec793ba9291a39cb99832193342ac3a5 Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Thu, 17 May 2018 20:28:35 +0200 -Subject: [PATCH 05/43] Don't crash if there is IR HAL is not declared +Subject: [PATCH 05/47] Don't crash if there is IR HAL is not declared Change-Id: I3afded27441bbee8244d5fda544b3e6d1238dc1b --- diff --git a/patches/trebledroid/platform_frameworks_base/0006-Implement-a-persistent-property-to-override-the-defa.patch b/patches/trebledroid/platform_frameworks_base/0006-Implement-a-persistent-property-to-override-the-defa.patch index 2f2487f6..e693fcc7 100644 --- a/patches/trebledroid/platform_frameworks_base/0006-Implement-a-persistent-property-to-override-the-defa.patch +++ b/patches/trebledroid/platform_frameworks_base/0006-Implement-a-persistent-property-to-override-the-defa.patch @@ -1,7 +1,7 @@ From c47433eb06a1fb40a76212064b760185b1819b5c Mon Sep 17 00:00:00 2001 From: Peter Cai Date: Wed, 1 Jun 2022 16:56:20 -0400 -Subject: [PATCH 06/43] Implement a persistent property to override the default +Subject: [PATCH 06/47] Implement a persistent property to override the default primary camera (0) Change-Id: I49b45d00bf71d7932591b3516d49a680e1b6568b 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 370bee23..229fe484 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 2348038ffbe8071c7db1e37d3aaa7d78852994af Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Mon, 6 Aug 2018 12:49:00 +0200 -Subject: [PATCH 07/43] Show APN Settings for CDMA carriers +Subject: [PATCH 07/47] 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 49df2e2d..81a0a2e4 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 89fa2cf8f4ee50301f5dac092cb51fbb5b36bed1 Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Thu, 8 Nov 2018 23:04:03 +0100 -Subject: [PATCH 08/43] Re-order services so that it works even without qtaguid +Subject: [PATCH 08/47] 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 dcfd28a2..9f3139b0 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 10840f40c1a6221fa9d08079667e27f758923581 Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Sun, 24 Mar 2019 23:05:14 +0100 -Subject: [PATCH 09/43] Support samsung Pie and Q light hal +Subject: [PATCH 09/47] 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 83206646..47f1d68c 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 d44d29905de26fff958aae8b6ae11b43f9ca8f2b Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Mon, 12 Aug 2019 23:08:26 +0200 -Subject: [PATCH 10/43] Add support for samsung touch, physical and hover +Subject: [PATCH 10/47] 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 e72b486a..a8ec6266 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 fc272941d85793fec06062e540ec51ed40c0a55b Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Sun, 5 Apr 2020 16:32:46 +0200 -Subject: [PATCH 11/43] Always allow overriding the number of work profiles +Subject: [PATCH 11/47] Always allow overriding the number of work profiles Change-Id: I6eb09aa71663c6fbe7563e3038bffcabdba0ff6a --- 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 cc9da270..925da6c1 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 966a233eaeb3a02abac02e25335ae5120fe09d02 Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Sat, 6 Jun 2020 18:21:56 +0200 -Subject: [PATCH 12/43] HOME deserves to wake-up devices just as well as back +Subject: [PATCH 12/47] HOME deserves to wake-up devices just as well as back and menu Change-Id: Ia562bafd8c620d00c17e8eb338e4701c6c4a3c3a diff --git a/patches/trebledroid/platform_frameworks_base/0013-Some-devices-have-proximity-sensor-reporting-NaN-as-.patch b/patches/trebledroid/platform_frameworks_base/0013-Some-devices-have-proximity-sensor-reporting-NaN-as-.patch index c3896487..e50627ac 100644 --- a/patches/trebledroid/platform_frameworks_base/0013-Some-devices-have-proximity-sensor-reporting-NaN-as-.patch +++ b/patches/trebledroid/platform_frameworks_base/0013-Some-devices-have-proximity-sensor-reporting-NaN-as-.patch @@ -1,7 +1,7 @@ From 4d40a5e693476a33bcf124ab5e2b0a6acf3897b8 Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Tue, 29 Sep 2020 22:39:47 +0200 -Subject: [PATCH 13/43] Some devices have proximity sensor reporting NaN as max +Subject: [PATCH 13/47] Some devices have proximity sensor reporting NaN as max range for some reason. Make them behave standard way by setting 5 cm Change-Id: I3c39e3e914a05903c140235702e0480d2d58a612 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 2cb1a622..cb6b6c9c 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 a0d3a673f2fc29205bc227558792917fcb4e8eb6 Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Tue, 29 Sep 2020 22:40:10 +0200 -Subject: [PATCH 14/43] Fix brightness range not being complete on Samsung +Subject: [PATCH 14/47] 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 d793d55e..fff90999 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 95fa02d91ee78ffc41c19571c934a0629fe1e8ee Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Sun, 25 Oct 2020 23:57:26 +0100 -Subject: [PATCH 15/43] Re-implement fnmatch-like behaviour for RRO java-side +Subject: [PATCH 15/47] 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 b7fc4f65..74fe6a3e 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 dfbcca0ba6887ab2944b9412734007545f054481 Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Fri, 11 Dec 2020 14:41:09 +0100 -Subject: [PATCH 16/43] Remove useless notification about "console" service +Subject: [PATCH 16/47] 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 adfb4809..a69cffb6 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 42a3481fae87c90e200067457b34934fd17c0901 Mon Sep 17 00:00:00 2001 From: Peter Cai Date: Wed, 16 Dec 2020 21:24:12 +0800 -Subject: [PATCH 17/43] Revert "Remove unused SystemProperties.set" +Subject: [PATCH 17/47] 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 50fab153..0cacaa1a 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 483e24ed172206d8bad47e0db4cdea12a6ef85f6 Mon Sep 17 00:00:00 2001 From: Peter Cai Date: Wed, 16 Dec 2020 13:46:15 +0800 -Subject: [PATCH 18/43] TelephonyManager: bring back getNetworkClass() +Subject: [PATCH 18/47] 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 c1f7b478..8a04e9fb 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 6fef4936b5844634735f7001bcc9b38e26ade3fc Mon Sep 17 00:00:00 2001 From: Peter Cai Date: Wed, 16 Dec 2020 21:26:45 +0800 -Subject: [PATCH 19/43] TelephonyManager: add API annotations for +Subject: [PATCH 19/47] 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 263b3094..f21bdc01 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 4953a3b1c494866ad1f7aba5125cf0efe2a19c7b Mon Sep 17 00:00:00 2001 From: Alberto Ponces Date: Tue, 2 Feb 2021 10:20:51 +0000 -Subject: [PATCH 20/43] Fix Wakelock issue +Subject: [PATCH 20/47] 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 7873663e..36f598ac 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 2181e71e36cde8ebecacd6b4e70dd6a75c3c7041 Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Sat, 20 Mar 2021 14:31:01 +0100 -Subject: [PATCH 21/43] Automatically detect pick up sensor, so that an overlay +Subject: [PATCH 21/47] 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 605307cb..3d5aec57 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 d395e20a564ca1023bceb1cec1f2537e653a2655 Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Tue, 23 Mar 2021 19:43:26 +0100 -Subject: [PATCH 22/43] Catch broken mainBuiltInDisplayCutoutRectApproximation +Subject: [PATCH 22/47] 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 140f1c8c..a0340aeb 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 0bcbe26b1b9f3592267db114af6cdcfbcc71e221 Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Sat, 24 Mar 2018 08:01:48 +0100 -Subject: [PATCH 23/43] backlight: Fix backlight control on Galaxy S9(+) +Subject: [PATCH 23/47] 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 ee47b4e4..da29ad34 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 789afc4f5b96073871349e86464c97c43c67b667 Mon Sep 17 00:00:00 2001 From: Andy CrossGate Yan Date: Sat, 4 Sep 2021 08:26:30 +0000 -Subject: [PATCH 24/43] Revert "Switch long-press power behavior in AOSP." +Subject: [PATCH 24/47] Revert "Switch long-press power behavior in AOSP." This reverts commit 803c77a0a24624111944832098c6f65158051dc4. --- diff --git a/patches/trebledroid/platform_frameworks_base/0025-Allow-disabling-of-fingerprint-cleanups-needed-on-so.patch b/patches/trebledroid/platform_frameworks_base/0025-Allow-disabling-of-fingerprint-cleanups-needed-on-so.patch index f473a3fa..0b9b1f53 100644 --- a/patches/trebledroid/platform_frameworks_base/0025-Allow-disabling-of-fingerprint-cleanups-needed-on-so.patch +++ b/patches/trebledroid/platform_frameworks_base/0025-Allow-disabling-of-fingerprint-cleanups-needed-on-so.patch @@ -1,7 +1,7 @@ From a8464a6ddab237f3b1e8fc11d1ad0caaf2737b4b Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Sat, 2 Apr 2022 18:04:01 -0400 -Subject: [PATCH 25/43] Allow disabling of fingerprint cleanups, needed on some +Subject: [PATCH 25/47] Allow disabling of fingerprint cleanups, needed on some Realme devices that cant enumerate --- 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 c47d48a4..6e4e09b7 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 176c2aaa566723e42973d20b85a273251dab6e69 Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Mon, 20 Dec 2021 15:01:41 -0500 -Subject: [PATCH 26/43] Dynamically resize boot animation to match screen size +Subject: [PATCH 26/47] 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 ec95daba..55711410 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 dbe19e9eef67309210e38cb8c82dde7207af0f43 Mon Sep 17 00:00:00 2001 From: Andy CrossGate Yan Date: Sat, 15 Oct 2022 09:33:56 +0000 -Subject: [PATCH 27/43] Revert "Remove more FDE methods from StorageManager" +Subject: [PATCH 27/47] Revert "Remove more FDE methods from StorageManager" This reverts commit bd13f84152449a3ead6fa8604fd31f48c0224676. diff --git a/patches/trebledroid/platform_frameworks_base/0028-SystemUI-Use-AVCProfileMain-for-screen-recorder.patch b/patches/trebledroid/platform_frameworks_base/0028-SystemUI-Use-AVCProfileMain-for-screen-recorder.patch index 708fe94d..e756c640 100644 --- a/patches/trebledroid/platform_frameworks_base/0028-SystemUI-Use-AVCProfileMain-for-screen-recorder.patch +++ b/patches/trebledroid/platform_frameworks_base/0028-SystemUI-Use-AVCProfileMain-for-screen-recorder.patch @@ -1,7 +1,7 @@ From 6a75c260ab74f5a1c2c06a7784c7660283ad92bf Mon Sep 17 00:00:00 2001 From: Arne Coucheron Date: Thu, 5 Nov 2020 05:38:44 +0100 -Subject: [PATCH 28/43] SystemUI: Use AVCProfileMain for screen recorder +Subject: [PATCH 28/47] SystemUI: Use AVCProfileMain for screen recorder Some devices don't support the High profile very well. Use Main profile, which is more compatible, so they 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 f2da7984..68781ba3 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 b6349f97257d8d32b0aeb8361bfabd4158d36808 Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Sat, 3 Dec 2022 17:13:24 -0500 -Subject: [PATCH 29/43] Set old fingerprint sensors to security "strong" +Subject: [PATCH 29/47] 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 fa253a4b..42323649 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 cf30ee029a579c89c7e2bd3a2f5217619225433e Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Wed, 14 Dec 2022 17:21:00 -0500 -Subject: [PATCH 30/43] Call Samsung's ISehSysInputDev to report screen state +Subject: [PATCH 30/47] Call Samsung's ISehSysInputDev to report screen state to touchscreen driver This fixes touchscreen not waking up on Galaxy F23 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 d4404b60..0f8aa8d7 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 5cb88083662cb28ccb47c6ef896e8dabb4273e94 Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Fri, 2 Jun 2023 19:19:31 -0400 -Subject: [PATCH 31/43] Try catch around constrainNitsAndBacklightArrays, and +Subject: [PATCH 31/47] 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 2bc10095..fa2f9407 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 dc79caf62c2ddb3e045c96cecd6f0afa502df7d4 Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Sat, 17 Jun 2023 08:31:55 -0400 -Subject: [PATCH 32/43] Add Mediatek power hints on touch +Subject: [PATCH 32/47] Add Mediatek power hints on touch Mediatek has multiple HALs (which existed concurrently), so it is a bit of a mess. 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 97557e07..33062a15 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 9adcc2c90fdd7894cb938a75974e46c1f10f11d3 Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Wed, 5 Jul 2023 10:50:36 -0400 -Subject: [PATCH 33/43] Detect Moto dynamic hardware feature +Subject: [PATCH 33/47] 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 b31163a6..c0fac388 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 1629fd7946e9c880d440912c55b7995acfd92770 Mon Sep 17 00:00:00 2001 From: Andy CrossGate Yan Date: Wed, 2 Aug 2023 20:59:53 +0800 -Subject: [PATCH 34/43] Restore getSimStateForSlotIndex in SubscriptionManager +Subject: [PATCH 34/47] 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 557202c3..cf4b2906 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 58acd8488a8e14021c599da71c532d768518799a Mon Sep 17 00:00:00 2001 From: Andy CrossGate Yan Date: Sat, 12 Aug 2023 20:11:17 +0800 -Subject: [PATCH 35/43] Add runWithCleanCallingIdentity variant with both +Subject: [PATCH 35/47] 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 8222fb93..b7c0b232 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 cf7d56710717b8d7a3271cb59f100cf77becfe56 Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Fri, 6 Oct 2023 10:57:13 -0400 -Subject: [PATCH 36/43] Catch NPE in SystemUI +Subject: [PATCH 36/47] 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-Add-support-for-app-signature-spoofing.patch b/patches/trebledroid/platform_frameworks_base/0037-Add-support-for-app-signature-spoofing.patch index 5b2f0e12..c64aa6b7 100644 --- a/patches/trebledroid/platform_frameworks_base/0037-Add-support-for-app-signature-spoofing.patch +++ b/patches/trebledroid/platform_frameworks_base/0037-Add-support-for-app-signature-spoofing.patch @@ -1,7 +1,7 @@ From 1213711846da457a0973dc79ab9dbae7679d396d Mon Sep 17 00:00:00 2001 From: Danny Lin Date: Sat, 16 Oct 2021 05:27:57 -0700 -Subject: [PATCH 37/43] Add support for app signature spoofing +Subject: [PATCH 37/47] Add support for app signature spoofing This is needed by microG GmsCore to pretend to be the official Google Play Services package, because client apps check the package signature diff --git a/patches/trebledroid/platform_frameworks_base/0038-Once-we-integrate-Samsung-Power-hal-in-libpowermanag.patch b/patches/trebledroid/platform_frameworks_base/0038-Once-we-integrate-Samsung-Power-hal-in-libpowermanag.patch index ea474c91..8c02b591 100644 --- a/patches/trebledroid/platform_frameworks_base/0038-Once-we-integrate-Samsung-Power-hal-in-libpowermanag.patch +++ b/patches/trebledroid/platform_frameworks_base/0038-Once-we-integrate-Samsung-Power-hal-in-libpowermanag.patch @@ -1,7 +1,7 @@ From df176e589b203ecdd7350629e9c7364ccbc5d9c2 Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Mon, 27 Dec 2021 17:57:11 -0500 -Subject: [PATCH 38/43] Once we integrate Samsung Power hal in libpowermanager, +Subject: [PATCH 38/47] 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/0039-FOD-support-for-Asus-Samsung-and-recent-Xiaomi-devic.patch b/patches/trebledroid/platform_frameworks_base/0039-FOD-support-for-Asus-Samsung-and-recent-Xiaomi-devic.patch index 67bd7e51..99bb9cfc 100644 --- a/patches/trebledroid/platform_frameworks_base/0039-FOD-support-for-Asus-Samsung-and-recent-Xiaomi-devic.patch +++ b/patches/trebledroid/platform_frameworks_base/0039-FOD-support-for-Asus-Samsung-and-recent-Xiaomi-devic.patch @@ -1,7 +1,7 @@ From 38999b41d5c2a54387748cc1bdc058761df07a0d Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Sun, 18 Dec 2022 18:20:40 -0500 -Subject: [PATCH 39/43] FOD support for Asus, Samsung and recent Xiaomi devices +Subject: [PATCH 39/47] FOD support for Asus, Samsung and recent Xiaomi devices Thanks Asus for providing a free device to make this support And thanks @davigamer987 for donating enough to get a Samsung FOD device diff --git a/patches/trebledroid/platform_frameworks_base/0040-SystemUI-Add-MTK-s-brightness-path-for-FOD.patch b/patches/trebledroid/platform_frameworks_base/0040-SystemUI-Add-MTK-s-brightness-path-for-FOD.patch index ea17d331..8ddc4400 100644 --- a/patches/trebledroid/platform_frameworks_base/0040-SystemUI-Add-MTK-s-brightness-path-for-FOD.patch +++ b/patches/trebledroid/platform_frameworks_base/0040-SystemUI-Add-MTK-s-brightness-path-for-FOD.patch @@ -1,7 +1,7 @@ From d09e5b4ad397b8483911103b3d4765c2bb849682 Mon Sep 17 00:00:00 2001 From: Andy CrossGate Yan Date: Sun, 15 Oct 2023 11:21:58 +0800 -Subject: [PATCH 40/43] SystemUI: Add MTK's brightness path for FOD +Subject: [PATCH 40/47] SystemUI: Add MTK's brightness path for FOD Rewrote the part for easier extension diff --git a/patches/trebledroid/platform_frameworks_base/0041-Fix-brightness-slider-curve-for-some-devices.patch b/patches/trebledroid/platform_frameworks_base/0041-Fix-brightness-slider-curve-for-some-devices.patch index ca695d6c..18bef006 100644 --- a/patches/trebledroid/platform_frameworks_base/0041-Fix-brightness-slider-curve-for-some-devices.patch +++ b/patches/trebledroid/platform_frameworks_base/0041-Fix-brightness-slider-curve-for-some-devices.patch @@ -1,7 +1,7 @@ From 115b3a67a05bee8d8f984de4fdc33db2fc9b5323 Mon Sep 17 00:00:00 2001 From: ChonDoit Date: Thu, 24 Aug 2023 15:58:15 -0300 -Subject: [PATCH 41/43] Fix brightness slider curve for some devices +Subject: [PATCH 41/47] Fix brightness slider curve for some devices Some devices report max brightness as 2047 or 4095 --- diff --git a/patches/trebledroid/platform_frameworks_base/0042-Ignore-cgroup-creation-errors.patch b/patches/trebledroid/platform_frameworks_base/0042-Ignore-cgroup-creation-errors.patch index d279ccb3..38623f5f 100644 --- a/patches/trebledroid/platform_frameworks_base/0042-Ignore-cgroup-creation-errors.patch +++ b/patches/trebledroid/platform_frameworks_base/0042-Ignore-cgroup-creation-errors.patch @@ -1,7 +1,7 @@ From b65bdc652b7358cc42ef28d8874a4a4ee25cd3a7 Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Wed, 18 Oct 2023 16:53:40 -0400 -Subject: [PATCH 42/43] Ignore cgroup creation errors +Subject: [PATCH 42/47] Ignore cgroup creation errors For old kernels who don't have those modern cgroups --- diff --git a/patches/trebledroid/platform_frameworks_base/0043-Samsung-tablets-use-SW_MACHINE_COVER-rather-than-SW_.patch b/patches/trebledroid/platform_frameworks_base/0043-Samsung-tablets-use-SW_MACHINE_COVER-rather-than-SW_.patch index f786de2b..191484c0 100644 --- a/patches/trebledroid/platform_frameworks_base/0043-Samsung-tablets-use-SW_MACHINE_COVER-rather-than-SW_.patch +++ b/patches/trebledroid/platform_frameworks_base/0043-Samsung-tablets-use-SW_MACHINE_COVER-rather-than-SW_.patch @@ -1,7 +1,7 @@ From aff6d95f97bea391c6fe0b08fa3928567fcb055c Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Wed, 18 Oct 2023 16:57:34 -0400 -Subject: [PATCH 43/43] Samsung tablets use SW_MACHINE_COVER rather than SW_LID +Subject: [PATCH 43/47] 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/0044-Revert-Removed-IWLAN-legacy-mode-support.patch b/patches/trebledroid/platform_frameworks_base/0044-Revert-Removed-IWLAN-legacy-mode-support.patch new file mode 100644 index 00000000..914f86fc --- /dev/null +++ b/patches/trebledroid/platform_frameworks_base/0044-Revert-Removed-IWLAN-legacy-mode-support.patch @@ -0,0 +1,82 @@ +From 15bde0a7262a0ab82011bd21d155c5ab52bccf25 Mon Sep 17 00:00:00 2001 +From: Alberto Ponces +Date: Fri, 20 Oct 2023 09:26:19 +0000 +Subject: [PATCH 44/47] Revert "Removed IWLAN legacy mode support" + +This reverts commit 2832dee607ab33eee688abea206f4adfcfc896f1. +--- + .../java/android/telephony/ServiceState.java | 30 ++++++++++++------- + 1 file changed, 20 insertions(+), 10 deletions(-) + +diff --git a/telephony/java/android/telephony/ServiceState.java b/telephony/java/android/telephony/ServiceState.java +index 523d0b0e55f4..96387a489dcc 100644 +--- a/telephony/java/android/telephony/ServiceState.java ++++ b/telephony/java/android/telephony/ServiceState.java +@@ -1213,8 +1213,13 @@ public class ServiceState implements Parcelable { + + /** + * Initialize the service state. Set everything to the default value. ++ * ++ * @param legacyMode {@code true} if the device is on IWLAN legacy mode, where IWLAN is ++ * considered as a RAT on WWAN {@link NetworkRegistrationInfo}. {@code false} if the device ++ * is on AP-assisted mode, where IWLAN should be reported through WLAN. ++ * {@link NetworkRegistrationInfo}. + */ +- private void init() { ++ private void init(boolean legacyMode) { + if (DBG) Rlog.d(LOG_TAG, "init"); + mVoiceRegState = STATE_OUT_OF_SERVICE; + mDataRegState = STATE_OUT_OF_SERVICE; +@@ -1246,11 +1251,13 @@ public class ServiceState implements Parcelable { + .setTransportType(AccessNetworkConstants.TRANSPORT_TYPE_WWAN) + .setRegistrationState(NetworkRegistrationInfo.REGISTRATION_STATE_UNKNOWN) + .build()); +- addNetworkRegistrationInfo(new NetworkRegistrationInfo.Builder() +- .setDomain(NetworkRegistrationInfo.DOMAIN_PS) +- .setTransportType(AccessNetworkConstants.TRANSPORT_TYPE_WLAN) +- .setRegistrationState(NetworkRegistrationInfo.REGISTRATION_STATE_UNKNOWN) +- .build()); ++ if (!legacyMode) { ++ addNetworkRegistrationInfo(new NetworkRegistrationInfo.Builder() ++ .setDomain(NetworkRegistrationInfo.DOMAIN_PS) ++ .setTransportType(AccessNetworkConstants.TRANSPORT_TYPE_WLAN) ++ .setRegistrationState(NetworkRegistrationInfo.REGISTRATION_STATE_UNKNOWN) ++ .build()); ++ } + } + mOperatorAlphaLongRaw = null; + mOperatorAlphaShortRaw = null; +@@ -1259,11 +1266,11 @@ public class ServiceState implements Parcelable { + } + + public void setStateOutOfService() { +- init(); ++ init(true); + } + + public void setStateOff() { +- init(); ++ init(true); + mVoiceRegState = STATE_POWER_OFF; + mDataRegState = STATE_POWER_OFF; + } +@@ -1271,11 +1278,14 @@ public class ServiceState implements Parcelable { + /** + * Set the service state to out-of-service + * ++ * @param legacyMode {@code true} if the device is on IWLAN legacy mode, where IWLAN is ++ * considered as a RAT on WWAN {@link NetworkRegistrationInfo}. {@code false} if the device ++ * is on AP-assisted mode, where IWLAN should be reported through WLAN. + * @param powerOff {@code true} if this is a power off case (i.e. Airplane mode on). + * @hide + */ +- public void setOutOfService(boolean powerOff) { +- init(); ++ public void setOutOfService(boolean legacyMode, boolean powerOff) { ++ init(legacyMode); + if (powerOff) { + mVoiceRegState = STATE_POWER_OFF; + mDataRegState = STATE_POWER_OFF; +-- +2.34.1 + diff --git a/patches/trebledroid/platform_frameworks_base/0045-add-nubia-red-magic-6-series-udfps-fod.patch b/patches/trebledroid/platform_frameworks_base/0045-add-nubia-red-magic-6-series-udfps-fod.patch new file mode 100644 index 00000000..cfaa61b0 --- /dev/null +++ b/patches/trebledroid/platform_frameworks_base/0045-add-nubia-red-magic-6-series-udfps-fod.patch @@ -0,0 +1,176 @@ +From b8ece716485d12a69b1570eadd7200edb7d5862d Mon Sep 17 00:00:00 2001 +From: Huy Hoang <38396158+boydaihungst@users.noreply.github.com> +Date: Sat, 14 Oct 2023 12:44:36 +0700 +Subject: [PATCH 45/47] add: nubia red magic 6 series udfps/fod + +--- + packages/SystemUI/Android.bp | 3 +- + .../systemui/biometrics/UdfpsController.java | 56 +++++++++++++++++++ + .../android/systemui/biometrics/UdfpsView.kt | 14 +++++ + 3 files changed, 72 insertions(+), 1 deletion(-) + +diff --git a/packages/SystemUI/Android.bp b/packages/SystemUI/Android.bp +index 7f77e39041d1..5d7b5494d7fd 100644 +--- a/packages/SystemUI/Android.bp ++++ b/packages/SystemUI/Android.bp +@@ -199,7 +199,8 @@ android_library { + "motion_tool_lib", + "vendor.goodix.hardware.biometrics.fingerprint-V2.1-java", + "vendor.xiaomi.hw.touchfeature-V1.0-java", +- "vendor.xiaomi.hardware.fingerprintextension-V1.0-java" ++ "vendor.xiaomi.hardware.fingerprintextension-V1.0-java", ++ "vendor.nubia.ifaa-V1.0-java", + ], + manifest: "AndroidManifest.xml", + +diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java +index 10e45dadee60..27ab0db69756 100644 +--- a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java ++++ b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java +@@ -47,6 +47,7 @@ import android.os.Handler; + import android.os.PowerManager; + import android.os.Process; + import android.os.Trace; ++import android.os.SystemProperties; + import android.os.VibrationAttributes; + import android.os.VibrationEffect; + import android.util.Log; +@@ -110,9 +111,13 @@ import java.util.HashSet; + import java.util.Optional; + import java.util.Set; + import java.util.concurrent.Executor; ++import java.io.File; ++import java.io.FileWriter; ++import java.io.IOException; + + import javax.inject.Inject; + import javax.inject.Provider; ++import vendor.nubia.ifaa.V1_0.IIfaa; + + /** + * Shows and hides the under-display fingerprint sensor (UDFPS) overlay, handles UDFPS touch events, +@@ -243,6 +248,46 @@ public class UdfpsController implements DozeReceiver, Dumpable { + mScreenOn = false; + } + }; ++ // Nubia 6 series fingerprint control command ++ // cmd = 13 -> finger down ++ // cmd = 14 -> after UI ready ++ // cmd = 15 -> finger up ++ public byte[] processCmd(int cmd, int param1, int param2, byte[] send_buf, int length) { ++ try { ++ if (cmd == 999) { ++ Log.d(TAG, "processCmd: 999"); ++ return null; ++ } ++ ArrayList sendList = new ArrayList<>(); ++ if (send_buf != null) { ++ for (byte b : send_buf) { ++ sendList.add(Byte.valueOf(b)); ++ } ++ } ++ if (send_buf == null) { ++ Log.d(TAG, "FingerprintService send_buf = " + send_buf); ++ } ++ IIfaa iIfaaDaemon = IIfaa.getService(); ++ if (iIfaaDaemon == null) { ++ Log.d(TAG, "processCmd: no iIfaaDaemon!"); ++ return null; ++ } ++ ArrayList resultList = iIfaaDaemon.processCmd(cmd, param1, param2, sendList, length); ++ int n = resultList.size(); ++ Log.d(TAG, "FingerprintService result length n = " + n); ++ if (n == 0) { ++ return null; ++ } ++ byte[] result = new byte[n]; ++ for (int i = 0; i < n; i++) { ++ result[i] = resultList.get(i).byteValue(); ++ } ++ return result; ++ } catch (Exception e) { ++ e.printStackTrace(); ++ return null; ++ } ++ }; + + @Override + public void dump(@NonNull PrintWriter pw, @NonNull String[] args) { +@@ -1188,10 +1233,17 @@ public class UdfpsController implements DozeReceiver, Dumpable { + view.configureDisplay(() -> dispatchOnUiReady(requestId)); + } + } ++ if(SystemProperties.get("ro.vendor.build.fingerprint").contains("nubia/NX669")) { ++ processCmd(13, 0, 0, new byte[0], 0); ++ } + + for (Callback cb : mCallbacks) { + cb.onFingerDown(); + } ++ if(SystemProperties.get("ro.vendor.build.fingerprint").contains("nubia/NX669")) { ++ processCmd(14, 0, 0, new byte[0], 0); ++ } ++ + } + + private void onFingerUp(long requestId, @NonNull UdfpsView view) { +@@ -1242,6 +1294,10 @@ public class UdfpsController implements DozeReceiver, Dumpable { + mFingerprintManager.onPointerUp(requestId, mSensorProps.sensorId); + } + } ++ if(SystemProperties.get("ro.vendor.build.fingerprint").contains("nubia/NX669")) { ++ processCmd(14, 0, 0, new byte[0], 0); ++ } ++ + for (Callback cb : mCallbacks) { + cb.onFingerUp(); + } +diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsView.kt b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsView.kt +index c005c66f96bc..084fcb8d260f 100644 +--- a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsView.kt ++++ b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsView.kt +@@ -45,6 +45,8 @@ import vendor.xiaomi.hardware.fingerprintextension.V1_0.IXiaomiFingerprint + import android.os.Handler + import android.os.HandlerThread + ++import vendor.nubia.ifaa.V1_0.IIfaa ++ + private const val TAG = "UdfpsView" + + /** +@@ -233,6 +235,10 @@ class UdfpsView( + private val handlerThread = HandlerThread("UDFPS").also { it.start() } + val myHandler = Handler(handlerThread.looper) + ++ // This file contain current hbm value ++ val nubiaHbmState = "/sys/kernel/lcd_enhance/hbm_state" ++ var hasNubiaHbm = File(nubiaHbmState).exists() ++ + fun configureDisplay(onDisplayConfigured: Runnable) { + isDisplayConfigured = true + animationViewController?.onDisplayConfiguring() +@@ -309,6 +315,11 @@ class UdfpsView( + }, 600) + }, 200) + } ++ if(hasNubiaHbm) { ++ Log.d("PHH-Enroll", "Nubia scenario in UdfpsView reached!") ++ File(nubiaHbmState).writeText("4095") ++ } ++ + } + + fun unconfigureDisplay() { +@@ -353,6 +364,9 @@ class UdfpsView( + } else if(hasXiaomiLhbm) { + IXiaomiFingerprint.getService().extCmd(android.os.SystemProperties.getInt("persist.phh.xiaomi.fod.enrollment.id", 4), 0); + ITouchFeature.getService().setTouchMode(0, 10, 0); ++ } else if(hasNubiaHbm) { ++ Log.d("PHH-Enroll", "Nubia Restore brightness") ++ File(nubiaHbmState).writeText(File("/sys/class/backlight/panel0-backlight/brightness").readText()) + } else { + dimUpdate(0.0f) + } +-- +2.34.1 + diff --git a/patches/trebledroid/platform_frameworks_base/0046-fix-finger-up-cmd-code.patch b/patches/trebledroid/platform_frameworks_base/0046-fix-finger-up-cmd-code.patch new file mode 100644 index 00000000..1eba8d47 --- /dev/null +++ b/patches/trebledroid/platform_frameworks_base/0046-fix-finger-up-cmd-code.patch @@ -0,0 +1,25 @@ +From 6d9abbe2dd84a572d9b629e50eb896ac78a42b5c Mon Sep 17 00:00:00 2001 +From: Huy Hoang <38396158+boydaihungst@users.noreply.github.com> +Date: Thu, 19 Oct 2023 04:27:30 +0700 +Subject: [PATCH 46/47] fix: finger up cmd code + +--- + .../src/com/android/systemui/biometrics/UdfpsController.java | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java +index 27ab0db69756..efb88b9fe1ec 100644 +--- a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java ++++ b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsController.java +@@ -1295,7 +1295,7 @@ public class UdfpsController implements DozeReceiver, Dumpable { + } + } + if(SystemProperties.get("ro.vendor.build.fingerprint").contains("nubia/NX669")) { +- processCmd(14, 0, 0, new byte[0], 0); ++ processCmd(15, 0, 0, new byte[0], 0); + } + + for (Callback cb : mCallbacks) { +-- +2.34.1 + diff --git a/patches/trebledroid/platform_frameworks_base/0047-fixup-FOD-support-for-Asus-Samsung-and-recent-Xiaomi.patch b/patches/trebledroid/platform_frameworks_base/0047-fixup-FOD-support-for-Asus-Samsung-and-recent-Xiaomi.patch new file mode 100644 index 00000000..3676d55b --- /dev/null +++ b/patches/trebledroid/platform_frameworks_base/0047-fixup-FOD-support-for-Asus-Samsung-and-recent-Xiaomi.patch @@ -0,0 +1,26 @@ +From 6dcde22d24a00566e6828bc6b89f79e598f30435 Mon Sep 17 00:00:00 2001 +From: Pierre-Hugues Husson +Date: Fri, 20 Oct 2023 13:40:56 -0400 +Subject: [PATCH 47/47] fixup! FOD support for Asus, Samsung and recent Xiaomi + devices + +--- + .../SystemUI/src/com/android/systemui/biometrics/UdfpsView.kt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsView.kt b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsView.kt +index 084fcb8d260f..f86e8436b608 100644 +--- a/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsView.kt ++++ b/packages/SystemUI/src/com/android/systemui/biometrics/UdfpsView.kt +@@ -82,7 +82,7 @@ class UdfpsView( + try { + canvas = p0.lockCanvas(); + Log.d("PHH", "Surface dimensions ${canvas.getWidth()*1.0f} ${canvas.getHeight()*1.0f}") +- canvas.drawOval(RectF(0.0f, 0.0f, canvas.getWidth()*1.0f, canvas.getHeight()*1.0f), paint); ++ canvas.drawOval(RectF(overlayParams.sensorBounds), paint); + } finally { + // Make sure the surface is never left in a bad state. + if (canvas != null) { +-- +2.34.1 + diff --git a/patches/trebledroid/platform_frameworks_opt_telephony/0001-SubscriptionController-Do-not-override-default-calli.patch b/patches/trebledroid/platform_frameworks_opt_telephony/0001-SubscriptionController-Do-not-override-default-calli.patch index 4bc845b1..1378ac33 100644 --- a/patches/trebledroid/platform_frameworks_opt_telephony/0001-SubscriptionController-Do-not-override-default-calli.patch +++ b/patches/trebledroid/platform_frameworks_opt_telephony/0001-SubscriptionController-Do-not-override-default-calli.patch @@ -1,7 +1,7 @@ From 0fe03c946b6978f567f397589129523e1eedadfb Mon Sep 17 00:00:00 2001 From: Peter Cai Date: Mon, 5 Sep 2022 14:02:37 -0400 -Subject: [PATCH 01/10] SubscriptionController: Do not override default calling +Subject: [PATCH 01/11] SubscriptionController: Do not override default calling account from third-party apps When the user has selected a calling account from a third-party app as diff --git a/patches/trebledroid/platform_frameworks_opt_telephony/0002-Telephony-Don-not-call-onUssdRelease-for-Huawei-RIL.patch b/patches/trebledroid/platform_frameworks_opt_telephony/0002-Telephony-Don-not-call-onUssdRelease-for-Huawei-RIL.patch index 0033247e..aea24016 100644 --- a/patches/trebledroid/platform_frameworks_opt_telephony/0002-Telephony-Don-not-call-onUssdRelease-for-Huawei-RIL.patch +++ b/patches/trebledroid/platform_frameworks_opt_telephony/0002-Telephony-Don-not-call-onUssdRelease-for-Huawei-RIL.patch @@ -1,7 +1,7 @@ From b53a8aa2cf0ed2c5c9d626f590288a2e4e51d9c4 Mon Sep 17 00:00:00 2001 From: Artem Borisov Date: Sat, 10 Nov 2018 17:19:17 +0000 -Subject: [PATCH 02/10] Telephony: Don not call onUssdRelease for Huawei RIL +Subject: [PATCH 02/11] Telephony: Don not call onUssdRelease for Huawei RIL Huawei RIL doesn't seem to work properly with USSD_MODE_NW_RELEASE, always releasing USSD when it should be finished instead. diff --git a/patches/trebledroid/platform_frameworks_opt_telephony/0003-Fix-baseband-being-too-long-to-fit-into-a-91-chars-p.patch b/patches/trebledroid/platform_frameworks_opt_telephony/0003-Fix-baseband-being-too-long-to-fit-into-a-91-chars-p.patch index 6990d24d..772403c4 100644 --- a/patches/trebledroid/platform_frameworks_opt_telephony/0003-Fix-baseband-being-too-long-to-fit-into-a-91-chars-p.patch +++ b/patches/trebledroid/platform_frameworks_opt_telephony/0003-Fix-baseband-being-too-long-to-fit-into-a-91-chars-p.patch @@ -1,7 +1,7 @@ From 48569205a4d36141584dc879bf8806a852baad42 Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Mon, 6 Dec 2021 16:28:22 -0500 -Subject: [PATCH 03/10] Fix baseband being too long to fit into a 91 chars +Subject: [PATCH 03/11] Fix baseband being too long to fit into a 91 chars property, preventing telephony subsystem from starting Change-Id: I1762e4a8cc137626be89f350229d6be162bdaf57 diff --git a/patches/trebledroid/platform_frameworks_opt_telephony/0004-Reintroduce-public-void-TelephonyMetrics.writeRilSen.patch b/patches/trebledroid/platform_frameworks_opt_telephony/0004-Reintroduce-public-void-TelephonyMetrics.writeRilSen.patch index 00d5891b..ad3449e9 100644 --- a/patches/trebledroid/platform_frameworks_opt_telephony/0004-Reintroduce-public-void-TelephonyMetrics.writeRilSen.patch +++ b/patches/trebledroid/platform_frameworks_opt_telephony/0004-Reintroduce-public-void-TelephonyMetrics.writeRilSen.patch @@ -1,7 +1,7 @@ From 69e75b8ecb11ccf33b13d4ae0ca49c5d32e4bc49 Mon Sep 17 00:00:00 2001 From: ironydelerium <42721860+ironydelerium@users.noreply.github.com> Date: Fri, 31 Dec 2021 02:20:28 -0800 -Subject: [PATCH 04/10] Reintroduce 'public void +Subject: [PATCH 04/11] Reintroduce 'public void TelephonyMetrics.writeRilSendSms(int, int, int, int)'. (#8) The MediaTek IMS package for Android Q, at the very least (likely for the rest, too) diff --git a/patches/trebledroid/platform_frameworks_opt_telephony/0005-Fix-signalstrength-for-huawei-kirin-hi6250-hi3670.patch b/patches/trebledroid/platform_frameworks_opt_telephony/0005-Fix-signalstrength-for-huawei-kirin-hi6250-hi3670.patch index 325bab85..2e5a95f8 100644 --- a/patches/trebledroid/platform_frameworks_opt_telephony/0005-Fix-signalstrength-for-huawei-kirin-hi6250-hi3670.patch +++ b/patches/trebledroid/platform_frameworks_opt_telephony/0005-Fix-signalstrength-for-huawei-kirin-hi6250-hi3670.patch @@ -1,7 +1,7 @@ From 20748e3c5508725c893ee6f52a58eb66a0865598 Mon Sep 17 00:00:00 2001 From: Raphael Mounier Date: Thu, 6 Oct 2022 08:35:38 +0200 -Subject: [PATCH 05/10] Fix signalstrength for huawei kirin (hi6250, hi3670) +Subject: [PATCH 05/11] Fix signalstrength for huawei kirin (hi6250, hi3670) The RILUtils.convertHalSignalStrength function does not work correctly under Huawei hi6250 and hi3660 platform. We have therefore replaced this function with a new one specifically for this Kirin platform. diff --git a/patches/trebledroid/platform_frameworks_opt_telephony/0006-telephony-forward-port-support-for-forceCognitive.patch b/patches/trebledroid/platform_frameworks_opt_telephony/0006-telephony-forward-port-support-for-forceCognitive.patch index 123a8f8f..4beeeb2b 100644 --- a/patches/trebledroid/platform_frameworks_opt_telephony/0006-telephony-forward-port-support-for-forceCognitive.patch +++ b/patches/trebledroid/platform_frameworks_opt_telephony/0006-telephony-forward-port-support-for-forceCognitive.patch @@ -1,7 +1,7 @@ From c2b3f07945a05d386d2b538acdcf57186a4daae6 Mon Sep 17 00:00:00 2001 From: corneranchu Date: Sat, 1 Oct 2022 01:49:58 +0000 -Subject: [PATCH 06/10] telephony: forward-port support for forceCognitive +Subject: [PATCH 06/11] telephony: forward-port support for forceCognitive * This is needed on some MTK devices. Android 10 refactored some code, so now the "non-persistent/cognitive" filter is relocated to RIL and diff --git a/patches/trebledroid/platform_frameworks_opt_telephony/0007-Pass-correct-value-to-setPreferredNetworkType-for-RI.patch b/patches/trebledroid/platform_frameworks_opt_telephony/0007-Pass-correct-value-to-setPreferredNetworkType-for-RI.patch index d0dc5305..c8b86848 100644 --- a/patches/trebledroid/platform_frameworks_opt_telephony/0007-Pass-correct-value-to-setPreferredNetworkType-for-RI.patch +++ b/patches/trebledroid/platform_frameworks_opt_telephony/0007-Pass-correct-value-to-setPreferredNetworkType-for-RI.patch @@ -1,7 +1,7 @@ From 0ce580d6287dada0dbd4110e2c4ae5e34d807205 Mon Sep 17 00:00:00 2001 From: LuK1337 Date: Fri, 21 Oct 2022 20:55:05 +0200 -Subject: [PATCH 07/10] Pass correct value to setPreferredNetworkType() for RIL +Subject: [PATCH 07/11] Pass correct value to setPreferredNetworkType() for RIL version < 1.4 Change-Id: Id14be66a2ea4e85b6504bc03fd7d2f038185c17d diff --git a/patches/trebledroid/platform_frameworks_opt_telephony/0008-Fix-NPE-with-1.0-and-1.1-CardStatus.patch b/patches/trebledroid/platform_frameworks_opt_telephony/0008-Fix-NPE-with-1.0-and-1.1-CardStatus.patch index bdfde8b6..df41f23c 100644 --- a/patches/trebledroid/platform_frameworks_opt_telephony/0008-Fix-NPE-with-1.0-and-1.1-CardStatus.patch +++ b/patches/trebledroid/platform_frameworks_opt_telephony/0008-Fix-NPE-with-1.0-and-1.1-CardStatus.patch @@ -1,7 +1,7 @@ From c244e37c04e1c9601d11544adac52051159a7972 Mon Sep 17 00:00:00 2001 From: Christian Hoffmann Date: Fri, 21 Oct 2022 12:58:04 +0200 -Subject: [PATCH 08/10] Fix NPE with 1.0 and 1.1 CardStatus +Subject: [PATCH 08/11] Fix NPE with 1.0 and 1.1 CardStatus Change-Id: I965f6ef419b7aef828da02f5d4745bd33d09fe3a --- diff --git a/patches/trebledroid/platform_frameworks_opt_telephony/0009-Conditionally-revert-Block-Binder-thread-until-incom.patch b/patches/trebledroid/platform_frameworks_opt_telephony/0009-Conditionally-revert-Block-Binder-thread-until-incom.patch index f053ae4c..5860b6f6 100644 --- a/patches/trebledroid/platform_frameworks_opt_telephony/0009-Conditionally-revert-Block-Binder-thread-until-incom.patch +++ b/patches/trebledroid/platform_frameworks_opt_telephony/0009-Conditionally-revert-Block-Binder-thread-until-incom.patch @@ -1,7 +1,7 @@ From 47e9c7455a2a0bf0aa9e050621f18855b46c1ebf Mon Sep 17 00:00:00 2001 From: ExactExampl Date: Tue, 11 Oct 2022 12:38:00 +0300 -Subject: [PATCH 09/10] Conditionally revert "Block Binder thread until +Subject: [PATCH 09/11] Conditionally revert "Block Binder thread until incoming call process completes" * Legacy IMS packages handling incoming calls in such a way that diff --git a/patches/trebledroid/platform_frameworks_opt_telephony/0010-When-logging-UiccSlot-ignore-error-if-we-cant-print-.patch b/patches/trebledroid/platform_frameworks_opt_telephony/0010-When-logging-UiccSlot-ignore-error-if-we-cant-print-.patch index ddb2cb9e..d8e6acee 100644 --- a/patches/trebledroid/platform_frameworks_opt_telephony/0010-When-logging-UiccSlot-ignore-error-if-we-cant-print-.patch +++ b/patches/trebledroid/platform_frameworks_opt_telephony/0010-When-logging-UiccSlot-ignore-error-if-we-cant-print-.patch @@ -1,7 +1,7 @@ From 08eca1bfdc1644bb5d507a2738c8f827933901e0 Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Tue, 17 Oct 2023 11:08:06 -0400 -Subject: [PATCH 10/10] When logging UiccSlot, ignore error if we cant print +Subject: [PATCH 10/11] When logging UiccSlot, ignore error if we cant print IccIds --- diff --git a/patches/trebledroid/platform_frameworks_opt_telephony/0011-Revert-Removed-IWLAN-legacy-mode-support.patch b/patches/trebledroid/platform_frameworks_opt_telephony/0011-Revert-Removed-IWLAN-legacy-mode-support.patch new file mode 100644 index 00000000..d3cba845 --- /dev/null +++ b/patches/trebledroid/platform_frameworks_opt_telephony/0011-Revert-Removed-IWLAN-legacy-mode-support.patch @@ -0,0 +1,439 @@ +From d349626689ae331e9598c5a6f62e0c54e8932a3f Mon Sep 17 00:00:00 2001 +From: Alberto Ponces +Date: Fri, 20 Oct 2023 09:11:55 +0000 +Subject: [PATCH 11/11] Revert "Removed IWLAN legacy mode support" + +This reverts commit d8d3ed41243ba1fc4b5a5a2a6e30be3f6a404a9d. + +Change-Id: I1fd5a803ea3b01f902ff14e1ee6225312b2d3206 +--- + .../telephony/ServiceStateTracker.java | 65 +++++++++-- + .../telephony/data/AccessNetworksManager.java | 110 +++++++++++++++--- + .../telephony/data/DataNetworkController.java | 10 +- + .../internal/telephony/imsphone/ImsPhone.java | 42 ++++++- + 4 files changed, 190 insertions(+), 37 deletions(-) + +diff --git a/src/java/com/android/internal/telephony/ServiceStateTracker.java b/src/java/com/android/internal/telephony/ServiceStateTracker.java +index 50eea7f695..33a04fb830 100644 +--- a/src/java/com/android/internal/telephony/ServiceStateTracker.java ++++ b/src/java/com/android/internal/telephony/ServiceStateTracker.java +@@ -659,7 +659,7 @@ public class ServiceStateTracker extends Handler { + + mAccessNetworksManager = mPhone.getAccessNetworksManager(); + mOutOfServiceSS = new ServiceState(); +- mOutOfServiceSS.setOutOfService(false); ++ mOutOfServiceSS.setOutOfService(mAccessNetworksManager.isInLegacyMode(), false); + + for (int transportType : mAccessNetworksManager.getAvailableTransports()) { + mRegStateManagers.append(transportType, new NetworkRegistrationManager( +@@ -776,9 +776,9 @@ public class ServiceStateTracker extends Handler { + } + + mSS = new ServiceState(); +- mSS.setOutOfService(false); ++ mSS.setOutOfService(mAccessNetworksManager.isInLegacyMode(), false); + mNewSS = new ServiceState(); +- mNewSS.setOutOfService(false); ++ mNewSS.setOutOfService(mAccessNetworksManager.isInLegacyMode(), false); + mLastCellInfoReqTime = 0; + mLastCellInfoList = null; + mStartedGprsRegCheck = false; +@@ -3308,7 +3308,7 @@ public class ServiceStateTracker extends Handler { + nri = mNewSS.getNetworkRegistrationInfo( + NetworkRegistrationInfo.DOMAIN_PS, + AccessNetworkConstants.TRANSPORT_TYPE_WLAN); +- mNewSS.setOutOfService(false); ++ mNewSS.setOutOfService(mAccessNetworksManager.isInLegacyMode(), false); + // Add the IWLAN registration info back to service state. + if (nri != null) { + mNewSS.addNetworkRegistrationInfo(nri); +@@ -3325,7 +3325,7 @@ public class ServiceStateTracker extends Handler { + nri = mNewSS.getNetworkRegistrationInfo( + NetworkRegistrationInfo.DOMAIN_PS, + AccessNetworkConstants.TRANSPORT_TYPE_WLAN); +- mNewSS.setOutOfService(true); ++ mNewSS.setOutOfService(mAccessNetworksManager.isInLegacyMode(), true); + // Add the IWLAN registration info back to service state. + if (nri != null) { + mNewSS.addNetworkRegistrationInfo(nri); +@@ -3452,10 +3452,14 @@ public class ServiceStateTracker extends Handler { + mSS.getState() == ServiceState.STATE_POWER_OFF + && mNewSS.getState() != ServiceState.STATE_POWER_OFF; + +- SparseBooleanArray hasDataAttached = new SparseBooleanArray(); +- SparseBooleanArray hasDataDetached = new SparseBooleanArray(); +- SparseBooleanArray hasRilDataRadioTechnologyChanged = new SparseBooleanArray(); +- SparseBooleanArray hasDataRegStateChanged = new SparseBooleanArray(); ++ SparseBooleanArray hasDataAttached = new SparseBooleanArray( ++ mAccessNetworksManager.getAvailableTransports().length); ++ SparseBooleanArray hasDataDetached = new SparseBooleanArray( ++ mAccessNetworksManager.getAvailableTransports().length); ++ SparseBooleanArray hasRilDataRadioTechnologyChanged = new SparseBooleanArray( ++ mAccessNetworksManager.getAvailableTransports().length); ++ SparseBooleanArray hasDataRegStateChanged = new SparseBooleanArray( ++ mAccessNetworksManager.getAvailableTransports().length); + boolean anyDataRegChanged = false; + boolean anyDataRatChanged = false; + boolean hasAlphaRawChanged = +@@ -3641,7 +3645,7 @@ public class ServiceStateTracker extends Handler { + ServiceState oldMergedSS = new ServiceState(mPhone.getServiceState()); + mSS = new ServiceState(mNewSS); + +- mNewSS.setOutOfService(false); ++ mNewSS.setOutOfService(mAccessNetworksManager.isInLegacyMode(), false); + + mCellIdentity = primaryCellIdentity; + if (mSS.getState() == ServiceState.STATE_IN_SERVICE && primaryCellIdentity != null) { +@@ -5503,7 +5507,8 @@ public class ServiceStateTracker extends Handler { + } + + /** +- * This method makes some adjustments when the device camps on IWLAN in airplane mode. ++ * This method adds IWLAN registration info for legacy mode devices camped on IWLAN. It also ++ * makes some adjustments when the device camps on IWLAN in airplane mode. + */ + private void processIwlanRegistrationInfo() { + if (mCi.getRadioState() == TelephonyManager.RADIO_POWER_OFF) { +@@ -5517,7 +5522,7 @@ public class ServiceStateTracker extends Handler { + } + // operator info should be kept in SS + String operator = mNewSS.getOperatorAlphaLong(); +- mNewSS.setOutOfService(true); ++ mNewSS.setOutOfService(mAccessNetworksManager.isInLegacyMode(), true); + if (resetIwlanRatVal) { + mNewSS.setDataRegState(ServiceState.STATE_IN_SERVICE); + NetworkRegistrationInfo nri = new NetworkRegistrationInfo.Builder() +@@ -5527,6 +5532,17 @@ public class ServiceStateTracker extends Handler { + .setRegistrationState(NetworkRegistrationInfo.REGISTRATION_STATE_HOME) + .build(); + mNewSS.addNetworkRegistrationInfo(nri); ++ if (mAccessNetworksManager.isInLegacyMode()) { ++ // If in legacy mode, simulate the behavior that IWLAN registration info ++ // is reported through WWAN transport. ++ nri = new NetworkRegistrationInfo.Builder() ++ .setTransportType(AccessNetworkConstants.TRANSPORT_TYPE_WWAN) ++ .setDomain(NetworkRegistrationInfo.DOMAIN_PS) ++ .setAccessNetworkTechnology(TelephonyManager.NETWORK_TYPE_IWLAN) ++ .setRegistrationState(NetworkRegistrationInfo.REGISTRATION_STATE_HOME) ++ .build(); ++ mNewSS.addNetworkRegistrationInfo(nri); ++ } + mNewSS.setOperatorAlphaLong(operator); + // Since it's in airplane mode, cellular must be out of service. The only possible + // transport for data to go through is the IWLAN transport. Setting this to true +@@ -5536,6 +5552,31 @@ public class ServiceStateTracker extends Handler { + } + return; + } ++ ++ // If the device operates in legacy mode and camps on IWLAN, modem reports IWLAN as a RAT ++ // through WWAN registration info. To be consistent with the behavior with AP-assisted mode, ++ // we manually make a WLAN registration info for clients to consume. In this scenario, ++ // both WWAN and WLAN registration info are the IWLAN registration info and that's the ++ // unfortunate limitation we have when the device operates in legacy mode. In AP-assisted ++ // mode, the WWAN registration will correctly report the actual cellular registration info ++ // when the device camps on IWLAN. ++ if (mAccessNetworksManager.isInLegacyMode()) { ++ NetworkRegistrationInfo wwanNri = mNewSS.getNetworkRegistrationInfo( ++ NetworkRegistrationInfo.DOMAIN_PS, AccessNetworkConstants.TRANSPORT_TYPE_WWAN); ++ if (wwanNri != null && wwanNri.getAccessNetworkTechnology() ++ == TelephonyManager.NETWORK_TYPE_IWLAN) { ++ NetworkRegistrationInfo wlanNri = new NetworkRegistrationInfo.Builder() ++ .setTransportType(AccessNetworkConstants.TRANSPORT_TYPE_WLAN) ++ .setDomain(NetworkRegistrationInfo.DOMAIN_PS) ++ .setRegistrationState(wwanNri.getNetworkRegistrationState()) ++ .setAccessNetworkTechnology(TelephonyManager.NETWORK_TYPE_IWLAN) ++ .setRejectCause(wwanNri.getRejectCause()) ++ .setEmergencyOnly(wwanNri.isEmergencyEnabled()) ++ .setAvailableServices(wwanNri.getAvailableServices()) ++ .build(); ++ mNewSS.addNetworkRegistrationInfo(wlanNri); ++ } ++ } + } + + /** +diff --git a/src/java/com/android/internal/telephony/data/AccessNetworksManager.java b/src/java/com/android/internal/telephony/data/AccessNetworksManager.java +index 267f70b389..73f4c7b847 100644 +--- a/src/java/com/android/internal/telephony/data/AccessNetworksManager.java ++++ b/src/java/com/android/internal/telephony/data/AccessNetworksManager.java +@@ -16,9 +16,12 @@ + + package com.android.internal.telephony.data; + ++import static android.telephony.TelephonyManager.HAL_SERVICE_DATA; ++ + import android.annotation.CallbackExecutor; + import android.annotation.NonNull; + import android.annotation.Nullable; ++import android.annotation.StringDef; + import android.content.ComponentName; + import android.content.Context; + import android.content.Intent; +@@ -32,6 +35,7 @@ import android.os.PersistableBundle; + import android.os.Registrant; + import android.os.RegistrantList; + import android.os.RemoteException; ++import android.os.SystemProperties; + import android.telephony.AccessNetworkConstants; + import android.telephony.AccessNetworkConstants.AccessNetworkType; + import android.telephony.AccessNetworkConstants.RadioAccessNetworkType; +@@ -52,11 +56,14 @@ import android.util.LocalLog; + import android.util.SparseArray; + + import com.android.internal.telephony.Phone; ++import com.android.internal.telephony.RIL; + import com.android.internal.telephony.SlidingWindowEventCounter; + import com.android.telephony.Rlog; + + import java.io.FileDescriptor; + import java.io.PrintWriter; ++import java.lang.annotation.Retention; ++import java.lang.annotation.RetentionPolicy; + import java.util.ArrayList; + import java.util.Arrays; + import java.util.List; +@@ -74,6 +81,35 @@ import java.util.stream.Collectors; + */ + public class AccessNetworksManager extends Handler { + private static final boolean DBG = false; ++ public static final String SYSTEM_PROPERTIES_IWLAN_OPERATION_MODE = ++ "ro.telephony.iwlan_operation_mode"; ++ ++ @Retention(RetentionPolicy.SOURCE) ++ @StringDef(prefix = {"IWLAN_OPERATION_MODE_"}, ++ value = { ++ IWLAN_OPERATION_MODE_DEFAULT, ++ IWLAN_OPERATION_MODE_LEGACY, ++ IWLAN_OPERATION_MODE_AP_ASSISTED}) ++ public @interface IwlanOperationMode {} ++ ++ /** ++ * IWLAN default mode. On device that has IRadio 1.4 or above, it means ++ * {@link #IWLAN_OPERATION_MODE_AP_ASSISTED}. On device that has IRadio 1.3 or below, it means ++ * {@link #IWLAN_OPERATION_MODE_LEGACY}. ++ */ ++ public static final String IWLAN_OPERATION_MODE_DEFAULT = "default"; ++ ++ /** ++ * IWLAN legacy mode. IWLAN is completely handled by the modem, and when the device is on ++ * IWLAN, modem reports IWLAN as a RAT. ++ */ ++ public static final String IWLAN_OPERATION_MODE_LEGACY = "legacy"; ++ ++ /** ++ * IWLAN application processor assisted mode. IWLAN is handled by the bound IWLAN data service ++ * and network service separately. ++ */ ++ public static final String IWLAN_OPERATION_MODE_AP_ASSISTED = "AP-assisted"; + + /** Event to guide a transport type for initial data connection of emergency data network. */ + private static final int EVENT_GUIDE_TRANSPORT_TYPE_FOR_EMERGENCY = 1; +@@ -344,21 +380,29 @@ public class AccessNetworksManager extends Handler { + Context.CARRIER_CONFIG_SERVICE); + mLogTag = "ANM-" + mPhone.getPhoneId(); + mApnTypeToQnsChangeNetworkCounter = new SparseArray<>(); +- mAvailableTransports = new int[]{AccessNetworkConstants.TRANSPORT_TYPE_WWAN, +- AccessNetworkConstants.TRANSPORT_TYPE_WLAN}; +- +- // bindQualifiedNetworksService posts real work to handler thread. So here we can +- // let the callback execute in binder thread to avoid post twice. +- mCarrierConfigManager.registerCarrierConfigChangeListener(Runnable::run, +- (slotIndex, subId, carrierId, specificCarrierId) -> { +- if (slotIndex != mPhone.getPhoneId()) return; +- // We should wait for carrier config changed event because the target binding +- // package name can come from the carrier config. Note that we still get this +- // event even when SIM is absent. +- if (DBG) log("Carrier config changed. Try to bind qualified network service."); +- bindQualifiedNetworksService(); +- }); +- bindQualifiedNetworksService(); ++ if (isInLegacyMode()) { ++ log("operates in legacy mode."); ++ // For legacy mode, WWAN is the only transport to handle all data connections, even ++ // the IWLAN ones. ++ mAvailableTransports = new int[]{AccessNetworkConstants.TRANSPORT_TYPE_WWAN}; ++ } else { ++ log("operates in AP-assisted mode."); ++ mAvailableTransports = new int[]{AccessNetworkConstants.TRANSPORT_TYPE_WWAN, ++ AccessNetworkConstants.TRANSPORT_TYPE_WLAN}; ++ ++ // bindQualifiedNetworksService posts real work to handler thread. So here we can ++ // let the callback execute in binder thread to avoid post twice. ++ mCarrierConfigManager.registerCarrierConfigChangeListener(Runnable::run, ++ (slotIndex, subId, carrierId, specificCarrierId) -> { ++ if (slotIndex != mPhone.getPhoneId()) return; ++ // We should wait for carrier config changed event because the target binding ++ // package name can come from the carrier config. Note that we still get this ++ // event even when SIM is absent. ++ if (DBG) log("Carrier config changed. Try to bind qualified network service."); ++ bindQualifiedNetworksService(); ++ }); ++ bindQualifiedNetworksService(); ++ } + + // Using post to delay the registering because data retry manager and data config + // manager instances are created later than access networks manager. +@@ -463,7 +507,8 @@ public class AccessNetworksManager extends Handler { + /** + * Get the qualified network service package. + * +- * @return package name of the qualified networks service package. ++ * @return package name of the qualified networks service package. Return empty string when in ++ * legacy mode (i.e. Dedicated IWLAN data/network service is not supported). + */ + private String getQualifiedNetworksServicePackageName() { + // Read package name from the resource +@@ -552,9 +597,30 @@ public class AccessNetworksManager extends Handler { + } + + /** +- * @return The available transports. ++ * @return {@code true} if the device operates in legacy mode, otherwise {@code false}. + */ +- public @NonNull int[] getAvailableTransports() { ++ public boolean isInLegacyMode() { ++ // Get IWLAN operation mode from the system property. If the system property is configured ++ // to default or not configured, the mode is tied to IRadio version. For 1.4 or above, it's ++ // AP-assisted mode, for 1.3 or below, it's legacy mode. ++ String mode = SystemProperties.get(SYSTEM_PROPERTIES_IWLAN_OPERATION_MODE); ++ ++ if (mode.equals(IWLAN_OPERATION_MODE_AP_ASSISTED)) { ++ return false; ++ } else if (mode.equals(IWLAN_OPERATION_MODE_LEGACY)) { ++ return true; ++ } ++ ++ return mPhone.getHalVersion(HAL_SERVICE_DATA).less(RIL.RADIO_HAL_VERSION_1_4); ++ } ++ ++ /** ++ * @return The available transports. Note that on legacy devices, the only available transport ++ * would be WWAN only. If the device is configured as AP-assisted mode, the available transport ++ * will always be WWAN and WLAN (even if the device is not camped on IWLAN). ++ * See {@link #isInLegacyMode()} for mode details. ++ */ ++ public synchronized @NonNull int[] getAvailableTransports() { + return mAvailableTransports; + } + +@@ -589,6 +655,11 @@ public class AccessNetworksManager extends Handler { + * @return The preferred transport. + */ + public @TransportType int getPreferredTransport(@ApnType int apnType) { ++ // In legacy mode, always preferred on cellular. ++ if (isInLegacyMode()) { ++ return AccessNetworkConstants.TRANSPORT_TYPE_WWAN; ++ } ++ + return mPreferredTransports.get(apnType) == null + ? AccessNetworkConstants.TRANSPORT_TYPE_WWAN : mPreferredTransports.get(apnType); + } +@@ -691,6 +762,9 @@ public class AccessNetworksManager extends Handler { + } + + pw.decreaseIndent(); ++ pw.println("isInLegacy=" + isInLegacyMode()); ++ pw.println("IWLAN operation mode=" ++ + SystemProperties.get(SYSTEM_PROPERTIES_IWLAN_OPERATION_MODE)); + pw.println("Local logs="); + pw.increaseIndent(); + mLocalLog.dump(fd, pw, args); +diff --git a/src/java/com/android/internal/telephony/data/DataNetworkController.java b/src/java/com/android/internal/telephony/data/DataNetworkController.java +index 127400bb05..28ada4ab7a 100644 +--- a/src/java/com/android/internal/telephony/data/DataNetworkController.java ++++ b/src/java/com/android/internal/telephony/data/DataNetworkController.java +@@ -984,10 +984,12 @@ public class DataNetworkController extends Handler { + mDataServiceManagers.get(AccessNetworkConstants.TRANSPORT_TYPE_WWAN) + .registerForServiceBindingChanged(this, EVENT_DATA_SERVICE_BINDING_CHANGED); + +- mPhone.getServiceStateTracker().registerForServiceStateChanged(this, +- EVENT_SERVICE_STATE_CHANGED, null); +- mDataServiceManagers.get(AccessNetworkConstants.TRANSPORT_TYPE_WLAN) +- .registerForServiceBindingChanged(this, EVENT_DATA_SERVICE_BINDING_CHANGED); ++ if (!mAccessNetworksManager.isInLegacyMode()) { ++ mPhone.getServiceStateTracker().registerForServiceStateChanged(this, ++ EVENT_SERVICE_STATE_CHANGED, null); ++ mDataServiceManagers.get(AccessNetworkConstants.TRANSPORT_TYPE_WLAN) ++ .registerForServiceBindingChanged(this, EVENT_DATA_SERVICE_BINDING_CHANGED); ++ } + + mPhone.getContext().getSystemService(TelephonyRegistryManager.class) + .addOnSubscriptionsChangedListener(new OnSubscriptionsChangedListener() { +diff --git a/src/java/com/android/internal/telephony/imsphone/ImsPhone.java b/src/java/com/android/internal/telephony/imsphone/ImsPhone.java +index 4b150cc533..47f107e50e 100644 +--- a/src/java/com/android/internal/telephony/imsphone/ImsPhone.java ++++ b/src/java/com/android/internal/telephony/imsphone/ImsPhone.java +@@ -483,7 +483,11 @@ public class ImsPhone extends ImsPhoneBase { + mCT.registerPhoneStateListener(mExternalCallTracker); + mExternalCallTracker.setCallPuller(mCT); + +- mSS.setOutOfService(false); ++ boolean legacyMode = true; ++ if (mDefaultPhone.getAccessNetworksManager() != null) { ++ legacyMode = mDefaultPhone.getAccessNetworksManager().isInLegacyMode(); ++ } ++ mSS.setOutOfService(legacyMode, false); + + mPhoneId = mDefaultPhone.getPhoneId(); + +@@ -2405,7 +2409,7 @@ public class ImsPhone extends ImsPhoneBase { + /** + * Update roaming state and WFC mode in the following situations: + * 1) voice is in service. +- * 2) data is in service. ++ * 2) data is in service and it is not IWLAN (if in legacy mode). + * @param ss non-null ServiceState + */ + private void updateRoamingState(ServiceState ss) { +@@ -2426,7 +2430,15 @@ public class ImsPhone extends ImsPhoneBase { + logi("updateRoamingState: we are not IN_SERVICE, ignoring roaming change."); + return; + } +- ++ // We ignore roaming changes when moving to IWLAN because it always sets the roaming ++ // mode to home and masks the actual cellular roaming status if voice is not registered. If ++ // we just moved to IWLAN because WFC roaming mode is IWLAN preferred and WFC home mode is ++ // cell preferred, we can get into a condition where the modem keeps bouncing between ++ // IWLAN->cell->IWLAN->cell... ++ if (isCsNotInServiceAndPsWwanReportingWlan(ss)) { ++ logi("updateRoamingState: IWLAN masking roaming, ignore roaming change."); ++ return; ++ } + if (mCT.getState() == PhoneConstants.State.IDLE) { + if (DBG) logd("updateRoamingState now: " + newRoamingState); + mLastKnownRoamingState = newRoamingState; +@@ -2445,6 +2457,30 @@ public class ImsPhone extends ImsPhoneBase { + } + } + ++ /** ++ * In legacy mode, data registration will report IWLAN when we are using WLAN for data, ++ * effectively masking the true roaming state of the device if voice is not registered. ++ * ++ * @return true if we are reporting not in service for CS domain over WWAN transport and WLAN ++ * for PS domain over WWAN transport. ++ */ ++ private boolean isCsNotInServiceAndPsWwanReportingWlan(ServiceState ss) { ++ // We can not get into this condition if we are in AP-Assisted mode. ++ if (mDefaultPhone.getAccessNetworksManager() == null ++ || !mDefaultPhone.getAccessNetworksManager().isInLegacyMode()) { ++ return false; ++ } ++ NetworkRegistrationInfo csInfo = ss.getNetworkRegistrationInfo( ++ NetworkRegistrationInfo.DOMAIN_CS, AccessNetworkConstants.TRANSPORT_TYPE_WWAN); ++ NetworkRegistrationInfo psInfo = ss.getNetworkRegistrationInfo( ++ NetworkRegistrationInfo.DOMAIN_PS, AccessNetworkConstants.TRANSPORT_TYPE_WWAN); ++ // We will return roaming state correctly if the CS domain is in service because ++ // ss.getRoaming() returns isVoiceRoaming||isDataRoaming result and isDataRoaming==false ++ // when the modem reports IWLAN RAT. ++ return psInfo != null && csInfo != null && !csInfo.isInService() ++ && psInfo.getAccessNetworkTechnology() == TelephonyManager.NETWORK_TYPE_IWLAN; ++ } ++ + public RegistrationManager.RegistrationCallback getImsMmTelRegistrationCallback() { + return mImsMmTelRegistrationHelper.getCallback(); + } +-- +2.34.1 + 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 87991106..9f8a6eed 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 @@ -13,7 +13,7 @@ Change-Id: Ifb9a65fd77f21d15a8dc1ced9240194d38218ef6 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/system/gd/hci/hci_layer.cc b/system/gd/hci/hci_layer.cc -index c3312a557c..3e8ab78371 100644 +index c3312a557ce..3e8ab783714 100644 --- a/system/gd/hci/hci_layer.cc +++ b/system/gd/hci/hci_layer.cc @@ -211,14 +211,13 @@ struct HciLayer::impl { 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 bb5d4def..c62a4fb8 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 @@ -13,7 +13,7 @@ Change-Id: I59973e6ec84c5923be8a7c67b36b2e237f000860 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/system/audio_hal_interface/aidl/client_interface_aidl.cc b/system/audio_hal_interface/aidl/client_interface_aidl.cc -index 897b891aa7..ed41627c3e 100644 +index 897b891aa77..ed41627c3ed 100644 --- a/system/audio_hal_interface/aidl/client_interface_aidl.cc +++ b/system/audio_hal_interface/aidl/client_interface_aidl.cc @@ -56,7 +56,7 @@ BluetoothAudioClientInterface::BluetoothAudioClientInterface( @@ -53,7 +53,7 @@ index 897b891aa7..ed41627c3e 100644 if (provider_factory == nullptr) { LOG(ERROR) << __func__ << ", can't get aidl version from unknown factory"; diff --git a/system/audio_hal_interface/aidl/client_interface_aidl.h b/system/audio_hal_interface/aidl/client_interface_aidl.h -index 8a40c1d7d7..6d962d3473 100644 +index 8a40c1d7d75..6d962d3473b 100644 --- a/system/audio_hal_interface/aidl/client_interface_aidl.h +++ b/system/audio_hal_interface/aidl/client_interface_aidl.h @@ -28,6 +28,7 @@ @@ -78,7 +78,7 @@ index 8a40c1d7d7..6d962d3473 100644 private: IBluetoothTransportInstance* transport_; diff --git a/system/audio_hal_interface/hal_version_manager.cc b/system/audio_hal_interface/hal_version_manager.cc -index a2c192f37d..c3d1cf35c2 100644 +index a2c192f37d1..c3d1cf35c2c 100644 --- a/system/audio_hal_interface/hal_version_manager.cc +++ b/system/audio_hal_interface/hal_version_manager.cc @@ -24,6 +24,7 @@ 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 cf3b44e3..51085c28 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 @@ -15,7 +15,7 @@ Change-Id: I3e5897c2ce983042b9a4bef9def6744ba4253bcb 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/system/device/src/esco_parameters.cc b/system/device/src/esco_parameters.cc -index 48607e6d54..3b19d7c3ea 100644 +index 48607e6d54a..3b19d7c3eaf 100644 --- a/system/device/src/esco_parameters.cc +++ b/system/device/src/esco_parameters.cc @@ -22,7 +22,8 @@ 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 1414f879..3f7bbeae 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 @@ -19,7 +19,7 @@ Change-Id: Id25dac186628e933185bdfd640498004459b375a 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/system/btif/src/btif_a2dp_sink.cc b/system/btif/src/btif_a2dp_sink.cc -index fb7e8f3607..2d68d49c84 100644 +index fb7e8f3607c..2d68d49c844 100644 --- a/system/btif/src/btif_a2dp_sink.cc +++ b/system/btif/src/btif_a2dp_sink.cc @@ -197,7 +197,7 @@ bool btif_a2dp_sink_init() { @@ -32,7 +32,7 @@ index fb7e8f3607..2d68d49c84 100644 #endif } diff --git a/system/btif/src/btif_a2dp_source.cc b/system/btif/src/btif_a2dp_source.cc -index 2a538390fb..1b0ffab492 100644 +index 2a538390fba..1b0ffab4929 100644 --- a/system/btif/src/btif_a2dp_source.cc +++ b/system/btif/src/btif_a2dp_source.cc @@ -365,7 +365,7 @@ static void btif_a2dp_source_startup_delayed() { @@ -45,7 +45,7 @@ index 2a538390fb..1b0ffab492 100644 } if (!bluetooth::audio::a2dp::init(&btif_a2dp_source_thread)) { diff --git a/system/osi/src/alarm.cc b/system/osi/src/alarm.cc -index 2f0a27ea71..ec0f71c232 100644 +index 2f0a27ea71c..ec0f71c232a 100644 --- a/system/osi/src/alarm.cc +++ b/system/osi/src/alarm.cc @@ -678,7 +678,17 @@ static bool timer_create_internal(const clockid_t clock_id, timer_t* timer) { @@ -68,7 +68,7 @@ index 2f0a27ea71..ec0f71c232 100644 strerror(errno)); if (clock_id == CLOCK_BOOTTIME_ALARM) { diff --git a/system/stack/btu/btu_task.cc b/system/stack/btu/btu_task.cc -index 2aa2510c04..e50de320c4 100644 +index 2aa2510c046..e50de320c40 100644 --- a/system/stack/btu/btu_task.cc +++ b/system/stack/btu/btu_task.cc @@ -122,7 +122,7 @@ void main_thread_start_up() { 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 c49c604c..ba441971 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 @@ -12,7 +12,7 @@ Change-Id: I7802b7a29c017a2cd7018e82772183df1dfa0b89 1 file changed, 8 insertions(+) diff --git a/android/app/src/com/android/bluetooth/hfp/HeadsetStateMachine.java b/android/app/src/com/android/bluetooth/hfp/HeadsetStateMachine.java -index 57eb9aff4c..fbe29415b8 100644 +index 57eb9aff4cf..fbe29415b8e 100644 --- a/android/app/src/com/android/bluetooth/hfp/HeadsetStateMachine.java +++ b/android/app/src/com/android/bluetooth/hfp/HeadsetStateMachine.java @@ -151,6 +151,7 @@ public class HeadsetStateMachine extends StateMachine { diff --git a/patches/trebledroid/platform_packages_modules_Bluetooth/0006-Add-properties-to-disable-some-features-commands-sta.patch b/patches/trebledroid/platform_packages_modules_Bluetooth/0006-Add-properties-to-disable-some-features-commands-sta.patch index b625a640..e9b7648a 100644 --- a/patches/trebledroid/platform_packages_modules_Bluetooth/0006-Add-properties-to-disable-some-features-commands-sta.patch +++ b/patches/trebledroid/platform_packages_modules_Bluetooth/0006-Add-properties-to-disable-some-features-commands-sta.patch @@ -9,7 +9,7 @@ Subject: [PATCH 6/7] Add properties to disable some features/commands/states 1 file changed, 68 insertions(+), 4 deletions(-) diff --git a/system/gd/hci/controller.cc b/system/gd/hci/controller.cc -index c08ecab9d5..66b7de6b5e 100644 +index c08ecab9d55..66b7de6b5e2 100644 --- a/system/gd/hci/controller.cc +++ b/system/gd/hci/controller.cc @@ -16,6 +16,7 @@ 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 664ae6d9..4f212bfe 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 @@ -9,7 +9,7 @@ Subject: [PATCH 7/7] Add a property to cap declared le vendor version. Found 1 file changed, 11 insertions(+) diff --git a/system/gd/hci/controller.cc b/system/gd/hci/controller.cc -index 66b7de6b5e..a51382cd0d 100644 +index 66b7de6b5e2..a51382cd0d8 100644 --- a/system/gd/hci/controller.cc +++ b/system/gd/hci/controller.cc @@ -603,6 +603,13 @@ struct Controller::impl {