From 58923f2ef9701ef3d189e0a55f9ec5c1b2e08311 Mon Sep 17 00:00:00 2001 From: Tavi Date: Thu, 5 Dec 2024 13:51:51 -0500 Subject: [PATCH] 21.0: More work Signed-off-by: Tavi --- Logs/resetWorkspace-LineageOS-21.0.txt | 60 +-- Manifests/Manifest_LAOS-21.0.xml | 5 + .../0002-Graphene_Bionic_Hardening-1.patch | 8 +- .../0002-Graphene_Bionic_Hardening-12.patch | 8 +- .../0002-Graphene_Bionic_Hardening-13.patch | 2 +- .../0002-Graphene_Bionic_Hardening-7.patch | 4 +- .../android_build/0001-Enable_fwrapv.patch | 4 +- .../0003-Exec_Based_Spawning.patch | 4 +- .../android_build/0004-Selective_APEX.patch | 2 +- .../0001-Enable_fwrapv.patch | 10 +- .../0002-hm_available.patch | 21 -- .../0001-constify_JNINativeMethod.patch | 4 +- ...er-overflow-in-function-nextScaffold.patch | 30 ++ ...ect-negative-len-for-XML_ParseBuffer.patch | 27 ++ ...0-for-both-XML_Parse-and-XML_ParseBu.patch | 84 +++++ ...t-XML_Parse-XML_ParseBuffer-reject-l.patch | 42 +++ ...b-Detect-integer-overflow-in-dtdCopy.patch | 31 ++ ...etect-billion-laughs-attack-with-iso.patch | 53 +++ .../0003-SUPL_No_IMSI.patch | 6 +- .../0004-Fingerprint_Lockout.patch | 4 +- .../0005-User_Logout-a1.patch | 4 +- .../0005-User_Logout.patch | 8 +- .../0007-Always_Restict_Serial.patch | 4 +- .../0013-Special_Permissions-1.patch | 26 +- .../0013-Special_Permissions-2.patch | 16 +- .../0013-Special_Permissions-3.patch | 24 +- .../0014-Automatic_Reboot.patch | 32 +- .../0015-Bluetooth_Timeout.patch | 4 +- .../0015-System_Server_Extensions.patch | 4 +- .../0015-WiFi_Timeout.patch | 4 +- .../0017-constify_JNINativeMethod.patch | 309 ++------------- .../0018-Exec_Based_Spawning-1.patch | 6 +- .../0018-Exec_Based_Spawning-12.patch | 14 +- .../0018-Exec_Based_Spawning-14.patch | 14 +- .../0018-Exec_Based_Spawning-2.patch | 4 +- .../0020-Location_Indicators.patch | 4 +- .../0022-Ignore_StatementService_ANR.patch | 4 +- .../0024-Burnin_Protection.patch | 26 +- .../0026-Crash_Details.patch | 355 ++++++++++++++++++ .../0028-Remove_Legacy_Package_Query.patch | 4 +- .../0029-Strict_Package_Checks-1.patch | 6 +- .../0029-Strict_Package_Checks-2.patch | 4 +- .../0031-appops_reset_fix-1.patch | 4 +- .../0031-appops_reset_fix-2.patch | 4 +- .../0032-SUPL_Toggle.patch | 20 +- .../0033-Ugly_Orbot_Workaround.patch | 2 +- .../0034-Allow_Disabling_NTP.patch | 2 +- .../0035-System_JobScheduler_Allowance.patch | 129 ------- .../0036-Unprivileged_microG_Handling.patch | 26 +- .../0037-filter-gms.patch | 8 +- .../0039-package_hooks.patch | 18 +- .../0040-euicc-restrictions.patch | 15 +- .../0041-tile_restrictions.patch | 12 +- .../revert-6b793fa9.patch | 223 +++++++++++ .../0001-constify_JNINativeMethod.patch | 22 -- .../0001-Icon_Cache.patch | 2 +- .../0001-Fix_Calling.patch | 6 +- .../0001-Random_MAC.patch | 2 +- .../0001-Unused-sm8350.patch | 2 +- .../0002-constify_JNINativeMethod.patch | 42 +-- .../0003-Exec_Based_Spawning-1.patch | 2 +- .../0001-Private_DNS-Migration.patch | 4 +- .../0001-presidential_alert_toggle.patch | 12 +- .../0001-constify_JNINativeMethod.patch | 12 +- .../0004-Private_DNS.patch | 2 +- .../0004-prereq.patch | 2 +- .../0005-Automatic_Reboot.patch | 6 +- .../0006-Bluetooth_Timeout.patch | 10 +- .../0007-WiFi_Timeout.patch | 6 +- .../0008-ptrace_scope.patch | 4 +- .../0010-exec_spawning_toggle.patch | 4 +- .../0011-Random_MAC.patch | 24 +- .../0012-hosts_toggle.patch | 4 +- .../0013-Captive_Portal_Toggle.patch | 6 +- .../0014-LTE_Only_Mode.patch | 24 +- .../0015-SUPL_Toggle.patch | 4 +- .../0016-microG_Toggle.patch | 4 +- .../0017-OpenEUICC_Toggle.patch | 4 +- .../0018-CC2_Toggle.patch | 173 +++++++++ .../0018-disable_apps.patch | 14 +- .../0001-Remove_Analytics.patch | 10 +- .../361248.patch | 4 +- .../0002-Tor_Support.patch | 4 +- .../0003-Server_Choices.patch | 2 +- .../0001-Hosts_Cache.patch | 10 +- .../0001-Random_MAC.patch | 2 +- .../0006-Location_Indicators.patch | 4 +- .../0001-Random_MAC.patch | 20 +- .../0001-CC2.patch | 39 ++ .../android_system_core/0001-Harden.patch | 10 +- .../0002-ptrace_scope.patch | 4 +- .../0003-HM-Increase_vm_mmc.patch | 4 +- .../0001-ext4_pad_filenames.patch | 4 +- .../0002-protected_files.patch | 2 +- .../0003-ptrace_scope-1.patch | 10 +- .../0003-ptrace_scope-2.patch | 2 +- Scripts/LineageOS-21.0/Functions.sh | 2 +- Scripts/LineageOS-21.0/Patch.sh | 77 ++-- 98 files changed, 1505 insertions(+), 850 deletions(-) delete mode 100644 Patches/LineageOS-21.0/android_build_soong/0002-hm_available.patch create mode 100644 Patches/LineageOS-21.0/android_external_expat/0001-lib-Detect-integer-overflow-in-function-nextScaffold.patch create mode 100644 Patches/LineageOS-21.0/android_external_expat/0002-lib-Reject-negative-len-for-XML_ParseBuffer.patch create mode 100644 Patches/LineageOS-21.0/android_external_expat/0003-tests-Cover-len-0-for-both-XML_Parse-and-XML_ParseBu.patch create mode 100644 Patches/LineageOS-21.0/android_external_expat/0004-doc-Document-that-XML_Parse-XML_ParseBuffer-reject-l.patch create mode 100644 Patches/LineageOS-21.0/android_external_expat/0005-lib-Detect-integer-overflow-in-dtdCopy.patch create mode 100644 Patches/LineageOS-21.0/android_external_expat/0006-lib-xmlparse.c-Detect-billion-laughs-attack-with-iso.patch create mode 100644 Patches/LineageOS-21.0/android_frameworks_base/0026-Crash_Details.patch delete mode 100644 Patches/LineageOS-21.0/android_frameworks_base/0035-System_JobScheduler_Allowance.patch create mode 100644 Patches/LineageOS-21.0/android_frameworks_base/revert-6b793fa9.patch delete mode 100644 Patches/LineageOS-21.0/android_frameworks_ex/0001-constify_JNINativeMethod.patch create mode 100644 Patches/LineageOS-21.0/android_packages_apps_Settings/0018-CC2_Toggle.patch create mode 100644 Patches/LineageOS-21.0/android_packages_services_Telephony/0001-CC2.patch diff --git a/Logs/resetWorkspace-LineageOS-21.0.txt b/Logs/resetWorkspace-LineageOS-21.0.txt index b970043b..d7357af6 100644 --- a/Logs/resetWorkspace-LineageOS-21.0.txt +++ b/Logs/resetWorkspace-LineageOS-21.0.txt @@ -41,19 +41,24 @@ device/google/cuttlefish 59f1b5b1b7b1bb1fd7dfc7003161c1ec32a3120e device/google/cuttlefish_prebuilts 78870564f4537fe1aada6110854ce2237fc20cfd device/google/cuttlefish_vmm aea3cd85d83d1d6d0b59c9cf0004e701ae7cdfef device/google/felix a24c87ba0622bf92ddfaa802bcbe9df2914310f9 +device/google/felix-kernel 5b9f0fdda4870d62bb3545590a201f22cb1efb0e device/google/gs-common 811212e50502a3e1af5f46279338942365890e2d device/google/gs101 ec68559daffa4aabbba264f56f9a6e450883db8d device/google/gs201 d0495834e4bd28d8dd559fb1b991340a5368ede5 device/google/lynx 0fbecf1c65177c0c7c138473b0fd5afbf5738387 +device/google/lynx-kernel 0d9c64fbe89b7df1630b168faa0e2c8a4cbf86ec device/google/oriole 4fc1b8acd2e4e388cb959d41a07e11af5034afb2 device/google/pantah b89ca93892b5121c0789611fbeca0ef5e053102e +device/google/pantah-kernel 219628f291c6df6df11c7084baad470c87688116 device/google/panther 1fffafe63058376bce1278a983f5e7ad87dfc5d5 device/google/raven d2ee4333052087d012c3c6ed0f3ff169d8746bc4 device/google/raviole 72dadeb7f455b984691e43f82cc7dfee924ab258 +device/google/raviole-kernel 1c5e7767d36771475bd0bc213734b542d29e9ac0 device/google/tangorpro 10f9f808bdf2c746d796179f040173f41db02eb0 +device/google/tangorpro-kernel 14ff7d544741ad835507239440eed87e17ed7bd8 device/google/vrservices 8aa3796da8e43c1f3b10b0e0bb6bf6a4aedd885f device/google_car 92b6781fa6ce806d4d33c362a8d083fc67f7f3e7 -device/lineage/atv 4ddb44d9c6c0d2d0d9bc13b33af3c88b86384a62 +device/lineage/atv a85571a4aa9135577912444a4274310466a111ad device/lineage/car 57aaa54bd41e2e0db3348a9b9792cc007ec496e4 device/lineage/sepolicy 126b2bdd0f6fdc815999e44b9e134c7ae6c39d8c device/qcom/sepolicy f1f31749313106bdc735fa700fb2248cc261c2c2 @@ -126,7 +131,7 @@ external/capstone 9a0e4156d50a75a99ec4f1653a0e9602a5d45c18 external/cblas e5d01406896b3eeb89dd91a97fd23acf8da54297 external/cbor-java 3bcaeafe943411543f051b8142b62ffe45589356 external/chromium-trace c942db8690e564bf053225d118980c694102dd5f -external/chromium-webview b8e0c96faa6299b17e727e586932d61cf2b8fde7 +external/chromium-webview 4a9cf619f77955ea20f608a193006dcdf1b21e21 external/clang 9297b900761ee5537ab713ca190f45c94d5ec3ac external/cldr b7a7a49c48ffd1ea235cff89d6b2d97359eba522 external/cn-cbor 28d988464a3b4df16c91af3771c7b042fa5a7772 @@ -869,7 +874,7 @@ external/zstd fc80ff3c3d0ef8123ebcd901d89ce352d0c191cd external/zucchini 11a3a4cd409d6e0f4ccfcfb97cc962eeaeddde00 external/zxing 513427e33d61bc67fc40bc261642ac0b2a686b45 frameworks/av 34fa5d146a5fdba488711e34b7a899472185fc9f -frameworks/base 426e4ecc2c224cc789d2a9f26cead6068d4e2dea +frameworks/base 2031865f119a22eec24ef5499f962f37e00e6c5d frameworks/compile/libbcc 2c3f4c361d131e500f6de3c417b819a05d13cf1f frameworks/compile/mclinker a40bbbff6e6e115620b12f620d3e9e9a0e7eb20e frameworks/compile/slang 8e9a212552c9096cfeccaacd65dea1d1bca88107 @@ -927,7 +932,7 @@ hardware/invensense 02424279a734a0cb64681cf11d5208a917662433 hardware/knowles/athletico/sound_trigger_hal 22e1e4a11c3d5dc3d25747054065e03e680c62d6 hardware/libhardware b923f817e9a095748f7ee86600586c9ff1c56c01 hardware/libhardware_legacy d38a44065863ae6edd31b758aa4049ea49dcc764 -hardware/lineage/compat 250739971e4ff8a92a71f088432960d2c0edc4a1 +hardware/lineage/compat ebbf14dbeb2a68b3be424e4877be369f9c05f41b hardware/lineage/interfaces 239c3734f1842d0876217449323bebab74e2e515 hardware/lineage/livedisplay 05bbbfd180bf8c02b6fb81a7e4b8057868f6e4ba hardware/nxp/keymint 13e2bde7ff9176a1ef37b1615c0e08c60ed1f318 @@ -1006,7 +1011,7 @@ hardware/qcom/sm8150/vr 1b71f99dcada3b7e90d1eb8ef34e3788b021a2cc hardware/qcom/wlan 930f96a82b9fa6b571197df6643dda263df7bd9b hardware/ril e1d539d38fecd4f1c0baf7478726352b1cea634f hardware/samsung/nfc 51321dd6bc591f9195fa17e00131a16c444fbdf8 -hardware/sony/SonyOpenTelephony 6c7bb0bf21ad10c8883b1e106c95ae27fe62a1b5 +hardware/sony/SonyOpenTelephony ef45e0879e14794e75ec784569669c814ddd5dd0 hardware/sony/macaddrsetup d2871b2041790f6d291e207bec8b0ef34029ef59 hardware/sony/simdetect b121cd8ddb0721c406fc9a6d052d13b9b0084669 hardware/sony/timekeep 11c1535c71b97f0ab833e215a8121ed107235010 @@ -1046,10 +1051,10 @@ kernel/prebuilts/mainline/x86_64 51a4241eb8c63ce034bfcd798d8dff8eaa8325d0 kernel/tests c34dac6e2a701ef73b6b27c71615ef16e997a73d libcore 7d70effa59da7858563c1345a91838bfe07b2a45 libnativehelper bd5a40c2b66bfe47123a22f35496ffe890be31ff -lineage-sdk f8894af39154ee79684d0ffb646b50fbd8a6479c -lineage/scripts 682b32168dff51c441081f24531bcce1113a0d86 -packages/apps/Aperture 0941b202cf853c922c13c21183864fb8cdf18cd5 -packages/apps/AudioFX e4982153b2aa1e0dbf2e5c7aafd6671be7d436ba +lineage-sdk 8f0bac92e8f7cbae8d393dbc47bc894cd2ecd575 +lineage/scripts 17fcbe772f7df4ffc2ef0f5a8adb255ebf0c5244 +packages/apps/Aperture cba6c523bfd97955f6db48dd1b872cb197470792 +packages/apps/AudioFX 185cd41fe273eeb8c61ba2ba6813f5431f0104e7 packages/apps/Backgrounds b960a88cdad0a64da086b40ce134a8b0ba30dc45 packages/apps/BasicSmsReceiver ea13485e203eaed509230326e974605212ca9b24 packages/apps/Camera2 d8b5759d205400bb2d4e36c05482ceae0afbc033 @@ -1072,40 +1077,41 @@ packages/apps/Car/SystemUI ad7f3e08546082fdce504d7b6633adb355b004d8 packages/apps/Car/SystemUpdater b967761389fe8198bbfebd7cd3de90263fdfc944 packages/apps/Car/systemlibs 53f8b321cc2c0be72effdd7b21551385bba25092 packages/apps/CarrierConfig 9042398d7bb6acc35a2091a04376b3201d9a2a03 +packages/apps/CarrierConfig2 e710a67ed64620fc11f62520cceef4bba64dc2a6 packages/apps/CellBroadcastReceiver cfbf20d2aab7ee61d0a6fc8ff4d2cef0a68defc7 packages/apps/CertInstaller ac293f1fa79b3a02cb78a1dd7eaf9942374603d1 -packages/apps/Contacts cf2b0b157267badb2091379d7f9407601dd3e663 -packages/apps/DeskClock 057796bb51024908bde81c55c16e9cf5dcb56f45 -packages/apps/Dialer b895bfeed40c694988d719d542b467bbed3022fa +packages/apps/Contacts d9ef1ac5a7850698632e3c28278e1ced449c4b91 +packages/apps/DeskClock 2828ae1a4d183feb32e842a642f58bdf0ae35485 +packages/apps/Dialer 1dad74cb39d1d8ba641698cb8ca85005a386f4d7 packages/apps/DocumentsUI a2c1dd717347fc6dae14de4e5ae0b1651eb5ed78 -packages/apps/ElmyraService e760bce21918980ff986cc20219a73c84b920b20 +packages/apps/ElmyraService b0fe9149683fac753182253ec488453e8e6903a5 packages/apps/EmergencyInfo c3f0da3e1b055755647c7728b30e723f4fd0fa41 -packages/apps/Etar 7e71d23ab1e6cbb5364cc036660f4090ec79335b +packages/apps/Etar 396a4e9c4cf26740fbb62558af19524ebb4e2370 packages/apps/ExactCalculator 760b63bba45f33696707646d7e62d086e9154808 packages/apps/FMRadio 038c2d22599ec990722c84e4c65dd67f5050a245 -packages/apps/FlipFlap fb78ed2085f4bd1ffad964debb1655e53107d2ed +packages/apps/FlipFlap 5ee8e316e5b3ec83fad48538a85470cec2099b25 packages/apps/Gallery2 9c5801d456a616be0a7091e5b3be0f1ff965aeff packages/apps/Glimpse ff1d891598941ad2036139e71967748735684291 packages/apps/HTMLViewer 31b1011ea5403d3b29e622dbd0f77fc607ed6b06 packages/apps/ImsServiceEntitlement 2d70ed5966ed71e1d51d6df4fbe6f51647990c36 packages/apps/KeyChain a39d83d995d5440029a09d892ba4f11c57c16987 packages/apps/LineageCustomizer 6d78f750ddfe8b7b5821a9ce83860755491b8bd8 -packages/apps/LineageParts f7e72af1522ac82c47f0795b3b82940c746a9b6a +packages/apps/LineageParts 819f6f928291907fbad8b4edea7f70ff4c9fd6f7 packages/apps/ManagedProvisioning 34923d09001dcfc507b76df7ca31d9bb41303c59 packages/apps/Messaging 4c4b67723fcb34087376f4515a4ab6fdf3c54346 packages/apps/Nfc b849d9252cbf05741642901a31a1140909d0200c packages/apps/OnDeviceAppPrediction 460e94bc49773d6e1a442fe0885e64bf3de98992 packages/apps/PhoneCommon 19a0c83a3623b673401bbbfd62f276ba95604c9f -packages/apps/Profiles 7edbf3aa9301f8af90508b4c5522574e84aff528 +packages/apps/Profiles d77fe623b1703c8ba7ba3e2afb3265cbb6ca7c14 packages/apps/Provision 841d5199e1d1c64e7853fd953eed5247780908c1 packages/apps/QuickAccessWallet ff76f8e175db7d199599e0c877a3ee477128da1b -packages/apps/Recorder 4c8cd5f64fb52f34459fc7f52fc92fee705a906d +packages/apps/Recorder 6d2b0b05ad53ad889f79af5781fdf23fc7d3e0e7 packages/apps/SafetyRegulatoryInfo b1b0deb1c285c9d72b4d7ce85db9b36eb1aa0586 packages/apps/SecureElement 7fea68a2a8bf25fb3bc4a121a5abe986a8a98cd0 packages/apps/Seedvault c906fd7834ed027fbc6c4dacea1b15525a882013 -packages/apps/Settings bd2f8fab45b9876e32b1108a9428a625b8b0d662 +packages/apps/Settings 5a11baa2e82e35da09877eaabdb94825e6902b2b packages/apps/SettingsIntelligence 2f2caa0a6524248bfefb63167c4bfcec9c83630b -packages/apps/SetupWizard ae6ef3aa56ea356e3feae1d8793e738e91f41a90 +packages/apps/SetupWizard db7f073b02044b6140a225457a99cb16ddc21711 packages/apps/SimpleDeviceConfig 82d31b18dd2550e05f89248f128cb571eecc863a packages/apps/SimpleSettingsConfig f5620aa22a44ac3a9794d0fda5c146efd7e0a11e packages/apps/Stk 12c0bb30b9b54820792f6245e048de42bdf4fc45 @@ -1116,14 +1122,14 @@ packages/apps/Tag 2844783b03f9a500ba58b64188ce44092e77c5df packages/apps/Test/connectivity fe8d01bb832962ecda95df428cf3271c2f5edd60 packages/apps/ThemePicker 23a6a5ee543d6d588c3a5d3f88cb3e73bacbb341 packages/apps/Traceur 502271cf2636652907facf05d1fe00e2c5f83fcb -packages/apps/Trebuchet d4eb7ecb69f71ee5fe3abcdbe48b545e3dae44ce +packages/apps/Trebuchet 5efbfaaf8b01176a7f86855adaaa6dbcd16dc7a1 packages/apps/TvFeedbackConsent 784429c3efe3567f37e79ba195d557c21e8a4e56 packages/apps/TvSettings b733bcb5add8f50f9261c3036239f1ac37e8ac0c packages/apps/TvSystemUI adddf3323e91d794360bcdb8b5c8bc15bfe7c042 packages/apps/UniversalMediaPlayer f702e26a7b8c26a43bb2a1f56a034b54159daaca packages/apps/Updater 589762cef61fb95c4caadd5cf6e174466e981693 packages/apps/WallpaperPicker2 6f89ba3cd7867ccdb629ce53764b79fe69f5a1a1 -packages/inputmethods/LatinIME b042d5d65abd6190b568ad1ec3bcdf97a40a76d9 +packages/inputmethods/LatinIME 4c7ab81beac15d42cee6e64fee77786e286c4539 packages/inputmethods/LeanbackIME e149bd75e80000e8ce5e1ffe045174c32825924e packages/modules/AdServices 50c6b795de14812a67eca6a83cb50ac7e74a0a2e packages/modules/AppSearch ceb280f1b40b917fc907d8eacfc84e27e497b8c4 @@ -1175,13 +1181,13 @@ packages/providers/CalendarProvider 1b7832da5de6cf1a604b4c68b66cf9ac96e201ae packages/providers/CallLogProvider e4d5033efd357b034145724eaf29d7a0e75b7fa4 packages/providers/ContactsKeysProvider d0fece438069f911483bd9af207b6ffb1ba7d2ca packages/providers/ContactsProvider 249c310fb32f5f0b509c6a4dcc0ef9e82bbb2c72 -packages/providers/DownloadProvider 99875e8ba1afb3bd0e3e5bb2233b82b87db3e39a +packages/providers/DownloadProvider e05cc5f9d779234d615cecd53d80b542d1e9ed49 packages/providers/MediaProvider fa08ed38ef8a60d22e0e2386075171b6bbc72bc7 packages/providers/PartnerBookmarksProvider 72dd0cb842aeeaf9f6fe2509eb8d198ef6d04a16 packages/providers/TelephonyProvider b87ec340fe67c18f28b768c32997f778e189d06f packages/providers/TvProvider 14f47205f4f56e8e55c8d9d4bb0fee5af7b2e98e packages/providers/UserDictionaryProvider f9a8cef4d18e56bbea1726b8f1333532711e73e2 -packages/resources/devicesettings 863052dc753099acc34c25a626f4f3d5bef99fb9 +packages/resources/devicesettings 33e71ed84a2ff37522ead88f9393399d5c356206 packages/screensavers/Basic ded60000831916dca597746d383f9b46372a7c48 packages/screensavers/PhotoTable c3bb60a519f9a27e62349e64ef8ed85ac84e61d2 packages/services/AlternativeNetworkAccess bcc3e8de6243b9547828c8bb390496bd6030a031 @@ -1189,7 +1195,7 @@ packages/services/BuiltInPrintService f57117a74aa3bbafcc97ae0a74b54c1e08136b2a packages/services/Car 87dd5b88b5963f5b3db281587fdc9eea25fef74e packages/services/DeviceAsWebcam 539de3cd26d68e0adc75fb968bb1ff46a2e63a59 packages/services/Iwlan 07028c630178232eb79eb7f1caabd707ad8c6f74 -packages/services/Mms 8f1803a5664a921f5b1ab2085fc7ed008d4c44ea +packages/services/Mms 399abfb55168f086723bc3c5bf42491f85fd8a21 packages/services/Mtp 4fb488f462033549ac6431563a71278cddd7c3e6 packages/services/Telecomm fcc9a88308e389d0fb0e9666e697a0af6b050cff packages/services/Telephony 782e27cddb8afec806b22e8fcd95312bbd1e2ee1 @@ -1401,7 +1407,7 @@ trusty/user/app/storage 3d0b4922803178c784a55272b7c67c5ba33bd290 trusty/user/base 776861c503a1efabb0ff34b47ea17a8d461a23b2 trusty/vendor/google/aosp 2edf8eb162934c428ffcbda2dcd91696e0bc1777 vendor/codeaurora/telephony 6cfafa7df042506e0c48f19e18b5972985177745 -vendor/crowdin 7db9fcf6232d8ecc8aac8dd44517fb28f31fcce6 +vendor/crowdin 15a184c4aaa6469cc55ca685b5f1cd1939155888 vendor/google/bluejay 430da8d3e2aa8a8f7985519d35b700d35830eaaa vendor/google/cheetah d49f62efef0843a81dc8d7c860b196a30efceb66 vendor/google/felix 6eff0c3e287454905660729a634e7e7a1264b18e @@ -1410,7 +1416,7 @@ vendor/google/oriole 460fad99f25575e4f3a328319952ee5497e0bbc3 vendor/google/panther ac852a92ef6381c4d52c8a19c393cde28045bba6 vendor/google/raven 8a497b74a346c15d94910aced32e93467a2a8890 vendor/google/tangorpro 51f599d8515e0a9fd9dcbdafecc8940eb79878d1 -vendor/lineage 5c70cfdf50b2e2365f61db3f566937691a709661 +vendor/lineage bd5c14a81070f25315e46910353dd32e3c2fdd83 vendor/qcom/opensource/audio-hal/st-hal b2a0060bb4fa63280419616eb6e17cf3c10a4d42 vendor/qcom/opensource/audio-hal/st-hal-ar 9a1ad498496ba28f7ed7d7146ec24ffaf899ed99 vendor/qcom/opensource/commonsys-intf/display bfd8bbc7536d4a06cb4f541a70e029060a0c7e90 diff --git a/Manifests/Manifest_LAOS-21.0.xml b/Manifests/Manifest_LAOS-21.0.xml index 3b2ec3b0..3712c23a 100644 --- a/Manifests/Manifest_LAOS-21.0.xml +++ b/Manifests/Manifest_LAOS-21.0.xml @@ -71,6 +71,7 @@ + @@ -78,12 +79,16 @@ + + + + diff --git a/Patches/LineageOS-21.0/android_bionic/0002-Graphene_Bionic_Hardening-1.patch b/Patches/LineageOS-21.0/android_bionic/0002-Graphene_Bionic_Hardening-1.patch index 146b75fc..d354be8d 100644 --- a/Patches/LineageOS-21.0/android_bionic/0002-Graphene_Bionic_Hardening-1.patch +++ b/Patches/LineageOS-21.0/android_bionic/0002-Graphene_Bionic_Hardening-1.patch @@ -26,17 +26,17 @@ Signed-off-by: anupritaisno1 create mode 100644 libc/bionic/explicit_bzero.cpp diff --git a/libc/Android.bp b/libc/Android.bp -index 13cefe94f..9f8b689af 100644 +index a5f87c3a2..bc5b16a22 100644 --- a/libc/Android.bp +++ b/libc/Android.bp -@@ -1127,6 +1127,7 @@ cc_library_static { +@@ -850,6 +850,7 @@ cc_library_static { "bionic/eventfd.cpp", "bionic/exec.cpp", "bionic/execinfo.cpp", + "bionic/explicit_bzero.cpp", + "bionic/exit.cpp", "bionic/faccessat.cpp", "bionic/fchmod.cpp", - "bionic/fchmodat.cpp", diff --git a/libc/bionic/explicit_bzero.cpp b/libc/bionic/explicit_bzero.cpp new file mode 100644 index 000000000..dd43f9c00 @@ -64,7 +64,7 @@ index 47bdd7271..e601ea022 100644 * [memset_explicit(3)](http://man7.org/linux/man-pages/man3/memset_explicit.3.html) * writes the bottom 8 bits of the given int to the next `n` bytes of `dst`, diff --git a/libc/libc.map.txt b/libc/libc.map.txt -index 5d87cd8ef..dd2e6c6f7 100644 +index f5340c172..9a0e7fb99 100644 --- a/libc/libc.map.txt +++ b/libc/libc.map.txt @@ -332,6 +332,7 @@ LIBC { diff --git a/Patches/LineageOS-21.0/android_bionic/0002-Graphene_Bionic_Hardening-12.patch b/Patches/LineageOS-21.0/android_bionic/0002-Graphene_Bionic_Hardening-12.patch index e1c1c7a9..277e281c 100644 --- a/Patches/LineageOS-21.0/android_bionic/0002-Graphene_Bionic_Hardening-12.patch +++ b/Patches/LineageOS-21.0/android_bionic/0002-Graphene_Bionic_Hardening-12.patch @@ -54,7 +54,7 @@ index 99077c101..74608513e 100644 __loader_remove_thread_local_dtor(current->dso_handle); } diff --git a/libc/bionic/libc_init_common.cpp b/libc/bionic/libc_init_common.cpp -index 7ef79b61a..9c946b077 100644 +index 51f7ce9ce..31d45724d 100644 --- a/libc/bionic/libc_init_common.cpp +++ b/libc/bionic/libc_init_common.cpp @@ -46,6 +46,7 @@ @@ -74,13 +74,13 @@ index 7ef79b61a..9c946b077 100644 } diff --git a/libc/private/bionic_globals.h b/libc/private/bionic_globals.h -index 66f8d84b0..bd34e3a08 100644 +index 598918f09..fcf049899 100644 --- a/libc/private/bionic_globals.h +++ b/libc/private/bionic_globals.h -@@ -50,6 +50,7 @@ struct libc_globals { - uintptr_t heap_pointer_tag; +@@ -51,6 +51,7 @@ struct libc_globals { _Atomic(bool) memtag_stack; _Atomic(bool) decay_time_enabled; + _Atomic(bool) memtag; + long dtor_cookie; // In order to allow a complete switch between dispatch tables without diff --git a/Patches/LineageOS-21.0/android_bionic/0002-Graphene_Bionic_Hardening-13.patch b/Patches/LineageOS-21.0/android_bionic/0002-Graphene_Bionic_Hardening-13.patch index 6cebd2ea..20db94b4 100644 --- a/Patches/LineageOS-21.0/android_bionic/0002-Graphene_Bionic_Hardening-13.patch +++ b/Patches/LineageOS-21.0/android_bionic/0002-Graphene_Bionic_Hardening-13.patch @@ -11,7 +11,7 @@ Signed-off-by: anupritaisno1 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libc/bionic/pthread_attr.cpp b/libc/bionic/pthread_attr.cpp -index de4cc9e8d..7e74b8a80 100644 +index f6c0401bb..deca10ca1 100644 --- a/libc/bionic/pthread_attr.cpp +++ b/libc/bionic/pthread_attr.cpp @@ -54,7 +54,7 @@ int pthread_attr_init(pthread_attr_t* attr) { diff --git a/Patches/LineageOS-21.0/android_bionic/0002-Graphene_Bionic_Hardening-7.patch b/Patches/LineageOS-21.0/android_bionic/0002-Graphene_Bionic_Hardening-7.patch index 498fcdb8..623ab5c1 100644 --- a/Patches/LineageOS-21.0/android_bionic/0002-Graphene_Bionic_Hardening-7.patch +++ b/Patches/LineageOS-21.0/android_bionic/0002-Graphene_Bionic_Hardening-7.patch @@ -9,10 +9,10 @@ Signed-off-by: anupritaisno1 1 file changed, 4 insertions(+) diff --git a/libc/bionic/pthread_internal.h b/libc/bionic/pthread_internal.h -index 3b9e6a481..c4d124e8e 100644 +index 091f711eb..07df081a9 100644 --- a/libc/bionic/pthread_internal.h +++ b/libc/bionic/pthread_internal.h -@@ -256,7 +256,11 @@ __LIBC_HIDDEN__ void pthread_key_clean_all(void); +@@ -258,7 +258,11 @@ __LIBC_HIDDEN__ void pthread_key_clean_all(void); // stack overflows, we subtracted the same amount we were using there // from the default thread stack size. This should keep memory usage // roughly constant. diff --git a/Patches/LineageOS-21.0/android_build/0001-Enable_fwrapv.patch b/Patches/LineageOS-21.0/android_build/0001-Enable_fwrapv.patch index 35fcfd39..6b1847d7 100644 --- a/Patches/LineageOS-21.0/android_build/0001-Enable_fwrapv.patch +++ b/Patches/LineageOS-21.0/android_build/0001-Enable_fwrapv.patch @@ -9,10 +9,10 @@ Signed-off-by: anupritaisno1 1 file changed, 6 insertions(+) diff --git a/core/config_sanitizers.mk b/core/config_sanitizers.mk -index 3507961833..01cb295bfe 100644 +index ab2d5c1ddf..d55f93081e 100644 --- a/core/config_sanitizers.mk +++ b/core/config_sanitizers.mk -@@ -572,3 +572,9 @@ ifneq ($(findstring fsanitize,$(my_cflags)),) +@@ -575,3 +575,9 @@ ifneq ($(findstring fsanitize,$(my_cflags)),) endif endif endif diff --git a/Patches/LineageOS-21.0/android_build/0003-Exec_Based_Spawning.patch b/Patches/LineageOS-21.0/android_build/0003-Exec_Based_Spawning.patch index c1a18ee7..ff2a7386 100644 --- a/Patches/LineageOS-21.0/android_build/0003-Exec_Based_Spawning.patch +++ b/Patches/LineageOS-21.0/android_build/0003-Exec_Based_Spawning.patch @@ -14,10 +14,10 @@ Signed-off-by: anupritaisno1 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/product/generic_system.mk b/target/product/generic_system.mk -index 08a7cdf83e..8ed85ab6fa 100644 +index 7aff62c39f..c7e11b89e0 100644 --- a/target/product/generic_system.mk +++ b/target/product/generic_system.mk -@@ -112,7 +112,7 @@ PRODUCT_COPY_FILES += \ +@@ -123,7 +123,7 @@ PRODUCT_COPY_FILES += \ # Enable dynamic partition size PRODUCT_USE_DYNAMIC_PARTITION_SIZE := true diff --git a/Patches/LineageOS-21.0/android_build/0004-Selective_APEX.patch b/Patches/LineageOS-21.0/android_build/0004-Selective_APEX.patch index 315377ce..d77e6707 100644 --- a/Patches/LineageOS-21.0/android_build/0004-Selective_APEX.patch +++ b/Patches/LineageOS-21.0/android_build/0004-Selective_APEX.patch @@ -10,7 +10,7 @@ Change-Id: Icffb72d8c3ed0e33e76538bb3427377c33c55ff9 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/target/product/generic_system.mk b/target/product/generic_system.mk -index 8ed85ab6fa..7b9ed53281 100644 +index c7e11b89e0..9304e232cb 100644 --- a/target/product/generic_system.mk +++ b/target/product/generic_system.mk @@ -21,8 +21,10 @@ $(call inherit-product, $(SRC_TARGET_DIR)/product/languages_default.mk) diff --git a/Patches/LineageOS-21.0/android_build_soong/0001-Enable_fwrapv.patch b/Patches/LineageOS-21.0/android_build_soong/0001-Enable_fwrapv.patch index 6290a2e7..57ed8324 100644 --- a/Patches/LineageOS-21.0/android_build_soong/0001-Enable_fwrapv.patch +++ b/Patches/LineageOS-21.0/android_build_soong/0001-Enable_fwrapv.patch @@ -11,10 +11,10 @@ Subject: [PATCH] use -fwrapv when signed overflow checking is off 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/cc/cc.go b/cc/cc.go -index 9d5b8d894..01cae261a 100644 +index b3f0bfadb..ccbc44a56 100644 --- a/cc/cc.go +++ b/cc/cc.go -@@ -2052,6 +2052,8 @@ func (c *Module) GenerateAndroidBuildActions(actx android.ModuleContext) { +@@ -2079,6 +2079,8 @@ func (c *Module) GenerateAndroidBuildActions(actx android.ModuleContext) { } if c.sanitize != nil { flags = c.sanitize.flags(ctx, flags) @@ -24,10 +24,10 @@ index 9d5b8d894..01cae261a 100644 if c.coverage != nil { flags, deps = c.coverage.flags(ctx, flags, deps) diff --git a/cc/cc_test.go b/cc/cc_test.go -index 3631f1998..af9498499 100644 +index 6cc500b5f..59f45403a 100644 --- a/cc/cc_test.go +++ b/cc/cc_test.go -@@ -4427,7 +4427,7 @@ func TestIncludeDirectoryOrdering(t *testing.T) { +@@ -4439,7 +4439,7 @@ func TestIncludeDirectoryOrdering(t *testing.T) { conly := []string{"-fPIC", "${config.CommonGlobalConlyflags}"} cppOnly := []string{"-fPIC", "${config.CommonGlobalCppflags}", "${config.DeviceGlobalCppflags}", "${config.ArmCppflags}"} @@ -37,7 +37,7 @@ index 3631f1998..af9498499 100644 cppstd := []string{"-std=gnu++20", "-std=cpp", "-fno-rtti"} diff --git a/cc/sanitize.go b/cc/sanitize.go -index 31c050018..38eeb12af 100644 +index 52b5be9e6..91e953090 100644 --- a/cc/sanitize.go +++ b/cc/sanitize.go @@ -787,8 +787,22 @@ func toDisableUnsignedShiftBaseChange(flags []string) bool { diff --git a/Patches/LineageOS-21.0/android_build_soong/0002-hm_available.patch b/Patches/LineageOS-21.0/android_build_soong/0002-hm_available.patch deleted file mode 100644 index 2d3305f1..00000000 --- a/Patches/LineageOS-21.0/android_build_soong/0002-hm_available.patch +++ /dev/null @@ -1,21 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Dmitry Muhomor -Date: Thu, 5 Oct 2023 15:16:24 +0300 -Subject: [PATCH] mark hardened_malloc as bp2build_available - ---- - android/allowlists/allowlists.go | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/android/allowlists/allowlists.go b/android/allowlists/allowlists.go -index b9d26f884..34c83e00c 100644 ---- a/android/allowlists/allowlists.go -+++ b/android/allowlists/allowlists.go -@@ -160,6 +160,7 @@ var ( - "external/guava": Bp2BuildDefaultTrueRecursively, - "external/gwp_asan": Bp2BuildDefaultTrueRecursively, - "external/hamcrest": Bp2BuildDefaultTrueRecursively, -+ "external/hardened_malloc": Bp2BuildDefaultTrueRecursively, - "external/icu": Bp2BuildDefaultTrueRecursively, - "external/icu/android_icu4j": Bp2BuildDefaultFalse, // java rules incomplete - "external/icu/icu4j": Bp2BuildDefaultFalse, // java rules incomplete diff --git a/Patches/LineageOS-21.0/android_external_conscrypt/0001-constify_JNINativeMethod.patch b/Patches/LineageOS-21.0/android_external_conscrypt/0001-constify_JNINativeMethod.patch index 64e19cb3..27225800 100644 --- a/Patches/LineageOS-21.0/android_external_conscrypt/0001-constify_JNINativeMethod.patch +++ b/Patches/LineageOS-21.0/android_external_conscrypt/0001-constify_JNINativeMethod.patch @@ -8,10 +8,10 @@ Subject: [PATCH] constify JNINativeMethod table 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/src/jni/main/cpp/conscrypt/native_crypto.cc b/common/src/jni/main/cpp/conscrypt/native_crypto.cc -index 6d831d03..db24fbc3 100644 +index 54625f5c..c2aaf494 100644 --- a/common/src/jni/main/cpp/conscrypt/native_crypto.cc +++ b/common/src/jni/main/cpp/conscrypt/native_crypto.cc -@@ -10940,7 +10940,7 @@ static jlong NativeCrypto_SSL_get1_session(JNIEnv* env, jclass, jlong ssl_addres +@@ -10981,7 +10981,7 @@ static jlong NativeCrypto_SSL_get1_session(JNIEnv* env, jclass, jlong ssl_addres #define REF_X509_CRL "L" TO_STRING(JNI_JARJAR_PREFIX) "org/conscrypt/OpenSSLX509CRL;" #define REF_SSL "L" TO_STRING(JNI_JARJAR_PREFIX) "org/conscrypt/NativeSsl;" #define REF_SSL_CTX "L" TO_STRING(JNI_JARJAR_PREFIX) "org/conscrypt/AbstractSessionContext;" diff --git a/Patches/LineageOS-21.0/android_external_expat/0001-lib-Detect-integer-overflow-in-function-nextScaffold.patch b/Patches/LineageOS-21.0/android_external_expat/0001-lib-Detect-integer-overflow-in-function-nextScaffold.patch new file mode 100644 index 00000000..3e569788 --- /dev/null +++ b/Patches/LineageOS-21.0/android_external_expat/0001-lib-Detect-integer-overflow-in-function-nextScaffold.patch @@ -0,0 +1,30 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Sebastian Pipping +Date: Mon, 19 Aug 2024 22:37:16 +0200 +Subject: [PATCH] lib: Detect integer overflow in function nextScaffoldPart + +Reported by TaiYou +--- + expat/lib/xmlparse.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c +index aaf0fa9c..67970854 100644 +--- a/expat/lib/xmlparse.c ++++ b/expat/lib/xmlparse.c +@@ -7550,6 +7550,15 @@ nextScaffoldPart(XML_Parser parser) { + int next; + + if (! dtd->scaffIndex) { ++ /* Detect and prevent integer overflow. ++ * The preprocessor guard addresses the "always false" warning ++ * from -Wtype-limits on platforms where ++ * sizeof(unsigned int) < sizeof(size_t), e.g. on x86_64. */ ++#if UINT_MAX >= SIZE_MAX ++ if (parser->m_groupSize > ((size_t)(-1) / sizeof(int))) { ++ return -1; ++ } ++#endif + dtd->scaffIndex = (int *)MALLOC(parser, parser->m_groupSize * sizeof(int)); + if (! dtd->scaffIndex) + return -1; diff --git a/Patches/LineageOS-21.0/android_external_expat/0002-lib-Reject-negative-len-for-XML_ParseBuffer.patch b/Patches/LineageOS-21.0/android_external_expat/0002-lib-Reject-negative-len-for-XML_ParseBuffer.patch new file mode 100644 index 00000000..57d5ca33 --- /dev/null +++ b/Patches/LineageOS-21.0/android_external_expat/0002-lib-Reject-negative-len-for-XML_ParseBuffer.patch @@ -0,0 +1,27 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Sebastian Pipping +Date: Mon, 19 Aug 2024 22:26:07 +0200 +Subject: [PATCH] lib: Reject negative len for XML_ParseBuffer + +Reported by TaiYou +--- + expat/lib/xmlparse.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c +index 67970854..d73d980e 100644 +--- a/expat/lib/xmlparse.c ++++ b/expat/lib/xmlparse.c +@@ -2030,6 +2030,12 @@ XML_ParseBuffer(XML_Parser parser, int len, int isFinal) { + + if (parser == NULL) + return XML_STATUS_ERROR; ++ ++ if (len < 0) { ++ parser->m_errorCode = XML_ERROR_INVALID_ARGUMENT; ++ return XML_STATUS_ERROR; ++ } ++ + switch (parser->m_parsingStatus.parsing) { + case XML_SUSPENDED: + parser->m_errorCode = XML_ERROR_SUSPENDED; diff --git a/Patches/LineageOS-21.0/android_external_expat/0003-tests-Cover-len-0-for-both-XML_Parse-and-XML_ParseBu.patch b/Patches/LineageOS-21.0/android_external_expat/0003-tests-Cover-len-0-for-both-XML_Parse-and-XML_ParseBu.patch new file mode 100644 index 00000000..70b886c2 --- /dev/null +++ b/Patches/LineageOS-21.0/android_external_expat/0003-tests-Cover-len-0-for-both-XML_Parse-and-XML_ParseBu.patch @@ -0,0 +1,84 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Sebastian Pipping +Date: Tue, 20 Aug 2024 22:57:12 +0200 +Subject: [PATCH] tests: Cover "len < 0" for both XML_Parse and XML_ParseBuffer + +--- + expat/tests/basic_tests.c | 57 +++++++++++++++++++++++++++++++++++++++ + 1 file changed, 57 insertions(+) + +diff --git a/expat/tests/basic_tests.c b/expat/tests/basic_tests.c +index 7112a440..6284faac 100644 +--- a/expat/tests/basic_tests.c ++++ b/expat/tests/basic_tests.c +@@ -2761,6 +2761,61 @@ START_TEST(test_empty_parse) { + } + END_TEST + ++/* Test XML_Parse for len < 0 */ ++START_TEST(test_negative_len_parse) { ++ const char *const doc = ""; ++ for (int isFinal = 0; isFinal < 2; isFinal++) { ++ set_subtest("isFinal=%d", isFinal); ++ ++ XML_Parser parser = XML_ParserCreate(NULL); ++ ++ if (XML_GetErrorCode(parser) != XML_ERROR_NONE) ++ fail("There was not supposed to be any initial parse error."); ++ ++ const enum XML_Status status = XML_Parse(parser, doc, -1, isFinal); ++ ++ if (status != XML_STATUS_ERROR) ++ fail("Negative len was expected to fail the parse but did not."); ++ ++ if (XML_GetErrorCode(parser) != XML_ERROR_INVALID_ARGUMENT) ++ fail("Parse error does not match XML_ERROR_INVALID_ARGUMENT."); ++ ++ XML_ParserFree(parser); ++ } ++} ++END_TEST ++ ++/* Test XML_ParseBuffer for len < 0 */ ++START_TEST(test_negative_len_parse_buffer) { ++ const char *const doc = ""; ++ for (int isFinal = 0; isFinal < 2; isFinal++) { ++ set_subtest("isFinal=%d", isFinal); ++ ++ XML_Parser parser = XML_ParserCreate(NULL); ++ ++ if (XML_GetErrorCode(parser) != XML_ERROR_NONE) ++ fail("There was not supposed to be any initial parse error."); ++ ++ void *const buffer = XML_GetBuffer(parser, (int)strlen(doc)); ++ ++ if (buffer == NULL) ++ fail("XML_GetBuffer failed."); ++ ++ memcpy(buffer, doc, strlen(doc)); ++ ++ const enum XML_Status status = XML_ParseBuffer(parser, -1, isFinal); ++ ++ if (status != XML_STATUS_ERROR) ++ fail("Negative len was expected to fail the parse but did not."); ++ ++ if (XML_GetErrorCode(parser) != XML_ERROR_INVALID_ARGUMENT) ++ fail("Parse error does not match XML_ERROR_INVALID_ARGUMENT."); ++ ++ XML_ParserFree(parser); ++ } ++} ++END_TEST ++ + /* Test odd corners of the XML_GetBuffer interface */ + static enum XML_Status + get_feature(enum XML_FeatureEnum feature_id, long *presult) { +@@ -5940,6 +5995,8 @@ make_basic_test_case(Suite *s) { + tcase_add_test__ifdef_xml_dtd(tc_basic, test_user_parameters); + tcase_add_test__ifdef_xml_dtd(tc_basic, test_ext_entity_ref_parameter); + tcase_add_test(tc_basic, test_empty_parse); ++ tcase_add_test(tc_basic, test_negative_len_parse); ++ tcase_add_test(tc_basic, test_negative_len_parse_buffer); + tcase_add_test(tc_basic, test_get_buffer_1); + tcase_add_test(tc_basic, test_get_buffer_2); + #if XML_CONTEXT_BYTES > 0 diff --git a/Patches/LineageOS-21.0/android_external_expat/0004-doc-Document-that-XML_Parse-XML_ParseBuffer-reject-l.patch b/Patches/LineageOS-21.0/android_external_expat/0004-doc-Document-that-XML_Parse-XML_ParseBuffer-reject-l.patch new file mode 100644 index 00000000..c6979113 --- /dev/null +++ b/Patches/LineageOS-21.0/android_external_expat/0004-doc-Document-that-XML_Parse-XML_ParseBuffer-reject-l.patch @@ -0,0 +1,42 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Sebastian Pipping +Date: Sun, 25 Aug 2024 19:09:51 +0200 +Subject: [PATCH] doc: Document that XML_Parse/XML_ParseBuffer reject "len < 0" + +--- + expat/doc/reference.html | 10 +++++++++- + 1 file changed, 9 insertions(+), 1 deletion(-) + +diff --git a/expat/doc/reference.html b/expat/doc/reference.html +index 898f03a3..44501407 100644 +--- a/expat/doc/reference.html ++++ b/expat/doc/reference.html +@@ -1138,7 +1138,9 @@ containing part (or perhaps all) of the document. The number of bytes of s + that are part of the document is indicated by len. This means + that s doesn't have to be null-terminated. It also means that + if len is larger than the number of bytes in the block of +-memory that s points at, then a memory fault is likely. The ++memory that s points at, then a memory fault is likely. ++Negative values for len are rejected since Expat 2.2.1. ++The + isFinal parameter informs the parser that this is the last + piece of the document. Frequently, the last piece is empty (i.e. + len is zero.) +@@ -1186,11 +1188,17 @@ XML_ParseBuffer(XML_Parser p, + int isFinal); + +
++

+ This is just like XML_Parse, + except in this case Expat provides the buffer. By obtaining the + buffer from Expat with the XML_GetBuffer function, the application can avoid double + copying of the input. ++

++ ++

++Negative values for len are rejected since Expat 2.6.3. ++

+
+ +

XML_GetBuffer

diff --git a/Patches/LineageOS-21.0/android_external_expat/0005-lib-Detect-integer-overflow-in-dtdCopy.patch b/Patches/LineageOS-21.0/android_external_expat/0005-lib-Detect-integer-overflow-in-dtdCopy.patch new file mode 100644 index 00000000..20e5aef0 --- /dev/null +++ b/Patches/LineageOS-21.0/android_external_expat/0005-lib-Detect-integer-overflow-in-dtdCopy.patch @@ -0,0 +1,31 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Sebastian Pipping +Date: Mon, 19 Aug 2024 22:34:13 +0200 +Subject: [PATCH] lib: Detect integer overflow in dtdCopy + +Reported by TaiYou +--- + expat/lib/xmlparse.c | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c +index d73d980e..76a149df 100644 +--- a/expat/lib/xmlparse.c ++++ b/expat/lib/xmlparse.c +@@ -7014,6 +7014,16 @@ dtdCopy(XML_Parser oldParser, DTD *newDtd, const DTD *oldDtd, + if (! newE) + return 0; + if (oldE->nDefaultAtts) { ++ /* Detect and prevent integer overflow. ++ * The preprocessor guard addresses the "always false" warning ++ * from -Wtype-limits on platforms where ++ * sizeof(int) < sizeof(size_t), e.g. on x86_64. */ ++#if UINT_MAX >= SIZE_MAX ++ if ((size_t)oldE->nDefaultAtts ++ > ((size_t)(-1) / sizeof(DEFAULT_ATTRIBUTE))) { ++ return 0; ++ } ++#endif + newE->defaultAtts + = ms->malloc_fcn(oldE->nDefaultAtts * sizeof(DEFAULT_ATTRIBUTE)); + if (! newE->defaultAtts) { diff --git a/Patches/LineageOS-21.0/android_external_expat/0006-lib-xmlparse.c-Detect-billion-laughs-attack-with-iso.patch b/Patches/LineageOS-21.0/android_external_expat/0006-lib-xmlparse.c-Detect-billion-laughs-attack-with-iso.patch new file mode 100644 index 00000000..53922da6 --- /dev/null +++ b/Patches/LineageOS-21.0/android_external_expat/0006-lib-xmlparse.c-Detect-billion-laughs-attack-with-iso.patch @@ -0,0 +1,53 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Sebastian Pipping +Date: Mon, 4 Mar 2024 23:49:06 +0100 +Subject: [PATCH] lib/xmlparse.c: Detect billion laughs attack with isolated + external parser + +When parsing DTD content with code like .. + + XML_Parser parser = XML_ParserCreate(NULL); + XML_Parser ext_parser = XML_ExternalEntityParserCreate(parser, NULL, NULL); + enum XML_Status status = XML_Parse(ext_parser, doc, (int)strlen(doc), XML_TRUE); + +.. there are 0 bytes accounted as direct input and all input from `doc` accounted +as indirect input. Now function accountingGetCurrentAmplification cannot calculate +the current amplification ratio as "(direct + indirect) / direct", and it did refuse +to divide by 0 as one would expect, but it returned 1.0 for this case to indicate +no amplification over direct input. As a result, billion laughs attacks from +DTD-only input were not detected with this isolated way of using an external parser. + +The new approach is to assume direct input of length not 0 but 22 -- derived from +ghost input "", the shortest possible way to include an external +DTD --, and do the usual "(direct + indirect) / direct" math with "direct := 22". + +GitHub issue #839 has more details on this issue and its origin in ClusterFuzz +finding 66812. +--- + expat/lib/xmlparse.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c +index 76a149df..37a5b70e 100644 +--- a/expat/lib/xmlparse.c ++++ b/expat/lib/xmlparse.c +@@ -7804,6 +7804,8 @@ copyString(const XML_Char *s, const XML_Memory_Handling_Suite *memsuite) { + + static float + accountingGetCurrentAmplification(XML_Parser rootParser) { ++ // 1.........1.........12 => 22 ++ const size_t lenOfShortestInclude = sizeof("") - 1; + const XmlBigCount countBytesOutput + = rootParser->m_accounting.countBytesDirect + + rootParser->m_accounting.countBytesIndirect; +@@ -7811,7 +7813,9 @@ accountingGetCurrentAmplification(XML_Parser rootParser) { + = rootParser->m_accounting.countBytesDirect + ? (countBytesOutput + / (float)(rootParser->m_accounting.countBytesDirect)) +- : 1.0f; ++ : ((lenOfShortestInclude ++ + rootParser->m_accounting.countBytesIndirect) ++ / (float)lenOfShortestInclude); + assert(! rootParser->m_parentParser); + return amplificationFactor; + } diff --git a/Patches/LineageOS-21.0/android_frameworks_base/0003-SUPL_No_IMSI.patch b/Patches/LineageOS-21.0/android_frameworks_base/0003-SUPL_No_IMSI.patch index e7c36dd8..9aa66857 100644 --- a/Patches/LineageOS-21.0/android_frameworks_base/0003-SUPL_No_IMSI.patch +++ b/Patches/LineageOS-21.0/android_frameworks_base/0003-SUPL_No_IMSI.patch @@ -9,10 +9,10 @@ Change-Id: I5ccc4d61e52ac11ef33f44618d0e610089885b87 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/location/gnss/GnssLocationProvider.java b/services/core/java/com/android/server/location/gnss/GnssLocationProvider.java -index 0386ee454278..af7dcc7d917a 100644 +index bb7d04c6736c..c99773ec89d5 100644 --- a/services/core/java/com/android/server/location/gnss/GnssLocationProvider.java +++ b/services/core/java/com/android/server/location/gnss/GnssLocationProvider.java -@@ -1798,6 +1798,11 @@ public class GnssLocationProvider extends AbstractLocationProvider implements +@@ -1809,6 +1809,11 @@ public class GnssLocationProvider extends AbstractLocationProvider implements int type = AGPS_SETID_TYPE_NONE; String setId = null; @@ -24,7 +24,7 @@ index 0386ee454278..af7dcc7d917a 100644 int subId = SubscriptionManager.getDefaultDataSubscriptionId(); if (mGnssConfiguration.isActiveSimEmergencySuplEnabled() && mNIHandler.getInEmergency() && mNetworkConnectivityHandler.getActiveSubId() >= 0) { -@@ -1818,7 +1823,7 @@ public class GnssLocationProvider extends AbstractLocationProvider implements +@@ -1829,7 +1834,7 @@ public class GnssLocationProvider extends AbstractLocationProvider implements // This means the framework has the SIM card. type = AGPS_SETID_TYPE_MSISDN; } diff --git a/Patches/LineageOS-21.0/android_frameworks_base/0004-Fingerprint_Lockout.patch b/Patches/LineageOS-21.0/android_frameworks_base/0004-Fingerprint_Lockout.patch index f7ba2902..46c3e6ce 100644 --- a/Patches/LineageOS-21.0/android_frameworks_base/0004-Fingerprint_Lockout.patch +++ b/Patches/LineageOS-21.0/android_frameworks_base/0004-Fingerprint_Lockout.patch @@ -9,10 +9,10 @@ Signed-off-by: anupritaisno1 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/core/java/com/android/server/biometrics/sensors/fingerprint/hidl/LockoutFrameworkImpl.java b/services/core/java/com/android/server/biometrics/sensors/fingerprint/hidl/LockoutFrameworkImpl.java -index 0730c672acd9..cbd7a8963eb1 100644 +index 0e05a7923db4..073d9a3777f6 100644 --- a/services/core/java/com/android/server/biometrics/sensors/fingerprint/hidl/LockoutFrameworkImpl.java +++ b/services/core/java/com/android/server/biometrics/sensors/fingerprint/hidl/LockoutFrameworkImpl.java -@@ -43,7 +43,7 @@ public class LockoutFrameworkImpl implements LockoutTracker { +@@ -48,7 +48,7 @@ public class LockoutFrameworkImpl implements LockoutTracker { private static final String ACTION_LOCKOUT_RESET = "com.android.server.biometrics.sensors.fingerprint.ACTION_LOCKOUT_RESET"; private static final int MAX_FAILED_ATTEMPTS_LOCKOUT_TIMED = 5; diff --git a/Patches/LineageOS-21.0/android_frameworks_base/0005-User_Logout-a1.patch b/Patches/LineageOS-21.0/android_frameworks_base/0005-User_Logout-a1.patch index 3f0401da..6defd966 100644 --- a/Patches/LineageOS-21.0/android_frameworks_base/0005-User_Logout-a1.patch +++ b/Patches/LineageOS-21.0/android_frameworks_base/0005-User_Logout-a1.patch @@ -10,10 +10,10 @@ in both callers of this method (both of which are "End session" buttons), making 1 file changed, 6 insertions(+) diff --git a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java -index cc8da148d272..6a2d88e49c27 100644 +index 51e8499ffd52..914f0bfe015f 100644 --- a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +++ b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java -@@ -12698,6 +12698,12 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { +@@ -12782,6 +12782,12 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { Preconditions.checkCallAuthorization(canManageUsers(caller) || hasCallingOrSelfPermission(permission.INTERACT_ACROSS_USERS)); diff --git a/Patches/LineageOS-21.0/android_frameworks_base/0005-User_Logout.patch b/Patches/LineageOS-21.0/android_frameworks_base/0005-User_Logout.patch index 5a64663d..765f7ef3 100644 --- a/Patches/LineageOS-21.0/android_frameworks_base/0005-User_Logout.patch +++ b/Patches/LineageOS-21.0/android_frameworks_base/0005-User_Logout.patch @@ -10,10 +10,10 @@ Ported from 11, 12 moved the isLogoutEnabled boolean to ActiveAdmin.java 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/services/devicepolicy/java/com/android/server/devicepolicy/ActiveAdmin.java b/services/devicepolicy/java/com/android/server/devicepolicy/ActiveAdmin.java -index 17638fcaba68..7e416811c45a 100644 +index dc8cec91001b..2ae616fc9cc5 100644 --- a/services/devicepolicy/java/com/android/server/devicepolicy/ActiveAdmin.java +++ b/services/devicepolicy/java/com/android/server/devicepolicy/ActiveAdmin.java -@@ -234,7 +234,7 @@ class ActiveAdmin { +@@ -233,7 +233,7 @@ class ActiveAdmin { boolean requireAutoTime = false; boolean forceEphemeralUsers = false; boolean isNetworkLoggingEnabled = false; @@ -23,10 +23,10 @@ index 17638fcaba68..7e416811c45a 100644 // one notification after enabling + one more after reboots static final int DEF_MAXIMUM_NETWORK_LOGGING_NOTIFICATIONS_SHOWN = 2; diff --git a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java -index fb07763f58d6..cc8da148d272 100644 +index e85a4c48f1c1..51e8499ffd52 100644 --- a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +++ b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java -@@ -18919,11 +18919,11 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { +@@ -19243,11 +19243,11 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { @Override public boolean isLogoutEnabled() { if (!mHasFeature) { diff --git a/Patches/LineageOS-21.0/android_frameworks_base/0007-Always_Restict_Serial.patch b/Patches/LineageOS-21.0/android_frameworks_base/0007-Always_Restict_Serial.patch index 42b7db9a..0fd0f155 100644 --- a/Patches/LineageOS-21.0/android_frameworks_base/0007-Always_Restict_Serial.patch +++ b/Patches/LineageOS-21.0/android_frameworks_base/0007-Always_Restict_Serial.patch @@ -10,10 +10,10 @@ requiring the READ_PHONE_STATE permission. 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java -index 89b53aab1539..0d95e615911d 100644 +index 7f5a865935b4..c579af374a2f 100644 --- a/services/core/java/com/android/server/am/ActivityManagerService.java +++ b/services/core/java/com/android/server/am/ActivityManagerService.java -@@ -4707,12 +4707,7 @@ public class ActivityManagerService extends IActivityManager.Stub +@@ -4734,12 +4734,7 @@ public class ActivityManagerService extends IActivityManager.Stub ProfilerInfo profilerInfo = mAppProfiler.setupProfilerInfoLocked(thread, app, instr); diff --git a/Patches/LineageOS-21.0/android_frameworks_base/0013-Special_Permissions-1.patch b/Patches/LineageOS-21.0/android_frameworks_base/0013-Special_Permissions-1.patch index 50a48ca0..c4950815 100644 --- a/Patches/LineageOS-21.0/android_frameworks_base/0013-Special_Permissions-1.patch +++ b/Patches/LineageOS-21.0/android_frameworks_base/0013-Special_Permissions-1.patch @@ -9,10 +9,10 @@ Ported from 12: b294a2ce1d0d185dbc438ac3c06c90386d5f5949 1 file changed, 30 insertions(+), 9 deletions(-) diff --git a/services/core/java/com/android/server/pm/permission/PermissionManagerServiceImpl.java b/services/core/java/com/android/server/pm/permission/PermissionManagerServiceImpl.java -index 671e031b546b..8c51fec86a46 100644 +index cd1d7996fbac..162d6ba1cd0b 100644 --- a/services/core/java/com/android/server/pm/permission/PermissionManagerServiceImpl.java +++ b/services/core/java/com/android/server/pm/permission/PermissionManagerServiceImpl.java -@@ -1406,7 +1406,8 @@ public class PermissionManagerServiceImpl implements PermissionManagerServiceInt +@@ -1415,7 +1415,8 @@ public class PermissionManagerServiceImpl implements PermissionManagerServiceInt // their permissions as always granted runtime ones since we need // to keep the review required permission flag per user while an // install permission's state is shared across all users. @@ -22,7 +22,7 @@ index 671e031b546b..8c51fec86a46 100644 return; } -@@ -1449,7 +1450,8 @@ public class PermissionManagerServiceImpl implements PermissionManagerServiceInt +@@ -1458,7 +1459,8 @@ public class PermissionManagerServiceImpl implements PermissionManagerServiceInt + " for package " + packageName); } @@ -32,7 +32,7 @@ index 671e031b546b..8c51fec86a46 100644 Slog.w(TAG, "Cannot grant runtime permission to a legacy app"); return; } -@@ -1592,7 +1594,8 @@ public class PermissionManagerServiceImpl implements PermissionManagerServiceInt +@@ -1602,7 +1604,8 @@ public class PermissionManagerServiceImpl implements PermissionManagerServiceInt // their permissions as always granted runtime ones since we need // to keep the review required permission flag per user while an // install permission's state is shared across all users. @@ -42,7 +42,7 @@ index 671e031b546b..8c51fec86a46 100644 return; } -@@ -1802,7 +1805,8 @@ public class PermissionManagerServiceImpl implements PermissionManagerServiceInt +@@ -1812,7 +1815,8 @@ public class PermissionManagerServiceImpl implements PermissionManagerServiceInt // permission as requiring a review as this is the initial state. final int uid = mPackageManagerInt.getPackageUid(packageName, 0, userId); final int targetSdk = mPackageManagerInt.getUidTargetSdkVersion(uid); @@ -52,7 +52,7 @@ index 671e031b546b..8c51fec86a46 100644 ? FLAG_PERMISSION_REVIEW_REQUIRED | FLAG_PERMISSION_REVOKED_COMPAT : 0; -@@ -1822,7 +1826,8 @@ public class PermissionManagerServiceImpl implements PermissionManagerServiceInt +@@ -1832,7 +1836,8 @@ public class PermissionManagerServiceImpl implements PermissionManagerServiceInt // If this permission was granted by default or role, make sure it is. if ((oldFlags & FLAG_PERMISSION_GRANTED_BY_DEFAULT) != 0 @@ -62,7 +62,7 @@ index 671e031b546b..8c51fec86a46 100644 // PermissionPolicyService will handle the app op for runtime permissions later. grantRuntimePermissionInternal(packageName, permName, false, Process.SYSTEM_UID, userId, delayingPermCallback); -@@ -2471,6 +2476,10 @@ public class PermissionManagerServiceImpl implements PermissionManagerServiceInt +@@ -2481,6 +2486,10 @@ public class PermissionManagerServiceImpl implements PermissionManagerServiceInt } } @@ -73,7 +73,7 @@ index 671e031b546b..8c51fec86a46 100644 /** * Restore the permission state for a package. * -@@ -2593,6 +2602,8 @@ public class PermissionManagerServiceImpl implements PermissionManagerServiceInt +@@ -2603,6 +2612,8 @@ public class PermissionManagerServiceImpl implements PermissionManagerServiceInt synchronized (mLock) { for (final int userId : userIds) { final UserPermissionState userState = mState.getOrCreateUserState(userId); @@ -82,7 +82,7 @@ index 671e031b546b..8c51fec86a46 100644 final UidPermissionState uidState = userState.getOrCreateUidState(ps.getAppId()); if (uidState.isMissing()) { -@@ -2609,7 +2620,7 @@ public class PermissionManagerServiceImpl implements PermissionManagerServiceInt +@@ -2619,7 +2630,7 @@ public class PermissionManagerServiceImpl implements PermissionManagerServiceInt FLAG_PERMISSION_RESTRICTION_UPGRADE_EXEMPT, FLAG_PERMISSION_RESTRICTION_UPGRADE_EXEMPT); } @@ -91,7 +91,7 @@ index 671e031b546b..8c51fec86a46 100644 uidState.updatePermissionFlags(permission, PackageManager.FLAG_PERMISSION_REVIEW_REQUIRED | PackageManager.FLAG_PERMISSION_REVOKED_COMPAT, -@@ -2803,7 +2814,7 @@ public class PermissionManagerServiceImpl implements PermissionManagerServiceInt +@@ -2813,7 +2824,7 @@ public class PermissionManagerServiceImpl implements PermissionManagerServiceInt boolean restrictionApplied = (origState.getPermissionFlags( bp.getName()) & FLAG_PERMISSION_APPLY_RESTRICTION) != 0; @@ -100,7 +100,7 @@ index 671e031b546b..8c51fec86a46 100644 // If hard restricted we don't allow holding it if (permissionPolicyInitialized && hardRestricted) { if (!restrictionExempt) { -@@ -2856,6 +2867,16 @@ public class PermissionManagerServiceImpl implements PermissionManagerServiceInt +@@ -2866,6 +2877,16 @@ public class PermissionManagerServiceImpl implements PermissionManagerServiceInt } } } @@ -117,7 +117,7 @@ index 671e031b546b..8c51fec86a46 100644 } else { if (origPermState == null) { // New permission -@@ -2890,7 +2911,7 @@ public class PermissionManagerServiceImpl implements PermissionManagerServiceInt +@@ -2900,7 +2921,7 @@ public class PermissionManagerServiceImpl implements PermissionManagerServiceInt if (restrictionApplied) { flags &= ~FLAG_PERMISSION_APPLY_RESTRICTION; // Dropping restriction on a legacy app implies a review @@ -126,7 +126,7 @@ index 671e031b546b..8c51fec86a46 100644 flags |= FLAG_PERMISSION_REVIEW_REQUIRED; } wasChanged = true; -@@ -3608,7 +3629,7 @@ public class PermissionManagerServiceImpl implements PermissionManagerServiceInt +@@ -3618,7 +3639,7 @@ public class PermissionManagerServiceImpl implements PermissionManagerServiceInt final int flags = getPermissionFlagsInternal(pkg.getPackageName(), permission, myUid, userId); if (shouldGrantRuntimePermission) { diff --git a/Patches/LineageOS-21.0/android_frameworks_base/0013-Special_Permissions-2.patch b/Patches/LineageOS-21.0/android_frameworks_base/0013-Special_Permissions-2.patch index 26eb34fe..a8a869c7 100644 --- a/Patches/LineageOS-21.0/android_frameworks_base/0013-Special_Permissions-2.patch +++ b/Patches/LineageOS-21.0/android_frameworks_base/0013-Special_Permissions-2.patch @@ -12,10 +12,10 @@ Ported from 12: a980a4c3d6b6906eb0ee5fb07ca4cf0bae052d00 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/core/api/current.txt b/core/api/current.txt -index 9b5316fb79b5..ab1becbad01f 100644 +index 62980ed5bd69..a08bc5ee1887 100644 --- a/core/api/current.txt +++ b/core/api/current.txt -@@ -331,6 +331,7 @@ package android { +@@ -345,6 +345,7 @@ package android { field public static final String LOCATION = "android.permission-group.LOCATION"; field public static final String MICROPHONE = "android.permission-group.MICROPHONE"; field public static final String NEARBY_DEVICES = "android.permission-group.NEARBY_DEVICES"; @@ -24,10 +24,10 @@ index 9b5316fb79b5..ab1becbad01f 100644 field public static final String PHONE = "android.permission-group.PHONE"; field public static final String READ_MEDIA_AURAL = "android.permission-group.READ_MEDIA_AURAL"; diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml -index 22591641cc66..6536d86432b4 100644 +index abe4b2942ca2..63e4fca51d80 100644 --- a/core/res/AndroidManifest.xml +++ b/core/res/AndroidManifest.xml -@@ -2054,13 +2054,21 @@ +@@ -2083,13 +2083,21 @@ @@ -51,10 +51,10 @@ index 22591641cc66..6536d86432b4 100644 show notifications @@ -67,10 +67,10 @@ index 4596ca74bf8f..5fe90e5510f5 100644 Retrieve window content diff --git a/services/core/java/com/android/server/pm/permission/PermissionManagerServiceImpl.java b/services/core/java/com/android/server/pm/permission/PermissionManagerServiceImpl.java -index 8c51fec86a46..ad63a2d19779 100644 +index 162d6ba1cd0b..ea7e13f20a17 100644 --- a/services/core/java/com/android/server/pm/permission/PermissionManagerServiceImpl.java +++ b/services/core/java/com/android/server/pm/permission/PermissionManagerServiceImpl.java -@@ -2477,7 +2477,7 @@ public class PermissionManagerServiceImpl implements PermissionManagerServiceInt +@@ -2487,7 +2487,7 @@ public class PermissionManagerServiceImpl implements PermissionManagerServiceInt } public static boolean isSpecialRuntimePermission(final String permission) { diff --git a/Patches/LineageOS-21.0/android_frameworks_base/0013-Special_Permissions-3.patch b/Patches/LineageOS-21.0/android_frameworks_base/0013-Special_Permissions-3.patch index 21006756..aceeaeab 100644 --- a/Patches/LineageOS-21.0/android_frameworks_base/0013-Special_Permissions-3.patch +++ b/Patches/LineageOS-21.0/android_frameworks_base/0013-Special_Permissions-3.patch @@ -13,10 +13,10 @@ Ported from 12: 9d5a62ed573bc3c7be8b19445b372fed13533d0e 5 files changed, 29 insertions(+), 1 deletion(-) diff --git a/core/api/current.txt b/core/api/current.txt -index ab1becbad01f..2f251c8a7755 100644 +index a08bc5ee1887..ad2059849b57 100644 --- a/core/api/current.txt +++ b/core/api/current.txt -@@ -220,6 +220,7 @@ package android { +@@ -231,6 +231,7 @@ package android { field public static final String NFC = "android.permission.NFC"; field public static final String NFC_PREFERRED_PAYMENT_INFO = "android.permission.NFC_PREFERRED_PAYMENT_INFO"; field public static final String NFC_TRANSACTION_EVENT = "android.permission.NFC_TRANSACTION_EVENT"; @@ -24,7 +24,7 @@ index ab1becbad01f..2f251c8a7755 100644 field public static final String OVERRIDE_WIFI_CONFIG = "android.permission.OVERRIDE_WIFI_CONFIG"; field public static final String PACKAGE_USAGE_STATS = "android.permission.PACKAGE_USAGE_STATS"; field @Deprecated public static final String PERSISTENT_ACTIVITY = "android.permission.PERSISTENT_ACTIVITY"; -@@ -333,6 +334,7 @@ package android { +@@ -347,6 +348,7 @@ package android { field public static final String NEARBY_DEVICES = "android.permission-group.NEARBY_DEVICES"; field public static final String NETWORK = "android.permission-group.NETWORK"; field public static final String NOTIFICATIONS = "android.permission-group.NOTIFICATIONS"; @@ -33,10 +33,10 @@ index ab1becbad01f..2f251c8a7755 100644 field public static final String READ_MEDIA_AURAL = "android.permission-group.READ_MEDIA_AURAL"; field public static final String READ_MEDIA_VISUAL = "android.permission-group.READ_MEDIA_VISUAL"; diff --git a/core/java/com/android/internal/pm/pkg/parsing/ParsingPackageUtils.java b/core/java/com/android/internal/pm/pkg/parsing/ParsingPackageUtils.java -index dbe4fba5dfdb..f71bbec1a8ad 100644 +index 95ecd47e3037..1e9c18a0b4ff 100644 --- a/core/java/com/android/internal/pm/pkg/parsing/ParsingPackageUtils.java +++ b/core/java/com/android/internal/pm/pkg/parsing/ParsingPackageUtils.java -@@ -2321,6 +2321,8 @@ public class ParsingPackageUtils { +@@ -2310,6 +2310,8 @@ public class ParsingPackageUtils { setSupportsSizeChanges(pkg); pkg.setHasDomainUrls(hasDomainURLs(pkg)); @@ -46,10 +46,10 @@ index dbe4fba5dfdb..f71bbec1a8ad 100644 /** diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml -index 6536d86432b4..84a53173be9f 100644 +index 63e4fca51d80..5c7dc3e9a622 100644 --- a/core/res/AndroidManifest.xml +++ b/core/res/AndroidManifest.xml -@@ -1815,6 +1815,18 @@ +@@ -1844,6 +1844,18 @@ android:protectionLevel="dangerous|instant" /> @@ -69,10 +69,10 @@ index 6536d86432b4..84a53173be9f 100644 diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml -index 5fe90e5510f5..fe69b195ea4c 100644 +index a967af7720a2..09af484a7941 100644 --- a/core/res/res/values/strings.xml +++ b/core/res/res/values/strings.xml -@@ -946,6 +946,11 @@ +@@ -967,6 +967,11 @@ show notifications @@ -84,7 +84,7 @@ index 5fe90e5510f5..fe69b195ea4c 100644 Network -@@ -1361,6 +1366,13 @@ +@@ -1393,6 +1398,13 @@ Allows the app to access body sensor data, such as heart rate, temperature, and blood oxygen percentage, while the app is in the background. @@ -99,10 +99,10 @@ index 5fe90e5510f5..fe69b195ea4c 100644 Read calendar events and details diff --git a/services/core/java/com/android/server/pm/permission/PermissionManagerServiceImpl.java b/services/core/java/com/android/server/pm/permission/PermissionManagerServiceImpl.java -index ad63a2d19779..9d91fbc0be74 100644 +index ea7e13f20a17..39384823f2cb 100644 --- a/services/core/java/com/android/server/pm/permission/PermissionManagerServiceImpl.java +++ b/services/core/java/com/android/server/pm/permission/PermissionManagerServiceImpl.java -@@ -2477,7 +2477,7 @@ public class PermissionManagerServiceImpl implements PermissionManagerServiceInt +@@ -2487,7 +2487,7 @@ public class PermissionManagerServiceImpl implements PermissionManagerServiceInt } public static boolean isSpecialRuntimePermission(final String permission) { diff --git a/Patches/LineageOS-21.0/android_frameworks_base/0014-Automatic_Reboot.patch b/Patches/LineageOS-21.0/android_frameworks_base/0014-Automatic_Reboot.patch index 19d499e9..ff3a1c88 100644 --- a/Patches/LineageOS-21.0/android_frameworks_base/0014-Automatic_Reboot.patch +++ b/Patches/LineageOS-21.0/android_frameworks_base/0014-Automatic_Reboot.patch @@ -13,10 +13,10 @@ Change-Id: If891bfbcc144c9336ba013260bad2b7c7a59c054 4 files changed, 46 insertions(+) diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java -index 64e39f5001f0..ec292016d3db 100644 +index 783483d8e491..48913891ac52 100644 --- a/core/java/android/provider/Settings.java +++ b/core/java/android/provider/Settings.java -@@ -18673,6 +18673,13 @@ public final class Settings { +@@ -19027,6 +19027,13 @@ public final class Settings { public static final String REVIEW_PERMISSIONS_NOTIFICATION_STATE = "review_permissions_notification_state"; @@ -31,7 +31,7 @@ index 64e39f5001f0..ec292016d3db 100644 * Whether repair mode is active on the device. *

diff --git a/data/etc/com.android.systemui.xml b/data/etc/com.android.systemui.xml -index 43683ffad432..499d39e0c5cf 100644 +index ce2543a47cf5..67108d16e099 100644 --- a/data/etc/com.android.systemui.xml +++ b/data/etc/com.android.systemui.xml @@ -54,6 +54,7 @@ @@ -41,12 +41,12 @@ index 43683ffad432..499d39e0c5cf 100644 + - + diff --git a/packages/SystemUI/AndroidManifest.xml b/packages/SystemUI/AndroidManifest.xml -index 6f86f4e83623..3770d9530d5b 100644 +index 351cce0929b7..00604a316019 100644 --- a/packages/SystemUI/AndroidManifest.xml +++ b/packages/SystemUI/AndroidManifest.xml -@@ -348,6 +348,9 @@ +@@ -356,6 +356,9 @@ @@ -55,12 +55,12 @@ index 6f86f4e83623..3770d9530d5b 100644 + - + diff --git a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java -index 81856ac16575..dafa9bf8a9a3 100644 +index 6034e92be873..d00599310c5c 100644 --- a/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java +++ b/packages/SystemUI/src/com/android/systemui/keyguard/KeyguardViewMediator.java -@@ -238,6 +238,8 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable, +@@ -240,6 +240,8 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable, private final static String TAG = "KeyguardViewMediator"; @@ -69,7 +69,7 @@ index 81856ac16575..dafa9bf8a9a3 100644 public static final String DELAYED_KEYGUARD_ACTION = "com.android.internal.policy.impl.PhoneWindowManager.DELAYED_KEYGUARD"; private static final String DELAYED_LOCK_PROFILE_ACTION = -@@ -411,6 +413,11 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable, +@@ -417,6 +419,11 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable, */ private int mDelayedProfileShowingSequence; @@ -81,7 +81,7 @@ index 81856ac16575..dafa9bf8a9a3 100644 private final DismissCallbackRegistry mDismissCallbackRegistry; // the properties of the keyguard -@@ -1495,6 +1502,7 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable, +@@ -1503,6 +1510,7 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable, final IntentFilter delayedActionFilter = new IntentFilter(); delayedActionFilter.addAction(DELAYED_KEYGUARD_ACTION); delayedActionFilter.addAction(DELAYED_LOCK_PROFILE_ACTION); @@ -119,18 +119,18 @@ index 81856ac16575..dafa9bf8a9a3 100644 /** * It will let us know when the device is waking up. */ -@@ -2276,6 +2300,10 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable, +@@ -2298,6 +2322,10 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable, if (DEBUG) Log.d(TAG, "doKeyguard: showing the lock screen"); - showLocked(options); + showKeyguard(options); + final long rebootAfterTimeout = Settings.Global.getLong(mContext.getContentResolver(), Settings.Global.SETTINGS_REBOOT_AFTER_TIMEOUT, 0); + if (rebootAfterTimeout >= 1) { + doRebootForOwnerAfterTimeoutIfEnabled(rebootAfterTimeout); + } } - private void lockProfile(int userId) { -@@ -2455,6 +2483,12 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable, + @SuppressLint("MissingPermission") +@@ -2478,6 +2506,12 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable, } } } @@ -143,7 +143,7 @@ index 81856ac16575..dafa9bf8a9a3 100644 } } }; -@@ -3164,6 +3198,7 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable, +@@ -3200,6 +3234,7 @@ public class KeyguardViewMediator implements CoreStartable, Dumpable, mHideAnimationRun = false; adjustStatusBarLocked(); sendUserPresentBroadcast(); diff --git a/Patches/LineageOS-21.0/android_frameworks_base/0015-Bluetooth_Timeout.patch b/Patches/LineageOS-21.0/android_frameworks_base/0015-Bluetooth_Timeout.patch index 8d47223f..625c6a5a 100644 --- a/Patches/LineageOS-21.0/android_frameworks_base/0015-Bluetooth_Timeout.patch +++ b/Patches/LineageOS-21.0/android_frameworks_base/0015-Bluetooth_Timeout.patch @@ -12,10 +12,10 @@ Co-authored-by: Pratyush create mode 100644 services/core/java/com/android/server/ext/BluetoothAutoOff.java diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java -index c22d62c0d40c..9fae9911e2fc 100644 +index 76f443956cf8..c0f9a1ad6be2 100644 --- a/core/java/android/provider/Settings.java +++ b/core/java/android/provider/Settings.java -@@ -18686,6 +18686,12 @@ public final class Settings { +@@ -19040,6 +19040,12 @@ public final class Settings { */ public static final String WIFI_OFF_TIMEOUT = "wifi_off_timeout"; diff --git a/Patches/LineageOS-21.0/android_frameworks_base/0015-System_Server_Extensions.patch b/Patches/LineageOS-21.0/android_frameworks_base/0015-System_Server_Extensions.patch index 367b4a39..be03d8b3 100644 --- a/Patches/LineageOS-21.0/android_frameworks_base/0015-System_Server_Extensions.patch +++ b/Patches/LineageOS-21.0/android_frameworks_base/0015-System_Server_Extensions.patch @@ -217,10 +217,10 @@ index 000000000000..83d895650473 + } +} diff --git a/services/java/com/android/server/SystemServer.java b/services/java/com/android/server/SystemServer.java -index fb36c0168172..308a0fdf7a8a 100644 +index 202aff7d5e04..f98fe8ca4c31 100644 --- a/services/java/com/android/server/SystemServer.java +++ b/services/java/com/android/server/SystemServer.java -@@ -3280,6 +3280,8 @@ public final class SystemServer implements Dumpable { +@@ -3332,6 +3332,8 @@ public final class SystemServer implements Dumpable { reportWtf("Triggering OdsignStatsLogger", e); } t.traceEnd(); diff --git a/Patches/LineageOS-21.0/android_frameworks_base/0015-WiFi_Timeout.patch b/Patches/LineageOS-21.0/android_frameworks_base/0015-WiFi_Timeout.patch index 26e1d484..c571c9a2 100644 --- a/Patches/LineageOS-21.0/android_frameworks_base/0015-WiFi_Timeout.patch +++ b/Patches/LineageOS-21.0/android_frameworks_base/0015-WiFi_Timeout.patch @@ -12,10 +12,10 @@ Co-authored-by: Pratyush create mode 100644 services/core/java/com/android/server/ext/WifiAutoOff.java diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java -index ec292016d3db..c22d62c0d40c 100644 +index 48913891ac52..76f443956cf8 100644 --- a/core/java/android/provider/Settings.java +++ b/core/java/android/provider/Settings.java -@@ -18680,6 +18680,12 @@ public final class Settings { +@@ -19034,6 +19034,12 @@ public final class Settings { */ public static final String SETTINGS_REBOOT_AFTER_TIMEOUT = "settings_reboot_after_timeout"; diff --git a/Patches/LineageOS-21.0/android_frameworks_base/0017-constify_JNINativeMethod.patch b/Patches/LineageOS-21.0/android_frameworks_base/0017-constify_JNINativeMethod.patch index df33b123..efb1097f 100644 --- a/Patches/LineageOS-21.0/android_frameworks_base/0017-constify_JNINativeMethod.patch +++ b/Patches/LineageOS-21.0/android_frameworks_base/0017-constify_JNINativeMethod.patch @@ -3,28 +3,26 @@ From: Dmitry Muhomor Date: Mon, 9 Oct 2023 14:21:11 +0300 Subject: [PATCH] constify JNINativeMethod tables -fd '.+\.(c|cpp|cc)$' --exec sed -i 's/static JNINativeMethod/static const JNINativeMethod/' +fd '.+\.(c|cpp|cc)$' --type file --exec sed -i 's/static JNINativeMethod/static const JNINativeMethod/' --- - .../jni/com_android_commands_hid_Device.cpp | 2 +- - .../com_android_commands_uinput_Device.cpp | 2 +- - core/jni/LayoutlibLoader.cpp | 2 +- - core/jni/android_app_ActivityThread.cpp | 2 +- - core/jni/android_media_MediaMetricsJNI.cpp | 238 +++++++++++++++++- - core/jni/android_os_HidlMemory.cpp | 2 +- - core/jni/android_os_HwBinder.cpp | 2 +- - core/jni/android_os_HwBlob.cpp | 2 +- - core/jni/android_os_HwParcel.cpp | 2 +- - core/jni/android_os_HwRemoteBinder.cpp | 2 +- - .../android_graphics_DisplayListCanvas.cpp | 2 +- - media/jni/android_media_ImageWriter.cpp | 4 +- - media/jni/android_media_MediaSync.cpp | 2 +- - .../jni/soundpool/android_media_SoundPool.cpp | 2 +- - .../com_android_server_UsbAlsaMidiDevice.cpp | 2 +- - ...rver_companion_virtual_InputController.cpp | 2 +- - .../com_android_server_tv_TvUinputBridge.cpp | 2 +- - ...oid_view_tests_ChoreographerNativeTest.cpp | 2 +- - 18 files changed, 255 insertions(+), 19 deletions(-) - mode change 120000 => 100644 core/jni/android_media_MediaMetricsJNI.cpp + cmds/hid/jni/com_android_commands_hid_Device.cpp | 2 +- + cmds/uinput/jni/com_android_commands_uinput_Device.cpp | 2 +- + core/jni/LayoutlibLoader.cpp | 2 +- + core/jni/android_app_ActivityThread.cpp | 2 +- + core/jni/android_os_HidlMemory.cpp | 2 +- + core/jni/android_os_HwBinder.cpp | 2 +- + core/jni/android_os_HwBlob.cpp | 2 +- + core/jni/android_os_HwParcel.cpp | 2 +- + core/jni/android_os_HwRemoteBinder.cpp | 2 +- + libs/hwui/jni/android_graphics_DisplayListCanvas.cpp | 2 +- + media/jni/android_media_ImageWriter.cpp | 4 ++-- + media/jni/android_media_MediaSync.cpp | 2 +- + media/jni/soundpool/android_media_SoundPool.cpp | 2 +- + services/core/jni/com_android_server_UsbAlsaMidiDevice.cpp | 2 +- + .../com_android_server_companion_virtual_InputController.cpp | 2 +- + services/core/jni/com_android_server_tv_TvUinputBridge.cpp | 2 +- + .../jni/android_view_tests_ChoreographerNativeTest.cpp | 2 +- + 17 files changed, 18 insertions(+), 18 deletions(-) diff --git a/cmds/hid/jni/com_android_commands_hid_Device.cpp b/cmds/hid/jni/com_android_commands_hid_Device.cpp index 8b8d361edbd4..60aa5e4267aa 100644 @@ -40,7 +38,7 @@ index 8b8d361edbd4..60aa5e4267aa 100644 "(Ljava/lang/String;IIII[B" "Lcom/android/commands/hid/Device$DeviceCallback;)J", diff --git a/cmds/uinput/jni/com_android_commands_uinput_Device.cpp b/cmds/uinput/jni/com_android_commands_uinput_Device.cpp -index a78a46504684..5752be8829cb 100644 +index bd61000186e5..3179c8a28e47 100644 --- a/cmds/uinput/jni/com_android_commands_uinput_Device.cpp +++ b/cmds/uinput/jni/com_android_commands_uinput_Device.cpp @@ -325,7 +325,7 @@ static jint getEvdevInputPropByLabel(JNIEnv* env, jclass /* clazz */, jstring ra @@ -53,7 +51,7 @@ index a78a46504684..5752be8829cb 100644 "(Ljava/lang/String;IIIIIILjava/lang/String;" "Lcom/android/commands/uinput/Device$DeviceCallback;)J", diff --git a/core/jni/LayoutlibLoader.cpp b/core/jni/LayoutlibLoader.cpp -index 200ddefc3bbc..e7acbdfbddf6 100644 +index d5f17da0a072..05c6388aa445 100644 --- a/core/jni/LayoutlibLoader.cpp +++ b/core/jni/LayoutlibLoader.cpp @@ -69,7 +69,7 @@ static void NativeAllocationRegistry_Delegate_nativeApplyFreeFunction(JNIEnv*, j @@ -78,257 +76,6 @@ index e25ba76cbbeb..16a8d4656179 100644 // ------------ Regular JNI ------------------ { "nPurgePendingResources", "()V", (void*) android_app_ActivityThread_purgePendingResources }, -diff --git a/core/jni/android_media_MediaMetricsJNI.cpp b/core/jni/android_media_MediaMetricsJNI.cpp -deleted file mode 120000 -index 3204317cab68..000000000000 ---- a/core/jni/android_media_MediaMetricsJNI.cpp -+++ /dev/null -@@ -1 +0,0 @@ --../../media/jni/android_media_MediaMetricsJNI.cpp -\ No newline at end of file -diff --git a/core/jni/android_media_MediaMetricsJNI.cpp b/core/jni/android_media_MediaMetricsJNI.cpp -new file mode 100644 -index 000000000000..2769dbc430ba ---- /dev/null -+++ b/core/jni/android_media_MediaMetricsJNI.cpp -@@ -0,0 +1,237 @@ -+/* -+ * Copyright 2017, The Android Open Source Project -+ * -+ * Licensed under the Apache License, Version 2.0 (the "License"); -+ * you may not use this file except in compliance with the License. -+ * You may obtain a copy of the License at -+ * -+ * http://www.apache.org/licenses/LICENSE-2.0 -+ * -+ * Unless required by applicable law or agreed to in writing, software -+ * distributed under the License is distributed on an "AS IS" BASIS, -+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -+ * See the License for the specific language governing permissions and -+ * limitations under the License. -+ */ -+ -+#define LOG_TAG "MediaMetricsJNI" -+ -+#include -+#include -+#include -+#include -+#include -+ -+#include "android_media_MediaMetricsJNI.h" -+#include "android_os_Parcel.h" -+#include "android_runtime/AndroidRuntime.h" -+ -+// This source file is compiled and linked into: -+// core/jni/ (libandroid_runtime.so) -+ -+namespace android { -+ -+namespace { -+struct BundleHelper { -+ BundleHelper(JNIEnv* _env, jobject _bundle) -+ : env(_env) -+ , clazzBundle(env->FindClass("android/os/PersistableBundle")) -+ , putIntID(env->GetMethodID(clazzBundle, "putInt", "(Ljava/lang/String;I)V")) -+ , putLongID(env->GetMethodID(clazzBundle, "putLong", "(Ljava/lang/String;J)V")) -+ , putDoubleID(env->GetMethodID(clazzBundle, "putDouble", "(Ljava/lang/String;D)V")) -+ , putStringID(env->GetMethodID(clazzBundle, -+ "putString", "(Ljava/lang/String;Ljava/lang/String;)V")) -+ , constructID(env->GetMethodID(clazzBundle, "", "()V")) -+ , bundle(_bundle == nullptr ? env->NewObject(clazzBundle, constructID) : _bundle) -+ { } -+ -+ JNIEnv* const env; -+ const jclass clazzBundle; -+ const jmethodID putIntID; -+ const jmethodID putLongID; -+ const jmethodID putDoubleID; -+ const jmethodID putStringID; -+ const jmethodID constructID; -+ jobject const bundle; -+ -+ // We use templated put to access mediametrics::Item based on data type not type enum. -+ // See std::variant and std::visit. -+ template -+ void put(jstring keyName, const T& value) = delete; -+ -+ template<> -+ void put(jstring keyName, const int32_t& value) { -+ env->CallVoidMethod(bundle, putIntID, keyName, (jint)value); -+ } -+ -+ template<> -+ void put(jstring keyName, const int64_t& value) { -+ env->CallVoidMethod(bundle, putLongID, keyName, (jlong)value); -+ } -+ -+ template<> -+ void put(jstring keyName, const double& value) { -+ env->CallVoidMethod(bundle, putDoubleID, keyName, (jdouble)value); -+ } -+ -+ template<> -+ void put(jstring keyName, const std::string& value) { -+ env->CallVoidMethod(bundle, putStringID, keyName, env->NewStringUTF(value.c_str())); -+ } -+ -+ template<> -+ void put(jstring keyName, const std::pair& value) { -+ ; // rate is currently ignored -+ } -+ -+ template<> -+ void put(jstring keyName, const std::monostate& value) { -+ ; // none is currently ignored -+ } -+ -+ // string char * helpers -+ -+ template<> -+ void put(jstring keyName, const char * const& value) { -+ env->CallVoidMethod(bundle, putStringID, keyName, env->NewStringUTF(value)); -+ } -+ -+ template<> -+ void put(jstring keyName, char * const& value) { -+ env->CallVoidMethod(bundle, putStringID, keyName, env->NewStringUTF(value)); -+ } -+ -+ // We allow both jstring and non-jstring variants. -+ template -+ void put(const char *keyName, const T& value) { -+ put(env->NewStringUTF(keyName), value); -+ } -+}; -+} // namespace -+ -+// place the attributes into a java PersistableBundle object -+jobject MediaMetricsJNI::writeMetricsToBundle( -+ JNIEnv* env, mediametrics::Item *item, jobject bundle) -+{ -+ BundleHelper bh(env, bundle); -+ -+ if (bh.bundle == nullptr) { -+ ALOGE("%s: unable to create Bundle", __func__); -+ return nullptr; -+ } -+ -+ bh.put(mediametrics::BUNDLE_KEY, item->getKey().c_str()); -+ if (item->getPid() != -1) { -+ bh.put(mediametrics::BUNDLE_PID, (int32_t)item->getPid()); -+ } -+ if (item->getTimestamp() > 0) { -+ bh.put(mediametrics::BUNDLE_TIMESTAMP, (int64_t)item->getTimestamp()); -+ } -+ if (static_cast(item->getUid()) != -1) { -+ bh.put(mediametrics::BUNDLE_UID, (int32_t)item->getUid()); -+ } -+ for (const auto &prop : *item) { -+ const char *name = prop.getName(); -+ if (name == nullptr) continue; -+ prop.visit([&] (auto &value) { bh.put(name, value); }); -+ } -+ return bh.bundle; -+} -+ -+// Implementation of MediaMetrics.native_submit_bytebuffer(), -+// Delivers the byte buffer to the mediametrics service. -+static jint android_media_MediaMetrics_submit_bytebuffer( -+ JNIEnv* env, jobject thiz, jobject byteBuffer, jint length) -+{ -+ const jbyte* buffer = -+ reinterpret_cast(env->GetDirectBufferAddress(byteBuffer)); -+ if (buffer == nullptr) { -+ ALOGE("Error retrieving source of audio data to play, can't play"); -+ return (jint)BAD_VALUE; -+ } -+ -+ return (jint)mediametrics::BaseItem::submitBuffer((char *)buffer, length); -+} -+ -+// Helper function to convert a native PersistableBundle to a Java -+// PersistableBundle. -+jobject MediaMetricsJNI::nativeToJavaPersistableBundle(JNIEnv *env, -+ os::PersistableBundle* nativeBundle) { -+ if (env == NULL || nativeBundle == NULL) { -+ ALOGE("Unexpected NULL parmeter"); -+ return NULL; -+ } -+ -+ // Create a Java parcel with the native parcel data. -+ // Then create a new PersistableBundle with that parcel as a parameter. -+ jobject jParcel = android::createJavaParcelObject(env); -+ if (jParcel == NULL) { -+ ALOGE("Failed to create a Java Parcel."); -+ return NULL; -+ } -+ -+ android::Parcel* nativeParcel = android::parcelForJavaObject(env, jParcel); -+ if (nativeParcel == NULL) { -+ ALOGE("Failed to get the native Parcel."); -+ return NULL; -+ } -+ -+ android::status_t result = nativeBundle->writeToParcel(nativeParcel); -+ nativeParcel->setDataPosition(0); -+ if (result != android::OK) { -+ ALOGE("Failed to write nativeBundle to Parcel: %d.", result); -+ return NULL; -+ } -+ -+#define STATIC_INIT_JNI(T, obj, method, globalref, ...) \ -+ static T obj{};\ -+ if (obj == NULL) { \ -+ obj = method(__VA_ARGS__); \ -+ if (obj == NULL) { \ -+ ALOGE("%s can't find " #obj, __func__); \ -+ return NULL; \ -+ } else { \ -+ obj = globalref; \ -+ }\ -+ } \ -+ -+ STATIC_INIT_JNI(jclass, clazzBundle, env->FindClass, -+ static_cast(env->NewGlobalRef(clazzBundle)), -+ "android/os/PersistableBundle"); -+ STATIC_INIT_JNI(jfieldID, bundleCreatorId, env->GetStaticFieldID, -+ bundleCreatorId, -+ clazzBundle, "CREATOR", "Landroid/os/Parcelable$Creator;"); -+ STATIC_INIT_JNI(jobject, bundleCreator, env->GetStaticObjectField, -+ env->NewGlobalRef(bundleCreator), -+ clazzBundle, bundleCreatorId); -+ STATIC_INIT_JNI(jclass, clazzCreator, env->FindClass, -+ static_cast(env->NewGlobalRef(clazzCreator)), -+ "android/os/Parcelable$Creator"); -+ STATIC_INIT_JNI(jmethodID, createFromParcelId, env->GetMethodID, -+ createFromParcelId, -+ clazzCreator, "createFromParcel", "(Landroid/os/Parcel;)Ljava/lang/Object;"); -+ -+ jobject newBundle = env->CallObjectMethod(bundleCreator, createFromParcelId, jParcel); -+ if (newBundle == NULL) { -+ ALOGE("Failed to create a new PersistableBundle " -+ "from the createFromParcel call."); -+ } -+ -+ return newBundle; -+} -+ -+// ---------------------------------------------------------------------------- -+ -+static constexpr JNINativeMethod gMethods[] = { -+ {"native_submit_bytebuffer", "(Ljava/nio/ByteBuffer;I)I", -+ (void *)android_media_MediaMetrics_submit_bytebuffer}, -+}; -+ -+// Registers the native methods, called from core/jni/AndroidRuntime.cpp -+int register_android_media_MediaMetrics(JNIEnv *env) -+{ -+ return AndroidRuntime::registerNativeMethods( -+ env, "android/media/MediaMetrics", gMethods, std::size(gMethods)); -+} -+ -+}; // namespace android diff --git a/core/jni/android_os_HidlMemory.cpp b/core/jni/android_os_HidlMemory.cpp index 69e48184c0ad..612fc95776a5 100644 --- a/core/jni/android_os_HidlMemory.cpp @@ -343,10 +90,10 @@ index 69e48184c0ad..612fc95776a5 100644 }; diff --git a/core/jni/android_os_HwBinder.cpp b/core/jni/android_os_HwBinder.cpp -index 781895eeeaba..cbec79144826 100644 +index 734b5f497e2e..d6c1e00d9b4a 100644 --- a/core/jni/android_os_HwBinder.cpp +++ b/core/jni/android_os_HwBinder.cpp -@@ -352,7 +352,7 @@ static void JHwBinder_report_sysprop_change(JNIEnv * /*env*/, jclass /*clazz*/) +@@ -396,7 +396,7 @@ static void JHwBinder_report_sysprop_change(JNIEnv * /*env*/, jclass /*clazz*/) report_sysprop_change(); } @@ -443,10 +190,10 @@ index d1ce30a3e827..d93bda166c44 100644 "(Landroid/view/Surface;)V", (void *)android_media_MediaSync_native_setSurface }, diff --git a/media/jni/soundpool/android_media_SoundPool.cpp b/media/jni/soundpool/android_media_SoundPool.cpp -index 25040a942061..f62c4340428c 100644 +index e872a58c96cf..fd6fb80d6867 100644 --- a/media/jni/soundpool/android_media_SoundPool.cpp +++ b/media/jni/soundpool/android_media_SoundPool.cpp -@@ -560,7 +560,7 @@ android_media_SoundPool_release(JNIEnv *env, jobject thiz) +@@ -563,7 +563,7 @@ android_media_SoundPool_release(JNIEnv *env, jobject thiz) // ---------------------------------------------------------------------------- // Dalvik VM type signatures @@ -469,11 +216,11 @@ index 93938b1ff1bc..47b22c5fd39f 100644 (void *)android_server_UsbAlsaMidiDevice_open}, {"nativeClose", "([Ljava/io/FileDescriptor;)V", diff --git a/services/core/jni/com_android_server_companion_virtual_InputController.cpp b/services/core/jni/com_android_server_companion_virtual_InputController.cpp -index 4cd018b0269e..039258cf983c 100644 +index 50d48b7d30e7..12afdeaf0a38 100644 --- a/services/core/jni/com_android_server_companion_virtual_InputController.cpp +++ b/services/core/jni/com_android_server_companion_virtual_InputController.cpp -@@ -287,7 +287,7 @@ static bool nativeWriteScrollEvent(JNIEnv* env, jobject thiz, jlong ptr, jfloat - std::chrono::nanoseconds(eventTimeNanos)); +@@ -381,7 +381,7 @@ static bool nativeWriteStylusButtonEvent(JNIEnv* env, jobject thiz, jlong ptr, j + std::chrono::nanoseconds(eventTimeNanos)); } -static JNINativeMethod methods[] = { diff --git a/Patches/LineageOS-21.0/android_frameworks_base/0018-Exec_Based_Spawning-1.patch b/Patches/LineageOS-21.0/android_frameworks_base/0018-Exec_Based_Spawning-1.patch index 64a2d088..45c11efa 100644 --- a/Patches/LineageOS-21.0/android_frameworks_base/0018-Exec_Based_Spawning-1.patch +++ b/Patches/LineageOS-21.0/android_frameworks_base/0018-Exec_Based_Spawning-1.patch @@ -145,7 +145,7 @@ index 6860759eea8a..a2eef62f80be 100644 OsConstants._LINUX_CAPABILITY_VERSION_3, 0); StructCapUserData[] data; diff --git a/core/java/com/android/internal/os/ZygoteConnection.java b/core/java/com/android/internal/os/ZygoteConnection.java -index cbe070048811..9e78c3a8b16c 100644 +index d4dcec948e31..ca6c358cc997 100644 --- a/core/java/com/android/internal/os/ZygoteConnection.java +++ b/core/java/com/android/internal/os/ZygoteConnection.java @@ -29,6 +29,7 @@ import android.net.Credentials; @@ -156,7 +156,7 @@ index cbe070048811..9e78c3a8b16c 100644 import android.os.Trace; import android.system.ErrnoException; import android.system.Os; -@@ -247,7 +248,7 @@ class ZygoteConnection { +@@ -250,7 +251,7 @@ class ZygoteConnection { fdsToClose[1] = zygoteFd.getInt$(); } @@ -165,7 +165,7 @@ index cbe070048811..9e78c3a8b16c 100644 || !multipleOK || peer.getUid() != Process.SYSTEM_UID) { // Continue using old code for now. TODO: Handle these cases in the other path. pid = Zygote.forkAndSpecialize(parsedArgs.mUid, parsedArgs.mGid, -@@ -535,6 +536,13 @@ class ZygoteConnection { +@@ -538,6 +539,13 @@ class ZygoteConnection { throw new IllegalStateException("WrapperInit.execApplication unexpectedly returned"); } else { if (!isZygote) { diff --git a/Patches/LineageOS-21.0/android_frameworks_base/0018-Exec_Based_Spawning-12.patch b/Patches/LineageOS-21.0/android_frameworks_base/0018-Exec_Based_Spawning-12.patch index ca4782f4..21d99fca 100644 --- a/Patches/LineageOS-21.0/android_frameworks_base/0018-Exec_Based_Spawning-12.patch +++ b/Patches/LineageOS-21.0/android_frameworks_base/0018-Exec_Based_Spawning-12.patch @@ -78,10 +78,10 @@ index cab84bb01f70..07691fcec545 100644 + public static native void nativeHandleRuntimeFlags(int runtimeFlags); } diff --git a/core/java/com/android/internal/os/ZygoteConnection.java b/core/java/com/android/internal/os/ZygoteConnection.java -index cc936ccefb91..eea7b1e57b37 100644 +index 703b5d12cbc2..7cff4afe93ce 100644 --- a/core/java/com/android/internal/os/ZygoteConnection.java +++ b/core/java/com/android/internal/os/ZygoteConnection.java -@@ -539,7 +539,7 @@ class ZygoteConnection { +@@ -542,7 +542,7 @@ class ZygoteConnection { if (SystemProperties.getBoolean("sys.spawn.exec", false) && (parsedArgs.mRuntimeFlags & ApplicationInfo.FLAG_DEBUGGABLE) == 0) { ExecInit.execApplication(parsedArgs.mNiceName, parsedArgs.mTargetSdkVersion, @@ -91,10 +91,10 @@ index cc936ccefb91..eea7b1e57b37 100644 // Should not get here. throw new IllegalStateException("ExecInit.execApplication unexpectedly returned"); diff --git a/core/jni/com_android_internal_os_Zygote.cpp b/core/jni/com_android_internal_os_Zygote.cpp -index 7c5885adb220..9fc92a480e1e 100644 +index 3ed9f49ede26..236f34e7239f 100644 --- a/core/jni/com_android_internal_os_Zygote.cpp +++ b/core/jni/com_android_internal_os_Zygote.cpp -@@ -1872,6 +1872,86 @@ static void BindMountStorageDirs(JNIEnv* env, jobjectArray pkg_data_info_list, +@@ -1894,6 +1894,86 @@ static void BindMountStorageDirs(JNIEnv* env, jobjectArray pkg_data_info_list, } } @@ -181,7 +181,7 @@ index 7c5885adb220..9fc92a480e1e 100644 // Utility routine to specialize a zygote child process. static void SpecializeCommon(JNIEnv* env, uid_t uid, gid_t gid, jintArray gids, jint runtime_flags, jobjectArray rlimits, jlong permitted_capabilities, -@@ -2019,84 +2099,9 @@ static void SpecializeCommon(JNIEnv* env, uid_t uid, gid_t gid, jintArray gids, +@@ -2044,84 +2124,9 @@ static void SpecializeCommon(JNIEnv* env, uid_t uid, gid_t gid, jintArray gids, } } @@ -268,7 +268,7 @@ index 7c5885adb220..9fc92a480e1e 100644 SetCapabilities(permitted_capabilities, effective_capabilities, permitted_capabilities, fail_fn); -@@ -3004,6 +3009,10 @@ static void com_android_internal_os_Zygote_nativeAllowFilesOpenedByPreload(JNIEn +@@ -3044,6 +3049,10 @@ static void com_android_internal_os_Zygote_nativeAllowFilesOpenedByPreload(JNIEn gPreloadFdsExtracted = true; } @@ -279,7 +279,7 @@ index 7c5885adb220..9fc92a480e1e 100644 static const JNINativeMethod gMethods[] = { {"nativeForkAndSpecialize", "(II[II[[IILjava/lang/String;Ljava/lang/String;[I[IZLjava/lang/String;Ljava/lang/" -@@ -3056,6 +3065,7 @@ static const JNINativeMethod gMethods[] = { +@@ -3096,6 +3105,7 @@ static const JNINativeMethod gMethods[] = { (void*)com_android_internal_os_Zygote_nativeMarkOpenedFilesBeforePreload}, {"nativeAllowFilesOpenedByPreload", "()V", (void*)com_android_internal_os_Zygote_nativeAllowFilesOpenedByPreload}, diff --git a/Patches/LineageOS-21.0/android_frameworks_base/0018-Exec_Based_Spawning-14.patch b/Patches/LineageOS-21.0/android_frameworks_base/0018-Exec_Based_Spawning-14.patch index fbd98630..1a08337c 100644 --- a/Patches/LineageOS-21.0/android_frameworks_base/0018-Exec_Based_Spawning-14.patch +++ b/Patches/LineageOS-21.0/android_frameworks_base/0018-Exec_Based_Spawning-14.patch @@ -11,10 +11,10 @@ Subject: [PATCH] exec spawning: support runtime resource overlays 4 files changed, 43 insertions(+), 2 deletions(-) diff --git a/core/java/android/app/IActivityManager.aidl b/core/java/android/app/IActivityManager.aidl -index 260e9859c72d..c3fdad0624d4 100644 +index 7a95720c1cf4..2f5122d4af16 100644 --- a/core/java/android/app/IActivityManager.aidl +++ b/core/java/android/app/IActivityManager.aidl -@@ -950,4 +950,6 @@ interface IActivityManager { +@@ -966,4 +966,6 @@ interface IActivityManager { */ oneway void frozenBinderTransactionDetected(int debugPid, int code, int flags, int err); int getBindingUidProcessState(int uid, in String callingPackage); @@ -22,7 +22,7 @@ index 260e9859c72d..c3fdad0624d4 100644 + String[] getSystemIdmapPaths(); } diff --git a/core/java/android/content/res/AssetManager.java b/core/java/android/content/res/AssetManager.java -index 0399995540e7..3885f0fe3dd4 100644 +index d62abf923126..faa21dcf5f7a 100644 --- a/core/java/android/content/res/AssetManager.java +++ b/core/java/android/content/res/AssetManager.java @@ -26,6 +26,7 @@ import android.annotation.Nullable; @@ -41,7 +41,7 @@ index 0399995540e7..3885f0fe3dd4 100644 import java.io.FileDescriptor; import java.io.FileNotFoundException; -@@ -235,6 +237,9 @@ public final class AssetManager implements AutoCloseable { +@@ -242,6 +244,9 @@ public final class AssetManager implements AutoCloseable { } } @@ -51,7 +51,7 @@ index 0399995540e7..3885f0fe3dd4 100644 /** * This must be called from Zygote so that system assets are shared by all applications. * @hide -@@ -251,8 +256,32 @@ public final class AssetManager implements AutoCloseable { +@@ -258,8 +263,32 @@ public final class AssetManager implements AutoCloseable { final ArrayList apkAssets = new ArrayList<>(); apkAssets.add(ApkAssets.loadFromPath(frameworkPath, ApkAssets.PROPERTY_SYSTEM)); @@ -109,10 +109,10 @@ index 749c67abf389..39f08b6a0f15 100644 // classpath. If found, create a PathClassLoader and use it for applicationInit. ClassLoader classLoader = null; diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java -index 0d95e615911d..ba6d5a027c9d 100644 +index c579af374a2f..5d4fa6e846e3 100644 --- a/services/core/java/com/android/server/am/ActivityManagerService.java +++ b/services/core/java/com/android/server/am/ActivityManagerService.java -@@ -20673,4 +20673,10 @@ public class ActivityManagerService extends IActivityManager.Stub +@@ -20868,4 +20868,10 @@ public class ActivityManagerService extends IActivityManager.Stub } mOomAdjuster.mCachedAppOptimizer.binderError(debugPid, app, code, flags, err); } diff --git a/Patches/LineageOS-21.0/android_frameworks_base/0018-Exec_Based_Spawning-2.patch b/Patches/LineageOS-21.0/android_frameworks_base/0018-Exec_Based_Spawning-2.patch index 74c0fb2a..750d19e1 100644 --- a/Patches/LineageOS-21.0/android_frameworks_base/0018-Exec_Based_Spawning-2.patch +++ b/Patches/LineageOS-21.0/android_frameworks_base/0018-Exec_Based_Spawning-2.patch @@ -10,10 +10,10 @@ spawning when doing debugging. 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/java/com/android/internal/os/ZygoteConnection.java b/core/java/com/android/internal/os/ZygoteConnection.java -index 9e78c3a8b16c..cc936ccefb91 100644 +index ca6c358cc997..703b5d12cbc2 100644 --- a/core/java/com/android/internal/os/ZygoteConnection.java +++ b/core/java/com/android/internal/os/ZygoteConnection.java -@@ -536,7 +536,8 @@ class ZygoteConnection { +@@ -539,7 +539,8 @@ class ZygoteConnection { throw new IllegalStateException("WrapperInit.execApplication unexpectedly returned"); } else { if (!isZygote) { diff --git a/Patches/LineageOS-21.0/android_frameworks_base/0020-Location_Indicators.patch b/Patches/LineageOS-21.0/android_frameworks_base/0020-Location_Indicators.patch index c72d370a..d2418946 100644 --- a/Patches/LineageOS-21.0/android_frameworks_base/0020-Location_Indicators.patch +++ b/Patches/LineageOS-21.0/android_frameworks_base/0020-Location_Indicators.patch @@ -14,10 +14,10 @@ Change-Id: Ie457bb2dad17bddbf9dc3a818e3ec586023ce918 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/java/android/permission/PermissionUsageHelper.java b/core/java/android/permission/PermissionUsageHelper.java -index 1f798baf1bd6..20502cdc81c3 100644 +index 141ffc9a491a..20ccdb025604 100644 --- a/core/java/android/permission/PermissionUsageHelper.java +++ b/core/java/android/permission/PermissionUsageHelper.java -@@ -108,7 +108,7 @@ public class PermissionUsageHelper implements AppOpsManager.OnOpActiveChangedLis +@@ -114,7 +114,7 @@ public class PermissionUsageHelper implements AppOpsManager.OnOpActiveChangedLis private static boolean shouldShowLocationIndicator() { return DeviceConfig.getBoolean(DeviceConfig.NAMESPACE_PRIVACY, diff --git a/Patches/LineageOS-21.0/android_frameworks_base/0022-Ignore_StatementService_ANR.patch b/Patches/LineageOS-21.0/android_frameworks_base/0022-Ignore_StatementService_ANR.patch index 49cfca1d..67a02f54 100644 --- a/Patches/LineageOS-21.0/android_frameworks_base/0022-Ignore_StatementService_ANR.patch +++ b/Patches/LineageOS-21.0/android_frameworks_base/0022-Ignore_StatementService_ANR.patch @@ -13,10 +13,10 @@ they get a message each time it tries again. 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml -index 3bc33bac37bc..be714871ad0f 100644 +index 0a4fc6515368..34ddab5adae1 100644 --- a/core/res/res/values/config.xml +++ b/core/res/res/values/config.xml -@@ -4211,7 +4211,7 @@ +@@ -4281,7 +4281,7 @@ diff --git a/Patches/LineageOS-21.0/android_frameworks_base/0024-Burnin_Protection.patch b/Patches/LineageOS-21.0/android_frameworks_base/0024-Burnin_Protection.patch index 098bbf62..668e6b60 100644 --- a/Patches/LineageOS-21.0/android_frameworks_base/0024-Burnin_Protection.patch +++ b/Patches/LineageOS-21.0/android_frameworks_base/0024-Burnin_Protection.patch @@ -43,7 +43,7 @@ index ca6e7db4c5b1..c0acba502cc2 100644 + 1dp diff --git a/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarView.java b/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarView.java -index aae1aa9a6698..90bcd525b32f 100644 +index 3b86d302ac0a..450e1f297f10 100644 --- a/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarView.java +++ b/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarView.java @@ -159,6 +159,13 @@ public class NavigationBarView extends FrameLayout { @@ -93,10 +93,10 @@ index aae1aa9a6698..90bcd525b32f 100644 reloadNavIcons(); } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java -index 73b95114b005..b943444676f6 100644 +index 18e95781a32c..32e1aebaedb3 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/CentralSurfacesImpl.java -@@ -216,6 +216,7 @@ import com.android.systemui.statusbar.notification.stack.NotificationStackScroll +@@ -218,6 +218,7 @@ import com.android.systemui.statusbar.notification.stack.NotificationStackScroll import com.android.systemui.statusbar.phone.dagger.StatusBarPhoneModule; import com.android.systemui.statusbar.policy.BatteryController; import com.android.systemui.statusbar.policy.BrightnessMirrorController; @@ -104,7 +104,7 @@ index 73b95114b005..b943444676f6 100644 import com.android.systemui.statusbar.policy.ConfigurationController; import com.android.systemui.statusbar.policy.ConfigurationController.ConfigurationListener; import com.android.systemui.statusbar.policy.DeviceProvisionedController; -@@ -379,6 +380,7 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { +@@ -371,6 +372,7 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { private BiometricUnlockController mBiometricUnlockController; private final LightBarController mLightBarController; private final AutoHideController mAutoHideController; @@ -112,7 +112,7 @@ index 73b95114b005..b943444676f6 100644 private final Point mCurrentDisplaySize = new Point(); -@@ -1223,6 +1225,12 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { +@@ -1228,6 +1230,12 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { mShadeSurface.updateExpansionAndVisibility(); setBouncerShowingForStatusBarComponents(mBouncerShowing); checkBarModes(); @@ -125,7 +125,7 @@ index 73b95114b005..b943444676f6 100644 }); mStatusBarInitializer.initializeStatusBar(); -@@ -2494,6 +2502,9 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { +@@ -2503,6 +2511,9 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { updateNotificationPanelTouchState(); getNotificationShadeWindowViewController().cancelCurrentTouch(); @@ -135,7 +135,7 @@ index 73b95114b005..b943444676f6 100644 if (mLaunchCameraOnFinishedGoingToSleep) { mLaunchCameraOnFinishedGoingToSleep = false; -@@ -2659,6 +2670,9 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { +@@ -2668,6 +2679,9 @@ public class CentralSurfacesImpl implements CoreStartable, CentralSurfaces { } } updateScrimController(); @@ -146,10 +146,10 @@ index 73b95114b005..b943444676f6 100644 }; diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java -index 1207388b4389..3015dfa7768f 100644 +index b275b3f35fa4..ed87f389c168 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java -@@ -19,6 +19,7 @@ package com.android.systemui.statusbar.phone; +@@ -21,6 +21,7 @@ import static com.android.systemui.Flags.truncatedStatusBarIconsFix; import android.annotation.Nullable; import android.content.Context; @@ -157,9 +157,9 @@ index 1207388b4389..3015dfa7768f 100644 import android.content.res.Configuration; import android.graphics.Insets; import android.graphics.Rect; -@@ -65,6 +66,13 @@ public class PhoneStatusBarView extends FrameLayout implements Callbacks { - private final CommandQueue mCommandQueue; +@@ -69,6 +70,13 @@ public class PhoneStatusBarView extends FrameLayout implements Callbacks { private final StatusBarContentInsetsProvider mContentInsetsProvider; + private final StatusBarWindowController mStatusBarWindowController; + private int mBasePaddingBottom; + private int mBasePaddingLeft; @@ -171,7 +171,7 @@ index 1207388b4389..3015dfa7768f 100644 private DarkReceiver mBattery; private ClockController mClockController; private int mRotationOrientation = -1; -@@ -143,6 +151,18 @@ public class PhoneStatusBarView extends FrameLayout implements Callbacks { +@@ -150,6 +158,18 @@ public class PhoneStatusBarView extends FrameLayout implements Callbacks { StatusBarUserChipViewBinder.bind(container, viewModel); } @@ -190,7 +190,7 @@ index 1207388b4389..3015dfa7768f 100644 @Override public void onFinishInflate() { super.onFinishInflate(); -@@ -150,6 +170,13 @@ public class PhoneStatusBarView extends FrameLayout implements Callbacks { +@@ -157,6 +177,13 @@ public class PhoneStatusBarView extends FrameLayout implements Callbacks { mClockController = new ClockController(getContext(), this); mCutoutSpace = findViewById(R.id.cutout_space_view); diff --git a/Patches/LineageOS-21.0/android_frameworks_base/0026-Crash_Details.patch b/Patches/LineageOS-21.0/android_frameworks_base/0026-Crash_Details.patch new file mode 100644 index 00000000..4ec4cdad --- /dev/null +++ b/Patches/LineageOS-21.0/android_frameworks_base/0026-Crash_Details.patch @@ -0,0 +1,355 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Dmitry Muhomor +Date: Mon, 8 Aug 2022 19:03:37 +0300 +Subject: [PATCH] add an option to show the details of an application error to + the user + +Adds a "Show details" item to crash and ANR (app not responding) dialogs that takes the user to a +SystemUI activity which shows the error details and allows to copy them to the clipboard or to +export them via the standard sharing UI. +--- + .../android/app/ApplicationErrorReport.java | 14 +- + core/res/res/layout/app_anr_dialog.xml | 4 +- + core/res/res/layout/app_error_dialog.xml | 4 +- + core/res/res/values/strings.xml | 3 + + core/res/res/values/symbols.xml | 3 + + packages/SystemUI/AndroidManifest.xml | 12 ++ + packages/SystemUI/res/values/strings.xml | 5 + + .../android/systemui/ErrorReportActivity.kt | 159 ++++++++++++++++++ + .../java/com/android/server/am/AppErrors.java | 1 + + 9 files changed, 199 insertions(+), 6 deletions(-) + create mode 100644 packages/SystemUI/src/com/android/systemui/ErrorReportActivity.kt + +diff --git a/core/java/android/app/ApplicationErrorReport.java b/core/java/android/app/ApplicationErrorReport.java +index 9cea5e8ef4cf..e9f28d80b6ed 100644 +--- a/core/java/android/app/ApplicationErrorReport.java ++++ b/core/java/android/app/ApplicationErrorReport.java +@@ -98,6 +98,9 @@ public class ApplicationErrorReport implements Parcelable { + */ + public String packageName; + ++ /** @hide */ ++ public long packageVersion; ++ + /** + * Package name of the application which installed the application this + * report pertains to. +@@ -162,13 +165,18 @@ public class ApplicationErrorReport implements Parcelable { + String packageName, int appFlags) { + // check if error reporting is enabled in secure settings + int enabled = Settings.Global.getInt(context.getContentResolver(), +- Settings.Global.SEND_ACTION_APP_ERROR, 0); ++ Settings.Global.SEND_ACTION_APP_ERROR, 1); + if (enabled == 0) { + return null; + } + + PackageManager pm = context.getPackageManager(); + ++ ComponentName systemUiReceiver = getErrorReportReceiver(pm, packageName, "com.android.systemui"); ++ if (systemUiReceiver != null) { ++ return systemUiReceiver; ++ } ++ + // look for receiver in the installer package + String candidate = null; + ComponentName result = null; +@@ -233,6 +241,7 @@ public class ApplicationErrorReport implements Parcelable { + public void writeToParcel(Parcel dest, int flags) { + dest.writeInt(type); + dest.writeString(packageName); ++ dest.writeLong(packageVersion); + dest.writeString(installerPackageName); + dest.writeString(processName); + dest.writeLong(time); +@@ -260,6 +269,7 @@ public class ApplicationErrorReport implements Parcelable { + public void readFromParcel(Parcel in) { + type = in.readInt(); + packageName = in.readString(); ++ packageVersion = in.readLong(); + installerPackageName = in.readString(); + processName = in.readString(); + time = in.readLong(); +@@ -704,7 +714,7 @@ public class ApplicationErrorReport implements Parcelable { + */ + public void dump(Printer pw, String prefix) { + pw.println(prefix + "type: " + type); +- pw.println(prefix + "packageName: " + packageName); ++ pw.println(prefix + "packageName: " + packageName + ":" + packageVersion); + pw.println(prefix + "installerPackageName: " + installerPackageName); + pw.println(prefix + "processName: " + processName); + pw.println(prefix + "time: " + time); +diff --git a/core/res/res/layout/app_anr_dialog.xml b/core/res/res/layout/app_anr_dialog.xml +index 5ad0f4c0f6cc..ad3a2d2991de 100644 +--- a/core/res/res/layout/app_anr_dialog.xml ++++ b/core/res/res/layout/app_anr_dialog.xml +@@ -41,8 +41,8 @@ + android:id="@+id/aerr_report" + android:layout_width="match_parent" + android:layout_height="wrap_content" +- android:text="@string/aerr_report" +- android:drawableStart="@drawable/ic_feedback" ++ android:text="@string/aerr_show_details" ++ android:drawableStart="@drawable/ic_info_outline_24" + style="@style/aerr_list_item" /> + + +diff --git a/core/res/res/layout/app_error_dialog.xml b/core/res/res/layout/app_error_dialog.xml +index c3b149a1e295..a47b82018377 100644 +--- a/core/res/res/layout/app_error_dialog.xml ++++ b/core/res/res/layout/app_error_dialog.xml +@@ -52,8 +52,8 @@ + android:id="@+id/aerr_report" + android:layout_width="match_parent" + android:layout_height="wrap_content" +- android:text="@string/aerr_report" +- android:drawableStart="@drawable/ic_feedback" ++ android:text="@string/aerr_show_details" ++ android:drawableStart="@drawable/ic_info_outline_24" + style="@style/aerr_list_item" /> + +