diff --git a/Patches/LineageOS-18.1/android_frameworks_av/403217.patch b/Patches/LineageOS-18.1/android_frameworks_av/403217.patch index 2590cb58..e1a784f8 100644 --- a/Patches/LineageOS-18.1/android_frameworks_av/403217.patch +++ b/Patches/LineageOS-18.1/android_frameworks_av/403217.patch @@ -1,4 +1,4 @@ -From 175ce9900d282d018e2175a4cc1727a35c2d21c6 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Wonsik Kim Date: Fri, 28 Jun 2024 00:33:51 +0000 Subject: [PATCH] omx: check HDR10+ info param size @@ -15,7 +15,7 @@ Change-Id: I72523e1de61e5f947174272b732e170e1c2964df 1 file changed, 7 insertions(+) diff --git a/media/libstagefright/omx/SoftVideoDecoderOMXComponent.cpp b/media/libstagefright/omx/SoftVideoDecoderOMXComponent.cpp -index 418302389d1..4ab5d106096 100644 +index 418302389d..4ab5d10609 100644 --- a/media/libstagefright/omx/SoftVideoDecoderOMXComponent.cpp +++ b/media/libstagefright/omx/SoftVideoDecoderOMXComponent.cpp @@ -619,6 +619,13 @@ OMX_ERRORTYPE SoftVideoDecoderOMXComponent::getConfig( diff --git a/Patches/LineageOS-18.1/android_frameworks_base/403218.patch b/Patches/LineageOS-18.1/android_frameworks_base/403218.patch index 6229518c..393501a8 100644 --- a/Patches/LineageOS-18.1/android_frameworks_base/403218.patch +++ b/Patches/LineageOS-18.1/android_frameworks_base/403218.patch @@ -1,4 +1,4 @@ -From 701cf719f36830fd3c1b02c5585ce3226a30f092 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Kiran Ramachandra Date: Wed, 5 Jun 2024 21:03:33 +0000 Subject: [PATCH] DO NOT MERGE Ignore - Sanitized uri scheme by removing scheme @@ -19,10 +19,10 @@ Change-Id: I88b1550a5d8b3dc0f6286e28899884025d059645 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/core/java/android/net/Uri.java b/core/java/android/net/Uri.java -index 84fc4f78edc46..4446f09bc8743 100644 +index 84fc4f78edc4..4446f09bc874 100644 --- a/core/java/android/net/Uri.java +++ b/core/java/android/net/Uri.java -@@ -1380,7 +1380,11 @@ public Builder() {} +@@ -1380,7 +1380,11 @@ public abstract class Uri implements Parcelable, Comparable { * @param scheme name or {@code null} if this is a relative Uri */ public Builder scheme(String scheme) { @@ -36,10 +36,10 @@ index 84fc4f78edc46..4446f09bc8743 100644 } diff --git a/core/tests/coretests/src/android/net/UriTest.java b/core/tests/coretests/src/android/net/UriTest.java -index 670aefd21d360..17a37831afdb1 100644 +index 670aefd21d36..17a37831afdb 100644 --- a/core/tests/coretests/src/android/net/UriTest.java +++ b/core/tests/coretests/src/android/net/UriTest.java -@@ -18,6 +18,7 @@ +@@ -18,6 +18,7 @@ package android.net; import android.content.ContentUris; import android.os.Parcel; @@ -47,7 +47,7 @@ index 670aefd21d360..17a37831afdb1 100644 import androidx.test.filters.SmallTest; -@@ -88,6 +89,16 @@ public void testBuildUponOpaqueStringUri() { +@@ -88,6 +89,16 @@ public class UriTest extends TestCase { assertNull(u.getHost()); } diff --git a/Patches/LineageOS-18.1/android_frameworks_base/405515.patch b/Patches/LineageOS-18.1/android_frameworks_base/405515.patch index ebe33039..c0a765ff 100644 --- a/Patches/LineageOS-18.1/android_frameworks_base/405515.patch +++ b/Patches/LineageOS-18.1/android_frameworks_base/405515.patch @@ -1,4 +1,4 @@ -From b0aee0b8b81d776e7c3234f7b340a856d138e4c4 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Dmitry Dementyev Date: Thu, 11 Jul 2024 12:39:22 -0700 Subject: [PATCH] Update AccountManagerService checkKeyIntent. @@ -17,10 +17,10 @@ Change-Id: I8b23191d3d60036ca7ddf0ef7dcba6b38fb27b3c 1 file changed, 3 insertions(+) diff --git a/services/core/java/com/android/server/accounts/AccountManagerService.java b/services/core/java/com/android/server/accounts/AccountManagerService.java -index 37a68d3eec76c..fb79904a5b3a8 100644 +index 37a68d3eec76..fb79904a5b3a 100644 --- a/services/core/java/com/android/server/accounts/AccountManagerService.java +++ b/services/core/java/com/android/server/accounts/AccountManagerService.java -@@ -4812,6 +4812,9 @@ protected boolean checkKeyIntent(int authUid, Bundle bundle) { +@@ -4812,6 +4812,9 @@ public class AccountManagerService if (resolveInfo == null) { return false; } diff --git a/Patches/LineageOS-18.1/android_frameworks_base/405516.patch b/Patches/LineageOS-18.1/android_frameworks_base/405516.patch index 02036d0f..bb79bd22 100644 --- a/Patches/LineageOS-18.1/android_frameworks_base/405516.patch +++ b/Patches/LineageOS-18.1/android_frameworks_base/405516.patch @@ -1,4 +1,4 @@ -From f31bdd9c6658dfb932eea857f17cc2d21124031e Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: William Loh Date: Mon, 3 Jun 2024 12:56:47 -0700 Subject: [PATCH] Fail parseUri if end is missing @@ -15,10 +15,10 @@ Change-Id: I5f619ced684ff505ce2b7408cd35dd3e9be89dea 1 file changed, 3 insertions(+) diff --git a/core/java/android/content/Intent.java b/core/java/android/content/Intent.java -index 24d59a0826c85..4ea29407f352f 100644 +index 24d59a0826c8..4ea29407f352 100644 --- a/core/java/android/content/Intent.java +++ b/core/java/android/content/Intent.java -@@ -7053,6 +7053,9 @@ public static Intent parseUri(String uri, @UriFlags int flags) throws URISyntaxE +@@ -7053,6 +7053,9 @@ public class Intent implements Parcelable, Cloneable { int eq = uri.indexOf('=', i); if (eq < 0) eq = i-1; int semi = uri.indexOf(';', i); diff --git a/Patches/LineageOS-18.1/android_frameworks_base/405517.patch b/Patches/LineageOS-18.1/android_frameworks_base/405517.patch index 9df47e9a..3b3ebb69 100644 --- a/Patches/LineageOS-18.1/android_frameworks_base/405517.patch +++ b/Patches/LineageOS-18.1/android_frameworks_base/405517.patch @@ -1,4 +1,4 @@ -From 1346eac616e21574788efa8bf374d8eb1ee744b7 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Mark Renouf Date: Thu, 20 Jun 2024 16:37:42 -0400 Subject: [PATCH] Prevent Sharing when FRP enforcement is in effect @@ -19,10 +19,10 @@ Change-Id: I1db78ab74babe71b516f601be35cf476b5e43271 1 file changed, 8 insertions(+) diff --git a/core/java/com/android/internal/app/ChooserActivity.java b/core/java/com/android/internal/app/ChooserActivity.java -index bc80dc9213bea..e259f1d20adb9 100644 +index bc80dc9213be..e259f1d20adb 100644 --- a/core/java/com/android/internal/app/ChooserActivity.java +++ b/core/java/com/android/internal/app/ChooserActivity.java -@@ -594,6 +594,14 @@ public void handleMessage(Message msg) { +@@ -594,6 +594,14 @@ public class ChooserActivity extends ResolverActivity implements @Override protected void onCreate(Bundle savedInstanceState) { diff --git a/Patches/LineageOS-18.1/android_frameworks_base/405518.patch b/Patches/LineageOS-18.1/android_frameworks_base/405518.patch index 0e896ad4..563c26a0 100644 --- a/Patches/LineageOS-18.1/android_frameworks_base/405518.patch +++ b/Patches/LineageOS-18.1/android_frameworks_base/405518.patch @@ -1,8 +1,8 @@ -From 5fe06ebbd23db602bb46ba51a7e40711d7823be6 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Sumedh Sen Date: Wed, 17 Jul 2024 01:00:55 +0000 -Subject: [PATCH] [RESTRICT AUTOMERGE] Check whether installerPackageName - contains only valid characters +Subject: [PATCH] Check whether installerPackageName contains only valid + characters Bug: 341256391 Bug: 307532206 @@ -15,10 +15,10 @@ Change-Id: I74a172c617d6f5b13f0708092156b657b73b5891 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/pm/PackageInstallerService.java b/services/core/java/com/android/server/pm/PackageInstallerService.java -index 7e67021e3b847..ab8cc4c8d6697 100644 +index 7e67021e3b84..ab8cc4c8d669 100644 --- a/services/core/java/com/android/server/pm/PackageInstallerService.java +++ b/services/core/java/com/android/server/pm/PackageInstallerService.java -@@ -580,12 +580,17 @@ private int createSessionInternal(SessionParams params, String installerPackageN +@@ -580,12 +580,17 @@ public class PackageInstallerService extends IPackageInstaller.Stub implements params.appLabel = TextUtils.trimToSize(params.appLabel, PackageItemInfo.MAX_SAFE_LABEL_LENGTH); diff --git a/Patches/LineageOS-18.1/android_packages_apps_Bluetooth/0001-constify_JNINativeMethod.patch b/Patches/LineageOS-18.1/android_packages_apps_Bluetooth/0001-constify_JNINativeMethod.patch index a8fbf82e..2d1f9e76 100644 --- a/Patches/LineageOS-18.1/android_packages_apps_Bluetooth/0001-constify_JNINativeMethod.patch +++ b/Patches/LineageOS-18.1/android_packages_apps_Bluetooth/0001-constify_JNINativeMethod.patch @@ -191,10 +191,10 @@ index 17b6e97c0..c3a00d5d2 100644 {"initNative", "()V", (void*)initNative}, {"cleanupNative", "()V", (void*)cleanupNative}, diff --git a/jni/com_android_bluetooth_hid_host.cpp b/jni/com_android_bluetooth_hid_host.cpp -index cab5e3361..cc242e811 100644 +index 22c7dcfe8..3b690d6d4 100644 --- a/jni/com_android_bluetooth_hid_host.cpp +++ b/jni/com_android_bluetooth_hid_host.cpp -@@ -506,7 +506,7 @@ static jboolean setIdleTimeNative(JNIEnv* env, jobject object, +@@ -508,7 +508,7 @@ static jboolean setIdleTimeNative(JNIEnv* env, jobject object, return status == BT_STATUS_SUCCESS ? JNI_TRUE : JNI_FALSE; } diff --git a/Patches/LineageOS-18.1/android_packages_apps_Bluetooth/405540.patch b/Patches/LineageOS-18.1/android_packages_apps_Bluetooth/405540.patch index 6a9e2285..8494df55 100644 --- a/Patches/LineageOS-18.1/android_packages_apps_Bluetooth/405540.patch +++ b/Patches/LineageOS-18.1/android_packages_apps_Bluetooth/405540.patch @@ -1,4 +1,4 @@ -From 6799e4b038c33ce3fd175749ebdea69379a5489f Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Himanshu Rawat Date: Mon, 8 Apr 2024 19:44:45 +0000 Subject: [PATCH] RESTRICT AUTOMERGE Disallow unexpected incoming HID @@ -61,7 +61,7 @@ diff --git a/src/com/android/bluetooth/hid/HidHostService.java b/src/com/android index 10d414d46..ed35c2908 100644 --- a/src/com/android/bluetooth/hid/HidHostService.java +++ b/src/com/android/bluetooth/hid/HidHostService.java -@@ -161,7 +161,10 @@ public void handleMessage(Message msg) { +@@ -161,7 +161,10 @@ public class HidHostService extends ProfileService { break; case MESSAGE_DISCONNECT: { BluetoothDevice device = (BluetoothDevice) msg.obj; @@ -73,7 +73,7 @@ index 10d414d46..ed35c2908 100644 broadcastConnectionState(device, BluetoothProfile.STATE_DISCONNECTING); broadcastConnectionState(device, BluetoothProfile.STATE_DISCONNECTED); break; -@@ -934,7 +937,7 @@ public void dump(StringBuilder sb) { +@@ -934,7 +937,7 @@ public class HidHostService extends ProfileService { private native boolean connectHidNative(byte[] btAddress); diff --git a/Patches/LineageOS-18.1/android_packages_apps_Settings/403219.patch b/Patches/LineageOS-18.1/android_packages_apps_Settings/403219.patch index 6c7f1154..bf315031 100644 --- a/Patches/LineageOS-18.1/android_packages_apps_Settings/403219.patch +++ b/Patches/LineageOS-18.1/android_packages_apps_Settings/403219.patch @@ -1,4 +1,4 @@ -From a593133d22bde6331bcaf258c2b01acea3ba246e Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Chaohui Wang Date: Thu, 2 Nov 2023 11:43:00 +0800 Subject: [PATCH] Limit wifi item edit content's max length to 500 diff --git a/Patches/LineageOS-18.1/android_packages_apps_Settings/403220.patch b/Patches/LineageOS-18.1/android_packages_apps_Settings/403220.patch index ccf19341..371e1435 100644 --- a/Patches/LineageOS-18.1/android_packages_apps_Settings/403220.patch +++ b/Patches/LineageOS-18.1/android_packages_apps_Settings/403220.patch @@ -1,4 +1,4 @@ -From 1e9cb20c9ea8c9e9234080ae8b805f0d5ee5f759 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Jason Chiu Date: Wed, 31 Jan 2024 16:29:01 +0800 Subject: [PATCH] Replace getCallingActivity() with getLaunchedFromPackage() @@ -54,7 +54,7 @@ index 63bf420c027..423779fbabf 100644 import com.android.settingslib.search.SearchIndexableResources; import com.android.settingslib.search.SearchIndexableResourcesMobile; -@@ -32,22 +33,19 @@ +@@ -32,22 +33,19 @@ import com.android.settingslib.search.SearchIndexableResourcesMobile; */ public class SearchFeatureProviderImpl implements SearchFeatureProvider { @@ -88,7 +88,7 @@ diff --git a/src/com/android/settings/search/SearchResultTrampoline.java b/src/c index e9304739460..c233e86b6fc 100644 --- a/src/com/android/settings/search/SearchResultTrampoline.java +++ b/src/com/android/settings/search/SearchResultTrampoline.java -@@ -39,7 +39,7 @@ protected void onCreate(Bundle savedInstanceState) { +@@ -39,7 +39,7 @@ public class SearchResultTrampoline extends Activity { // First make sure caller has privilege to launch a search result page. FeatureFactory.getFactory(this) .getSearchFeatureProvider() @@ -101,7 +101,7 @@ diff --git a/tests/robotests/src/com/android/settings/search/SearchFeatureProvid index 444a8137889..ebd935d3406 100644 --- a/tests/robotests/src/com/android/settings/search/SearchFeatureProviderImplTest.java +++ b/tests/robotests/src/com/android/settings/search/SearchFeatureProviderImplTest.java -@@ -21,7 +21,6 @@ +@@ -21,7 +21,6 @@ import static com.google.common.truth.Truth.assertThat; import android.app.Activity; import android.app.settings.SettingsEnums; @@ -109,7 +109,7 @@ index 444a8137889..ebd935d3406 100644 import android.content.Intent; import android.content.pm.ActivityInfo; import android.content.pm.ResolveInfo; -@@ -126,20 +125,22 @@ public void verifyLaunchSearchResultPageCaller_nullCaller_shouldCrash() { +@@ -126,20 +125,22 @@ public class SearchFeatureProviderImplTest { @Test(expected = SecurityException.class) public void verifyLaunchSearchResultPageCaller_badCaller_shouldCrash() { diff --git a/Patches/LineageOS-18.1/android_packages_apps_Settings/403221.patch b/Patches/LineageOS-18.1/android_packages_apps_Settings/403221.patch index 9f7ca60d..da0ef994 100644 --- a/Patches/LineageOS-18.1/android_packages_apps_Settings/403221.patch +++ b/Patches/LineageOS-18.1/android_packages_apps_Settings/403221.patch @@ -1,4 +1,4 @@ -From 227df78aae8974bcdde516d111189f082824a765 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Chris Antol Date: Tue, 4 Jun 2024 17:00:46 +0000 Subject: [PATCH] Ignore fragment attr from ext authenticator resource @@ -19,7 +19,7 @@ diff --git a/src/com/android/settings/accounts/AccountTypePreferenceLoader.java index c639d1df2eb..84386a38f08 100644 --- a/src/com/android/settings/accounts/AccountTypePreferenceLoader.java +++ b/src/com/android/settings/accounts/AccountTypePreferenceLoader.java -@@ -32,6 +32,10 @@ +@@ -32,6 +32,10 @@ import android.os.UserHandle; import android.text.TextUtils; import android.util.Log; @@ -30,7 +30,7 @@ index c639d1df2eb..84386a38f08 100644 import androidx.preference.Preference; import androidx.preference.Preference.OnPreferenceClickListener; import androidx.preference.PreferenceFragmentCompat; -@@ -45,6 +49,8 @@ +@@ -45,6 +49,8 @@ import com.android.settings.utils.LocalClassLoaderContextThemeWrapper; import com.android.settingslib.accounts.AuthenticatorHelper; import com.android.settingslib.core.instrumentation.Instrumentable; @@ -39,7 +39,7 @@ index c639d1df2eb..84386a38f08 100644 /** * Class to load the preference screen to be added to the settings page for the specific account * type as specified in the account-authenticator. -@@ -83,6 +89,7 @@ public PreferenceScreen addPreferencesForType(final String accountType, +@@ -83,6 +89,7 @@ public class AccountTypePreferenceLoader { try { desc = mAuthenticatorHelper.getAccountTypeDescription(accountType); if (desc != null && desc.accountPreferencesId != 0) { @@ -47,7 +47,7 @@ index c639d1df2eb..84386a38f08 100644 // Load the context of the target package, then apply the // base Settings theme (no references to local resources) // and create a context theme wrapper so that we get the -@@ -98,6 +105,12 @@ public PreferenceScreen addPreferencesForType(final String accountType, +@@ -98,6 +105,12 @@ public class AccountTypePreferenceLoader { themedCtx.getTheme().setTo(baseTheme); prefs = mFragment.getPreferenceManager().inflateFromResource(themedCtx, desc.accountPreferencesId, parent); @@ -60,7 +60,7 @@ index c639d1df2eb..84386a38f08 100644 } } catch (PackageManager.NameNotFoundException e) { Log.w(TAG, "Couldn't load preferences.xml file from " + desc.packageName); -@@ -182,6 +195,48 @@ public boolean onPreferenceClick(Preference preference) { +@@ -182,6 +195,48 @@ public class AccountTypePreferenceLoader { } } diff --git a/Patches/LineageOS-18.1/android_packages_apps_Settings/403222.patch b/Patches/LineageOS-18.1/android_packages_apps_Settings/403222.patch index 0652d7ca..e90f701f 100644 --- a/Patches/LineageOS-18.1/android_packages_apps_Settings/403222.patch +++ b/Patches/LineageOS-18.1/android_packages_apps_Settings/403222.patch @@ -1,4 +1,4 @@ -From e406e4d8ec8c977652e2c6be7ca1e400683a475e Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Chris Antol Date: Mon, 25 Mar 2024 23:49:35 +0000 Subject: [PATCH] RESTRICT AUTOMERGE Restrict Settings Homepage prior to @@ -20,7 +20,7 @@ diff --git a/src/com/android/settings/homepage/SettingsHomepageActivity.java b/s index a8426437f57..61567947124 100644 --- a/src/com/android/settings/homepage/SettingsHomepageActivity.java +++ b/src/com/android/settings/homepage/SettingsHomepageActivity.java -@@ -20,6 +20,7 @@ +@@ -20,6 +20,7 @@ import android.animation.LayoutTransition; import android.app.ActivityManager; import android.app.settings.SettingsEnums; import android.os.Bundle; diff --git a/Patches/LineageOS-18.1/android_packages_apps_Settings/405534.patch b/Patches/LineageOS-18.1/android_packages_apps_Settings/405534.patch index 7f50d430..88ed86d4 100644 --- a/Patches/LineageOS-18.1/android_packages_apps_Settings/405534.patch +++ b/Patches/LineageOS-18.1/android_packages_apps_Settings/405534.patch @@ -1,4 +1,4 @@ -From da6ee7b698b7d4c4cbe56c70027904268b72d0f1 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Yiling Chuang Date: Mon, 8 Jul 2024 03:09:50 +0000 Subject: [PATCH] RESTRICT AUTOMERGE FRP bypass defense in App battery usage @@ -24,7 +24,7 @@ diff --git a/src/com/android/settings/fuelgauge/AdvancedPowerUsageDetail.java b/ index e8d5f3330f2..d17642053e7 100644 --- a/src/com/android/settings/fuelgauge/AdvancedPowerUsageDetail.java +++ b/src/com/android/settings/fuelgauge/AdvancedPowerUsageDetail.java -@@ -210,6 +210,11 @@ public void onResume() { +@@ -210,6 +210,11 @@ public class AdvancedPowerUsageDetail extends DashboardFragment implements initPreference(); } @@ -40,7 +40,7 @@ diff --git a/tests/robotests/src/com/android/settings/fuelgauge/AdvancedPowerUsa index 8eeac8d26b0..37fa511beeb 100644 --- a/tests/robotests/src/com/android/settings/fuelgauge/AdvancedPowerUsageDetailTest.java +++ b/tests/robotests/src/com/android/settings/fuelgauge/AdvancedPowerUsageDetailTest.java -@@ -395,4 +395,9 @@ public void testInitPreference_hasCorrectSummary() { +@@ -395,4 +395,9 @@ public class AdvancedPowerUsageDetailTest { assertThat(mForegroundPreference.getSummary().toString()).isEqualTo("Used for 0 min"); assertThat(mBackgroundPreference.getSummary().toString()).isEqualTo("Active for 0 min"); } diff --git a/Patches/LineageOS-18.1/android_packages_services_Telecomm/403223.patch b/Patches/LineageOS-18.1/android_packages_services_Telecomm/403223.patch index 492bb529..5da7acc1 100644 --- a/Patches/LineageOS-18.1/android_packages_services_Telecomm/403223.patch +++ b/Patches/LineageOS-18.1/android_packages_services_Telecomm/403223.patch @@ -1,4 +1,4 @@ -From d5dd619c2ba08613723d45636e04fc37da0bd716 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Grant Menke Date: Thu, 25 Apr 2024 10:43:43 -0700 Subject: [PATCH] DO NOT MERGE Unbind CS if connection is not created within 15 @@ -28,7 +28,7 @@ diff --git a/src/com/android/server/telecom/Call.java b/src/com/android/server/t index cd236d2f4..e8c5a47ac 100755 --- a/src/com/android/server/telecom/Call.java +++ b/src/com/android/server/telecom/Call.java -@@ -329,6 +329,17 @@ public void onContactPhotoQueryComplete(Uri handle, CallerInfo callerInfo) { +@@ -329,6 +329,17 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable, /** The state of the call. */ private int mState; @@ -46,7 +46,7 @@ index cd236d2f4..e8c5a47ac 100755 /** The handle with which to establish this call. */ private Uri mHandle; -@@ -958,6 +969,19 @@ public ConnectionServiceFocusManager.ConnectionServiceFocus getConnectionService +@@ -958,6 +969,19 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable, return mConnectionService; } @@ -66,7 +66,7 @@ index cd236d2f4..e8c5a47ac 100755 @VisibleForTesting public int getState() { return mState; -@@ -2043,6 +2067,7 @@ public void handleCreateConferenceSuccess( +@@ -2043,6 +2067,7 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable, CallIdMapper idMapper, ParcelableConference conference) { Log.v(this, "handleCreateConferenceSuccessful %s", conference); @@ -74,7 +74,7 @@ index cd236d2f4..e8c5a47ac 100755 setTargetPhoneAccount(conference.getPhoneAccount()); setHandle(conference.getHandle(), conference.getHandlePresentation()); -@@ -2076,6 +2101,7 @@ public void handleCreateConnectionSuccess( +@@ -2076,6 +2101,7 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable, CallIdMapper idMapper, ParcelableConnection connection) { Log.v(this, "handleCreateConnectionSuccessful %s", connection); @@ -86,7 +86,7 @@ diff --git a/src/com/android/server/telecom/ConnectionServiceWrapper.java b/src/ index 64fdd8833..6ca74fba3 100644 --- a/src/com/android/server/telecom/ConnectionServiceWrapper.java +++ b/src/com/android/server/telecom/ConnectionServiceWrapper.java -@@ -37,6 +37,7 @@ +@@ -37,6 +37,7 @@ import android.telecom.ConnectionService; import android.telecom.DisconnectCause; import android.telecom.GatewayInfo; import android.telecom.Log; @@ -94,7 +94,7 @@ index 64fdd8833..6ca74fba3 100644 import android.telecom.Logging.Session; import android.telecom.ParcelableConference; import android.telecom.ParcelableConnection; -@@ -59,6 +60,11 @@ +@@ -59,6 +60,11 @@ import java.util.List; import java.util.Map; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; @@ -118,7 +118,7 @@ index 64fdd8833..6ca74fba3 100644 private final class Adapter extends IConnectionServiceAdapter.Stub { @Override -@@ -84,6 +95,12 @@ public void handleCreateConnectionComplete(String callId, ConnectionRequest requ +@@ -84,6 +95,12 @@ public class ConnectionServiceWrapper extends ServiceBinder implements try { synchronized (mLock) { logIncoming("handleCreateConnectionComplete %s", callId); @@ -131,7 +131,7 @@ index 64fdd8833..6ca74fba3 100644 // Check status hints image for cross user access if (connection.getStatusHints() != null) { Icon icon = connection.getStatusHints().getIcon(); -@@ -120,6 +137,12 @@ public void handleCreateConferenceComplete(String callId, ConnectionRequest requ +@@ -120,6 +137,12 @@ public class ConnectionServiceWrapper extends ServiceBinder implements try { synchronized (mLock) { logIncoming("handleCreateConferenceComplete %s", callId); @@ -144,7 +144,7 @@ index 64fdd8833..6ca74fba3 100644 ConnectionServiceWrapper.this .handleCreateConferenceComplete(callId, request, conference); -@@ -1183,7 +1206,8 @@ public void setCallDirection(String callId, int direction, Session.Info sessionI +@@ -1183,7 +1206,8 @@ public class ConnectionServiceWrapper extends ServiceBinder implements * @param context The context. * @param userHandle The {@link UserHandle} to use when binding. */ @@ -154,7 +154,7 @@ index 64fdd8833..6ca74fba3 100644 ComponentName componentName, ConnectionServiceRepository connectionServiceRepository, PhoneAccountRegistrar phoneAccountRegistrar, -@@ -1258,6 +1282,26 @@ public void onSuccess() { +@@ -1258,6 +1282,26 @@ public class ConnectionServiceWrapper extends ServiceBinder implements .setIsAdhocConferenceCall(call.isAdhocConferenceCall()) .build(); @@ -181,7 +181,7 @@ index 64fdd8833..6ca74fba3 100644 try { mServiceInterface.createConference( call.getConnectionManagerPhoneAccount(), -@@ -1347,6 +1391,26 @@ public void onSuccess() { +@@ -1347,6 +1391,26 @@ public class ConnectionServiceWrapper extends ServiceBinder implements .setRttPipeToInCall(call.getCsToInCallRttPipeForCs()) .build(); @@ -208,7 +208,7 @@ index 64fdd8833..6ca74fba3 100644 try { mServiceInterface.createConnection( call.getConnectionManagerPhoneAccount(), -@@ -1727,7 +1791,8 @@ void stopDtmfTone(Call call) { +@@ -1727,7 +1791,8 @@ public class ConnectionServiceWrapper extends ServiceBinder implements } } @@ -218,7 +218,7 @@ index 64fdd8833..6ca74fba3 100644 if (mCallIdMapper.getCallId(call) == null) { mCallIdMapper.addCall(call); } -@@ -2172,4 +2237,9 @@ public String toString() { +@@ -2172,4 +2237,9 @@ public class ConnectionServiceWrapper extends ServiceBinder implements sb.append("]"); return sb.toString(); } @@ -232,7 +232,7 @@ diff --git a/src/com/android/server/telecom/LogUtils.java b/src/com/android/serv index 5bb14e625..1c62a5c71 100644 --- a/src/com/android/server/telecom/LogUtils.java +++ b/src/com/android/server/telecom/LogUtils.java -@@ -124,8 +124,10 @@ public final static class Events { +@@ -124,8 +124,10 @@ public class LogUtils { public static final String STOP_CALL_WAITING_TONE = "STOP_CALL_WAITING_TONE"; public static final String START_CONNECTION = "START_CONNECTION"; public static final String CREATE_CONNECTION_FAILED = "CREATE_CONNECTION_FAILED"; @@ -247,7 +247,7 @@ diff --git a/tests/src/com/android/server/telecom/tests/BasicCallTests.java b/te index 382e0b710..6ac8e1c62 100644 --- a/tests/src/com/android/server/telecom/tests/BasicCallTests.java +++ b/tests/src/com/android/server/telecom/tests/BasicCallTests.java -@@ -963,6 +963,7 @@ public void testOutgoingCallSelectPhoneAccountVideo() throws Exception { +@@ -963,6 +963,7 @@ public class BasicCallTests extends TelecomSystemTest { call.setTargetPhoneAccount(mPhoneAccountA1.getAccountHandle()); assert(call.isVideoCallingSupportedByPhoneAccount()); assertEquals(VideoProfile.STATE_BIDIRECTIONAL, call.getVideoState()); @@ -255,7 +255,7 @@ index 382e0b710..6ac8e1c62 100644 } /** -@@ -986,6 +987,7 @@ public void testOutgoingCallSelectPhoneAccountNoVideo() throws Exception { +@@ -986,6 +987,7 @@ public class BasicCallTests extends TelecomSystemTest { call.setTargetPhoneAccount(mPhoneAccountA2.getAccountHandle()); assert(!call.isVideoCallingSupportedByPhoneAccount()); assertEquals(VideoProfile.STATE_AUDIO_ONLY, call.getVideoState()); @@ -267,7 +267,7 @@ diff --git a/tests/src/com/android/server/telecom/tests/CallsManagerTest.java b/ index d16430298..912b56cf3 100644 --- a/tests/src/com/android/server/telecom/tests/CallsManagerTest.java +++ b/tests/src/com/android/server/telecom/tests/CallsManagerTest.java -@@ -40,11 +40,13 @@ +@@ -40,11 +40,13 @@ import static org.mockito.Mockito.timeout; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; @@ -281,7 +281,7 @@ index d16430298..912b56cf3 100644 import android.os.Process; import android.os.SystemClock; import android.os.UserHandle; -@@ -62,6 +64,7 @@ +@@ -62,6 +64,7 @@ import android.test.suitebuilder.annotation.MediumTest; import android.test.suitebuilder.annotation.SmallTest; import android.widget.Toast; @@ -289,7 +289,7 @@ index d16430298..912b56cf3 100644 import com.android.server.telecom.AsyncRingtonePlayer; import com.android.server.telecom.Call; import com.android.server.telecom.CallAudioManager; -@@ -74,6 +77,7 @@ +@@ -74,6 +77,7 @@ import com.android.server.telecom.CallsManagerListenerBase; import com.android.server.telecom.ClockProxy; import com.android.server.telecom.ConnectionServiceFocusManager; import com.android.server.telecom.ConnectionServiceFocusManager.ConnectionServiceFocusManagerFactory; @@ -305,7 +305,7 @@ index d16430298..912b56cf3 100644 private CallsManager mCallsManager; -@@ -274,11 +279,19 @@ public void setUp() throws Exception { +@@ -274,11 +279,19 @@ public class CallsManagerTest extends TelecomTestCase { eq(SIM_2_HANDLE), any())).thenReturn(SIM_2_ACCOUNT); when(mToastFactory.makeText(any(), anyInt(), anyInt())).thenReturn(mToast); when(mToastFactory.makeText(any(), any(), anyInt())).thenReturn(mToast); @@ -325,7 +325,7 @@ index d16430298..912b56cf3 100644 super.tearDown(); } -@@ -1456,6 +1469,32 @@ public void testCrossUserCallRedirectionEndEarlyForIncapablePhoneAccount() { +@@ -1456,6 +1469,32 @@ public class CallsManagerTest extends TelecomTestCase { assertTrue(argumentCaptor.getValue().contains("Unavailable phoneAccountHandle")); } @@ -358,7 +358,7 @@ index d16430298..912b56cf3 100644 private Call addSpyCall() { return addSpyCall(SIM_2_HANDLE, CallState.ACTIVE); } -@@ -1549,4 +1588,19 @@ private void setupMsimAccounts() { +@@ -1549,4 +1588,19 @@ public class CallsManagerTest extends TelecomTestCase { when(mPhoneAccountRegistrar.getSimPhoneAccountsOfCurrentUser()).thenReturn( new ArrayList<>(Arrays.asList(SIM_1_HANDLE, SIM_2_HANDLE))); } @@ -382,7 +382,7 @@ diff --git a/tests/src/com/android/server/telecom/tests/ComponentContextFixture. index af062d77f..0768970b1 100644 --- a/tests/src/com/android/server/telecom/tests/ComponentContextFixture.java +++ b/tests/src/com/android/server/telecom/tests/ComponentContextFixture.java -@@ -589,6 +589,14 @@ public void addConnectionService( +@@ -589,6 +589,14 @@ public class ComponentContextFixture implements TestFixture { mServiceInfoByComponentName.put(componentName, serviceInfo); } @@ -397,7 +397,7 @@ index af062d77f..0768970b1 100644 public void addInCallService( ComponentName componentName, IInCallService service, -@@ -658,6 +666,12 @@ private void addService(String action, ComponentName name, IInterface service) { +@@ -658,6 +666,12 @@ public class ComponentContextFixture implements TestFixture { mComponentNameByService.put(service, name); } diff --git a/Patches/LineageOS-18.1/android_packages_services_Telecomm/403224.patch b/Patches/LineageOS-18.1/android_packages_services_Telecomm/403224.patch index 63ee0b90..5de77f51 100644 --- a/Patches/LineageOS-18.1/android_packages_services_Telecomm/403224.patch +++ b/Patches/LineageOS-18.1/android_packages_services_Telecomm/403224.patch @@ -1,4 +1,4 @@ -From bc65c0bcae61a887b46b5d125ac30b065ff65d15 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Pranav Madapurmath Date: Tue, 11 Jun 2024 15:51:39 +0000 Subject: [PATCH] Unbind CallScreeningService when timeout reached. @@ -30,7 +30,7 @@ diff --git a/src/com/android/server/telecom/CallScreeningServiceHelper.java b/sr index 5e47c1f94..e9ad451c2 100644 --- a/src/com/android/server/telecom/CallScreeningServiceHelper.java +++ b/src/com/android/server/telecom/CallScreeningServiceHelper.java -@@ -191,6 +191,10 @@ public void onNullBinding(ComponentName name) { +@@ -191,6 +191,10 @@ public class CallScreeningServiceHelper { Log.w(TAG, "Cancelling call id process due to timeout"); } mFuture.complete(null); diff --git a/Patches/LineageOS-18.1/android_packages_services_Telecomm/403225.patch b/Patches/LineageOS-18.1/android_packages_services_Telecomm/403225.patch index 5205add5..5727dee1 100644 --- a/Patches/LineageOS-18.1/android_packages_services_Telecomm/403225.patch +++ b/Patches/LineageOS-18.1/android_packages_services_Telecomm/403225.patch @@ -1,4 +1,4 @@ -From cd4c2994e16a9a5c911292a6d05ed66f41efd53a Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Pranav Madapurmath Date: Tue, 11 Jun 2024 22:50:08 -0700 Subject: [PATCH] Resolve cross-user image exploit for conference status hints @@ -20,7 +20,7 @@ diff --git a/src/com/android/server/telecom/ConnectionServiceWrapper.java b/src/ index 6ca74fba3..e944209a4 100644 --- a/src/com/android/server/telecom/ConnectionServiceWrapper.java +++ b/src/com/android/server/telecom/ConnectionServiceWrapper.java -@@ -133,10 +133,17 @@ public void handleCreateConferenceComplete(String callId, ConnectionRequest requ +@@ -133,10 +133,17 @@ public class ConnectionServiceWrapper extends ServiceBinder implements ParcelableConference conference, Session.Info sessionInfo) { Log.startSession(sessionInfo, LogUtils.Sessions.CSW_HANDLE_CREATE_CONNECTION_COMPLETE, mPackageAbbreviation); diff --git a/Patches/LineageOS-18.1/android_system_bt/405535.patch b/Patches/LineageOS-18.1/android_system_bt/405535.patch index 570365f3..21fc74b5 100644 --- a/Patches/LineageOS-18.1/android_system_bt/405535.patch +++ b/Patches/LineageOS-18.1/android_system_bt/405535.patch @@ -1,4 +1,4 @@ -From 2e7c27c2b5d773905ded3e89cbaa424744ddd897 Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Chris Manton Date: Sun, 29 Nov 2020 17:05:05 -0800 Subject: [PATCH] Add privatize option for bluetooth addresses for logging @@ -15,7 +15,7 @@ Change-Id: Id568adb9f9497072a79100202501c4d207e40828 1 file changed, 7 insertions(+) diff --git a/main/shim/dumpsys.h b/main/shim/dumpsys.h -index 91c4ea74618..21339463265 100644 +index 91c4ea746..213394632 100644 --- a/main/shim/dumpsys.h +++ b/main/shim/dumpsys.h @@ -18,6 +18,13 @@ diff --git a/Patches/LineageOS-18.1/android_system_bt/405536.patch b/Patches/LineageOS-18.1/android_system_bt/405536.patch index d945ae1e..5aac371c 100644 --- a/Patches/LineageOS-18.1/android_system_bt/405536.patch +++ b/Patches/LineageOS-18.1/android_system_bt/405536.patch @@ -1,4 +1,4 @@ -From 935b7a26fa502de27c0cd3c97a05381319e8f22c Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Chris Manton Date: Sun, 14 Mar 2021 09:52:19 -0700 Subject: [PATCH] Add btif/include/btif_hh::btif_hh_status_text @@ -16,7 +16,7 @@ Change-Id: Iab6a4f33a3e498c33f4870abc5abd59e073d03f2 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/btif/include/btif_hh.h b/btif/include/btif_hh.h -index b71d347c1a7..f33598d2f19 100644 +index b71d347c1..f33598d2f 100644 --- a/btif/include/btif_hh.h +++ b/btif/include/btif_hh.h @@ -46,7 +46,7 @@ diff --git a/Patches/LineageOS-18.1/android_system_bt/405537.patch b/Patches/LineageOS-18.1/android_system_bt/405537.patch index 158a347e..30efaad8 100644 --- a/Patches/LineageOS-18.1/android_system_bt/405537.patch +++ b/Patches/LineageOS-18.1/android_system_bt/405537.patch @@ -1,7 +1,7 @@ -From 1017cfa02f11db8d077d5d7a32dd46da7c8b050b Mon Sep 17 00:00:00 2001 +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Himanshu Rawat Date: Mon, 8 Apr 2024 19:42:21 +0000 -Subject: [PATCH] [BACKPORT] Disallow unexpected incoming HID connections 1/2 +Subject: [PATCH] Disallow unexpected incoming HID connections 1/2 HID profile accepted any new incoming HID connection. Even when the connection policy disabled HID connection, remote devices could initiate @@ -27,7 +27,7 @@ Change-Id: I6e9db983e752dd498625078c13b736cd4c668806 5 files changed, 161 insertions(+), 8 deletions(-) diff --git a/btif/include/btif_hh.h b/btif/include/btif_hh.h -index f33598d2f19..f93341d89f1 100644 +index f33598d2f..f93341d89 100644 --- a/btif/include/btif_hh.h +++ b/btif/include/btif_hh.h @@ -97,6 +97,7 @@ typedef struct { @@ -49,7 +49,7 @@ index f33598d2f19..f93341d89f1 100644 extern void btif_hh_disconnect(RawAddress* bd_addr); extern void btif_hh_setreport(btif_hh_device_t* p_dev, diff --git a/btif/include/btif_storage.h b/btif/include/btif_storage.h -index 1c1163d1428..362ffdc21bb 100644 +index 1c1163d14..362ffdc21 100644 --- a/btif/include/btif_storage.h +++ b/btif/include/btif_storage.h @@ -178,6 +178,29 @@ bt_status_t btif_storage_remove_bonded_device(const RawAddress* remote_bd_addr); @@ -83,7 +83,7 @@ index 1c1163d1428..362ffdc21bb 100644 * * Function btif_storage_add_hid_device_info diff --git a/btif/src/btif_hh.cc b/btif/src/btif_hh.cc -index 97479e040ba..25fb151d260 100644 +index 97479e040..25fb151d2 100644 --- a/btif/src/btif_hh.cc +++ b/btif/src/btif_hh.cc @@ -42,6 +42,7 @@ @@ -269,7 +269,7 @@ index 97479e040ba..25fb151d260 100644 osi_free_and_reset((void**)&dscp_info.descriptor.dsc_list); diff --git a/btif/src/btif_storage.cc b/btif/src/btif_storage.cc -index 95e4ef07150..8077ae55547 100644 +index 95e4ef071..8077ae555 100644 --- a/btif/src/btif_storage.cc +++ b/btif/src/btif_storage.cc @@ -83,6 +83,8 @@ using bluetooth::Uuid; @@ -355,7 +355,7 @@ index 95e4ef07150..8077ae55547 100644 return BT_STATUS_SUCCESS; } diff --git a/include/hardware/bt_hh.h b/include/hardware/bt_hh.h -index b87b129bb12..923c6279216 100644 +index b87b129bb..923c62792 100644 --- a/include/hardware/bt_hh.h +++ b/include/hardware/bt_hh.h @@ -154,7 +154,7 @@ typedef struct { diff --git a/Patches/LineageOS-19.1/android_frameworks_base/405507.patch b/Patches/LineageOS-19.1/android_frameworks_base/405507.patch deleted file mode 100644 index fd98b376..00000000 --- a/Patches/LineageOS-19.1/android_frameworks_base/405507.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 0ae6d568dabe36c3d303849aee50ce01f58eea11 Mon Sep 17 00:00:00 2001 -From: Dmitry Dementyev -Date: Thu, 11 Jul 2024 12:39:22 -0700 -Subject: [PATCH] Update AccountManagerService checkKeyIntent. - -Block intents with "content" data scheme. - -Bug: 349780950 -Test: manual -Flag: EXEMPT bugfix -(cherry picked from commit c1e79495a49bd4d3e380136fe4bca7ac1a9ed763) -(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:2fec744928adb3e30539a1b9f7bff4ca0ec68bcd) -Merged-In: I8b23191d3d60036ca7ddf0ef7dcba6b38fb27b3c -Change-Id: I8b23191d3d60036ca7ddf0ef7dcba6b38fb27b3c ---- - .../com/android/server/accounts/AccountManagerService.java | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/services/core/java/com/android/server/accounts/AccountManagerService.java b/services/core/java/com/android/server/accounts/AccountManagerService.java -index 43944b050de4e..d55be44f62cdc 100644 ---- a/services/core/java/com/android/server/accounts/AccountManagerService.java -+++ b/services/core/java/com/android/server/accounts/AccountManagerService.java -@@ -4895,6 +4895,9 @@ protected boolean checkKeyIntent(int authUid, Bundle bundle) { - if (resolveInfo == null) { - return false; - } -+ if ("content".equals(intent.getScheme())) { -+ return false; -+ } - ActivityInfo targetActivityInfo = resolveInfo.activityInfo; - int targetUid = targetActivityInfo.applicationInfo.uid; - PackageManagerInternal pmi = LocalServices.getService(PackageManagerInternal.class); diff --git a/Patches/LineageOS-19.1/android_frameworks_base/405508.patch b/Patches/LineageOS-19.1/android_frameworks_base/405508.patch deleted file mode 100644 index 2f37ca34..00000000 --- a/Patches/LineageOS-19.1/android_frameworks_base/405508.patch +++ /dev/null @@ -1,30 +0,0 @@ -From aa9853f993a575fb59dd2ccc4cfeb54bbaa1ab4d Mon Sep 17 00:00:00 2001 -From: William Loh -Date: Mon, 3 Jun 2024 12:56:47 -0700 -Subject: [PATCH] Fail parseUri if end is missing - -Bug: 318683126 -Test: atest IntentTest -Flag: EXEMPT bugfix -(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:b85bee508793e31d6fe37fc9cd4e8fa3787113cc) -(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:a649e8e9abfb16548ccf57d8b740b4bf9ff73ef4) -Merged-In: I5f619ced684ff505ce2b7408cd35dd3e9be89dea -Change-Id: I5f619ced684ff505ce2b7408cd35dd3e9be89dea ---- - core/java/android/content/Intent.java | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/core/java/android/content/Intent.java b/core/java/android/content/Intent.java -index 6224758ce71a4..ec67c7239df25 100644 ---- a/core/java/android/content/Intent.java -+++ b/core/java/android/content/Intent.java -@@ -7322,6 +7322,9 @@ private static Intent parseUriInternal(String uri, @UriFlags int flags) - int eq = uri.indexOf('=', i); - if (eq < 0) eq = i-1; - int semi = uri.indexOf(';', i); -+ if (semi < 0) { -+ throw new URISyntaxException(uri, "uri end not found"); -+ } - String value = eq < semi ? Uri.decode(uri.substring(eq + 1, semi)) : ""; - - // action diff --git a/Patches/LineageOS-19.1/android_frameworks_base/405509.patch b/Patches/LineageOS-19.1/android_frameworks_base/405509.patch deleted file mode 100644 index 7c9237c4..00000000 --- a/Patches/LineageOS-19.1/android_frameworks_base/405509.patch +++ /dev/null @@ -1,39 +0,0 @@ -From eaed3b4cae32cee9b843fb94f4c9c6aa119e9e90 Mon Sep 17 00:00:00 2001 -From: Mark Renouf -Date: Thu, 20 Jun 2024 16:37:42 -0400 -Subject: [PATCH] Prevent Sharing when FRP enforcement is in effect - -ADB command to trigger sharing: - -``` -adb shell 'am start -a android.intent.action.CHOOSER --eu android.intent.extra.INTENT "intent:#Intent;action=android.intent.action.SEND;type=text/plain;S.android.intent.extra.TEXT=Shared%20text;end"' -``` - -Bug: 327645387 -Test: manual; trigger FRP; attempt to open share sheet using adb -(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:697997f9cb0d7cf943549ca757ccc85c6c02ab74) -Merged-In: I1db78ab74babe71b516f601be35cf476b5e43271 -Change-Id: I1db78ab74babe71b516f601be35cf476b5e43271 ---- - core/java/com/android/internal/app/ChooserActivity.java | 8 ++++++++ - 1 file changed, 8 insertions(+) - -diff --git a/core/java/com/android/internal/app/ChooserActivity.java b/core/java/com/android/internal/app/ChooserActivity.java -index 9d95a6b346b3b..c741029143eca 100644 ---- a/core/java/com/android/internal/app/ChooserActivity.java -+++ b/core/java/com/android/internal/app/ChooserActivity.java -@@ -600,6 +600,14 @@ public void handleMessage(Message msg) { - - @Override - protected void onCreate(Bundle savedInstanceState) { -+ if (Settings.Secure.getIntForUser(getContentResolver(), -+ Settings.Secure.SECURE_FRP_MODE, 0, -+ getUserId()) == 1) { -+ Log.e(TAG, "Sharing disabled due to active FRP lock."); -+ super.onCreate(savedInstanceState); -+ finish(); -+ return; -+ } - final long intentReceivedTime = System.currentTimeMillis(); - getChooserActivityLogger().logSharesheetTriggered(); - // This is the only place this value is being set. Effectively final. diff --git a/Patches/LineageOS-19.1/android_frameworks_base/405510.patch b/Patches/LineageOS-19.1/android_frameworks_base/405510.patch deleted file mode 100644 index 0e9bcc7a..00000000 --- a/Patches/LineageOS-19.1/android_frameworks_base/405510.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 183c70e744c8aa6e9f2e74c888785a1811bde781 Mon Sep 17 00:00:00 2001 -From: Sumedh Sen -Date: Wed, 17 Jul 2024 01:00:55 +0000 -Subject: [PATCH] [RESTRICT AUTOMERGE] Check whether installerPackageName - contains only valid characters - -Bug: 341256391 -Bug: 307532206 -Test: sts-tradefed run sts-dynamic-develop -m CtsSecurityTestCases -t android.security.cts.CVE_2024_0044 -(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:33d1e985c4a0118a33ea745b2786b2958a03a9b0) -Merged-In: I74a172c617d6f5b13f0708092156b657b73b5891 -Change-Id: I74a172c617d6f5b13f0708092156b657b73b5891 ---- - .../com/android/server/pm/PackageInstallerService.java | 7 ++++++- - 1 file changed, 6 insertions(+), 1 deletion(-) - -diff --git a/services/core/java/com/android/server/pm/PackageInstallerService.java b/services/core/java/com/android/server/pm/PackageInstallerService.java -index 02515cfdc16ad..310c56ef12601 100644 ---- a/services/core/java/com/android/server/pm/PackageInstallerService.java -+++ b/services/core/java/com/android/server/pm/PackageInstallerService.java -@@ -609,12 +609,17 @@ private int createSessionInternal(SessionParams params, String installerPackageN - params.appLabel = TextUtils.trimToSize(params.appLabel, - PackageItemInfo.MAX_SAFE_LABEL_LENGTH); - -- // Validate installer package name. -+ // Validate requested installer package name. - if (params.installerPackageName != null && !isValidPackageName( - params.installerPackageName)) { - params.installerPackageName = null; - } - -+ // Validate installer package name. -+ if (installerPackageName != null && !isValidPackageName(installerPackageName)) { -+ installerPackageName = null; -+ } -+ - String requestedInstallerPackageName = - params.installerPackageName != null ? params.installerPackageName - : installerPackageName; diff --git a/Patches/LineageOS-19.1/android_libcore/405541.patch b/Patches/LineageOS-19.1/android_libcore/405541.patch deleted file mode 100644 index 664b71ec..00000000 --- a/Patches/LineageOS-19.1/android_libcore/405541.patch +++ /dev/null @@ -1,53 +0,0 @@ -From 1e0f995b0b68d811d4225e73426c4c6350a506ad Mon Sep 17 00:00:00 2001 -From: Almaz Mingaleev -Date: Wed, 10 Jul 2024 13:38:35 +0100 -Subject: [PATCH] Do not accept zip files with invalid headers. - -According to Section 4.3.6 in [1] non-empty zip file starts with -local file header. 4.3.1 allows empty files, and in such case -file starts with "end of central directory record". - -This aligns ZipFile with libziparchive modulo empty zip files - -libziparchive rejects them. - -Tests are skipped because sc-dev branch uses ART module -prebuilts, but builds tests from sources which leads to presubmit -failures. - -Ignore-AOSP-First: b/309938635#comment1 - -[1] https://pkwaredownloads.blob.core.windows.net/pem/APPNOTE.txt - -Bug: 309938635 -Test: CtsLibcoreTestCases -Test: CtsLibcoreOjTestCases -(cherry picked from commit 288a44a1817707110cdf5a3a6ef8377c6e10cce2) -(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:43e428a99aa89a9dfbe93000171721ecbfc31b88) -Merged-In: I545cdd49ec3cc138331145f4716c8148662a478b -Change-Id: I545cdd49ec3cc138331145f4716c8148662a478b ---- - ojluni/src/main/native/zip_util.c | 11 +++++++++++ - 1 file changed, 11 insertions(+) - -diff --git a/ojluni/src/main/native/zip_util.c b/ojluni/src/main/native/zip_util.c -index aa9c5cede9e..16951a78ede 100644 ---- a/ojluni/src/main/native/zip_util.c -+++ b/ojluni/src/main/native/zip_util.c -@@ -878,6 +878,17 @@ ZIP_Put_In_Cache0(const char *name, ZFILE zfd, char **pmsg, jlong lastModified, - zip->locsig = JNI_TRUE; - else - zip->locsig = JNI_FALSE; -+ -+ // BEGIN Android-changed: do not accept files with invalid header. -+ if (GETSIG(errbuf) != LOCSIG && GETSIG(errbuf) != ENDSIG) { -+ if (pmsg) { -+ *pmsg = strdup("Entry at offset zero has invalid LFH signature."); -+ } -+ ZFILE_Close(zfd); -+ freeZip(zip); -+ return NULL; -+ } -+ // END Android-changed: do not accept files with invalid header. - } - - // This lseek is safe because it happens during construction of the ZipFile diff --git a/Patches/LineageOS-19.1/android_packages_apps_Bluetooth/405364-backport.patch b/Patches/LineageOS-19.1/android_packages_apps_Bluetooth/405364-backport.patch deleted file mode 100644 index 116b96b9..00000000 --- a/Patches/LineageOS-19.1/android_packages_apps_Bluetooth/405364-backport.patch +++ /dev/null @@ -1,84 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Himanshu Rawat -Date: Mon, 8 Apr 2024 19:44:45 +0000 -Subject: [PATCH] RESTRICT AUTOMERGE Disallow unexpected incoming HID - connections 2/2 - -HID profile accepted any new incoming HID connection. Even when the -connection policy disabled HID connection, remote devices could initiate -HID connection. -This change ensures that incoming HID connection are accepted only if -application was interested in that HID connection. -This vulnerarbility no longer exists on the main because of feature -request b/324093729. - -Test: Manual | Pair and connect a HID device, disable HID connection -from Bluetooth device setting, attempt to connect from the HID device. -Bug: 308429049 -Ignore-AOSP-First: security -(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:5fc87e65eb3d70f051e2902d3e81ce6587ab1a96) -Merged-In: I1d7e886b1045d026f96c8274aca86dc499f87777 -Change-Id: I1d7e886b1045d026f96c8274aca86dc499f87777 ---- - jni/com_android_bluetooth_hid_host.cpp | 8 +++++--- - src/com/android/bluetooth/hid/HidHostService.java | 7 +++++-- - 2 files changed, 10 insertions(+), 5 deletions(-) - -diff --git a/jni/com_android_bluetooth_hid_host.cpp b/jni/com_android_bluetooth_hid_host.cpp -index 074e39d5b..b552cae52 100644 ---- a/jni/com_android_bluetooth_hid_host.cpp -+++ b/jni/com_android_bluetooth_hid_host.cpp -@@ -284,7 +284,8 @@ static jboolean connectHidNative(JNIEnv* env, jobject object, - } - - static jboolean disconnectHidNative(JNIEnv* env, jobject object, -- jbyteArray address) { -+ jbyteArray address, -+ jboolean reconnect_allowed) { - jbyte* addr; - jboolean ret = JNI_TRUE; - if (!sBluetoothHidInterface) return JNI_FALSE; -@@ -295,7 +296,8 @@ static jboolean disconnectHidNative(JNIEnv* env, jobject object, - return JNI_FALSE; - } - -- bt_status_t status = sBluetoothHidInterface->disconnect((RawAddress*)addr); -+ bt_status_t status = -+ sBluetoothHidInterface->disconnect((RawAddress*)addr, reconnect_allowed); - if (status != BT_STATUS_SUCCESS) { - ALOGE("Failed disconnect hid channel, status: %d", status); - ret = JNI_FALSE; -@@ -511,7 +513,7 @@ static JNINativeMethod sMethods[] = { - {"initializeNative", "()V", (void*)initializeNative}, - {"cleanupNative", "()V", (void*)cleanupNative}, - {"connectHidNative", "([B)Z", (void*)connectHidNative}, -- {"disconnectHidNative", "([B)Z", (void*)disconnectHidNative}, -+ {"disconnectHidNative", "([BZ)Z", (void*)disconnectHidNative}, - {"getProtocolModeNative", "([B)Z", (void*)getProtocolModeNative}, - {"virtualUnPlugNative", "([B)Z", (void*)virtualUnPlugNative}, - {"setProtocolModeNative", "([BB)Z", (void*)setProtocolModeNative}, -diff --git a/src/com/android/bluetooth/hid/HidHostService.java b/src/com/android/bluetooth/hid/HidHostService.java -index f1e974631..e88f4b649 100644 ---- a/src/com/android/bluetooth/hid/HidHostService.java -+++ b/src/com/android/bluetooth/hid/HidHostService.java -@@ -175,7 +175,10 @@ public class HidHostService extends ProfileService { - BluetoothDevice device = (BluetoothDevice) msg.obj; - Attributable.setAttributionSource(device, - ActivityThread.currentAttributionSource()); -- if (!disconnectHidNative(Utils.getByteAddress(device))) { -+ int connectionPolicy = getConnectionPolicy(device); -+ boolean reconnectAllowed = -+ connectionPolicy == BluetoothProfile.CONNECTION_POLICY_ALLOWED; -+ if (!disconnectHidNative(Utils.getByteAddress(device), reconnectAllowed)) { - broadcastConnectionState(device, BluetoothProfile.STATE_DISCONNECTING); - broadcastConnectionState(device, BluetoothProfile.STATE_DISCONNECTED); - break; -@@ -959,7 +962,7 @@ public class HidHostService extends ProfileService { - - private native boolean connectHidNative(byte[] btAddress); - -- private native boolean disconnectHidNative(byte[] btAddress); -+ private native boolean disconnectHidNative(byte[] btAddress, boolean reconnectAllowed); - - private native boolean getProtocolModeNative(byte[] btAddress); - diff --git a/Patches/LineageOS-19.1/android_packages_apps_Settings/405363-backport.patch b/Patches/LineageOS-19.1/android_packages_apps_Settings/405363-backport.patch deleted file mode 100644 index 511ef02a..00000000 --- a/Patches/LineageOS-19.1/android_packages_apps_Settings/405363-backport.patch +++ /dev/null @@ -1,52 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Yiling Chuang -Date: Mon, 8 Jul 2024 03:09:50 +0000 -Subject: [PATCH] RESTRICT AUTOMERGE FRP bypass defense in App battery usage - page - -Before the setup flow completion, don't allow the app info page in App battery usage to be launched. - -Bug: 327748846 -Test: atest SettingsRoboTests + manual test -- factory reset + launch app battery usage app info via ADB during Setup -> verify app closes -Flag : EXEMPT bugfix - -(cherry picked from commit 419a6a907902a12a0f565c808fa70092004d6686) -(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:e5d21702863284479af7561e3c833bc2cab2a7d3) -Merged-In: I486820ca2afecc02729a56a3c531fb931c1907d0 -Change-Id: I486820ca2afecc02729a56a3c531fb931c1907d0 ---- - .../android/settings/fuelgauge/AdvancedPowerUsageDetail.java | 5 +++++ - .../settings/fuelgauge/AdvancedPowerUsageDetailTest.java | 5 +++++ - 2 files changed, 10 insertions(+) - -diff --git a/src/com/android/settings/fuelgauge/AdvancedPowerUsageDetail.java b/src/com/android/settings/fuelgauge/AdvancedPowerUsageDetail.java -index 3741bfe804..d89286d4e4 100644 ---- a/src/com/android/settings/fuelgauge/AdvancedPowerUsageDetail.java -+++ b/src/com/android/settings/fuelgauge/AdvancedPowerUsageDetail.java -@@ -283,6 +283,11 @@ public class AdvancedPowerUsageDetail extends DashboardFragment implements - } - } - -+ @Override -+ protected boolean shouldSkipForInitialSUW() { -+ return true; -+ } -+ - @Override - public void onPause() { - super.onPause(); -diff --git a/tests/robotests/src/com/android/settings/fuelgauge/AdvancedPowerUsageDetailTest.java b/tests/robotests/src/com/android/settings/fuelgauge/AdvancedPowerUsageDetailTest.java -index 0a48cd1b12..212ac21cd0 100644 ---- a/tests/robotests/src/com/android/settings/fuelgauge/AdvancedPowerUsageDetailTest.java -+++ b/tests/robotests/src/com/android/settings/fuelgauge/AdvancedPowerUsageDetailTest.java -@@ -859,4 +859,9 @@ public class AdvancedPowerUsageDetailTest { - - verifyZeroInteractions(mBackupManager); - } -+ -+ @Test -+ public void shouldSkipForInitialSUW_returnTrue() { -+ assertThat(mFragment.shouldSkipForInitialSUW()).isTrue(); -+ } - } diff --git a/Patches/LineageOS-19.1/android_system_bt/405364-backport.patch b/Patches/LineageOS-19.1/android_system_bt/405364-backport.patch deleted file mode 100644 index 090162fc..00000000 --- a/Patches/LineageOS-19.1/android_system_bt/405364-backport.patch +++ /dev/null @@ -1,361 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Himanshu Rawat -Date: Mon, 8 Apr 2024 19:42:21 +0000 -Subject: [PATCH] RESTRICT AUTOMERGE Disallow unexpected incoming HID - connections 1/2 - -HID profile accepted any new incoming HID connection. Even when the -connection policy disabled HID connection, remote devices could initiate -HID connection. -This change ensures that incoming HID connection are accepted only if -application was interested in that HID connection. -This vulnerarbility no longer exists on the main because of feature -request b/324093729. - -Test: Manual | Pair and connect a HID device, disable HID connection -from Bluetooth device setting, attempt to connect from the HID device. -Bug: 308429049 -Ignore-AOSP-First: security -(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:18c635ad7923f5c26d6cd4cf7f7c66b2fa02462b) -Merged-In: I6e9db983e752dd498625078c13b736cd4c668806 -Change-Id: I6e9db983e752dd498625078c13b736cd4c668806 ---- - btif/include/btif_hh.h | 4 +- - btif/include/btif_storage.h | 23 ++++++++++ - btif/src/btif_hh.cc | 86 ++++++++++++++++++++++++++++++++++--- - btif/src/btif_storage.cc | 52 +++++++++++++++++++++- - include/hardware/bt_hh.h | 2 +- - 5 files changed, 159 insertions(+), 8 deletions(-) - -diff --git a/btif/include/btif_hh.h b/btif/include/btif_hh.h -index 1d4bc93e2..978951500 100644 ---- a/btif/include/btif_hh.h -+++ b/btif/include/btif_hh.h -@@ -99,6 +99,7 @@ typedef struct { - uint8_t dev_handle; - RawAddress bd_addr; - tBTA_HH_ATTR_MASK attr_mask; -+ bool reconnect_allowed; - } btif_hh_added_device_t; - - /** -@@ -124,7 +125,8 @@ extern btif_hh_cb_t btif_hh_cb; - extern btif_hh_device_t* btif_hh_find_connected_dev_by_handle(uint8_t handle); - extern void btif_hh_remove_device(RawAddress bd_addr); - extern bool btif_hh_add_added_dev(const RawAddress& bda, -- tBTA_HH_ATTR_MASK attr_mask); -+ tBTA_HH_ATTR_MASK attr_mask, -+ bool reconnect_allowed); - extern bt_status_t btif_hh_virtual_unplug(const RawAddress* bd_addr); - extern void btif_hh_disconnect(RawAddress* bd_addr); - extern void btif_hh_setreport(btif_hh_device_t* p_dev, -diff --git a/btif/include/btif_storage.h b/btif/include/btif_storage.h -index 7e970ec4d..a568e7006 100644 ---- a/btif/include/btif_storage.h -+++ b/btif/include/btif_storage.h -@@ -179,6 +179,29 @@ bt_status_t btif_storage_remove_bonded_device(const RawAddress* remote_bd_addr); - ******************************************************************************/ - bt_status_t btif_storage_load_bonded_devices(void); - -+/******************************************************************************* -+ * -+ * Function btif_storage_set_hid_connection_policy -+ * -+ * Description Stores connection policy info in nvram -+ * -+ * Returns BT_STATUS_SUCCESS -+ * -+ ******************************************************************************/ -+bt_status_t btif_storage_set_hid_connection_policy(const RawAddress& addr, -+ bool reconnect_allowed); -+/******************************************************************************* -+ * -+ * Function btif_storage_get_hid_connection_policy -+ * -+ * Description get connection policy info from nvram -+ * -+ * Returns BT_STATUS_SUCCESS -+ * -+ ******************************************************************************/ -+bt_status_t btif_storage_get_hid_connection_policy(const RawAddress& addr, -+ bool* reconnect_allowed); -+ - /******************************************************************************* - * - * Function btif_storage_add_hid_device_info -diff --git a/btif/src/btif_hh.cc b/btif/src/btif_hh.cc -index b35b2cd49..fc7731e92 100644 ---- a/btif/src/btif_hh.cc -+++ b/btif/src/btif_hh.cc -@@ -305,6 +305,24 @@ btif_hh_device_t* btif_hh_find_connected_dev_by_handle(uint8_t handle) { - return NULL; - } - -+/******************************************************************************* -+ * -+ * Function btif_hh_find_added_dev -+ * -+ * Description Return the added device pointer of the specified address -+ * -+ * Returns Added device entry -+ ******************************************************************************/ -+btif_hh_added_device_t* btif_hh_find_added_dev(const RawAddress& addr) { -+ for (int i = 0; i < BTIF_HH_MAX_ADDED_DEV; i++) { -+ btif_hh_added_device_t* added_dev = &btif_hh_cb.added_devices[i]; -+ if (added_dev->bd_addr == addr) { -+ return added_dev; -+ } -+ } -+ return nullptr; -+} -+ - /******************************************************************************* - * - * Function btif_hh_find_dev_by_bda -@@ -390,7 +408,8 @@ void btif_hh_start_vup_timer(const RawAddress* bd_addr) { - * - * Returns true if add successfully, otherwise false. - ******************************************************************************/ --bool btif_hh_add_added_dev(const RawAddress& bda, tBTA_HH_ATTR_MASK attr_mask) { -+bool btif_hh_add_added_dev(const RawAddress& bda, tBTA_HH_ATTR_MASK attr_mask, -+ bool reconnect_allowed) { - int i; - for (i = 0; i < BTIF_HH_MAX_ADDED_DEV; i++) { - if (btif_hh_cb.added_devices[i].bd_addr == bda) { -@@ -404,6 +423,7 @@ bool btif_hh_add_added_dev(const RawAddress& bda, tBTA_HH_ATTR_MASK attr_mask) { - btif_hh_cb.added_devices[i].bd_addr = bda; - btif_hh_cb.added_devices[i].dev_handle = BTA_HH_INVALID_HANDLE; - btif_hh_cb.added_devices[i].attr_mask = attr_mask; -+ btif_hh_cb.added_devices[i].reconnect_allowed = reconnect_allowed; - return true; - } - } -@@ -711,6 +731,23 @@ void btif_hh_getreport(btif_hh_device_t* p_dev, bthh_report_type_t r_type, - * - ****************************************************************************/ - -+static bool btif_hh_connection_allowed(const RawAddress& bda) { -+ /* Accept connection only if reconnection is allowed for the known device, or -+ * outgoing connection was requested */ -+ btif_hh_added_device_t* added_dev = btif_hh_find_added_dev(bda); -+ if (added_dev != nullptr && added_dev->reconnect_allowed) { -+ LOG_VERBOSE("Connection allowed %s", PRIVATE_ADDRESS(bda)); -+ return true; -+ } else if (btif_hh_cb.pending_conn_address == bda) { -+ LOG_VERBOSE("Device connection was pending for: %s, status: %s", -+ PRIVATE_ADDRESS(bda), -+ btif_hh_status_text(btif_hh_cb.status).c_str()); -+ return true; -+ } -+ -+ return false; -+} -+ - /******************************************************************************* - * - * Function btif_hh_upstreams_evt -@@ -769,9 +806,26 @@ static void btif_hh_upstreams_evt(uint16_t event, char* p_param) { - p_data->status); - break; - -- case BTA_HH_OPEN_EVT: -+ case BTA_HH_OPEN_EVT: { - BTIF_TRACE_WARNING("%s: BTA_HH_OPN_EVT: handle=%d, status =%d", __func__, - p_data->conn.handle, p_data->conn.status); -+ -+ if (!btif_hh_connection_allowed(p_data->conn.bda)) { -+ LOG_WARN("Reject Incoming HID Connection, device: %s", -+ PRIVATE_ADDRESS(p_data->conn.bda)); -+ btif_hh_device_t* p_dev = -+ btif_hh_find_connected_dev_by_handle(p_data->conn.handle); -+ if (p_dev != nullptr) { -+ p_dev->dev_status = BTHH_CONN_STATE_DISCONNECTED; -+ } -+ -+ btif_hh_cb.status = (BTIF_HH_STATUS)BTIF_HH_DEV_DISCONNECTED; -+ BTA_HhClose(p_data->conn.handle); -+ HAL_CBACK(bt_hh_callbacks, connection_state_cb, &p_data->conn.bda, -+ BTHH_CONN_STATE_DISCONNECTED); -+ return; -+ } -+ - btif_hh_cb.pending_conn_address = RawAddress::kEmpty; - if (p_data->conn.status == BTA_HH_OK) { - p_dev = btif_hh_find_connected_dev_by_handle(p_data->conn.handle); -@@ -830,6 +884,7 @@ static void btif_hh_upstreams_evt(uint16_t event, char* p_param) { - btif_hh_cb.status = (BTIF_HH_STATUS)BTIF_HH_DEV_DISCONNECTED; - } - break; -+ } - - case BTA_HH_CLOSE_EVT: - BTIF_TRACE_DEBUG("BTA_HH_CLOSE_EVT: status = %d, handle = %d", -@@ -982,7 +1037,7 @@ static void btif_hh_upstreams_evt(uint16_t event, char* p_param) { - p_data->dscp_info.version, - p_data->dscp_info.ctry_code, len, - p_data->dscp_info.descriptor.dsc_list); -- if (btif_hh_add_added_dev(p_dev->bd_addr, p_dev->attr_mask)) { -+ if (btif_hh_add_added_dev(p_dev->bd_addr, p_dev->attr_mask, true)) { - tBTA_HH_DEV_DSCP_INFO dscp_info; - bt_status_t ret; - btif_hh_copy_hid_info(&dscp_info, &p_data->dscp_info); -@@ -998,6 +1053,8 @@ static void btif_hh_upstreams_evt(uint16_t event, char* p_param) { - p_data->dscp_info.ssr_min_tout, len, - p_data->dscp_info.descriptor.dsc_list); - -+ btif_storage_set_hid_connection_policy(p_dev->bd_addr, true); -+ - ASSERTC(ret == BT_STATUS_SUCCESS, "storing hid info failed", ret); - BTIF_TRACE_WARNING("BTA_HH_GET_DSCP_EVT: Called add device"); - -@@ -1285,6 +1342,13 @@ static bt_status_t init(bthh_callbacks_t* callbacks) { - ******************************************************************************/ - static bt_status_t connect(RawAddress* bd_addr) { - if (btif_hh_cb.status != BTIF_HH_DEV_CONNECTING) { -+ /* If the device was already added, ensure that reconnections are allowed */ -+ btif_hh_added_device_t* added_dev = btif_hh_find_added_dev(*bd_addr); -+ if (added_dev != nullptr && !added_dev->reconnect_allowed) { -+ added_dev->reconnect_allowed = true; -+ btif_storage_set_hid_connection_policy(*bd_addr, true); -+ } -+ - btif_transfer_context(btif_hh_handle_evt, BTIF_HH_CONNECT_REQ_EVT, - (char*)bd_addr, sizeof(RawAddress), NULL); - return BT_STATUS_SUCCESS; -@@ -1305,7 +1369,7 @@ static bt_status_t connect(RawAddress* bd_addr) { - * Returns bt_status_t - * - ******************************************************************************/ --static bt_status_t disconnect(RawAddress* bd_addr) { -+static bt_status_t disconnect(RawAddress* bd_addr, bool reconnect_allowed) { - CHECK_BTHH_INIT(); - BTIF_TRACE_EVENT("BTHH: %s", __func__); - btif_hh_device_t* p_dev; -@@ -1315,6 +1379,17 @@ static bt_status_t disconnect(RawAddress* bd_addr) { - btif_hh_cb.status); - return BT_STATUS_FAIL; - } -+ -+ if (!reconnect_allowed) { -+ LOG_INFO("Incoming reconnections disabled for device %s", -+ PRIVATE_ADDRESS((*bd_addr))); -+ btif_hh_added_device_t* added_dev = btif_hh_find_added_dev(*bd_addr); -+ if (added_dev != nullptr && added_dev->reconnect_allowed) { -+ added_dev->reconnect_allowed = false; -+ btif_storage_set_hid_connection_policy(added_dev->bd_addr, false); -+ } -+ } -+ - p_dev = btif_hh_find_connected_dev_by_bda(*bd_addr); - if (p_dev != NULL) { - return btif_transfer_context(btif_hh_handle_evt, BTIF_HH_DISCONNECT_REQ_EVT, -@@ -1446,9 +1521,10 @@ static bt_status_t set_info(RawAddress* bd_addr, bthh_hid_info_t hid_info) { - (uint8_t*)osi_malloc(dscp_info.descriptor.dl_len); - memcpy(dscp_info.descriptor.dsc_list, &(hid_info.dsc_list), hid_info.dl_len); - -- if (btif_hh_add_added_dev(*bd_addr, hid_info.attr_mask)) { -+ if (btif_hh_add_added_dev(*bd_addr, hid_info.attr_mask, true)) { - BTA_HhAddDev(*bd_addr, hid_info.attr_mask, hid_info.sub_class, - hid_info.app_id, dscp_info); -+ btif_storage_set_hid_connection_policy(*bd_addr, true); - } - - osi_free_and_reset((void**)&dscp_info.descriptor.dsc_list); -diff --git a/btif/src/btif_storage.cc b/btif/src/btif_storage.cc -index 570c024fe..b42b8ed7d 100644 ---- a/btif/src/btif_storage.cc -+++ b/btif/src/btif_storage.cc -@@ -88,6 +88,8 @@ using bluetooth::Uuid; - #define BTIF_STORAGE_KEY_SECURE_CONNECTIONS_SUPPORTED \ - "SecureConnectionsSupported" - -+#define BTIF_STORAGE_KEY_HID_RECONNECT_ALLOWED "HidReConnectAllowed" -+ - /* This is a local property to add a device found */ - #define BT_PROPERTY_REMOTE_DEVICE_TIMESTAMP 0xFF - -@@ -1348,6 +1350,50 @@ bt_status_t btif_storage_get_remote_addr_type(const RawAddress* remote_bd_addr, - *addr_type = static_cast(val); - return ret ? BT_STATUS_SUCCESS : BT_STATUS_FAIL; - } -+ -+/******************************************************************************* -+ * -+ * Function btif_storage_set_hid_connection_policy -+ * -+ * Description Stores connection policy info in nvram -+ * -+ * Returns BT_STATUS_SUCCESS -+ * -+ ******************************************************************************/ -+bt_status_t btif_storage_set_hid_connection_policy(const RawAddress& addr, -+ bool reconnect_allowed) { -+ std::string bdstr = addr.ToString(); -+ -+ if (btif_config_set_int(bdstr, BTIF_STORAGE_KEY_HID_RECONNECT_ALLOWED, -+ reconnect_allowed)) { -+ return BT_STATUS_SUCCESS; -+ } else { -+ return BT_STATUS_FAIL; -+ } -+} -+ -+/******************************************************************************* -+ * -+ * Function btif_storage_get_hid_connection_policy -+ * -+ * Description get connection policy info from nvram -+ * -+ * Returns BT_STATUS_SUCCESS -+ * -+ ******************************************************************************/ -+bt_status_t btif_storage_get_hid_connection_policy(const RawAddress& addr, -+ bool* reconnect_allowed) { -+ std::string bdstr = addr.ToString(); -+ -+ // For backward compatibility, assume that the reconnection is allowed in the -+ // absence of the key -+ int value = 1; -+ btif_config_get_int(bdstr, BTIF_STORAGE_KEY_HID_RECONNECT_ALLOWED, &value); -+ *reconnect_allowed = (value != 0); -+ -+ return BT_STATUS_SUCCESS; -+} -+ - /******************************************************************************* - * - * Function btif_storage_add_hid_device_info -@@ -1443,8 +1489,11 @@ bt_status_t btif_storage_load_bonded_hid_info(void) { - (uint8_t*)dscp_info.descriptor.dsc_list, &len); - } - -+ bool reconnect_allowed = false; -+ btif_storage_get_hid_connection_policy(bd_addr, &reconnect_allowed); -+ - // add extracted information to BTA HH -- if (btif_hh_add_added_dev(bd_addr, attr_mask)) { -+ if (btif_hh_add_added_dev(bd_addr, attr_mask, reconnect_allowed)) { - BTA_HhAddDev(bd_addr, attr_mask, sub_class, app_id, dscp_info); - } - } -@@ -1476,6 +1525,7 @@ bt_status_t btif_storage_remove_hid_info(const RawAddress& remote_bd_addr) { - btif_config_remove(bdstr, "HidSSRMaxLatency"); - btif_config_remove(bdstr, "HidSSRMinTimeout"); - btif_config_remove(bdstr, "HidDescriptor"); -+ btif_config_remove(bdstr, BTIF_STORAGE_KEY_HID_RECONNECT_ALLOWED); - btif_config_save(); - return BT_STATUS_SUCCESS; - } -diff --git a/include/hardware/bt_hh.h b/include/hardware/bt_hh.h -index 06272d2c9..75c9cf462 100644 ---- a/include/hardware/bt_hh.h -+++ b/include/hardware/bt_hh.h -@@ -170,7 +170,7 @@ typedef struct { - bt_status_t (*connect)(RawAddress* bd_addr); - - /** dis-connect from hid device */ -- bt_status_t (*disconnect)(RawAddress* bd_addr); -+ bt_status_t (*disconnect)(RawAddress* bd_addr, bool reconnect_allowed); - - /** Virtual UnPlug (VUP) the specified HID device */ - bt_status_t (*virtual_unplug)(RawAddress* bd_addr); diff --git a/Scripts/LineageOS-18.1/Patch.sh b/Scripts/LineageOS-18.1/Patch.sh index 51516133..59b39c0a 100644 --- a/Scripts/LineageOS-18.1/Patch.sh +++ b/Scripts/LineageOS-18.1/Patch.sh @@ -311,7 +311,7 @@ applyPatch "$DOS_PATCHES/android_hardware_qcom_audio/0001-Unused-sm8150.patch"; fi; if enterAndClear "libcore"; then -applyPatch "$DOS_PATCHES/android_libcore/405541.patch"; #R_asb_2024-10 Do not accept zip files with invalid headers. +applyPatch "$DOS_PATCHES/android_libcore/405362.patch"; #R_asb_2024-10 Do not accept zip files with invalid headers. applyPatch "$DOS_PATCHES/android_libcore/0001-Network_Permission.patch"; #Expose the NETWORK permission (GrapheneOS) applyPatch "$DOS_PATCHES/android_libcore/0002-constify_JNINativeMethod.patch"; #Constify JNINativeMethod tables (GrapheneOS) applyPatch "$DOS_PATCHES/android_libcore/0003-Exec_Based_Spawning-1.patch"; #Add exec-based spawning support (GrapheneOS) diff --git a/Scripts/LineageOS-19.1/Functions.sh b/Scripts/LineageOS-19.1/Functions.sh index b0fad491..5ce8bc74 100644 --- a/Scripts/LineageOS-19.1/Functions.sh +++ b/Scripts/LineageOS-19.1/Functions.sh @@ -66,8 +66,9 @@ patchWorkspaceReal() { verifyAllPlatformTags; gpgVerifyGitHead "$DOS_BUILD_BASE/external/chromium-webview"; - #source build/envsetup.sh; + source build/envsetup.sh; #repopick -ift twelve-bt-sbc-hd-dualchannel; + repopick -it S_asb_2024-10; sh "$DOS_SCRIPTS/Patch.sh"; sh "$DOS_SCRIPTS_COMMON/Enable_Verity.sh"; diff --git a/Scripts/LineageOS-19.1/Patch.sh b/Scripts/LineageOS-19.1/Patch.sh index 4a52504c..4755b58a 100644 --- a/Scripts/LineageOS-19.1/Patch.sh +++ b/Scripts/LineageOS-19.1/Patch.sh @@ -135,10 +135,6 @@ fi; if enterAndClear "frameworks/base"; then git revert --no-edit 83fe523914728a3674debba17a6019cb74803045; #Reverts "Allow signature spoofing for microG Companion/Services" in favor of below patch -applyPatch "$DOS_PATCHES/android_frameworks_base/405507.patch"; #S_asb_2024-10 Update AccountManagerService checkKeyIntent. -applyPatch "$DOS_PATCHES/android_frameworks_base/405508.patch"; #S_asb_2024-10 Fail parseUri if end is missing -applyPatch "$DOS_PATCHES/android_frameworks_base/405509.patch"; #S_asb_2024-10 Prevent Sharing when FRP enforcement is in effect -applyPatch "$DOS_PATCHES/android_frameworks_base/405510.patch"; #S_asb_2024-10 Check whether installerPackageName contains only valid characters applyPatch "$DOS_PATCHES/android_frameworks_base/344888-backport.patch"; #fixup! fw/b: Add support for allowing/disallowing apps on cellular, vpn and wifi networks (CalyxOS) applyPatch "$DOS_PATCHES/android_frameworks_base/0007-Always_Restict_Serial.patch"; #Always restrict access to Build.SERIAL (GrapheneOS) applyPatch "$DOS_PATCHES/android_frameworks_base/0008-Browser_No_Location.patch"; #Don't grant location permission to system browsers (GrapheneOS) @@ -260,7 +256,6 @@ applyPatch "$DOS_PATCHES/android_hardware_qcom_audio/0001-Unused-sm8150.patch"; fi; if enterAndClear "libcore"; then -applyPatch "$DOS_PATCHES/android_libcore/405362.patch"; #T_asb_2024-10 Do not accept zip files with invalid headers. applyPatch "$DOS_PATCHES/android_libcore/0001-Network_Permission.patch"; #Expose the NETWORK permission (GrapheneOS) applyPatch "$DOS_PATCHES/android_libcore/0002-constify_JNINativeMethod.patch"; #Constify JNINativeMethod tables (GrapheneOS) applyPatch "$DOS_PATCHES/android_libcore/0003-Exec_Based_Spawning-1.patch"; #Add exec-based spawning support (GrapheneOS) @@ -272,7 +267,6 @@ if [ "$DOS_DEBLOBBER_REMOVE_AUDIOFX" = true ]; then awk -i inplace '!/LineageAud fi; if enterAndClear "packages/apps/Bluetooth"; then -applyPatch "$DOS_PATCHES/android_packages_apps_Bluetooth/405364-backport.patch"; #T_asb_2024-10 Disallow unexpected incoming HID connections applyPatch "$DOS_PATCHES/android_packages_apps_Bluetooth/0001-constify_JNINativeMethod.patch"; #Constify JNINativeMethod tables (GrapheneOS) fi; @@ -313,7 +307,6 @@ applyPatch "$DOS_PATCHES/android_packages_apps_Nfc/0001-constify_JNINativeMethod fi; if enterAndClear "packages/apps/Settings"; then -applyPatch "$DOS_PATCHES/android_packages_apps_Settings/405363-backport.patch"; #T_asb_2024-10 FRP bypass defense in App battery usage page applyPatch "$DOS_PATCHES/android_packages_apps_Settings/0004-Private_DNS.patch"; #More 'Private DNS' options (heavily based off of a CalyxOS patch) applyPatch "$DOS_PATCHES/android_packages_apps_Settings/0005-Automatic_Reboot.patch"; #Timeout for reboot (GrapheneOS) applyPatch "$DOS_PATCHES/android_packages_apps_Settings/0006-Bluetooth_Timeout.patch"; #Timeout for Bluetooth (CalyxOS) @@ -402,7 +395,6 @@ if [ -d "$DOS_BUILD_BASE"/vendor/divested-carriersettings ]; then applyPatch "$D fi; if enterAndClear "system/bt"; then -applyPatch "$DOS_PATCHES/android_system_bt/405364-backport.patch"; #T_asb_2024-10 Disallow unexpected incoming HID connections applyPatch "$DOS_PATCHES_COMMON/android_system_bt/0001-alloc_size.patch"; #Add alloc_size attributes to the allocator (GrapheneOS) fi;