DivestOS/Patches/LineageOS-18.1/android_libcore/0003-Exec_Based_Spawning-2.patch

54 lines
2.7 KiB
Diff
Raw Normal View History

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Daniel Micay <danielmicay@gmail.com>
Date: Wed, 11 Sep 2019 06:47:11 -0400
Subject: [PATCH] disable ICU cache pinning for exec spawning
---
.../main/java/dalvik/system/ZygoteHooks.java | 26 +++++++++++--------
1 file changed, 15 insertions(+), 11 deletions(-)
diff --git a/dalvik/src/main/java/dalvik/system/ZygoteHooks.java b/dalvik/src/main/java/dalvik/system/ZygoteHooks.java
index de5a0561430..e77cec25172 100644
--- a/dalvik/src/main/java/dalvik/system/ZygoteHooks.java
+++ b/dalvik/src/main/java/dalvik/system/ZygoteHooks.java
@@ -49,15 +49,17 @@ public final class ZygoteHooks {
*/
@libcore.api.CorePlatformApi
public static void onBeginPreload(boolean fullPreload) {
- // Pin ICU data in memory from this point that would normally be held by soft references.
- // Without this, any references created immediately below or during class preloading
- // would be collected when the Zygote GC runs in gcAndFinalize().
- CacheValue.setStrength(CacheValue.Strength.STRONG);
-
- // Explicitly exercise code to cache data apps are likely to need.
- ULocale[] localesToPin = { ULocale.ROOT, ULocale.US, ULocale.getDefault() };
- for (ULocale uLocale : localesToPin) {
- new DecimalFormatSymbols(uLocale);
+ if (fullPreload) {
+ // Pin ICU data in memory from this point that would normally be held by soft references.
+ // Without this, any references created immediately below or during class preloading
+ // would be collected when the Zygote GC runs in gcAndFinalize().
+ CacheValue.setStrength(CacheValue.Strength.STRONG);
+
+ // Explicitly exercise code to cache data apps are likely to need.
+ ULocale[] localesToPin = { ULocale.ROOT, ULocale.US, ULocale.getDefault() };
+ for (ULocale uLocale : localesToPin) {
+ new DecimalFormatSymbols(uLocale);
+ }
}
Fix/Add exec based spawning patchsets from GrapheneOS 11 https://github.com/GrapheneOS/platform_frameworks_base/commit/14c3c1d4cd2df5dde69274e76a91b42fa383e577 https://github.com/GrapheneOS/platform_frameworks_base/commit/ac1943345ec96411ecbac3ce9b15cb371cc03551 https://github.com/GrapheneOS/platform_frameworks_base/commit/1abb8050413dae6ac6c1a082a38fb555c88534b9 https://github.com/GrapheneOS/platform_frameworks_base/commit/2e07ab8c242551e6847bffef84546ed5eaf345cf https://github.com/GrapheneOS/platform_frameworks_base/commit/0044836677b9be153e04a91dddddcb74d9585643 https://github.com/GrapheneOS/platform_frameworks_base/commit/c561811fad950dce791ef9941753ef95076da4c0 https://github.com/GrapheneOS/platform_frameworks_base/commit/7a848373efa0bd5b948af7ade19927a8706f9ea2 https://github.com/GrapheneOS/platform_frameworks_base/commit/89646bdeb19463424158544c6942224320e9e180 https://github.com/GrapheneOS/platform_frameworks_base/commit/2a70bbac4a8342175971498084494845b4f24546 https://github.com/GrapheneOS/platform_frameworks_base/commit/d414dcaa351e7a890d31c1da949421fb435ff168 https://github.com/GrapheneOS/platform_frameworks_base/commit/b4cd877e3a0c2384b8939d5d1e2b6b734bbd13b2 https://github.com/GrapheneOS/platform_frameworks_base/commit/98634286bbdffe967a9a03442e5aa324ec26986a 11 https://github.com/GrapheneOS/platform_libcore/commit/4c2635390c10512b0c79ee1f3658a25d6b671ca0 11 https://github.com/GrapheneOS/platform_libcore/commit/add34a4bc6aa69f21f012d62215b5af500bea551 11 https://github.com/GrapheneOS/platform_build/commit/a2b51906dece2ea351b5aa4b66fa8cdefbf37ff6 10 https://github.com/GrapheneOS/platform_frameworks_base/commit/527787f3c82d385c98c2e954bbbf092937100085 https://github.com/GrapheneOS/platform_frameworks_base/commit/ffde474ad7e72c72367f16a231bc30ea8ee3311b https://github.com/GrapheneOS/platform_frameworks_base/commit/aa87e487c42e3f23b42ac151fc6a37f5cb4751e7 https://github.com/GrapheneOS/platform_frameworks_base/commit/c906fe97221c7f48d5e8a6be508fb85f8df113b1 https://github.com/GrapheneOS/platform_frameworks_base/commit/c69c3eecd4f34a932760303e10e3a47798335f7e https://github.com/GrapheneOS/platform_frameworks_base/commit/b2303adccc82b89f19a6f4af8834443fa7e01b67 https://github.com/GrapheneOS/platform_frameworks_base/commit/5bb05db6f73992cc345d3662652bea024f3ace3b https://github.com/GrapheneOS/platform_frameworks_base/commit/536b4976880224d8518e9208f4e3caacf79e64c9 https://github.com/GrapheneOS/platform_frameworks_base/commit/24802a832b514452df5cea11759be8d33a7b8bc0 https://github.com/GrapheneOS/platform_frameworks_base/commit/ce6dcc2368fbf817c1c7ae2595b0367750b741dc https://github.com/GrapheneOS/platform_frameworks_base/commit/3d3d5c4d38a1614ba6e9c8baa517516bdb647223 https://github.com/GrapheneOS/platform_frameworks_base/commit/2eda592b79edd89907769fbc9e8ad175523bff0b 10 https://github.com/GrapheneOS/platform_libcore/commit/29f28b53c0cc85612e66485bc250fc57d82bc622 10 https://github.com/GrapheneOS/platform_libcore/commit/13a992c716f9b39920a7b37af2f447ced8e45c15 9 https://github.com/GrapheneOS/platform_frameworks_base/commit/750efbf6bce8bbe850679eb6a90b00108314226c https://github.com/GrapheneOS/platform_frameworks_base/commit/ed563b6f26452581f9dba1c1ef245e893f5045ca https://github.com/GrapheneOS/platform_frameworks_base/commit/aad3c7d750f9814344514cb187112e50574bb382 https://github.com/GrapheneOS/platform_frameworks_base/commit/da3180f9a8e75b10826ce2faf046c0f3912dfd59 https://github.com/GrapheneOS/platform_frameworks_base/commit/68773a29b77d6e87201b3af1b0b21e9385a1bdb0 https://github.com/GrapheneOS/platform_frameworks_base/commit/283b3fa09c002861fa5525a2be8071953e05e794 https://github.com/GrapheneOS/platform_frameworks_base/commit/f133136b65841735895ec15acdd2c60ecd45e72d https://github.com/GrapheneOS/platform_frameworks_base/commit/01a01ce5f6570f31232bc488da5683481ca32388 https://github.com/GrapheneOS/platform_frameworks_base/commit/17c309c0988ccea718ee0779d23387d6af40a80d https://github.com/GrapheneOS/platform_frameworks_base/commit/8806ec3ef166fe1fd1eeb690ace6dd5a7682195c Signed-off-by: Tad <tad@spotco.us>
2022-03-15 19:41:05 +00:00
// Framework's LocalLog is used during app start-up. It indirectly uses the current ICU time
@@ -72,8 +74,10 @@ public final class ZygoteHooks {
*/
@libcore.api.CorePlatformApi
public static void onEndPreload(boolean fullPreload) {
- // All cache references created by ICU from this point will be soft.
- CacheValue.setStrength(CacheValue.Strength.SOFT);
+ if (fullPreload) {
+ // All cache references created by ICU from this point will be soft.
+ CacheValue.setStrength(CacheValue.Strength.SOFT);
+ }
Fix/Add exec based spawning patchsets from GrapheneOS 11 https://github.com/GrapheneOS/platform_frameworks_base/commit/14c3c1d4cd2df5dde69274e76a91b42fa383e577 https://github.com/GrapheneOS/platform_frameworks_base/commit/ac1943345ec96411ecbac3ce9b15cb371cc03551 https://github.com/GrapheneOS/platform_frameworks_base/commit/1abb8050413dae6ac6c1a082a38fb555c88534b9 https://github.com/GrapheneOS/platform_frameworks_base/commit/2e07ab8c242551e6847bffef84546ed5eaf345cf https://github.com/GrapheneOS/platform_frameworks_base/commit/0044836677b9be153e04a91dddddcb74d9585643 https://github.com/GrapheneOS/platform_frameworks_base/commit/c561811fad950dce791ef9941753ef95076da4c0 https://github.com/GrapheneOS/platform_frameworks_base/commit/7a848373efa0bd5b948af7ade19927a8706f9ea2 https://github.com/GrapheneOS/platform_frameworks_base/commit/89646bdeb19463424158544c6942224320e9e180 https://github.com/GrapheneOS/platform_frameworks_base/commit/2a70bbac4a8342175971498084494845b4f24546 https://github.com/GrapheneOS/platform_frameworks_base/commit/d414dcaa351e7a890d31c1da949421fb435ff168 https://github.com/GrapheneOS/platform_frameworks_base/commit/b4cd877e3a0c2384b8939d5d1e2b6b734bbd13b2 https://github.com/GrapheneOS/platform_frameworks_base/commit/98634286bbdffe967a9a03442e5aa324ec26986a 11 https://github.com/GrapheneOS/platform_libcore/commit/4c2635390c10512b0c79ee1f3658a25d6b671ca0 11 https://github.com/GrapheneOS/platform_libcore/commit/add34a4bc6aa69f21f012d62215b5af500bea551 11 https://github.com/GrapheneOS/platform_build/commit/a2b51906dece2ea351b5aa4b66fa8cdefbf37ff6 10 https://github.com/GrapheneOS/platform_frameworks_base/commit/527787f3c82d385c98c2e954bbbf092937100085 https://github.com/GrapheneOS/platform_frameworks_base/commit/ffde474ad7e72c72367f16a231bc30ea8ee3311b https://github.com/GrapheneOS/platform_frameworks_base/commit/aa87e487c42e3f23b42ac151fc6a37f5cb4751e7 https://github.com/GrapheneOS/platform_frameworks_base/commit/c906fe97221c7f48d5e8a6be508fb85f8df113b1 https://github.com/GrapheneOS/platform_frameworks_base/commit/c69c3eecd4f34a932760303e10e3a47798335f7e https://github.com/GrapheneOS/platform_frameworks_base/commit/b2303adccc82b89f19a6f4af8834443fa7e01b67 https://github.com/GrapheneOS/platform_frameworks_base/commit/5bb05db6f73992cc345d3662652bea024f3ace3b https://github.com/GrapheneOS/platform_frameworks_base/commit/536b4976880224d8518e9208f4e3caacf79e64c9 https://github.com/GrapheneOS/platform_frameworks_base/commit/24802a832b514452df5cea11759be8d33a7b8bc0 https://github.com/GrapheneOS/platform_frameworks_base/commit/ce6dcc2368fbf817c1c7ae2595b0367750b741dc https://github.com/GrapheneOS/platform_frameworks_base/commit/3d3d5c4d38a1614ba6e9c8baa517516bdb647223 https://github.com/GrapheneOS/platform_frameworks_base/commit/2eda592b79edd89907769fbc9e8ad175523bff0b 10 https://github.com/GrapheneOS/platform_libcore/commit/29f28b53c0cc85612e66485bc250fc57d82bc622 10 https://github.com/GrapheneOS/platform_libcore/commit/13a992c716f9b39920a7b37af2f447ced8e45c15 9 https://github.com/GrapheneOS/platform_frameworks_base/commit/750efbf6bce8bbe850679eb6a90b00108314226c https://github.com/GrapheneOS/platform_frameworks_base/commit/ed563b6f26452581f9dba1c1ef245e893f5045ca https://github.com/GrapheneOS/platform_frameworks_base/commit/aad3c7d750f9814344514cb187112e50574bb382 https://github.com/GrapheneOS/platform_frameworks_base/commit/da3180f9a8e75b10826ce2faf046c0f3912dfd59 https://github.com/GrapheneOS/platform_frameworks_base/commit/68773a29b77d6e87201b3af1b0b21e9385a1bdb0 https://github.com/GrapheneOS/platform_frameworks_base/commit/283b3fa09c002861fa5525a2be8071953e05e794 https://github.com/GrapheneOS/platform_frameworks_base/commit/f133136b65841735895ec15acdd2c60ecd45e72d https://github.com/GrapheneOS/platform_frameworks_base/commit/01a01ce5f6570f31232bc488da5683481ca32388 https://github.com/GrapheneOS/platform_frameworks_base/commit/17c309c0988ccea718ee0779d23387d6af40a80d https://github.com/GrapheneOS/platform_frameworks_base/commit/8806ec3ef166fe1fd1eeb690ace6dd5a7682195c Signed-off-by: Tad <tad@spotco.us>
2022-03-15 19:41:05 +00:00
// Clone standard descriptors as originals closed / rebound during zygote post fork.
FileDescriptor.in.cloneForFork();