diff --git a/Patches/LineageOS-17.1/android_frameworks_av/358555.patch b/Patches/LineageOS-17.1/android_frameworks_av/358555.patch new file mode 100644 index 00000000..cdbfef79 --- /dev/null +++ b/Patches/LineageOS-17.1/android_frameworks_av/358555.patch @@ -0,0 +1,75 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Ray Essick +Date: Mon, 27 Mar 2023 18:16:46 -0500 +Subject: [PATCH] Fix NuMediaExtractor::readSampleData buffer Handling + +readSampleData() did not initialize buffer before filling it, +leading to OOB memory references. Correct and clarify the book +keeping around output buffer management. + +Bug: 275418191 +Test: CtsMediaExtractorTestCases w/debug messages +(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:943fc12219b21d2a98f0ddc070b9b316a6f5d412) +(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:84c69bca81175feb2fd97ebb22e432ee41572786) +Merged-In: Ie744f118526f100d82a312c64f7c6fcf20773b6d +Change-Id: Ie744f118526f100d82a312c64f7c6fcf20773b6d +--- + media/libstagefright/NuMediaExtractor.cpp | 14 +++++++++----- + 1 file changed, 9 insertions(+), 5 deletions(-) + +diff --git a/media/libstagefright/NuMediaExtractor.cpp b/media/libstagefright/NuMediaExtractor.cpp +index 680d426d96..ddab6d3923 100644 +--- a/media/libstagefright/NuMediaExtractor.cpp ++++ b/media/libstagefright/NuMediaExtractor.cpp +@@ -595,9 +595,11 @@ status_t NuMediaExtractor::appendVorbisNumPageSamples( + numPageSamples = -1; + } + ++ // insert, including accounting for the space used. + memcpy((uint8_t *)buffer->data() + mbuf->range_length(), + &numPageSamples, + sizeof(numPageSamples)); ++ buffer->setRange(buffer->offset(), buffer->size() + sizeof(numPageSamples)); + + uint32_t type; + const void *data; +@@ -646,6 +648,8 @@ status_t NuMediaExtractor::readSampleData(const sp &buffer) { + + ssize_t minIndex = fetchAllTrackSamples(); + ++ buffer->setRange(0, 0); // start with an empty buffer ++ + if (minIndex < 0) { + return ERROR_END_OF_STREAM; + } +@@ -661,25 +665,25 @@ status_t NuMediaExtractor::readSampleData(const sp &buffer) { + sampleSize += sizeof(int32_t); + } + ++ // capacity() is ok since we cleared out the buffer + if (buffer->capacity() < sampleSize) { + return -ENOMEM; + } + ++ const size_t srclen = it->mBuffer->range_length(); + const uint8_t *src = + (const uint8_t *)it->mBuffer->data() + + it->mBuffer->range_offset(); + +- memcpy((uint8_t *)buffer->data(), src, it->mBuffer->range_length()); ++ memcpy((uint8_t *)buffer->data(), src, srclen); ++ buffer->setRange(0, srclen); + + status_t err = OK; + if (info->mTrackFlags & kIsVorbis) { ++ // adjusts range when it inserts the extra bits + err = appendVorbisNumPageSamples(it->mBuffer, buffer); + } + +- if (err == OK) { +- buffer->setRange(0, sampleSize); +- } +- + return err; + } + diff --git a/Patches/LineageOS-17.1/android_frameworks_base/0013-Private_DNS.patch b/Patches/LineageOS-17.1/android_frameworks_base/0013-Private_DNS.patch index d80e55c6..60fbb860 100644 --- a/Patches/LineageOS-17.1/android_frameworks_base/0013-Private_DNS.patch +++ b/Patches/LineageOS-17.1/android_frameworks_base/0013-Private_DNS.patch @@ -21,7 +21,7 @@ Change-Id: Id75a774ce1ed109a83c6a5bf512536c643165d71 2 files changed, 170 insertions(+) diff --git a/core/java/android/net/ConnectivityManager.java b/core/java/android/net/ConnectivityManager.java -index 111a8c48a46c..12102a140947 100644 +index 111a8c48a46c..962c4215f7b6 100644 --- a/core/java/android/net/ConnectivityManager.java +++ b/core/java/android/net/ConnectivityManager.java @@ -757,6 +757,58 @@ public class ConnectivityManager { diff --git a/Patches/LineageOS-17.1/android_frameworks_base/0014-Network_Permission-6.patch b/Patches/LineageOS-17.1/android_frameworks_base/0014-Network_Permission-6.patch index cfbb71fc..6bb9c631 100644 --- a/Patches/LineageOS-17.1/android_frameworks_base/0014-Network_Permission-6.patch +++ b/Patches/LineageOS-17.1/android_frameworks_base/0014-Network_Permission-6.patch @@ -8,7 +8,7 @@ Subject: [PATCH] skip reportNetworkConnectivity() when permission is revoked 1 file changed, 8 insertions(+) diff --git a/core/java/android/net/ConnectivityManager.java b/core/java/android/net/ConnectivityManager.java -index 12102a140947..21661609ff72 100644 +index 962c4215f7b6..089f6b65a908 100644 --- a/core/java/android/net/ConnectivityManager.java +++ b/core/java/android/net/ConnectivityManager.java @@ -17,6 +17,7 @@ package android.net; diff --git a/Patches/LineageOS-17.1/android_frameworks_base/358556.patch b/Patches/LineageOS-17.1/android_frameworks_base/358556.patch new file mode 100644 index 00000000..2bd7fa27 --- /dev/null +++ b/Patches/LineageOS-17.1/android_frameworks_base/358556.patch @@ -0,0 +1,35 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Hongwei Wang +Date: Thu, 23 Feb 2023 13:23:37 -0800 +Subject: [PATCH] Remove Activity if it enters PiP without window + +This is to prevent malicious app entering PiP without being visible +first, like blocking onResume from completion. Which in turn +leaves the PiP window in limbo and non-interactable. + +Bug: 265293293 +Test: atest PinnedStackTests +(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:4fad1456409b79d6e649a29d5116a4fe3160bd21) +Merged-In: I458a9508662e72a1adb9d9818105f2e9d7096d44 +Change-Id: I458a9508662e72a1adb9d9818105f2e9d7096d44 +--- + .../core/java/com/android/server/wm/ActivityRecord.java | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/services/core/java/com/android/server/wm/ActivityRecord.java b/services/core/java/com/android/server/wm/ActivityRecord.java +index 55e8e19fd278..ffd27481a280 100644 +--- a/services/core/java/com/android/server/wm/ActivityRecord.java ++++ b/services/core/java/com/android/server/wm/ActivityRecord.java +@@ -781,6 +781,12 @@ final class ActivityRecord extends ConfigurationContainer { + } + schedulePictureInPictureModeChanged(newConfig); + scheduleMultiWindowModeChanged(newConfig); ++ if (inPictureInPictureMode && findMainWindow() == null) { ++ // Prevent malicious app entering PiP without valid WindowState, which can in turn ++ // result a non-touchable PiP window since the InputConsumer for PiP requires it. ++ EventLog.writeEvent(0x534e4554, "265293293", -1, ""); ++ removeImmediately(); ++ } + } + } + diff --git a/Patches/LineageOS-17.1/android_frameworks_base/358557.patch b/Patches/LineageOS-17.1/android_frameworks_base/358557.patch new file mode 100644 index 00000000..9426ddc0 --- /dev/null +++ b/Patches/LineageOS-17.1/android_frameworks_base/358557.patch @@ -0,0 +1,106 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Mark Renouf +Date: Wed, 22 Feb 2023 15:14:08 +0000 +Subject: [PATCH] Prevent sharesheet from previewing unowned URIs + +Bug: 261036568 +Test: manually via supplied tool (see bug) +(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:3062b80fb28014a7482d5fa8b2a5c852134a5845) +Merged-In: I21accf6f753d2f676f1602d6e1ce829c5ef29e9a +Change-Id: I21accf6f753d2f676f1602d6e1ce829c5ef29e9a +--- + .../android/internal/app/ChooserActivity.java | 36 +++++++++++++++++-- + 1 file changed, 34 insertions(+), 2 deletions(-) + +diff --git a/core/java/com/android/internal/app/ChooserActivity.java b/core/java/com/android/internal/app/ChooserActivity.java +index f43ff17ed7d0..2e17dce90240 100644 +--- a/core/java/com/android/internal/app/ChooserActivity.java ++++ b/core/java/com/android/internal/app/ChooserActivity.java +@@ -16,6 +16,8 @@ + + package com.android.internal.app; + ++import static android.content.ContentProvider.getUserIdFromUri; ++ + import static java.lang.annotation.RetentionPolicy.SOURCE; + + import android.animation.Animator; +@@ -140,6 +142,7 @@ import java.util.HashSet; + import java.util.List; + import java.util.Map; + import java.util.Set; ++import java.util.stream.Collectors; + + /** + * The Chooser Activity handles intent resolution specifically for sharing intents - +@@ -1082,7 +1085,7 @@ public class ChooserActivity extends ResolverActivity { + + ImageView previewThumbnailView = contentPreviewLayout.findViewById( + R.id.content_preview_thumbnail); +- if (previewThumbnail == null) { ++ if (!validForContentPreview(previewThumbnail)) { + previewThumbnailView.setVisibility(View.GONE); + } else { + mPreviewCoord = new ContentPreviewCoordinator(contentPreviewLayout, false); +@@ -1109,6 +1112,10 @@ public class ChooserActivity extends ResolverActivity { + String action = targetIntent.getAction(); + if (Intent.ACTION_SEND.equals(action)) { + Uri uri = targetIntent.getParcelableExtra(Intent.EXTRA_STREAM); ++ if (!validForContentPreview(uri)) { ++ contentPreviewLayout.setVisibility(View.GONE); ++ return contentPreviewLayout; ++ } + mPreviewCoord.loadUriIntoView(R.id.content_preview_image_1_large, uri, 0); + } else { + ContentResolver resolver = getContentResolver(); +@@ -1116,7 +1123,7 @@ public class ChooserActivity extends ResolverActivity { + List uris = targetIntent.getParcelableArrayListExtra(Intent.EXTRA_STREAM); + List imageUris = new ArrayList<>(); + for (Uri uri : uris) { +- if (isImageType(resolver.getType(uri))) { ++ if (validForContentPreview(uri) && isImageType(resolver.getType(uri))) { + imageUris.add(uri); + } + } +@@ -1222,9 +1229,16 @@ public class ChooserActivity extends ResolverActivity { + String action = targetIntent.getAction(); + if (Intent.ACTION_SEND.equals(action)) { + Uri uri = targetIntent.getParcelableExtra(Intent.EXTRA_STREAM); ++ if (!validForContentPreview(uri)) { ++ contentPreviewLayout.setVisibility(View.GONE); ++ return contentPreviewLayout; ++ } + loadFileUriIntoView(uri, contentPreviewLayout); + } else { + List uris = targetIntent.getParcelableArrayListExtra(Intent.EXTRA_STREAM); ++ uris = uris.stream() ++ .filter(ChooserActivity::validForContentPreview) ++ .collect(Collectors.toList()); + int uriCount = uris.size(); + + if (uriCount == 0) { +@@ -1278,6 +1292,24 @@ public class ChooserActivity extends ResolverActivity { + } + } + ++ /** ++ * Indicate if the incoming content URI should be allowed. ++ * ++ * @param uri the uri to test ++ * @return true if the URI is allowed for content preview ++ */ ++ private static boolean validForContentPreview(Uri uri) throws SecurityException { ++ if (uri == null) { ++ return false; ++ } ++ int userId = getUserIdFromUri(uri, UserHandle.USER_CURRENT); ++ if (userId != UserHandle.USER_CURRENT && userId != UserHandle.myUserId()) { ++ Log.e(TAG, "dropped invalid content URI belonging to user " + userId); ++ return false; ++ } ++ return true; ++ } ++ + @VisibleForTesting + protected boolean isImageType(String mimeType) { + return mimeType != null && mimeType.startsWith("image/"); diff --git a/Patches/LineageOS-17.1/android_frameworks_base/358560.patch b/Patches/LineageOS-17.1/android_frameworks_base/358560.patch new file mode 100644 index 00000000..83402d21 --- /dev/null +++ b/Patches/LineageOS-17.1/android_frameworks_base/358560.patch @@ -0,0 +1,167 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Brian Lee +Date: Fri, 17 Feb 2023 16:05:17 -0800 +Subject: [PATCH] Check key intent for selectors and prohibited flags + +Bug: 265015796 +Test: atest +FrameworksServicesTests: com.android.server.accounts.AccountManagerServiceTest +(cherry picked from commit e53a96304352e2965176c8d32ac1b504e52ef185) +(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:92114886bdce8467c52c655c186f3e7ab1e134d8) +Merged-In: Ie16f8654337bd75eaad3156817470674b4f0cee3 +Change-Id: Ie16f8654337bd75eaad3156817470674b4f0cee3 +--- + .../accounts/AccountManagerService.java | 18 +++++++--- + .../accounts/AccountManagerServiceTest.java | 36 +++++++++++++++++++ + .../AccountManagerServiceTestFixtures.java | 5 ++- + .../TestAccountType1Authenticator.java | 5 +-- + 4 files changed, 54 insertions(+), 10 deletions(-) + +diff --git a/services/core/java/com/android/server/accounts/AccountManagerService.java b/services/core/java/com/android/server/accounts/AccountManagerService.java +index b4edf94927b2..a9c7b0c6a3f1 100644 +--- a/services/core/java/com/android/server/accounts/AccountManagerService.java ++++ b/services/core/java/com/android/server/accounts/AccountManagerService.java +@@ -4808,10 +4808,6 @@ public class AccountManagerService + if (intent.getClipData() == null) { + intent.setClipData(ClipData.newPlainText(null, null)); + } +- intent.setFlags(intent.getFlags() & ~(Intent.FLAG_GRANT_READ_URI_PERMISSION +- | Intent.FLAG_GRANT_WRITE_URI_PERMISSION +- | Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION +- | Intent.FLAG_GRANT_PREFIX_URI_PERMISSION)); + long bid = Binder.clearCallingIdentity(); + try { + PackageManager pm = mContext.getPackageManager(); +@@ -4858,7 +4854,19 @@ public class AccountManagerService + if (intent == null) { + return (simulateIntent == null); + } +- return intent.filterEquals(simulateIntent); ++ if (!intent.filterEquals(simulateIntent)) { ++ return false; ++ } ++ ++ if (intent.getSelector() != simulateIntent.getSelector()) { ++ return false; ++ } ++ ++ int prohibitedFlags = Intent.FLAG_GRANT_READ_URI_PERMISSION ++ | Intent.FLAG_GRANT_WRITE_URI_PERMISSION ++ | Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION ++ | Intent.FLAG_GRANT_PREFIX_URI_PERMISSION; ++ return (simulateIntent.getFlags() & prohibitedFlags) == 0; + } + + private boolean isExportedSystemActivity(ActivityInfo activityInfo) { +diff --git a/services/tests/servicestests/src/com/android/server/accounts/AccountManagerServiceTest.java b/services/tests/servicestests/src/com/android/server/accounts/AccountManagerServiceTest.java +index 215f1e8e2a9e..d379e8131268 100644 +--- a/services/tests/servicestests/src/com/android/server/accounts/AccountManagerServiceTest.java ++++ b/services/tests/servicestests/src/com/android/server/accounts/AccountManagerServiceTest.java +@@ -18,6 +18,7 @@ package com.android.server.accounts; + + import static android.database.sqlite.SQLiteDatabase.deleteDatabase; + ++import static org.mockito.ArgumentMatchers.contains; + import static org.mockito.Matchers.any; + import static org.mockito.Matchers.anyBoolean; + import static org.mockito.Matchers.anyInt; +@@ -686,6 +687,41 @@ public class AccountManagerServiceTest extends AndroidTestCase { + assertNotNull(intent.getParcelableExtra(AccountManagerServiceTestFixtures.KEY_CALLBACK)); + } + ++ @SmallTest ++ public void testStartAddAccountSessionWhereAuthenticatorReturnsIntentWithProhibitedFlags() ++ throws Exception { ++ unlockSystemUser(); ++ ResolveInfo resolveInfo = new ResolveInfo(); ++ resolveInfo.activityInfo = new ActivityInfo(); ++ resolveInfo.activityInfo.applicationInfo = new ApplicationInfo(); ++ when(mMockPackageManager.resolveActivityAsUser( ++ any(Intent.class), anyInt(), anyInt())).thenReturn(resolveInfo); ++ when(mMockPackageManager.checkSignatures( ++ anyInt(), anyInt())).thenReturn(PackageManager.SIGNATURE_MATCH); ++ ++ final CountDownLatch latch = new CountDownLatch(1); ++ Response response = new Response(latch, mMockAccountManagerResponse); ++ Bundle options = createOptionsWithAccountName( ++ AccountManagerServiceTestFixtures.ACCOUNT_NAME_INTERVENE); ++ int prohibitedFlags = Intent.FLAG_GRANT_READ_URI_PERMISSION ++ | Intent.FLAG_GRANT_WRITE_URI_PERMISSION ++ | Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION ++ | Intent.FLAG_GRANT_PREFIX_URI_PERMISSION; ++ options.putInt(AccountManagerServiceTestFixtures.KEY_INTENT_FLAGS, prohibitedFlags); ++ ++ mAms.startAddAccountSession( ++ response, // response ++ AccountManagerServiceTestFixtures.ACCOUNT_TYPE_1, // accountType ++ "authTokenType", ++ null, // requiredFeatures ++ true, // expectActivityLaunch ++ options); // optionsIn ++ waitForLatch(latch); ++ ++ verify(mMockAccountManagerResponse).onError( ++ eq(AccountManager.ERROR_CODE_INVALID_RESPONSE), contains("invalid intent")); ++ } ++ + @SmallTest + public void testStartAddAccountSessionError() throws Exception { + unlockSystemUser(); +diff --git a/services/tests/servicestests/src/com/android/server/accounts/AccountManagerServiceTestFixtures.java b/services/tests/servicestests/src/com/android/server/accounts/AccountManagerServiceTestFixtures.java +index 73f30d9f9e79..b98a6a891d55 100644 +--- a/services/tests/servicestests/src/com/android/server/accounts/AccountManagerServiceTestFixtures.java ++++ b/services/tests/servicestests/src/com/android/server/accounts/AccountManagerServiceTestFixtures.java +@@ -17,9 +17,6 @@ package com.android.server.accounts; + + import android.accounts.Account; + +-import java.util.ArrayList; +-import java.util.List; +- + /** + * Constants shared between test AccountAuthenticators and AccountManagerServiceTest. + */ +@@ -31,6 +28,8 @@ public final class AccountManagerServiceTestFixtures { + "account_manager_service_test:account_status_token_key"; + public static final String KEY_ACCOUNT_PASSWORD = + "account_manager_service_test:account_password_key"; ++ public static final String KEY_INTENT_FLAGS = ++ "account_manager_service_test:intent_flags_key"; + public static final String KEY_OPTIONS_BUNDLE = + "account_manager_service_test:option_bundle_key"; + public static final String ACCOUNT_NAME_SUCCESS = "success_on_return@fixture.com"; +diff --git a/services/tests/servicestests/src/com/android/server/accounts/TestAccountType1Authenticator.java b/services/tests/servicestests/src/com/android/server/accounts/TestAccountType1Authenticator.java +index 8106364477d9..924443e9d5cf 100644 +--- a/services/tests/servicestests/src/com/android/server/accounts/TestAccountType1Authenticator.java ++++ b/services/tests/servicestests/src/com/android/server/accounts/TestAccountType1Authenticator.java +@@ -24,8 +24,6 @@ import android.content.Context; + import android.content.Intent; + import android.os.Bundle; + +-import com.android.frameworks.servicestests.R; +- + import java.util.concurrent.atomic.AtomicInteger; + + /** +@@ -270,11 +268,13 @@ public class TestAccountType1Authenticator extends AbstractAccountAuthenticator + String accountName = null; + Bundle sessionBundle = null; + String password = null; ++ int intentFlags = 0; + if (options != null) { + accountName = options.getString(AccountManagerServiceTestFixtures.KEY_ACCOUNT_NAME); + sessionBundle = options.getBundle( + AccountManagerServiceTestFixtures.KEY_ACCOUNT_SESSION_BUNDLE); + password = options.getString(AccountManagerServiceTestFixtures.KEY_ACCOUNT_PASSWORD); ++ intentFlags = options.getInt(AccountManagerServiceTestFixtures.KEY_INTENT_FLAGS, 0); + } + + Bundle result = new Bundle(); +@@ -302,6 +302,7 @@ public class TestAccountType1Authenticator extends AbstractAccountAuthenticator + intent.putExtra(AccountManagerServiceTestFixtures.KEY_RESULT, + eventualActivityResultData); + intent.putExtra(AccountManagerServiceTestFixtures.KEY_CALLBACK, response); ++ intent.setFlags(intentFlags); + + result.putParcelable(AccountManager.KEY_INTENT, intent); + } else { diff --git a/Patches/LineageOS-17.1/android_frameworks_base/358561-backport.patch b/Patches/LineageOS-17.1/android_frameworks_base/358561-backport.patch new file mode 100644 index 00000000..45d42e8c --- /dev/null +++ b/Patches/LineageOS-17.1/android_frameworks_base/358561-backport.patch @@ -0,0 +1,79 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Kweku Adams +Date: Wed, 21 Sep 2022 22:13:01 +0000 +Subject: [PATCH] Handle invalid data during job loading. + +Catch exceptions that may be thrown if invalid data ended up in the +persisted job file. + +Bug: 246541702 +Bug: 246542132 +Bug: 246542285 +Bug: 246542330 +Test: install test app with invalid job config, start app to schedule job, then reboot device +(cherry picked from commit c98fb42b480b3beedc2d94de6110f50212c4aa0b) +(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:df1ba00dd9f64a3ae9a9e05979dfae6a15c7e203) +Merged-In: Id0ceba345942baf21177f687b8dd85ef001c0a9e +Change-Id: Id0ceba345942baf21177f687b8dd85ef001c0a9e +--- + .../java/com/android/server/job/JobStore.java | 26 ++++++++++++++++--- + 1 file changed, 23 insertions(+), 3 deletions(-) + +diff --git a/services/core/java/com/android/server/job/JobStore.java b/services/core/java/com/android/server/job/JobStore.java +index 4ef37a2e484d..1f2772571e71 100644 +--- a/services/core/java/com/android/server/job/JobStore.java ++++ b/services/core/java/com/android/server/job/JobStore.java +@@ -677,6 +677,10 @@ public final class JobStore { + } + } catch (XmlPullParserException | IOException e) { + Slog.wtf(TAG, "Error jobstore xml.", e); ++ } catch (Exception e) { ++ // Crashing at this point would result in a boot loop, so live with a general ++ // Exception for system stability's sake. ++ Slog.wtf(TAG, "Unexpected exception", e); + } finally { + if (mPersistInfo.countAllJobsLoaded < 0) { // Only set them once. + mPersistInfo.countAllJobsLoaded = numJobs; +@@ -807,6 +811,15 @@ public final class JobStore { + } catch (NumberFormatException e) { + Slog.d(TAG, "Error reading constraints, skipping."); + return null; ++ } catch (XmlPullParserException e) { ++ Slog.d(TAG, "Error Parser Exception.", e); ++ return null; ++ } catch (IOException e) { ++ Slog.d(TAG, "Error I/O Exception.", e); ++ return null; ++ } catch (IllegalArgumentException e) { ++ Slog.e(TAG, "Constraints contained invalid data", e); ++ return null; + } + parser.next(); // Consume + +@@ -902,8 +915,14 @@ public final class JobStore { + return null; + } + +- PersistableBundle extras = PersistableBundle.restoreFromXml(parser); +- jobBuilder.setExtras(extras); ++ final PersistableBundle extras; ++ try { ++ extras = PersistableBundle.restoreFromXml(parser); ++ jobBuilder.setExtras(extras); ++ } catch (IllegalArgumentException e) { ++ Slog.e(TAG, "Persisted extras contained invalid data", e); ++ return null; ++ } + parser.nextTag(); // Consume + + final JobInfo builtJob; +@@ -950,7 +969,8 @@ public final class JobStore { + return new JobInfo.Builder(jobId, cname); + } + +- private void buildConstraintsFromXml(JobInfo.Builder jobBuilder, XmlPullParser parser) { ++ private void buildConstraintsFromXml(JobInfo.Builder jobBuilder, XmlPullParser parser) ++ throws XmlPullParserException, IOException { + String val; + + final String netCapabilities = parser.getAttributeValue(null, "net-capabilities"); diff --git a/Patches/LineageOS-17.1/android_frameworks_base/358562-backport.patch b/Patches/LineageOS-17.1/android_frameworks_base/358562-backport.patch new file mode 100644 index 00000000..36f89da4 --- /dev/null +++ b/Patches/LineageOS-17.1/android_frameworks_base/358562-backport.patch @@ -0,0 +1,231 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Julia Reynolds +Date: Tue, 7 Mar 2023 15:44:49 -0500 +Subject: [PATCH] Allow filtering of services + +Test: ServiceListingTest +Bug: 260570119 +(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:44dcb8351e61f4b3a63ec68fa5d8490501e8a823) +Merged-In: Ib4740ba401667de62fa1a33334c2c1fbee25b760 +Change-Id: Ib4740ba401667de62fa1a33334c2c1fbee25b760 +--- + .../applications/ServiceListing.java | 19 +++- + .../applications/ServiceListingTest.java | 98 ++++++++++++++++++- + 2 files changed, 113 insertions(+), 4 deletions(-) + +diff --git a/packages/SettingsLib/src/com/android/settingslib/applications/ServiceListing.java b/packages/SettingsLib/src/com/android/settingslib/applications/ServiceListing.java +index 454d1dce0b2f..6ed7b5065175 100644 +--- a/packages/SettingsLib/src/com/android/settingslib/applications/ServiceListing.java ++++ b/packages/SettingsLib/src/com/android/settingslib/applications/ServiceListing.java +@@ -35,6 +35,7 @@ import android.util.Slog; + import java.util.ArrayList; + import java.util.HashSet; + import java.util.List; ++import java.util.function.Predicate; + + /** + * Class for managing services matching a given intent and requesting a given permission. +@@ -50,11 +51,13 @@ public class ServiceListing { + private final HashSet mEnabledServices = new HashSet<>(); + private final List mServices = new ArrayList<>(); + private final List mCallbacks = new ArrayList<>(); ++ private final Predicate mValidator; + + private boolean mListening; + + private ServiceListing(Context context, String tag, +- String setting, String intentAction, String permission, String noun) { ++ String setting, String intentAction, String permission, String noun, ++ Predicate validator) { + mContentResolver = context.getContentResolver(); + mContext = context; + mTag = tag; +@@ -62,6 +65,7 @@ public class ServiceListing { + mIntentAction = intentAction; + mPermission = permission; + mNoun = noun; ++ mValidator = validator; + } + + public void addCallback(Callback callback) { +@@ -130,7 +134,6 @@ public class ServiceListing { + new Intent(mIntentAction), + PackageManager.GET_SERVICES | PackageManager.GET_META_DATA, + user); +- + for (ResolveInfo resolveInfo : installedServices) { + ServiceInfo info = resolveInfo.serviceInfo; + +@@ -141,6 +144,9 @@ public class ServiceListing { + + mPermission); + continue; + } ++ if (mValidator != null && !mValidator.test(info)) { ++ continue; ++ } + mServices.add(info); + } + for (Callback callback : mCallbacks) { +@@ -186,6 +192,7 @@ public class ServiceListing { + private String mIntentAction; + private String mPermission; + private String mNoun; ++ private Predicate mValidator; + + public Builder(Context context) { + mContext = context; +@@ -216,8 +223,14 @@ public class ServiceListing { + return this; + } + ++ public Builder setValidator(Predicate validator) { ++ mValidator = validator; ++ return this; ++ } ++ + public ServiceListing build() { +- return new ServiceListing(mContext, mTag, mSetting, mIntentAction, mPermission, mNoun); ++ return new ServiceListing(mContext, mTag, mSetting, mIntentAction, mPermission, mNoun, ++ mValidator); + } + } + } +diff --git a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/applications/ServiceListingTest.java b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/applications/ServiceListingTest.java +index f7fd25b9fb7d..7ff0988c494d 100644 +--- a/packages/SettingsLib/tests/robotests/src/com/android/settingslib/applications/ServiceListingTest.java ++++ b/packages/SettingsLib/tests/robotests/src/com/android/settingslib/applications/ServiceListingTest.java +@@ -18,20 +18,35 @@ package com.android.settingslib.applications; + + import static com.google.common.truth.Truth.assertThat; + ++import static org.mockito.ArgumentMatchers.any; ++import static org.mockito.ArgumentMatchers.anyInt; + import static org.mockito.ArgumentMatchers.anyList; + import static org.mockito.Mockito.mock; ++import static org.mockito.Mockito.spy; + import static org.mockito.Mockito.times; + import static org.mockito.Mockito.verify; ++import static org.mockito.Mockito.when; + + import android.content.ComponentName; ++import android.content.Context; ++import android.content.pm.PackageManager; ++import android.content.pm.ResolveInfo; ++import android.content.pm.ServiceInfo; + import android.provider.Settings; + ++import androidx.test.core.app.ApplicationProvider; ++ ++import com.google.common.collect.ImmutableList; ++ + import org.junit.Before; + import org.junit.Test; + import org.junit.runner.RunWith; ++import org.mockito.ArgumentCaptor; + import org.robolectric.RobolectricTestRunner; + import org.robolectric.RuntimeEnvironment; + ++import java.util.List; ++ + @RunWith(RobolectricTestRunner.class) + public class ServiceListingTest { + +@@ -39,16 +54,97 @@ public class ServiceListingTest { + private static final String TEST_INTENT = "com.example.intent"; + + private ServiceListing mServiceListing; ++ private Context mContext; ++ private PackageManager mPm; + + @Before + public void setUp() { +- mServiceListing = new ServiceListing.Builder(RuntimeEnvironment.application) ++ mPm = mock(PackageManager.class); ++ mContext = spy(ApplicationProvider.getApplicationContext()); ++ when(mContext.getPackageManager()).thenReturn(mPm); ++ ++ mServiceListing = new ServiceListing.Builder(mContext) ++ .setTag("testTag") ++ .setSetting(TEST_SETTING) ++ .setNoun("testNoun") ++ .setIntentAction(TEST_INTENT) ++ .setPermission("testPermission") ++ .build(); ++ } ++ ++ @Test ++ public void testValidator() { ++ ServiceInfo s1 = new ServiceInfo(); ++ s1.permission = "testPermission"; ++ s1.packageName = "pkg"; ++ ServiceInfo s2 = new ServiceInfo(); ++ s2.permission = "testPermission"; ++ s2.packageName = "pkg2"; ++ ResolveInfo r1 = new ResolveInfo(); ++ r1.serviceInfo = s1; ++ ResolveInfo r2 = new ResolveInfo(); ++ r2.serviceInfo = s2; ++ ++ when(mPm.queryIntentServicesAsUser(any(), anyInt(), anyInt())).thenReturn( ++ ImmutableList.of(r1, r2)); ++ ++ mServiceListing = new ServiceListing.Builder(mContext) ++ .setTag("testTag") ++ .setSetting(TEST_SETTING) ++ .setNoun("testNoun") ++ .setIntentAction(TEST_INTENT) ++ .setValidator(info -> { ++ if (info.packageName.equals("pkg")) { ++ return true; ++ } ++ return false; ++ }) ++ .setPermission("testPermission") ++ .build(); ++ ServiceListing.Callback callback = mock(ServiceListing.Callback.class); ++ mServiceListing.addCallback(callback); ++ mServiceListing.reload(); ++ ++ verify(mPm).queryIntentServicesAsUser(any(), anyInt(), anyInt()); ++ ArgumentCaptor> captor = ArgumentCaptor.forClass(List.class); ++ verify(callback, times(1)).onServicesReloaded(captor.capture()); ++ ++ assertThat(captor.getValue().size()).isEqualTo(1); ++ assertThat(captor.getValue().get(0)).isEqualTo(s1); ++ } ++ ++ @Test ++ public void testNoValidator() { ++ ServiceInfo s1 = new ServiceInfo(); ++ s1.permission = "testPermission"; ++ s1.packageName = "pkg"; ++ ServiceInfo s2 = new ServiceInfo(); ++ s2.permission = "testPermission"; ++ s2.packageName = "pkg2"; ++ ResolveInfo r1 = new ResolveInfo(); ++ r1.serviceInfo = s1; ++ ResolveInfo r2 = new ResolveInfo(); ++ r2.serviceInfo = s2; ++ ++ when(mPm.queryIntentServicesAsUser(any(), anyInt(), anyInt())).thenReturn( ++ ImmutableList.of(r1, r2)); ++ ++ mServiceListing = new ServiceListing.Builder(mContext) + .setTag("testTag") + .setSetting(TEST_SETTING) + .setNoun("testNoun") + .setIntentAction(TEST_INTENT) + .setPermission("testPermission") + .build(); ++ ServiceListing.Callback callback = mock(ServiceListing.Callback.class); ++ mServiceListing.addCallback(callback); ++ mServiceListing.reload(); ++ ++ verify(mPm).queryIntentServicesAsUser(any(), anyInt(), anyInt()); ++ ArgumentCaptor> captor = ArgumentCaptor.forClass(List.class); ++ verify(callback, times(1)).onServicesReloaded(captor.capture()); ++ ++ assertThat(captor.getValue().size()).isEqualTo(2); + } + + @Test diff --git a/Patches/LineageOS-17.1/android_frameworks_base/358564-backport.patch b/Patches/LineageOS-17.1/android_frameworks_base/358564-backport.patch new file mode 100644 index 00000000..30411350 --- /dev/null +++ b/Patches/LineageOS-17.1/android_frameworks_base/358564-backport.patch @@ -0,0 +1,39 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Jeff DeCew +Date: Fri, 24 Mar 2023 16:15:24 +0000 +Subject: [PATCH] Add BubbleMetadata detection to block FSI + +Bug: 274759612 +Test: atest NotificationInterruptStateProviderImplTest +(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:c60e264a551df9f880fd73683321b7e821429da7) +Merged-In: I40e1aa6377b8a60d91cb2f4189df1e9a4a4578a2 +Change-Id: I40e1aa6377b8a60d91cb2f4189df1e9a4a4578a2 +--- + .../NotificationInterruptionStateProvider.java | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationInterruptionStateProvider.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationInterruptionStateProvider.java +index ff71db4dc3b5..336c65b3c7d4 100644 +--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationInterruptionStateProvider.java ++++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/NotificationInterruptionStateProvider.java +@@ -461,6 +461,20 @@ public class NotificationInterruptionStateProvider { + return false; + } + ++ // If the notification has suppressive BubbleMetadata, block FSI and warn. ++ Notification.BubbleMetadata bubbleMetadata = sbn.getNotification().getBubbleMetadata(); ++ if (bubbleMetadata != null && bubbleMetadata.isNotificationSuppressed()) { ++ // b/274759612: Detect and report an event when a notification has both an FSI and a ++ // suppressive BubbleMetadata, and now correctly block the FSI from firing. ++ final int uid = entry.getSbn().getUid(); ++ android.util.EventLog.writeEvent(0x534e4554, "274759612", uid, "bubbleMetadata"); ++ if (DEBUG) { ++ Log.w(TAG, "No FullScreenIntent: WARNING: BubbleMetadata may prevent HUN: " ++ + entry.getKey()); ++ } ++ return false; ++ } ++ + // If the screen is off, then launch the FullScreenIntent + if (!mPowerManager.isInteractive()) { + if (DEBUG) { diff --git a/Patches/LineageOS-17.1/android_frameworks_base/358732-backport.patch b/Patches/LineageOS-17.1/android_frameworks_base/358732-backport.patch new file mode 100644 index 00000000..0c8319d4 --- /dev/null +++ b/Patches/LineageOS-17.1/android_frameworks_base/358732-backport.patch @@ -0,0 +1,85 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Valentin Iftime +Date: Wed, 22 Feb 2023 09:38:55 +0100 +Subject: [PATCH] Prevent RemoteViews crashing SystemUi + + Catch canvas drawing exceptions caused by unsuported image sizes. + +Test: 1. Post a custom view notification with a layout + containing an ImageView that references a 5k x 5k image +2. Add an App Widget to the home screen with that has the + layout mentioned above as preview/initial layout. + +Bug: 268193777 +(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:cfc0b34432ab54e3fa472db5c43e620293f64a5d) +Merged-In: Ib3bda769c499b4069b49c566b1b227f98f707a8a +Change-Id: Ib3bda769c499b4069b49c566b1b227f98f707a8a +--- + .../android/appwidget/AppWidgetHostView.java | 39 ++++++++++++++----- + 1 file changed, 29 insertions(+), 10 deletions(-) + +diff --git a/core/java/android/appwidget/AppWidgetHostView.java b/core/java/android/appwidget/AppWidgetHostView.java +index 85f0e2342412..eafb631216e5 100644 +--- a/core/java/android/appwidget/AppWidgetHostView.java ++++ b/core/java/android/appwidget/AppWidgetHostView.java +@@ -28,6 +28,7 @@ import android.content.pm.LauncherActivityInfo; + import android.content.pm.LauncherApps; + import android.content.pm.PackageManager.NameNotFoundException; + import android.content.res.Resources; ++import android.graphics.Canvas; + import android.graphics.Color; + import android.graphics.Rect; + import android.os.Bundle; +@@ -250,19 +251,26 @@ public class AppWidgetHostView extends FrameLayout { + super.onLayout(changed, left, top, right, bottom); + } catch (final RuntimeException e) { + Log.e(TAG, "Remote provider threw runtime exception, using error view instead.", e); +- removeViewInLayout(mView); +- View child = getErrorView(); +- prepareView(child); +- addViewInLayout(child, 0, child.getLayoutParams()); +- measureChild(child, MeasureSpec.makeMeasureSpec(getMeasuredWidth(), MeasureSpec.EXACTLY), +- MeasureSpec.makeMeasureSpec(getMeasuredHeight(), MeasureSpec.EXACTLY)); +- child.layout(0, 0, child.getMeasuredWidth() + mPaddingLeft + mPaddingRight, +- child.getMeasuredHeight() + mPaddingTop + mPaddingBottom); +- mView = child; +- mViewMode = VIEW_MODE_ERROR; ++ handleViewError(); + } + } + ++ /** ++ * Remove bad view and replace with error message view ++ */ ++ private void handleViewError() { ++ removeViewInLayout(mView); ++ View child = getErrorView(); ++ prepareView(child); ++ addViewInLayout(child, 0, child.getLayoutParams()); ++ measureChild(child, MeasureSpec.makeMeasureSpec(getMeasuredWidth(), MeasureSpec.EXACTLY), ++ MeasureSpec.makeMeasureSpec(getMeasuredHeight(), MeasureSpec.EXACTLY)); ++ child.layout(0, 0, child.getMeasuredWidth() + mPaddingLeft + mPaddingRight, ++ child.getMeasuredHeight() + mPaddingTop + mPaddingBottom); ++ mView = child; ++ mViewMode = VIEW_MODE_ERROR; ++ } ++ + /** + * Provide guidance about the size of this widget to the AppWidgetManager. The widths and + * heights should correspond to the full area the AppWidgetHostView is given. Padding added by +@@ -711,4 +719,15 @@ public class AppWidgetHostView extends FrameLayout { + } + return null; + } ++ ++ @Override ++ protected void dispatchDraw(Canvas canvas) { ++ try { ++ super.dispatchDraw(canvas); ++ } catch (Exception e) { ++ // Catch draw exceptions that may be caused by RemoteViews ++ Log.e(TAG, "Drawing view failed: " + e); ++ post(this::handleViewError); ++ } ++ } + } diff --git a/Patches/LineageOS-17.1/android_packages_apps_Car_Settings/358565-backport.patch b/Patches/LineageOS-17.1/android_packages_apps_Car_Settings/358565-backport.patch new file mode 100644 index 00000000..de378d2f --- /dev/null +++ b/Patches/LineageOS-17.1/android_packages_apps_Car_Settings/358565-backport.patch @@ -0,0 +1,28 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Dmitry Dementyev +Date: Tue, 7 Mar 2023 10:59:38 -0800 +Subject: [PATCH] Convert argument to Intent in car settings + AddAccountActivity. + +Bug: 265798353 +Test: manual +(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:3195c559667939b458445b7e133fb4a7c76aaead) +Merged-In: I4b035fd370197b7f4838af5fb6e4d0ce27a5f3e7 +Change-Id: I4b035fd370197b7f4838af5fb6e4d0ce27a5f3e7 +--- + src/com/android/car/settings/accounts/AddAccountActivity.java | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/com/android/car/settings/accounts/AddAccountActivity.java b/src/com/android/car/settings/accounts/AddAccountActivity.java +index d5ce57142..69ada037f 100644 +--- a/src/com/android/car/settings/accounts/AddAccountActivity.java ++++ b/src/com/android/car/settings/accounts/AddAccountActivity.java +@@ -94,7 +94,7 @@ public class AddAccountActivity extends Activity { + intent.putExtras(addAccountOptions); + intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + startActivityForResultAsUser( +- intent, ADD_ACCOUNT_REQUEST, mUserHandle); ++ new Intent(intent), ADD_ACCOUNT_REQUEST, mUserHandle); + LOG.v("account added: " + result); + } catch (OperationCanceledException | IOException | AuthenticatorException e) { + LOG.v("addAccount error: " + e); diff --git a/Patches/LineageOS-17.1/android_packages_apps_Settings/0005-Automatic_Reboot.patch b/Patches/LineageOS-17.1/android_packages_apps_Settings/0005-Automatic_Reboot.patch index 044893f7..612fd4a9 100644 --- a/Patches/LineageOS-17.1/android_packages_apps_Settings/0005-Automatic_Reboot.patch +++ b/Patches/LineageOS-17.1/android_packages_apps_Settings/0005-Automatic_Reboot.patch @@ -55,7 +55,7 @@ index b983f467df..5813bb18db 100644 Small Default diff --git a/res/values/strings.xml b/res/values/strings.xml -index 2180ea45f6..eeee1c039f 100644 +index f6e3b0f62d..8f4a3c6115 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -810,6 +810,9 @@ diff --git a/Patches/LineageOS-17.1/android_packages_apps_Settings/0006-Bluetooth_Timeout.patch b/Patches/LineageOS-17.1/android_packages_apps_Settings/0006-Bluetooth_Timeout.patch index bbed0a6d..b6195ddb 100644 --- a/Patches/LineageOS-17.1/android_packages_apps_Settings/0006-Bluetooth_Timeout.patch +++ b/Patches/LineageOS-17.1/android_packages_apps_Settings/0006-Bluetooth_Timeout.patch @@ -67,7 +67,7 @@ index 5813bb18db..40d01907a4 100644 15 seconds diff --git a/res/values/strings.xml b/res/values/strings.xml -index eeee1c039f..c5287c4489 100644 +index 8f4a3c6115..ef517e8503 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -25,6 +25,25 @@ diff --git a/Patches/LineageOS-17.1/android_packages_apps_Settings/0007-WiFi_Timeout.patch b/Patches/LineageOS-17.1/android_packages_apps_Settings/0007-WiFi_Timeout.patch index 173fb8a7..3f80d913 100644 --- a/Patches/LineageOS-17.1/android_packages_apps_Settings/0007-WiFi_Timeout.patch +++ b/Patches/LineageOS-17.1/android_packages_apps_Settings/0007-WiFi_Timeout.patch @@ -67,7 +67,7 @@ index 40d01907a4..0a9a9a31e8 100644 15 seconds diff --git a/res/values/strings.xml b/res/values/strings.xml -index c5287c4489..0f254706ff 100644 +index ef517e8503..228d9570dd 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -44,6 +44,25 @@ diff --git a/Patches/LineageOS-17.1/android_packages_apps_Settings/0008-ptrace_scope.patch b/Patches/LineageOS-17.1/android_packages_apps_Settings/0008-ptrace_scope.patch index e9348fc6..0110274c 100644 --- a/Patches/LineageOS-17.1/android_packages_apps_Settings/0008-ptrace_scope.patch +++ b/Patches/LineageOS-17.1/android_packages_apps_Settings/0008-ptrace_scope.patch @@ -12,7 +12,7 @@ Subject: [PATCH] add native debugging setting create mode 100644 src/com/android/settings/security/NativeDebugPreferenceController.java diff --git a/res/values/strings.xml b/res/values/strings.xml -index 0f254706ff..fcac812417 100644 +index 228d9570dd..d965a63b0d 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -11316,6 +11316,9 @@ diff --git a/Patches/LineageOS-17.1/android_packages_apps_Settings/0009-exec_spawning_toggle.patch b/Patches/LineageOS-17.1/android_packages_apps_Settings/0009-exec_spawning_toggle.patch index e7e6b123..6327853e 100644 --- a/Patches/LineageOS-17.1/android_packages_apps_Settings/0009-exec_spawning_toggle.patch +++ b/Patches/LineageOS-17.1/android_packages_apps_Settings/0009-exec_spawning_toggle.patch @@ -12,7 +12,7 @@ Subject: [PATCH] add exec spawning toggle create mode 100644 src/com/android/settings/security/ExecSpawnPreferenceController.java diff --git a/res/values/strings.xml b/res/values/strings.xml -index fcac812417..197882d66e 100644 +index d965a63b0d..e7dcf62ddc 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -11316,6 +11316,8 @@ diff --git a/Patches/LineageOS-17.1/android_packages_apps_Settings/0011-LTE_Only_Mode.patch b/Patches/LineageOS-17.1/android_packages_apps_Settings/0011-LTE_Only_Mode.patch index 4ba8b5b0..7d2d6166 100644 --- a/Patches/LineageOS-17.1/android_packages_apps_Settings/0011-LTE_Only_Mode.patch +++ b/Patches/LineageOS-17.1/android_packages_apps_Settings/0011-LTE_Only_Mode.patch @@ -106,7 +106,7 @@ index 6d95bcc58b..072004e447 100644 "18" "1" diff --git a/res/values/strings.xml b/res/values/strings.xml -index 197882d66e..88bd100122 100644 +index e7dcf62ddc..fedb9f3fde 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -10942,6 +10942,8 @@ diff --git a/Patches/LineageOS-17.1/android_packages_apps_Settings/0012-hosts_toggle.patch b/Patches/LineageOS-17.1/android_packages_apps_Settings/0012-hosts_toggle.patch index 0381aa75..44750f22 100644 --- a/Patches/LineageOS-17.1/android_packages_apps_Settings/0012-hosts_toggle.patch +++ b/Patches/LineageOS-17.1/android_packages_apps_Settings/0012-hosts_toggle.patch @@ -16,7 +16,7 @@ Change-Id: Ic01a142722372d9d57f52947025cd9db23e58ef4 create mode 100644 src/com/android/settings/security/HostsPreferenceController.java diff --git a/res/values/strings.xml b/res/values/strings.xml -index 88bd100122..a64940d793 100644 +index fedb9f3fde..b5dbdc7d81 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -11327,6 +11327,9 @@ diff --git a/Patches/LineageOS-17.1/android_packages_apps_Settings/0013-SUPL_Toggle.patch b/Patches/LineageOS-17.1/android_packages_apps_Settings/0013-SUPL_Toggle.patch index d39620bd..f1ef0085 100644 --- a/Patches/LineageOS-17.1/android_packages_apps_Settings/0013-SUPL_Toggle.patch +++ b/Patches/LineageOS-17.1/android_packages_apps_Settings/0013-SUPL_Toggle.patch @@ -11,7 +11,7 @@ Subject: [PATCH] add a toggle for forcibly disabling SUPL create mode 100644 src/com/android/settings/location/ForceDisableSuplPrefController.java diff --git a/res/values/strings.xml b/res/values/strings.xml -index a64940d793..f1ea003e3b 100644 +index b5dbdc7d81..a5aab8e5d0 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -11517,4 +11517,7 @@ diff --git a/Patches/LineageOS-17.1/android_packages_apps_Settings/358566.patch b/Patches/LineageOS-17.1/android_packages_apps_Settings/358566.patch new file mode 100644 index 00000000..789f694f --- /dev/null +++ b/Patches/LineageOS-17.1/android_packages_apps_Settings/358566.patch @@ -0,0 +1,190 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Bonian Chen +Date: Thu, 18 Nov 2021 10:27:34 +0800 +Subject: [PATCH] Move display of VPN version into summary text + +Move the display of version text within VPN into summary part of the +display, and limit the height of summary area. + +Bug: 205460459 +Test: install apk from b/205460459#comment3 and verify +(cherry picked from commit 144f295d7aa66bae8556ba030553a49615eab0b2) +(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:dddd74a491a206178feb10d5ef983d5cd273504d) +Merged-In: I666b9db356feeebf04e3be688897c2d9110a5275 +Change-Id: I666b9db356feeebf04e3be688897c2d9110a5275 +--- + res/values/strings.xml | 2 +- + res/values/styles.xml | 10 ++++ + res/xml/vpn_app_management.xml | 14 ++++- + .../settings/vpn2/AppManagementFragment.java | 51 +++++++++++++++++-- + 4 files changed, 71 insertions(+), 6 deletions(-) + +diff --git a/res/values/strings.xml b/res/values/strings.xml +index 2180ea45f6..f6e3b0f62d 100644 +--- a/res/values/strings.xml ++++ b/res/values/strings.xml +@@ -6613,7 +6613,7 @@ + + Disconnect + +- Version %s ++ Version + + Forget VPN + +diff --git a/res/values/styles.xml b/res/values/styles.xml +index d3d3199f62..ec66bc8d1b 100644 +--- a/res/values/styles.xml ++++ b/res/values/styles.xml +@@ -197,6 +197,16 @@ + @android:style/TextAppearance.DeviceDefault.Small + + ++ ++ ++ ++ +