From edbcfc74f228d67d361dd378b563b510488a9976 Mon Sep 17 00:00:00 2001 From: Peter Cai Date: Sat, 7 Oct 2023 19:36:35 -0400 Subject: [PATCH 1/3] [2/n] Android 14 port --- ...s-static-ImsManager.updateImsService.patch | 8 +-- ...c-void-TelephonyMetrics.writeRilSen.patch} | 6 +- ...roller-Do-not-override-default-calli.patch | 45 -------------- ...e-to-setPreferredNetworkType-for-RI.patch} | 16 ++--- ...g-too-long-to-fit-into-a-91-chars-p.patch} | 10 ++-- ...vert-Block-Binder-thread-until-incom.patch | 29 +++++----- ...roller-Do-not-override-default-calli.patch | 58 +++++++++++++++++++ 7 files changed, 91 insertions(+), 81 deletions(-) rename frameworks/opt/telephony/{0002-Reintroduce-public-void-TelephonyMetrics.writeRilSen.patch => 0001-Reintroduce-public-void-TelephonyMetrics.writeRilSen.patch} (94%) delete mode 100644 frameworks/opt/telephony/0001-SubscriptionController-Do-not-override-default-calli.patch rename frameworks/opt/telephony/{0003-Pass-correct-value-to-setPreferredNetworkType-for-RI.patch => 0002-Pass-correct-value-to-setPreferredNetworkType-for-RI.patch} (84%) rename frameworks/opt/telephony/{0005-Fix-baseband-being-too-long-to-fit-into-a-91-chars-p.patch => 0003-Fix-baseband-being-too-long-to-fit-into-a-91-chars-p.patch} (83%) create mode 100644 frameworks/opt/telephony/0005-SubscriptionController-Do-not-override-default-calli.patch diff --git a/frameworks/opt/net/ims/0001-Pie-MTK-IMS-calls-static-ImsManager.updateImsService.patch b/frameworks/opt/net/ims/0001-Pie-MTK-IMS-calls-static-ImsManager.updateImsService.patch index cea2729..732d74a 100644 --- a/frameworks/opt/net/ims/0001-Pie-MTK-IMS-calls-static-ImsManager.updateImsService.patch +++ b/frameworks/opt/net/ims/0001-Pie-MTK-IMS-calls-static-ImsManager.updateImsService.patch @@ -1,4 +1,4 @@ -From 9f88617d1af3f068efdff111984a7a631464a205 Mon Sep 17 00:00:00 2001 +From 45ee12fd0ac92b5e6a07de927716b8b03c18f1fd Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Sun, 14 Nov 2021 13:47:29 -0500 Subject: [PATCH] Pie MTK IMS calls static @@ -10,10 +10,10 @@ Change-Id: I3dd66d436629d37c8ec795df6569736195ae570e 1 file changed, 8 insertions(+) diff --git a/src/java/com/android/ims/ImsManager.java b/src/java/com/android/ims/ImsManager.java -index c41426d0..2c6d656f 100644 +index b5a1168b..547a3a16 100644 --- a/src/java/com/android/ims/ImsManager.java +++ b/src/java/com/android/ims/ImsManager.java -@@ -1667,6 +1667,14 @@ public class ImsManager implements FeatureUpdates { +@@ -1666,6 +1666,14 @@ public class ImsManager implements FeatureUpdates { } } @@ -29,5 +29,5 @@ index c41426d0..2c6d656f 100644 * Push configuration updates to the ImsService implementation. */ -- -2.40.0 +2.41.0 diff --git a/frameworks/opt/telephony/0002-Reintroduce-public-void-TelephonyMetrics.writeRilSen.patch b/frameworks/opt/telephony/0001-Reintroduce-public-void-TelephonyMetrics.writeRilSen.patch similarity index 94% rename from frameworks/opt/telephony/0002-Reintroduce-public-void-TelephonyMetrics.writeRilSen.patch rename to frameworks/opt/telephony/0001-Reintroduce-public-void-TelephonyMetrics.writeRilSen.patch index 6dc0420..c7c6822 100644 --- a/frameworks/opt/telephony/0002-Reintroduce-public-void-TelephonyMetrics.writeRilSen.patch +++ b/frameworks/opt/telephony/0001-Reintroduce-public-void-TelephonyMetrics.writeRilSen.patch @@ -1,7 +1,7 @@ -From bcaff4d8a493c657519ae50cf7f3661da6c4a46b Mon Sep 17 00:00:00 2001 +From d8c305abadf223aef7237029d9b58c6756922a7d 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 2/5] Reintroduce 'public void +Subject: [PATCH 1/5] 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) @@ -42,5 +42,5 @@ index 3fdbfe0ed7..fb8011c3df 100644 * Write Send SMS event using ImsService. Expecting response from * {@link #writeOnSmsSolicitedResponse}. -- -2.40.0 +2.41.0 diff --git a/frameworks/opt/telephony/0001-SubscriptionController-Do-not-override-default-calli.patch b/frameworks/opt/telephony/0001-SubscriptionController-Do-not-override-default-calli.patch deleted file mode 100644 index 6bb0898..0000000 --- a/frameworks/opt/telephony/0001-SubscriptionController-Do-not-override-default-calli.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 02041484d88e3c8a6cd62e1253f4b12b15be6852 Mon Sep 17 00:00:00 2001 -From: Peter Cai -Date: Mon, 5 Sep 2022 14:02:37 -0400 -Subject: [PATCH 1/5] 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 -default, it should not be overridden by the rest of the telephony -subsystem (e.g. SIM subcription updates, or default SIM slot selection). - -Otherwise, it creates a somewhat annoying situation where the user has -to keep re-selecting the desired calling account after every reboot. - -Test: manual -Change-Id: Iccab64e9b3b3ab4773bd8944d47c2006f229d472 ---- - .../internal/telephony/SubscriptionController.java | 11 ++++++++++- - 1 file changed, 10 insertions(+), 1 deletion(-) - -diff --git a/src/java/com/android/internal/telephony/SubscriptionController.java b/src/java/com/android/internal/telephony/SubscriptionController.java -index 82799bea8b..5105d3a183 100644 ---- a/src/java/com/android/internal/telephony/SubscriptionController.java -+++ b/src/java/com/android/internal/telephony/SubscriptionController.java -@@ -2855,8 +2855,17 @@ public class SubscriptionController extends ISub.Stub { - subId); - - TelecomManager telecomManager = mContext.getSystemService(TelecomManager.class); -+ PhoneAccountHandle currentHandle = telecomManager.getUserSelectedOutgoingPhoneAccount(); -+ String currentPackageName = -+ currentHandle == null ? null : currentHandle.getComponentName().getPackageName(); -+ boolean currentIsSim = "com.android.phone".equals(currentPackageName); -+ // Do not override user selected outgoing calling account -+ // if the user has selected a third-party app as default -+ boolean shouldKeepOutgoingAccount = currentHandle != null && !currentIsSim; - -- telecomManager.setUserSelectedOutgoingPhoneAccount(newHandle); -+ if (!shouldKeepOutgoingAccount) { -+ telecomManager.setUserSelectedOutgoingPhoneAccount(newHandle); -+ } - logd("[setDefaultVoiceSubId] requesting change to phoneAccountHandle=" + newHandle); - - if (previousDefaultSub != getDefaultSubId()) { --- -2.40.0 - diff --git a/frameworks/opt/telephony/0003-Pass-correct-value-to-setPreferredNetworkType-for-RI.patch b/frameworks/opt/telephony/0002-Pass-correct-value-to-setPreferredNetworkType-for-RI.patch similarity index 84% rename from frameworks/opt/telephony/0003-Pass-correct-value-to-setPreferredNetworkType-for-RI.patch rename to frameworks/opt/telephony/0002-Pass-correct-value-to-setPreferredNetworkType-for-RI.patch index c070a86..7eba6ed 100644 --- a/frameworks/opt/telephony/0003-Pass-correct-value-to-setPreferredNetworkType-for-RI.patch +++ b/frameworks/opt/telephony/0002-Pass-correct-value-to-setPreferredNetworkType-for-RI.patch @@ -1,7 +1,7 @@ -From 9550951ff96e643d143da826cb9560da572850a1 Mon Sep 17 00:00:00 2001 +From b299cb6cb26268d1a0a58b8df42ea334d7bdc950 Mon Sep 17 00:00:00 2001 From: LuK1337 Date: Fri, 21 Oct 2022 20:55:05 +0200 -Subject: [PATCH 3/5] Pass correct value to setPreferredNetworkType() for RIL +Subject: [PATCH 2/5] Pass correct value to setPreferredNetworkType() for RIL version < 1.4 Change-Id: Id14be66a2ea4e85b6504bc03fd7d2f038185c17d @@ -11,10 +11,10 @@ Change-Id: Id14be66a2ea4e85b6504bc03fd7d2f038185c17d 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/java/com/android/internal/telephony/RIL.java b/src/java/com/android/internal/telephony/RIL.java -index 6de66527e1..0c1b7cdf8c 100644 +index 5ecdfcbbd4..174b89c141 100644 --- a/src/java/com/android/internal/telephony/RIL.java +++ b/src/java/com/android/internal/telephony/RIL.java -@@ -2879,7 +2879,8 @@ public class RIL extends BaseCommands implements CommandsInterface { +@@ -3027,7 +3027,8 @@ public class RIL extends BaseCommands implements CommandsInterface { mMetrics.writeSetPreferredNetworkType(mPhoneId, networkType); try { @@ -22,13 +22,13 @@ index 6de66527e1..0c1b7cdf8c 100644 + networkProxy.setPreferredNetworkTypeBitmap( + rr.mSerial, mAllowedNetworkTypesBitmask, networkType); } catch (RemoteException | RuntimeException e) { - handleRadioProxyExceptionForRR(NETWORK_SERVICE, "setPreferredNetworkType", e); + handleRadioProxyExceptionForRR(HAL_SERVICE_NETWORK, "setPreferredNetworkType", e); } diff --git a/src/java/com/android/internal/telephony/RadioNetworkProxy.java b/src/java/com/android/internal/telephony/RadioNetworkProxy.java -index b88103510a..661fa56954 100644 +index 246c2e0204..2e352a96b4 100644 --- a/src/java/com/android/internal/telephony/RadioNetworkProxy.java +++ b/src/java/com/android/internal/telephony/RadioNetworkProxy.java -@@ -379,16 +379,17 @@ public class RadioNetworkProxy extends RadioServiceProxy { +@@ -389,16 +389,17 @@ public class RadioNetworkProxy extends RadioServiceProxy { * Call IRadioNetwork#setPreferredNetworkTypeBitmap * @param serial Serial number of request * @param networkTypesBitmask Preferred network types bitmask to set @@ -49,5 +49,5 @@ index b88103510a..661fa56954 100644 } -- -2.40.0 +2.41.0 diff --git a/frameworks/opt/telephony/0005-Fix-baseband-being-too-long-to-fit-into-a-91-chars-p.patch b/frameworks/opt/telephony/0003-Fix-baseband-being-too-long-to-fit-into-a-91-chars-p.patch similarity index 83% rename from frameworks/opt/telephony/0005-Fix-baseband-being-too-long-to-fit-into-a-91-chars-p.patch rename to frameworks/opt/telephony/0003-Fix-baseband-being-too-long-to-fit-into-a-91-chars-p.patch index 9210d5e..a7f9bd6 100644 --- a/frameworks/opt/telephony/0005-Fix-baseband-being-too-long-to-fit-into-a-91-chars-p.patch +++ b/frameworks/opt/telephony/0003-Fix-baseband-being-too-long-to-fit-into-a-91-chars-p.patch @@ -1,7 +1,7 @@ -From 53160d33c83afe4f56862c3c12d4b61e2970209b Mon Sep 17 00:00:00 2001 +From 2861b7ed720286f3a69782d4fc18128e742d8949 Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Mon, 6 Dec 2021 16:28:22 -0500 -Subject: [PATCH 5/5] Fix baseband being too long to fit into a 91 chars +Subject: [PATCH 3/5] Fix baseband being too long to fit into a 91 chars property, preventing telephony subsystem from starting Change-Id: I1762e4a8cc137626be89f350229d6be162bdaf57 @@ -10,10 +10,10 @@ Change-Id: I1762e4a8cc137626be89f350229d6be162bdaf57 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/java/com/android/internal/telephony/GsmCdmaPhone.java b/src/java/com/android/internal/telephony/GsmCdmaPhone.java -index 76a8d57246..9a72712c59 100644 +index 5eae06112c..d5302413bc 100644 --- a/src/java/com/android/internal/telephony/GsmCdmaPhone.java +++ b/src/java/com/android/internal/telephony/GsmCdmaPhone.java -@@ -3124,7 +3124,7 @@ public class GsmCdmaPhone extends Phone { +@@ -3282,7 +3282,7 @@ public class GsmCdmaPhone extends Phone { String version = (String)ar.result; if (version != null) { int length = version.length(); @@ -23,5 +23,5 @@ index 76a8d57246..9a72712c59 100644 length <= MAX_VERSION_LEN ? version : version.substring(length - MAX_VERSION_LEN, length)); -- -2.40.0 +2.41.0 diff --git a/frameworks/opt/telephony/0004-Conditionally-revert-Block-Binder-thread-until-incom.patch b/frameworks/opt/telephony/0004-Conditionally-revert-Block-Binder-thread-until-incom.patch index 5e1d94d..8870493 100644 --- a/frameworks/opt/telephony/0004-Conditionally-revert-Block-Binder-thread-until-incom.patch +++ b/frameworks/opt/telephony/0004-Conditionally-revert-Block-Binder-thread-until-incom.patch @@ -1,4 +1,4 @@ -From c527732943bc02fd434cbecbd07787e2d429023d Mon Sep 17 00:00:00 2001 +From ec5993b869fc758bd48c1636ee009bad8d4205bf Mon Sep 17 00:00:00 2001 From: ExactExampl Date: Tue, 11 Oct 2022 12:38:00 +0300 Subject: [PATCH 4/5] Conditionally revert "Block Binder thread until incoming @@ -13,14 +13,14 @@ This conditionally reverts commit 75c3dc9ba272b43971f519caba0382f9871c7d9d. Change-Id: I55a8f3bbca4a2b9a6bc7511e9fe2d0884a8818e5 --- - .../imsphone/ImsPhoneCallTracker.java | 18 ++++++++++++++---- - 1 file changed, 14 insertions(+), 4 deletions(-) + .../telephony/imsphone/ImsPhoneCallTracker.java | 15 ++++++++++++++- + 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/java/com/android/internal/telephony/imsphone/ImsPhoneCallTracker.java b/src/java/com/android/internal/telephony/imsphone/ImsPhoneCallTracker.java -index 5968ba6fa1..86034f6fa1 100644 +index c3ee0f6060..f11b921c08 100644 --- a/src/java/com/android/internal/telephony/imsphone/ImsPhoneCallTracker.java +++ b/src/java/com/android/internal/telephony/imsphone/ImsPhoneCallTracker.java -@@ -50,6 +50,7 @@ import android.os.Registrant; +@@ -70,6 +70,7 @@ import android.os.Registrant; import android.os.RegistrantList; import android.os.RemoteException; import android.os.SystemClock; @@ -28,30 +28,27 @@ index 5968ba6fa1..86034f6fa1 100644 import android.preference.PreferenceManager; import android.provider.Settings; import android.sysprop.TelephonyProperties; -@@ -322,10 +323,19 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall { - - @Override - public void onIncomingCall(IImsCallSession c, Bundle extras) { -- // we want to ensure we block this binder thread until incoming call setup completes -- // as to avoid race conditions where the ImsService tries to update the state of the -- // call before the listeners have been attached. -- executeAndWait(()-> processIncomingCall(c, extras)); +@@ -385,7 +386,19 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall { + @Nullable + public IImsCallSessionListener onIncomingCall( + @NonNull IImsCallSession c, @Nullable String callId, @Nullable Bundle extras) { +- return executeAndWaitForReturn(()-> processIncomingCall(c, callId, extras)); + final boolean shouldBlockBinderThreadOnIncomingCalls = SystemProperties.getBoolean( + "ro.telephony.block_binder_thread_on_incoming_calls", true); + if (shouldBlockBinderThreadOnIncomingCalls) { + // we want to ensure we block this binder thread until incoming call setup completes + // as to avoid race conditions where the ImsService tries to update the state of the + // call before the listeners have been attached. -+ executeAndWait(()-> processIncomingCall(c, extras)); ++ return executeAndWaitForReturn(()-> processIncomingCall(c, callId, extras)); + } else { + // for legacy IMS we want to avoid blocking the binder thread, otherwise + // we end up with half dead incoming calls with unattached call session -+ TelephonyUtils.runWithCleanCallingIdentity(()-> processIncomingCall(c, extras), ++ return TelephonyUtils.runWithCleanCallingIdentity(()-> processIncomingCall(c, callId, extras), + mExecutor); + } } @Override -- -2.40.0 +2.41.0 diff --git a/frameworks/opt/telephony/0005-SubscriptionController-Do-not-override-default-calli.patch b/frameworks/opt/telephony/0005-SubscriptionController-Do-not-override-default-calli.patch new file mode 100644 index 0000000..32fe8b6 --- /dev/null +++ b/frameworks/opt/telephony/0005-SubscriptionController-Do-not-override-default-calli.patch @@ -0,0 +1,58 @@ +From 2685c843046fcfb12b42f530ed4d5b8fa28cdc9e Mon Sep 17 00:00:00 2001 +From: Peter Cai +Date: Mon, 5 Sep 2022 14:02:37 -0400 +Subject: [PATCH 5/5] 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 +default, it should not be overridden by the rest of the telephony +subsystem (e.g. SIM subcription updates, or default SIM slot selection). + +Otherwise, it creates a somewhat annoying situation where the user has +to keep re-selecting the desired calling account after every reboot. + +Test: manual +Change-Id: Iccab64e9b3b3ab4773bd8944d47c2006f229d472 +--- + .../SubscriptionManagerService.java | 18 +++++++++++++++++- + 1 file changed, 17 insertions(+), 1 deletion(-) + +diff --git a/src/java/com/android/internal/telephony/subscription/SubscriptionManagerService.java b/src/java/com/android/internal/telephony/subscription/SubscriptionManagerService.java +index 8e773c072d..1efe9ba3b4 100644 +--- a/src/java/com/android/internal/telephony/subscription/SubscriptionManagerService.java ++++ b/src/java/com/android/internal/telephony/subscription/SubscriptionManagerService.java +@@ -78,6 +78,7 @@ import android.util.Base64; + import android.util.EventLog; + import android.util.IndentingPrintWriter; + import android.util.LocalLog; ++import android.util.Log; + + import com.android.internal.R; + import com.android.internal.annotations.VisibleForTesting; +@@ -2839,7 +2840,22 @@ public class SubscriptionManagerService extends ISub.Stub { + + TelecomManager telecomManager = mContext.getSystemService(TelecomManager.class); + if (telecomManager != null) { +- telecomManager.setUserSelectedOutgoingPhoneAccount(newHandle); ++ PhoneAccountHandle currentHandle = telecomManager.getUserSelectedOutgoingPhoneAccount(); ++ log("[setDefaultVoiceSubId] current phoneAccountHandle=" + currentHandle); ++ ++ String currentPackageName = ++ currentHandle == null ? null : currentHandle.getComponentName().getPackageName(); ++ boolean currentIsSim = "com.android.phone".equals(currentPackageName); ++ // Do not override user selected outgoing calling account ++ // if the user has selected a third-party app as default ++ boolean shouldKeepOutgoingAccount = currentHandle != null && !currentIsSim; ++ ++ if (!shouldKeepOutgoingAccount) { ++ telecomManager.setUserSelectedOutgoingPhoneAccount(newHandle); ++ log("[setDefaultVoiceSubId] change to phoneAccountHandle=" + newHandle); ++ } else { ++ log("[setDefaultVoiceSubId] default phoneAccountHandle not changed."); ++ } + } + + updateDefaultSubId(); +-- +2.41.0 + From c06b6e26a20913e1549bc6df3bb9f30081e0677f Mon Sep 17 00:00:00 2001 From: Peter Cai Date: Sat, 7 Oct 2023 19:38:33 -0400 Subject: [PATCH 2/3] [3/n] Android 14 port More required fwb patches --- ...support-glob-matching-for-properties.patch | 2 +- ...d-support-for-app-signature-spoofing.patch | 2 +- ...PackageUtils-Add-glob-matching-suppo.patch | 2 +- .../base/0004-Global-VPN-feature-1-2.patch | 2 +- ...more-FDE-methods-from-StorageManager.patch | 110 ++++++++++++++++++ ...ze-boot-animation-to-match-screen-si.patch | 46 ++++++++ ...ateForSlotIndex-in-SubscriptionManag.patch | 40 +++++++ ...CallingIdentity-variant-with-both-ex.patch | 72 ++++++++++++ 8 files changed, 272 insertions(+), 4 deletions(-) create mode 100644 frameworks/base/0005-Revert-Remove-more-FDE-methods-from-StorageManager.patch create mode 100644 frameworks/base/0006-Dynamically-resize-boot-animation-to-match-screen-si.patch create mode 100644 frameworks/base/0007-Restore-getSimStateForSlotIndex-in-SubscriptionManag.patch create mode 100644 frameworks/base/0008-Add-runWithCleanCallingIdentity-variant-with-both-ex.patch diff --git a/frameworks/base/0001-PackageParser-support-glob-matching-for-properties.patch b/frameworks/base/0001-PackageParser-support-glob-matching-for-properties.patch index cea0159..bedcf73 100644 --- a/frameworks/base/0001-PackageParser-support-glob-matching-for-properties.patch +++ b/frameworks/base/0001-PackageParser-support-glob-matching-for-properties.patch @@ -1,7 +1,7 @@ From c25e4bfafc3b0b9f44c9cd2b9fed590299480f71 Mon Sep 17 00:00:00 2001 From: Peter Cai Date: Tue, 12 Oct 2021 21:37:22 -0400 -Subject: [PATCH 1/4] PackageParser: support glob matching for properties +Subject: [PATCH 1/8] PackageParser: support glob matching for properties Needed to make phh's vendor overlays work --- diff --git a/frameworks/base/0002-Add-support-for-app-signature-spoofing.patch b/frameworks/base/0002-Add-support-for-app-signature-spoofing.patch index d2fe6b4..e986653 100644 --- a/frameworks/base/0002-Add-support-for-app-signature-spoofing.patch +++ b/frameworks/base/0002-Add-support-for-app-signature-spoofing.patch @@ -1,7 +1,7 @@ From 540857efdf49ba24121970d2b836eb38ab7e7b32 Mon Sep 17 00:00:00 2001 From: Danny Lin Date: Sat, 16 Oct 2021 05:27:57 -0700 -Subject: [PATCH 2/4] Add support for app signature spoofing +Subject: [PATCH 2/8] 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/frameworks/base/0003-FrameworkParsingPackageUtils-Add-glob-matching-suppo.patch b/frameworks/base/0003-FrameworkParsingPackageUtils-Add-glob-matching-suppo.patch index ccecbe6..4e6cc3c 100644 --- a/frameworks/base/0003-FrameworkParsingPackageUtils-Add-glob-matching-suppo.patch +++ b/frameworks/base/0003-FrameworkParsingPackageUtils-Add-glob-matching-suppo.patch @@ -1,7 +1,7 @@ From 148fe28e381f444f7d06ea611dbd82c1e1ae8573 Mon Sep 17 00:00:00 2001 From: Peter Cai Date: Fri, 2 Sep 2022 21:36:06 -0400 -Subject: [PATCH 3/4] FrameworkParsingPackageUtils: Add glob matching support +Subject: [PATCH 3/8] FrameworkParsingPackageUtils: Add glob matching support for properties This is now required in addition to the one in PackageParser in order diff --git a/frameworks/base/0004-Global-VPN-feature-1-2.patch b/frameworks/base/0004-Global-VPN-feature-1-2.patch index 173de2b..c777a2b 100644 --- a/frameworks/base/0004-Global-VPN-feature-1-2.patch +++ b/frameworks/base/0004-Global-VPN-feature-1-2.patch @@ -1,7 +1,7 @@ From 00b72ce36c74f294e9823a41c0f50f73d435b1dd Mon Sep 17 00:00:00 2001 From: Oliver Scott Date: Thu, 8 Jul 2021 10:41:43 -0400 -Subject: [PATCH 4/4] Global VPN feature [1/2] +Subject: [PATCH 4/8] Global VPN feature [1/2] * Modify existing VPN user range functions to conditionally have traffic from all users pass through the global VPN. diff --git a/frameworks/base/0005-Revert-Remove-more-FDE-methods-from-StorageManager.patch b/frameworks/base/0005-Revert-Remove-more-FDE-methods-from-StorageManager.patch new file mode 100644 index 0000000..8f664c6 --- /dev/null +++ b/frameworks/base/0005-Revert-Remove-more-FDE-methods-from-StorageManager.patch @@ -0,0 +1,110 @@ +From aa7e0467d0c5c98a9de336ef8e3e635491c8395a Mon Sep 17 00:00:00 2001 +From: Andy CrossGate Yan +Date: Sat, 15 Oct 2022 09:33:56 +0000 +Subject: [PATCH 5/8] Revert "Remove more FDE methods from StorageManager" + +This reverts commit bd13f84152449a3ead6fa8604fd31f48c0224676. + +Change-Id: Ic394934ec27b1a486c60123130825d44dad73412 +--- + .../android/os/storage/StorageManager.java | 57 +++++++++++++++++++ + .../internal/os/RoSystemProperties.java | 4 ++ + 2 files changed, 61 insertions(+) + +diff --git a/core/java/android/os/storage/StorageManager.java b/core/java/android/os/storage/StorageManager.java +index 80dd48825ba7..cb4769ff4ec3 100644 +--- a/core/java/android/os/storage/StorageManager.java ++++ b/core/java/android/os/storage/StorageManager.java +@@ -1660,6 +1660,15 @@ public class StorageManager { + return false; + } + ++ /** {@hide} ++ * Is this device encryptable or already encrypted? ++ * @return true for encryptable or encrypted ++ * false not encrypted and not encryptable ++ */ ++ public static boolean isEncryptable() { ++ return RoSystemProperties.CRYPTO_ENCRYPTABLE; ++ } ++ + /** {@hide} + * Is this device encrypted? + *

+@@ -1693,6 +1702,54 @@ public class StorageManager { + return isFileEncrypted(); + } + ++ /** {@hide} ++ * Is this device block encrypted? ++ * @return true for block encrypted. (Implies isEncrypted() == true) ++ * false not encrypted or file encrypted ++ */ ++ public static boolean isBlockEncrypted() { ++ return false; ++ } ++ ++ /** {@hide} ++ * Is this device block encrypted with credentials? ++ * @return true for crediential block encrypted. ++ * (Implies isBlockEncrypted() == true) ++ * false not encrypted, file encrypted or default block encrypted ++ */ ++ public static boolean isNonDefaultBlockEncrypted() { ++ return false; ++ } ++ ++ /** {@hide} ++ * Is this device in the process of being block encrypted? ++ * @return true for encrypting. ++ * false otherwise ++ * Whether device isEncrypted at this point is undefined ++ * Note that only system services and CryptKeeper will ever see this return ++ * true - no app will ever be launched in this state. ++ * Also note that this state will not change without a teardown of the ++ * framework, so no service needs to check for changes during their lifespan ++ */ ++ public static boolean isBlockEncrypting() { ++ return false; ++ } ++ ++ /** {@hide} ++ * Is this device non default block encrypted and in the process of ++ * prompting for credentials? ++ * @return true for prompting for credentials. ++ * (Implies isNonDefaultBlockEncrypted() == true) ++ * false otherwise ++ * Note that only system services and CryptKeeper will ever see this return ++ * true - no app will ever be launched in this state. ++ * Also note that this state will not change without a teardown of the ++ * framework, so no service needs to check for changes during their lifespan ++ */ ++ public static boolean inCryptKeeperBounce() { ++ return false; ++ } ++ + /** {@hide} + * @deprecated Use {@link #isFileEncrypted} instead, since emulated FBE is no longer supported. + */ +diff --git a/core/java/com/android/internal/os/RoSystemProperties.java b/core/java/com/android/internal/os/RoSystemProperties.java +index 40d5c4761dff..66288706b0f1 100644 +--- a/core/java/com/android/internal/os/RoSystemProperties.java ++++ b/core/java/com/android/internal/os/RoSystemProperties.java +@@ -68,10 +68,14 @@ public class RoSystemProperties { + public static final CryptoProperties.type_values CRYPTO_TYPE = + CryptoProperties.type().orElse(CryptoProperties.type_values.NONE); + // These are pseudo-properties ++ public static final boolean CRYPTO_ENCRYPTABLE = ++ CRYPTO_STATE != CryptoProperties.state_values.UNSUPPORTED; + public static final boolean CRYPTO_ENCRYPTED = + CRYPTO_STATE == CryptoProperties.state_values.ENCRYPTED; + public static final boolean CRYPTO_FILE_ENCRYPTED = + CRYPTO_TYPE == CryptoProperties.type_values.FILE; ++ public static final boolean CRYPTO_BLOCK_ENCRYPTED = ++ CRYPTO_TYPE == CryptoProperties.type_values.BLOCK; + + public static final boolean CONTROL_PRIVAPP_PERMISSIONS_LOG = + "log".equalsIgnoreCase(CONTROL_PRIVAPP_PERMISSIONS); +-- +2.41.0 + diff --git a/frameworks/base/0006-Dynamically-resize-boot-animation-to-match-screen-si.patch b/frameworks/base/0006-Dynamically-resize-boot-animation-to-match-screen-si.patch new file mode 100644 index 0000000..ac1b186 --- /dev/null +++ b/frameworks/base/0006-Dynamically-resize-boot-animation-to-match-screen-si.patch @@ -0,0 +1,46 @@ +From 5c0f50bd093ad8fa878b79d124942d1a5bceef00 Mon Sep 17 00:00:00 2001 +From: Pierre-Hugues Husson +Date: Mon, 20 Dec 2021 15:01:41 -0500 +Subject: [PATCH 6/8] Dynamically resize boot animation to match screen size + +Change-Id: I54e49fc6b8c670103852e212d1416e27ff976205 +--- + cmds/bootanimation/BootAnimation.cpp | 22 ++++++++++++++++++++++ + 1 file changed, 22 insertions(+) + +diff --git a/cmds/bootanimation/BootAnimation.cpp b/cmds/bootanimation/BootAnimation.cpp +index a8b6c0b70804..9c50e954cee5 100644 +--- a/cmds/bootanimation/BootAnimation.cpp ++++ b/cmds/bootanimation/BootAnimation.cpp +@@ -605,6 +605,28 @@ status_t BootAnimation::readyToRun() { + mFlingerSurface = s; + mTargetInset = -1; + ++ if ( mAnimation != nullptr ) { ++ SLOGE("Got screen size %d, animation size %d", mWidth, mAnimation->width); ++ int origWidth = mAnimation->width; ++ if ( mAnimation->width*2 < mWidth ) { ++ SLOGE("Making animation bigger"); ++ mAnimation->width *= 2; ++ mAnimation->height *= 2; ++ } else if ( mWidth < mAnimation->width ) { ++ SLOGE("Making animation smaller"); ++ mAnimation->width /= 2; ++ mAnimation->height /= 2; ++ } ++ for (Animation::Part& part : mAnimation->parts) { ++ for(auto& frame: part.frames) { ++ if(frame.trimWidth == origWidth && frame.trimX == 0 && frame.trimY == 0) { ++ frame.trimWidth = mAnimation->width; ++ frame.trimHeight = mAnimation->height; ++ } ++ } ++ } ++ } ++ + // Rotate the boot animation according to the value specified in the sysprop + // ro.bootanim.set_orientation_. Four values are supported: ORIENTATION_0, + // ORIENTATION_90, ORIENTATION_180 and ORIENTATION_270. +-- +2.41.0 + diff --git a/frameworks/base/0007-Restore-getSimStateForSlotIndex-in-SubscriptionManag.patch b/frameworks/base/0007-Restore-getSimStateForSlotIndex-in-SubscriptionManag.patch new file mode 100644 index 0000000..6a120b5 --- /dev/null +++ b/frameworks/base/0007-Restore-getSimStateForSlotIndex-in-SubscriptionManag.patch @@ -0,0 +1,40 @@ +From d2b69b92fe4f37f8bcfdd4b8e3b756e5ad253663 Mon Sep 17 00:00:00 2001 +From: Andy CrossGate Yan +Date: Wed, 2 Aug 2023 20:59:53 +0800 +Subject: [PATCH 7/8] Restore getSimStateForSlotIndex in SubscriptionManager + +MTK IMS still needs it here + +Change-Id: I41bac57c68055f369232359a464642daab94403b +--- + .../android/telephony/SubscriptionManager.java | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +diff --git a/telephony/java/android/telephony/SubscriptionManager.java b/telephony/java/android/telephony/SubscriptionManager.java +index 64e43568e4d6..cfb4f12815a2 100644 +--- a/telephony/java/android/telephony/SubscriptionManager.java ++++ b/telephony/java/android/telephony/SubscriptionManager.java +@@ -2549,6 +2549,20 @@ public class SubscriptionManager { + return TelephonyManager.getDefault().isNetworkRoaming(subId); + } + ++ /** ++ * Returns a constant indicating the state of sim for the slot index. ++ * ++ * @param slotIndex Logical SIM slot index. ++ * ++ * @see TelephonyManager.SimState ++ * ++ * @hide ++ */ ++ @TelephonyManager.SimState ++ public static int getSimStateForSlotIndex(int slotIndex) { ++ return TelephonyManager.getSimStateForSlotIndex(slotIndex); ++ } ++ + /** + * Set a field in the subscription database. Note not all fields are supported. + * +-- +2.41.0 + diff --git a/frameworks/base/0008-Add-runWithCleanCallingIdentity-variant-with-both-ex.patch b/frameworks/base/0008-Add-runWithCleanCallingIdentity-variant-with-both-ex.patch new file mode 100644 index 0000000..ccf5495 --- /dev/null +++ b/frameworks/base/0008-Add-runWithCleanCallingIdentity-variant-with-both-ex.patch @@ -0,0 +1,72 @@ +From 8a8a763c989ddbf886288a130a66c39a4613c515 Mon Sep 17 00:00:00 2001 +From: Andy CrossGate Yan +Date: Sat, 12 Aug 2023 20:11:17 +0800 +Subject: [PATCH 8/8] Add runWithCleanCallingIdentity variant with both + executor and return value + +This complements the fixup to ImsPhoneCallTracker (in fw/o/t) for U + +Change-Id: If444290787025e130dce4bdeaf92372ae32793fe +--- + .../telephony/util/TelephonyUtils.java | 32 ++++++++++++++++++- + 1 file changed, 31 insertions(+), 1 deletion(-) + +diff --git a/telephony/common/com/android/internal/telephony/util/TelephonyUtils.java b/telephony/common/com/android/internal/telephony/util/TelephonyUtils.java +index 9a8c9655375d..454080144d35 100644 +--- a/telephony/common/com/android/internal/telephony/util/TelephonyUtils.java ++++ b/telephony/common/com/android/internal/telephony/util/TelephonyUtils.java +@@ -42,7 +42,9 @@ import com.android.internal.telephony.ITelephony; + import java.io.PrintWriter; + import java.util.Collections; + import java.util.List; ++import java.util.concurrent.CompletableFuture; + import java.util.concurrent.CountDownLatch; ++import java.util.concurrent.ExecutionException; + import java.util.concurrent.Executor; + import java.util.concurrent.TimeUnit; + import java.util.function.Supplier; +@@ -151,6 +153,34 @@ public final class TelephonyUtils { + } + } + ++ /** ++ * Convenience method for running the provided action in the provided ++ * executor enclosed in ++ * {@link Binder#clearCallingIdentity}/{@link Binder#restoreCallingIdentity} and return ++ * the result. ++ * ++ * Any exception thrown by the given action will need to be handled by caller. ++ * ++ */ ++ public static T runWithCleanCallingIdentity( ++ @NonNull Supplier action, @NonNull Executor executor) { ++ if (action != null) { ++ if (executor != null) { ++ try { ++ return CompletableFuture.supplyAsync( ++ () -> runWithCleanCallingIdentity(action), executor).get(); ++ } catch (ExecutionException | InterruptedException e) { ++ Log.w(LOG_TAG, "TelephonyUtils : runWithCleanCallingIdentity exception: " ++ + e.getMessage()); ++ return null; ++ } ++ } else { ++ return runWithCleanCallingIdentity(action); ++ } ++ } ++ return null; ++ } ++ + /** + * Filter values in bundle to only basic types. + */ +@@ -319,4 +349,4 @@ public final class TelephonyUtils { + return false; + + } +-} +\ No newline at end of file ++} +-- +2.41.0 + From c4daf7d00466a059e8e84e66a365c90809f2503d Mon Sep 17 00:00:00 2001 From: Peter Cai Date: Sat, 7 Oct 2023 20:22:56 -0400 Subject: [PATCH 3/3] [4/n] Android 14 port Refresh Bluetooth patches --- ...ck-le_set_event_mask-command-resturn.patch | 57 ------------------- ...hci-Ignore-unexpected-status-events.patch} | 20 +++---- ...interface-Optionally-use-sysbta-HAL.patch} | 12 ++-- 3 files changed, 16 insertions(+), 73 deletions(-) delete mode 100644 packages/modules/Bluetooth/0001-Additionally-check-le_set_event_mask-command-resturn.patch rename packages/modules/Bluetooth/{0002-gd-hci-Ignore-unexpected-status-events.patch => 0001-gd-hci-Ignore-unexpected-status-events.patch} (72%) rename packages/modules/Bluetooth/{0003-audio_hal_interface-Optionally-use-sysbta-HAL.patch => 0002-audio_hal_interface-Optionally-use-sysbta-HAL.patch} (94%) diff --git a/packages/modules/Bluetooth/0001-Additionally-check-le_set_event_mask-command-resturn.patch b/packages/modules/Bluetooth/0001-Additionally-check-le_set_event_mask-command-resturn.patch deleted file mode 100644 index 5d8eb45..0000000 --- a/packages/modules/Bluetooth/0001-Additionally-check-le_set_event_mask-command-resturn.patch +++ /dev/null @@ -1,57 +0,0 @@ -From 08cae5289428f6a99f2a6d28145fa542d1288916 Mon Sep 17 00:00:00 2001 -From: "tzu-hsien.huang" -Date: Wed, 20 Jul 2022 15:12:01 +0800 -Subject: [PATCH 1/3] Additionally check le_set_event_mask command resturn - status with UNSUPPORTED_LMP_OR_LL_PARAMETER -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -In GD BT stack, stack will check each return status of HCI Commands. E.g. reset , le_set_event_mask, set_event_mask …etc. -In BT spec 5.2, SIG add some parameters for le_set_event_mask for le audio, like LE Terminate BIG Complete event: Supported. -However, some legacy chips do not support LE Audio feature, and controller will return Status: Unsupported LMP Parameter Value when it receives this HCI Command -When it checks the return value and find the status is not SUCCESS, it will cause FAIL and cannot be compatible with old legacy chip. -After brushing GSI, Bluetooth will turn off automatically when it is turned on. -So all CTS test will always fail. - -Check le_set_event_mask command return status with SUCCESS or UNSUPPORTED_LMP_OR_LL_PARAMETER - -Bug: 239662211 -Test: CtsBluetoothTestCases -Change-Id: I2b0cede7f47eecd2124a386e958773289eb6f11c ---- - system/gd/hci/controller.cc | 11 ++++++++++- - 1 file changed, 10 insertions(+), 1 deletion(-) - -diff --git a/system/gd/hci/controller.cc b/system/gd/hci/controller.cc -index 9dac2b6a84..50342d639e 100644 ---- a/system/gd/hci/controller.cc -+++ b/system/gd/hci/controller.cc -@@ -548,7 +548,7 @@ struct Controller::impl { - void le_set_event_mask(uint64_t le_event_mask) { - std::unique_ptr packet = LeSetEventMaskBuilder::Create(le_event_mask); - hci_->EnqueueCommand(std::move(packet), module_.GetHandler()->BindOnceOn( -- this, &Controller::impl::check_status)); -+ this, &Controller::impl::check_event_mask_status)); - } - - template -@@ -559,6 +559,15 @@ struct Controller::impl { - ASSERT(status_view.GetStatus() == ErrorCode::SUCCESS); - } - -+ template -+ void check_event_mask_status(CommandCompleteView view) { -+ ASSERT(view.IsValid()); -+ auto status_view = T::Create(view); -+ ASSERT(status_view.IsValid()); -+ ASSERT(status_view.GetStatus() == ErrorCode::SUCCESS || -+ status_view.GetStatus() == ErrorCode::UNSUPPORTED_LMP_OR_LL_PARAMETER); -+ } -+ - #define OP_CODE_MAPPING(name) \ - case OpCode::name: { \ - uint16_t index = (uint16_t)OpCodeIndex::name; \ --- -2.40.1 - diff --git a/packages/modules/Bluetooth/0002-gd-hci-Ignore-unexpected-status-events.patch b/packages/modules/Bluetooth/0001-gd-hci-Ignore-unexpected-status-events.patch similarity index 72% rename from packages/modules/Bluetooth/0002-gd-hci-Ignore-unexpected-status-events.patch rename to packages/modules/Bluetooth/0001-gd-hci-Ignore-unexpected-status-events.patch index 319c7f4..214a703 100644 --- a/packages/modules/Bluetooth/0002-gd-hci-Ignore-unexpected-status-events.patch +++ b/packages/modules/Bluetooth/0001-gd-hci-Ignore-unexpected-status-events.patch @@ -1,7 +1,7 @@ -From 55a4e7e7158f50f3e8840b526e15d7c9f10423de Mon Sep 17 00:00:00 2001 +From 184dbd4770340934511622b0bac58eb45d0cb905 Mon Sep 17 00:00:00 2001 From: Peter Cai Date: Wed, 24 Aug 2022 10:41:29 -0400 -Subject: [PATCH 2/3] gd: hci: Ignore unexpected status events +Subject: [PATCH 1/2] gd: hci: Ignore unexpected status events For some reason, on some old devices, the controller will report a remote to support SNIFF_SUBRATING even when it does not. Just ignore the @@ -13,12 +13,12 @@ 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 5def729ac8..9c235294bb 100644 +index c3312a557c..3e8ab78371 100644 --- a/system/gd/hci/hci_layer.cc +++ b/system/gd/hci/hci_layer.cc -@@ -195,14 +195,13 @@ struct HciLayer::impl { - EventView::Create(PacketView(std::make_shared>(std::vector())))); - command_queue_.front().GetCallback()->Invoke(move(command_complete_view)); +@@ -211,14 +211,13 @@ struct HciLayer::impl { + command_queue_.front().GetCallback()->Invoke( + std::move(command_complete_view)); } else { - ASSERT_LOG( - command_queue_.front().waiting_for_status_ == is_status, @@ -27,17 +27,17 @@ index 5def729ac8..9c235294bb 100644 - OpCodeText(op_code).c_str(), - logging_id.c_str()); - -- command_queue_.front().GetCallback()->Invoke(move(response_view)); +- command_queue_.front().GetCallback()->Invoke(std::move(response_view)); + if (command_queue_.front().waiting_for_status_ == is_status) { -+ command_queue_.front().GetCallback()->Invoke(move(response_view)); ++ command_queue_.front().GetCallback()->Invoke(std::move(response_view)); + } else { + CommandCompleteView command_complete_view = CommandCompleteView::Create( + EventView::Create(PacketView(std::make_shared>(std::vector())))); -+ command_queue_.front().GetCallback()->Invoke(move(command_complete_view)); ++ command_queue_.front().GetCallback()->Invoke(std::move(command_complete_view)); + } } command_queue_.pop_front(); -- -2.40.1 +2.41.0 diff --git a/packages/modules/Bluetooth/0003-audio_hal_interface-Optionally-use-sysbta-HAL.patch b/packages/modules/Bluetooth/0002-audio_hal_interface-Optionally-use-sysbta-HAL.patch similarity index 94% rename from packages/modules/Bluetooth/0003-audio_hal_interface-Optionally-use-sysbta-HAL.patch rename to packages/modules/Bluetooth/0002-audio_hal_interface-Optionally-use-sysbta-HAL.patch index 0dca5de..57ca3c3 100644 --- a/packages/modules/Bluetooth/0003-audio_hal_interface-Optionally-use-sysbta-HAL.patch +++ b/packages/modules/Bluetooth/0002-audio_hal_interface-Optionally-use-sysbta-HAL.patch @@ -1,7 +1,7 @@ -From f2d820597f4dcbb08e4e0c9026dc1d56fe7b3bfd Mon Sep 17 00:00:00 2001 +From 9524502060facedcba0682c61b4b94340d082f36 Mon Sep 17 00:00:00 2001 From: Peter Cai Date: Wed, 24 Aug 2022 15:45:18 -0400 -Subject: [PATCH 3/3] audio_hal_interface: Optionally use sysbta HAL +Subject: [PATCH 2/2] audio_hal_interface: Optionally use sysbta HAL Required to support sysbta, our system-side bt audio implementation. @@ -13,7 +13,7 @@ Change-Id: I59973e6ec84c5923be8a7c67b36b2e237f000860 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/system/audio_hal_interface/aidl/client_interface_aidl.cc b/system/audio_hal_interface/aidl/client_interface_aidl.cc -index 9af28031f7..5a9dbbccad 100644 +index 897b891aa7..660a141894 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( @@ -44,7 +44,7 @@ index 9af28031f7..5a9dbbccad 100644 if (provider_factory == nullptr) { LOG(ERROR) << __func__ << ", can't get capability 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 17abefe8fe..07dd11266f 100644 +index 8a40c1d7d7..6d962d3473 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 @@ @@ -55,7 +55,7 @@ index 17abefe8fe..07dd11266f 100644 #define BLUETOOTH_AUDIO_HAL_PROP_DISABLED \ "persist.bluetooth.bluetooth_audio_hal.disabled" -@@ -117,6 +118,12 @@ class BluetoothAudioClientInterface { +@@ -119,6 +120,12 @@ class BluetoothAudioClientInterface { // "android.hardware.bluetooth.audio.IBluetoothAudioProviderFactory/default"; static inline const std::string kDefaultAudioProviderFactoryInterface = std::string() + IBluetoothAudioProviderFactory::descriptor + "/default"; @@ -103,5 +103,5 @@ index a2c192f37d..c3d1cf35c2 100644 return; } -- -2.40.1 +2.41.0