21.0: More work

Signed-off-by: Tavi <tavi@divested.dev>
This commit is contained in:
Tavi 2024-12-05 13:51:51 -05:00
parent fbefce0e28
commit 58923f2ef9
No known key found for this signature in database
GPG Key ID: E599F62ECBAEAF2E
98 changed files with 1505 additions and 850 deletions

View File

@ -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

View File

@ -71,6 +71,7 @@
<project path="device/google/raviole" name="LineageOS/android_device_google_raviole" remote="github" revision="lineage-21" />
<project path="device/google/oriole" name="LineageOS/android_device_google_oriole" remote="github" revision="lineage-21" />
<project path="device/google/raven" name="LineageOS/android_device_google_raven" remote="github" revision="lineage-21" />
<project path="device/google/raviole-kernel" name="device/google/raviole-kernel" remote="aosp-raviole" clone-depth="1" />
<!-- Google Pixel 6a (bluejay) -->
<project path="device/google/bluejay" name="LineageOS/android_device_google_bluejay" remote="github" revision="lineage-21" />
<project path="device/google/bluejay-kernel" name="device/google/bluejay-kernel" remote="aosp-bluejay" clone-depth="1" />
@ -78,12 +79,16 @@
<project path="device/google/pantah" name="LineageOS/android_device_google_pantah" remote="github" revision="lineage-21" />
<project path="device/google/panther" name="LineageOS/android_device_google_panther" remote="github" revision="lineage-21" />
<project path="device/google/cheetah" name="LineageOS/android_device_google_cheetah" remote="github" revision="lineage-21" />
<project path="device/google/pantah-kernel" name="device/google/pantah-kernel" remote="aosp-pantah" clone-depth="1" />
<!-- Google Pixel 7a (lynx) -->
<project path="device/google/lynx" name="LineageOS/android_device_google_lynx" remote="github" revision="lineage-21" />
<project path="device/google/lynx-kernel" name="device/google/lynx-kernel" remote="aosp-lynx" clone-depth="1" />
<!-- Google Pixel Tablet (tangorpro) -->
<project path="device/google/tangorpro" name="LineageOS/android_device_google_tangorpro" remote="github" revision="lineage-21" />
<project path="device/google/tangorpro-kernel" name="device/google/tangorpro-kernel" remote="aosp-tangorpro" clone-depth="1" />
<!-- Google Pixel Fold (felix) -->
<project path="device/google/felix" name="LineageOS/android_device_google_felix" remote="github" revision="lineage-21" />
<project path="device/google/felix-kernel" name="device/google/felix-kernel" remote="aosp-felix" clone-depth="1" />
<!-- Proprietary Blobs -->
<project path="vendor/google/bluejay" name="[COLOUR IN THE LINES]/proprietary_vendor_google_bluejay" remote="github" revision="lineage-21" />

View File

@ -26,17 +26,17 @@ Signed-off-by: anupritaisno1 <www.anuprita804@gmail.com>
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 {

View File

@ -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

View File

@ -11,7 +11,7 @@ Signed-off-by: anupritaisno1 <www.anuprita804@gmail.com>
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) {

View File

@ -9,10 +9,10 @@ Signed-off-by: anupritaisno1 <www.anuprita804@gmail.com>
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.

View File

@ -9,10 +9,10 @@ Signed-off-by: anupritaisno1 <www.anuprita804@gmail.com>
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

View File

@ -14,10 +14,10 @@ Signed-off-by: anupritaisno1 <www.anuprita804@gmail.com>
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

View File

@ -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)

View File

@ -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 {

View File

@ -1,21 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Dmitry Muhomor <muhomor.dmitry@gmail.com>
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

View File

@ -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;"

View File

@ -0,0 +1,30 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Sebastian Pipping <sebastian@pipping.org>
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;

View File

@ -0,0 +1,27 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Sebastian Pipping <sebastian@pipping.org>
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;

View File

@ -0,0 +1,84 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Sebastian Pipping <sebastian@pipping.org>
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 = "<root/>";
+ 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 = "<root/>";
+ 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

View File

@ -0,0 +1,42 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Sebastian Pipping <sebastian@pipping.org>
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 <code>len</code>. This means
that <code>s</code> doesn't have to be null-terminated. It also means that
if <code>len</code> is larger than the number of bytes in the block of
-memory that <code>s</code> points at, then a memory fault is likely. The
+memory that <code>s</code> points at, then a memory fault is likely.
+Negative values for <code>len</code> are rejected since Expat 2.2.1.
+The
<code>isFinal</code> parameter informs the parser that this is the last
piece of the document. Frequently, the last piece is empty (i.e.
<code>len</code> is zero.)
@@ -1186,11 +1188,17 @@ XML_ParseBuffer(XML_Parser p,
int isFinal);
</pre>
<div class="fcndef">
+<p>
This is just like <code><a href= "#XML_Parse" >XML_Parse</a></code>,
except in this case Expat provides the buffer. By obtaining the
buffer from Expat with the <code><a href= "#XML_GetBuffer"
>XML_GetBuffer</a></code> function, the application can avoid double
copying of the input.
+</p>
+
+<p>
+Negative values for <code>len</code> are rejected since Expat 2.6.3.
+</p>
</div>
<h4 id="XML_GetBuffer">XML_GetBuffer</h4>

View File

@ -0,0 +1,31 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Sebastian Pipping <sebastian@pipping.org>
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) {

View File

@ -0,0 +1,53 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Sebastian Pipping <sebastian@pipping.org>
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 "<!ENTITY a SYSTEM 'b'>", 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("<!ENTITY a SYSTEM 'b'>") - 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;
}

View File

@ -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;
}

View File

@ -9,10 +9,10 @@ Signed-off-by: anupritaisno1 <www.anuprita804@gmail.com>
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;

View File

@ -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));

View File

@ -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) {

View File

@ -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);

View File

@ -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) {

View File

@ -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 @@
<!-- ======================================= -->
<eat-comment />
@ -51,10 +51,10 @@ index 22591641cc66..6536d86432b4 100644
<!-- Allows applications to access information about networks.
<p>Protection level: normal
diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml
index 4596ca74bf8f..5fe90e5510f5 100644
index 59066eb83f1c..a967af7720a2 100644
--- a/core/res/res/values/strings.xml
+++ b/core/res/res/values/strings.xml
@@ -946,6 +946,11 @@
@@ -967,6 +967,11 @@
<!-- Description of a category of application permissions, listed so the user can choose whether they want to allow the application to do this. [CHAR LIMIT=NONE]-->
<string name="permgroupdesc_notifications">show notifications</string>
@ -67,10 +67,10 @@ index 4596ca74bf8f..5fe90e5510f5 100644
<string name="capability_title_canRetrieveWindowContent">Retrieve window content</string>
<!-- Description for the capability of an accessibility service to 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) {

View File

@ -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" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
@ -69,10 +69,10 @@ index 6536d86432b4..84a53173be9f 100644
<!-- REMOVED PERMISSIONS -->
<!-- ====================================================================== -->
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 @@
<!-- Description of a category of application permissions, listed so the user can choose whether they want to allow the application to do this. [CHAR LIMIT=NONE]-->
<string name="permgroupdesc_notifications">show notifications</string>
@ -84,7 +84,7 @@ index 5fe90e5510f5..fe69b195ea4c 100644
<!-- Title of a category of application permissions, listed so the user can choose whether they want to allow the application to do this. -->
<string name="permgrouplab_network">Network</string>
<!-- Description of a category of application permissions, listed so the user can choose whether they want to allow the application to do this. -->
@@ -1361,6 +1366,13 @@
@@ -1393,6 +1398,13 @@
<!-- Description of the background body sensors permission, listed so the user can decide whether to allow the application to access data from body sensors in the background. [CHAR LIMIT=NONE] -->
<string name="permdesc_bodySensors_background" product="default">Allows the app to access body sensor data, such as heart rate, temperature, and blood oxygen percentage, while the app is in the background.</string>
@ -99,10 +99,10 @@ index 5fe90e5510f5..fe69b195ea4c 100644
<string name="permlab_readCalendar">Read calendar events and details</string>
<!-- Description of an application permission, listed so the user can choose whether they want to allow the application to do this. -->
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) {

View File

@ -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.
* <p>
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
+ <permission name="android.permission.REBOOT"/>
<permission name="android.permission.REQUEST_NETWORK_SCORES"/>
<permission name="android.permission.RECEIVE_MEDIA_RESOURCE_USAGE"/>
<permission name="android.permission.SET_WALLPAPER_DIM_AMOUNT"/>
<permission name="android.permission.SATELLITE_COMMUNICATION"/>
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 @@
<uses-permission android:name="android.permission.SET_UNRESTRICTED_KEEP_CLEAR_AREAS" />
@ -55,12 +55,12 @@ index 6f86f4e83623..3770d9530d5b 100644
+
<uses-permission android:name="android.permission.MONITOR_KEYBOARD_BACKLIGHT" />
<!-- Listen to (dis-)connection of external displays and enable / disable them. -->
<uses-permission android:name="android.permission.MONITOR_STICKY_MODIFIER_STATE" />
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();

View File

@ -12,10 +12,10 @@ Co-authored-by: Pratyush <codelab@pratyush.dev>
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";

View File

@ -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();

View File

@ -12,10 +12,10 @@ Co-authored-by: Pratyush <codelab@pratyush.dev>
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";

View File

@ -3,28 +3,26 @@ From: Dmitry Muhomor <muhomor.dmitry@gmail.com>
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 <binder/Parcel.h>
+#include <jni.h>
+#include <media/MediaMetricsItem.h>
+#include <nativehelper/JNIHelp.h>
+#include <variant>
+
+#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, "<init>", "()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<typename T>
+ 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<int64_t, int64_t>& 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<typename T>
+ 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<int32_t>(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<const jbyte*>(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<jclass>(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<jclass>(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[] = {

View File

@ -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) {

View File

@ -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},

View File

@ -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> 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);
}

View File

@ -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) {

View File

@ -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,

View File

@ -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 @@
<!-- List of comma separated package names for which we the system will not show crash, ANR,
etc. dialogs. -->

View File

@ -43,7 +43,7 @@ index ca6e7db4c5b1..c0acba502cc2 100644
+ <dimen name="burnin_protection_vertical_shift">1dp</dimen>
</resources>
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);

View File

@ -0,0 +1,355 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Dmitry Muhomor <muhomor.dmitry@gmail.com>
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" />
</LinearLayout>
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" />
<Button
diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml
index 59066eb83f1c..d422e6f2aca6 100644
--- a/core/res/res/values/strings.xml
+++ b/core/res/res/values/strings.xml
@@ -6337,6 +6337,9 @@ ul.</string>
<!-- Title for preference of the system default locale. [CHAR LIMIT=50]-->
<string name="system_locale_title">System default</string>
+ <!-- Button that opens the screen with details of an application error -->
+ <string name="aerr_show_details">Show details</string>
+
<!-- Display content to tell the user the sim card name and number-->
<string name="default_card_name">CARD <xliff:g id="cardNumber" example="1">%d</xliff:g></string>
diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml
index a1804672da73..07d3924d8d39 100644
--- a/core/res/res/values/symbols.xml
+++ b/core/res/res/values/symbols.xml
@@ -5174,6 +5174,9 @@
<java-symbol type="id" name="language_picker_item" />
<java-symbol type="id" name="language_picker_header" />
+ <!-- Button that opens the screen with details of an application error -->
+ <java-symbol type="string" name="aerr_show_details" />
+
<java-symbol type="dimen" name="status_bar_height_default" />
<java-symbol type="string" name="default_card_name"/>
diff --git a/packages/SystemUI/AndroidManifest.xml b/packages/SystemUI/AndroidManifest.xml
index 00604a316019..6f003b4ec257 100644
--- a/packages/SystemUI/AndroidManifest.xml
+++ b/packages/SystemUI/AndroidManifest.xml
@@ -1069,6 +1069,18 @@
android:exported="false">
</activity>
+ <activity
+ android:name=".ErrorReportActivity"
+ android:exported="true"
+ android:theme="@android:style/Theme.DeviceDefault.DayNight"
+ android:documentLaunchMode="always"
+ android:process=":ui"
+ >
+ <intent-filter>
+ <action android:name="android.intent.action.APP_ERROR" />
+ </intent-filter>
+ </activity>
+
<provider
android:authorities="com.android.systemui.customization"
android:name="com.android.systemui.keyguard.CustomizationProvider"
diff --git a/packages/SystemUI/res/values/strings.xml b/packages/SystemUI/res/values/strings.xml
index d2b186d9af2c..48a08ff2b7e9 100644
--- a/packages/SystemUI/res/values/strings.xml
+++ b/packages/SystemUI/res/values/strings.xml
@@ -3159,6 +3159,11 @@
<!-- Time format for the Dream Time Complication for 24-hour time format [CHAR LIMIT=NONE] -->
<string name="dream_time_complication_24_hr_time_format">kk:mm</string>
+ <string name="error_report_title">Error in %1$s</string>
+ <string name="copy_to_clipboard">Copy to clipboard</string>
+ <string name="copied_to_clipboard">Copied to clipboard</string>
+ <string name="error_share">Share</string>
+
<!-- Title for the log access confirmation dialog. [CHAR LIMIT=NONE] -->
<string name="log_access_confirmation_title">Allow <xliff:g id="log_access_app_name" example="Example App">%s</xliff:g> to access all device logs?</string>
<!-- Label for the allow button on the log access confirmation dialog. [CHAR LIMIT=40] -->
diff --git a/packages/SystemUI/src/com/android/systemui/ErrorReportActivity.kt b/packages/SystemUI/src/com/android/systemui/ErrorReportActivity.kt
new file mode 100644
index 000000000000..94630b044fbe
--- /dev/null
+++ b/packages/SystemUI/src/com/android/systemui/ErrorReportActivity.kt
@@ -0,0 +1,159 @@
+/*
+ * Copyright (C) 2022 GrapheneOS
+ *
+ * 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.
+ */
+
+package com.android.systemui
+
+import android.app.Activity
+import android.app.ApplicationErrorReport
+import android.content.ClipData
+import android.content.ClipDescription
+import android.content.ClipboardManager
+import android.content.Intent
+import android.graphics.Typeface
+import android.os.Build
+import android.os.Bundle
+import android.util.StringBuilderPrinter
+import android.util.TypedValue
+import android.view.Gravity
+import android.view.View
+import android.widget.Button
+import android.widget.LinearLayout
+import android.widget.LinearLayout.LayoutParams
+import android.widget.ScrollView
+import android.widget.TextView
+import android.widget.Toast
+
+class ErrorReportActivity : Activity() {
+
+ override fun onCreate(savedInstanceState: Bundle?) {
+ super.onCreate(savedInstanceState)
+
+ val title: String
+ val reportText: String
+ try {
+ val report = intent.getParcelableExtra<ApplicationErrorReport>(Intent.EXTRA_BUG_REPORT)!!
+ val pm = packageManager
+ val ai = pm.getApplicationInfo(report.packageName, 0)
+ title = getString(R.string.error_report_title, ai.loadLabel(pm))
+
+ reportText = errorReportToText(report)
+ } catch (e: Exception) {
+ e.printStackTrace()
+ finishAndRemoveTask()
+ return
+ }
+
+ setTitle(title)
+
+ val textView = TextView(this).apply {
+ typeface = Typeface.MONOSPACE
+ text = reportText
+ textSize = 12f
+ setTextIsSelectable(true)
+ // default color is too light
+ val color = if (resources.configuration.isNightModeActive) 0xff_d0_d0_d0 else 0xff_00_00_00
+ setTextColor(color.toInt())
+ }
+
+ val scroller = ScrollView(this).apply {
+ isScrollbarFadingEnabled = false
+ scrollBarStyle = View.SCROLLBARS_INSIDE_INSET
+ addView(textView)
+ }
+
+ val formattedReportText = "```\n" + reportText + "\n```"
+ val clipData = ClipData.newPlainText(title, formattedReportText)
+
+ val btnCopy = Button(this).apply {
+ setText(R.string.copy_to_clipboard)
+ setOnClickListener { _ ->
+ val cm = getSystemService(ClipboardManager::class.java)
+ cm.setPrimaryClip(clipData)
+ Toast.makeText(this@ErrorReportActivity, R.string.copied_to_clipboard, Toast.LENGTH_SHORT).show()
+ }
+ }
+
+ val btnShare = Button(this).apply {
+ setText(R.string.error_share)
+ setOnClickListener { _ ->
+ val i = Intent(Intent.ACTION_SEND)
+ i.clipData = clipData
+ i.type = ClipDescription.MIMETYPE_TEXT_PLAIN
+ i.putExtra(Intent.EXTRA_SUBJECT, title)
+ i.putExtra(Intent.EXTRA_TEXT, formattedReportText)
+ startActivity(Intent.createChooser(i, title))
+ }
+ }
+
+ val buttonLayout = LinearLayout(this).apply {
+ orientation = LinearLayout.HORIZONTAL
+ gravity = Gravity.CENTER
+ addView(btnCopy)
+ addView(btnShare)
+ }
+
+ val pad = px(16)
+
+ val layout = LinearLayout(this).apply {
+ orientation = LinearLayout.VERTICAL
+ addView(scroller, LayoutParams(LayoutParams.MATCH_PARENT, 0, 1f))
+ addView(buttonLayout)
+ setPadding(pad, pad, pad, pad)
+ }
+
+ setContentView(layout)
+ }
+
+ fun px(dp: Int) = TypedValue.applyDimension(
+ TypedValue.COMPLEX_UNIT_PX, dp.toFloat(), resources.displayMetrics).toInt()
+
+ fun errorReportToText(r: ApplicationErrorReport) =
+
+"""type: ${reportTypeToString(r.type)}
+osVersion: ${Build.FINGERPRINT}
+package: ${r.packageName}:${r.packageVersion}
+process: ${r.processName}
+
+${reportInfoToString(r)}"""
+
+ fun reportInfoToString(r: ApplicationErrorReport): String {
+ if (r.type == ApplicationErrorReport.TYPE_CRASH) {
+ return r.crashInfo.stackTrace
+ }
+
+ val sb = StringBuilder()
+ val printer = StringBuilderPrinter(sb)
+
+ when (r.type) {
+ ApplicationErrorReport.TYPE_ANR ->
+ r.anrInfo.dump(printer, "")
+ ApplicationErrorReport.TYPE_BATTERY ->
+ r.batteryInfo.dump(printer, "")
+ ApplicationErrorReport.TYPE_RUNNING_SERVICE ->
+ r.runningServiceInfo.dump(printer, "")
+ }
+
+ return sb.toString()
+ }
+
+ fun reportTypeToString(type: Int) = when (type) {
+ ApplicationErrorReport.TYPE_CRASH -> "crash"
+ ApplicationErrorReport.TYPE_ANR -> "ANR"
+ ApplicationErrorReport.TYPE_BATTERY -> "battery"
+ ApplicationErrorReport.TYPE_RUNNING_SERVICE -> "running_service"
+ else -> "unknown ($type)"
+ }
+}
diff --git a/services/core/java/com/android/server/am/AppErrors.java b/services/core/java/com/android/server/am/AppErrors.java
index 061bcd740f6b..937b0eacff66 100644
--- a/services/core/java/com/android/server/am/AppErrors.java
+++ b/services/core/java/com/android/server/am/AppErrors.java
@@ -838,6 +838,7 @@ class AppErrors {
ApplicationErrorReport report = new ApplicationErrorReport();
report.packageName = r.info.packageName;
+ report.packageVersion = r.info.longVersionCode;
report.installerPackageName = errState.getErrorReportReceiver().getPackageName();
report.processName = r.processName;
report.time = timeMillis;

View File

@ -22,10 +22,10 @@ https://github.com/GrapheneOS/os-issue-tracker/issues/1634 for more details.
1 file changed, 12 deletions(-)
diff --git a/services/core/java/com/android/server/pm/ComputerEngine.java b/services/core/java/com/android/server/pm/ComputerEngine.java
index 3cb2420cd223..063fc92dddb8 100644
index 06b16becd3fe..b76683e29e42 100644
--- a/services/core/java/com/android/server/pm/ComputerEngine.java
+++ b/services/core/java/com/android/server/pm/ComputerEngine.java
@@ -2711,24 +2711,12 @@ public class ComputerEngine implements Computer {
@@ -2721,24 +2721,12 @@ public class ComputerEngine implements Computer {
* Update given flags when being used to request {@link PackageInfo}.
*/
public final long updateFlagsForPackage(long flags, int userId) {

View File

@ -9,10 +9,10 @@ This is needed for properly verifying updates of system packages.
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/services/core/java/com/android/server/pm/PackageManagerServiceUtils.java b/services/core/java/com/android/server/pm/PackageManagerServiceUtils.java
index 40591fcf4c98..6c71f54d6d74 100644
index d7e0fca87059..70aae56d7a3a 100644
--- a/services/core/java/com/android/server/pm/PackageManagerServiceUtils.java
+++ b/services/core/java/com/android/server/pm/PackageManagerServiceUtils.java
@@ -200,7 +200,7 @@ public class PackageManagerServiceUtils {
@@ -211,7 +211,7 @@ public class PackageManagerServiceUtils {
/**
* The initial enabled state of the cache before other checks are done.
*/
@ -21,7 +21,7 @@ index 40591fcf4c98..6c71f54d6d74 100644
/**
* Whether to skip all other checks and force the cache to be enabled.
@@ -1440,6 +1440,7 @@ public class PackageManagerServiceUtils {
@@ -1451,6 +1451,7 @@ public class PackageManagerServiceUtils {
boolean isUserDebugBuild, String incrementalVersion) {
if (!FORCE_PACKAGE_PARSED_CACHE_ENABLED) {
if (!DEFAULT_PACKAGE_PARSER_CACHE_ENABLED) {

View File

@ -10,10 +10,10 @@ Subject: [PATCH] perform additional boot-time checks on system package updates
create mode 100644 services/core/java/com/android/server/pm/PackageVerityExt.java
diff --git a/services/core/java/com/android/server/pm/InstallPackageHelper.java b/services/core/java/com/android/server/pm/InstallPackageHelper.java
index 2ed4dfa4e8db..8ebfc9c4bb74 100644
index e27e8cf9e02d..cbfb2b07e97e 100644
--- a/services/core/java/com/android/server/pm/InstallPackageHelper.java
+++ b/services/core/java/com/android/server/pm/InstallPackageHelper.java
@@ -3960,6 +3960,13 @@ final class InstallPackageHelper {
@@ -4009,6 +4009,13 @@ final class InstallPackageHelper {
@Nullable UserHandle user) throws PackageManagerException {
final boolean scanSystemPartition =
(parseFlags & ParsingPackageUtils.PARSE_IS_SYSTEM_DIR) != 0;

View File

@ -38,10 +38,10 @@ Such ops are being constructed due to another bug.
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/services/core/java/com/android/server/appop/AppOpsService.java b/services/core/java/com/android/server/appop/AppOpsService.java
index 8e8b9956f3cc..4040e7d31a3c 100644
index 390874678b00..1e93b41bef28 100644
--- a/services/core/java/com/android/server/appop/AppOpsService.java
+++ b/services/core/java/com/android/server/appop/AppOpsService.java
@@ -4715,15 +4715,13 @@ public class AppOpsService extends IAppOpsService.Stub {
@@ -4981,15 +4981,13 @@ public class AppOpsService extends IAppOpsService.Stub {
String lastPkg = null;
for (int i=0; i<allOps.size(); i++) {
AppOpsManager.PackageOps pkg = allOps.get(i);

View File

@ -15,10 +15,10 @@ crashes.
1 file changed, 3 insertions(+)
diff --git a/services/core/java/com/android/server/appop/AppOpsService.java b/services/core/java/com/android/server/appop/AppOpsService.java
index 4040e7d31a3c..ed36f9bf6f8a 100644
index 1e93b41bef28..17aa376f3981 100644
--- a/services/core/java/com/android/server/appop/AppOpsService.java
+++ b/services/core/java/com/android/server/appop/AppOpsService.java
@@ -4715,6 +4715,9 @@ public class AppOpsService extends IAppOpsService.Stub {
@@ -4981,6 +4981,9 @@ public class AppOpsService extends IAppOpsService.Stub {
String lastPkg = null;
for (int i=0; i<allOps.size(); i++) {
AppOpsManager.PackageOps pkg = allOps.get(i);

View File

@ -11,10 +11,10 @@ Change-Id: I5c31c319d198f09ace493e601278f8224a259f05
3 files changed, 38 insertions(+)
diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java
index 9fae9911e2fc..2544b7bcb7c8 100644
index c0f9a1ad6be2..2b4836861219 100644
--- a/core/java/android/provider/Settings.java
+++ b/core/java/android/provider/Settings.java
@@ -18680,6 +18680,15 @@ public final class Settings {
@@ -19034,6 +19034,15 @@ public final class Settings {
*/
public static final String SETTINGS_REBOOT_AFTER_TIMEOUT = "settings_reboot_after_timeout";
@ -31,11 +31,11 @@ index 9fae9911e2fc..2544b7bcb7c8 100644
* The amount of time in milliseconds before a disconnected Wi-Fi adapter is turned off
* @hide
diff --git a/services/core/java/com/android/server/location/gnss/GnssConfiguration.java b/services/core/java/com/android/server/location/gnss/GnssConfiguration.java
index 5ef89ad4269a..0192ed9de15b 100644
index a5939e924adb..7cdf29223fc7 100644
--- a/services/core/java/com/android/server/location/gnss/GnssConfiguration.java
+++ b/services/core/java/com/android/server/location/gnss/GnssConfiguration.java
@@ -19,11 +19,13 @@ package com.android.server.location.gnss;
import android.content.Context;
@@ -20,11 +20,13 @@ import android.content.Context;
import android.location.flags.Flags;
import android.os.PersistableBundle;
import android.os.SystemProperties;
+import android.provider.Settings;
@ -48,7 +48,7 @@ index 5ef89ad4269a..0192ed9de15b 100644
import com.android.internal.util.FrameworkStatsLog;
@@ -289,6 +291,7 @@ public class GnssConfiguration {
@@ -296,6 +298,7 @@ public class GnssConfiguration {
*/
loadPropertiesFromGpsDebugConfig(mProperties, DEBUG_PROPERTIES_VENDOR_FILE);
loadPropertiesFromGpsDebugConfig(mProperties, DEBUG_PROPERTIES_SYSTEM_FILE);
@ -56,7 +56,7 @@ index 5ef89ad4269a..0192ed9de15b 100644
mEsExtensionSec = getRangeCheckedConfigEsExtensionSec();
logConfigurations();
@@ -489,4 +492,15 @@ public class GnssConfiguration {
@@ -514,4 +517,15 @@ public class GnssConfiguration {
private static native boolean native_set_satellite_blocklist(int[] constellations, int[] svIds);
private static native boolean native_set_es_extension_sec(int emergencyExtensionSeconds);
@ -73,10 +73,10 @@ index 5ef89ad4269a..0192ed9de15b 100644
+ }
}
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 af7dcc7d917a..d4706d9da0a8 100644
index c99773ec89d5..36ec04b74d9c 100644
--- a/services/core/java/com/android/server/location/gnss/GnssLocationProvider.java
+++ b/services/core/java/com/android/server/location/gnss/GnssLocationProvider.java
@@ -103,6 +103,7 @@ import android.telephony.TelephonyManager;
@@ -104,6 +104,7 @@ import android.telephony.TelephonyManager;
import android.text.TextUtils;
import android.text.format.DateUtils;
import android.util.Log;
@ -84,7 +84,7 @@ index af7dcc7d917a..d4706d9da0a8 100644
import android.util.Pair;
import android.util.TimeUtils;
@@ -489,6 +490,20 @@ public class GnssLocationProvider extends AbstractLocationProvider implements
@@ -490,6 +491,20 @@ public class GnssLocationProvider extends AbstractLocationProvider implements
mGnssNative.setNotificationCallbacks(this);
mGnssNative.setLocationRequestCallbacks(this);
mGnssNative.setTimeCallbacks(this);

View File

@ -13,7 +13,7 @@ Change-Id: I62c2553c8877b946d7e7e1ca4ef113f963d3f8eb
1 file changed, 46 insertions(+)
diff --git a/services/core/java/com/android/server/connectivity/Vpn.java b/services/core/java/com/android/server/connectivity/Vpn.java
index c5170585a1b3..f430b7b7c7a1 100644
index b7ece2ea65b1..33e2c3d9195b 100644
--- a/services/core/java/com/android/server/connectivity/Vpn.java
+++ b/services/core/java/com/android/server/connectivity/Vpn.java
@@ -50,9 +50,11 @@ import android.content.Context;

View File

@ -9,7 +9,7 @@ Signed-off-by: anupritaisno1 <www.anuprita804@gmail.com>
1 file changed, 9 insertions(+)
diff --git a/core/java/android/util/NtpTrustedTime.java b/core/java/android/util/NtpTrustedTime.java
index 3adbd686cd2c..6221541473d3 100644
index 3adbd686cd2c..a3d1bd6a2a2e 100644
--- a/core/java/android/util/NtpTrustedTime.java
+++ b/core/java/android/util/NtpTrustedTime.java
@@ -272,6 +272,15 @@ public abstract class NtpTrustedTime implements TrustedTime {

View File

@ -1,129 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Dmitry Muhomor <muhomor.dmitry@gmail.com>
Date: Thu, 7 Jul 2022 09:28:40 +0300
Subject: [PATCH] DeviceIdleJobsController: don't ignore whitelisted system
apps
Only user app IDs were written to `mDeviceIdleWhitelistAppIds`, both initially and when
`PowerManager.ACTION_POWER_SAVE_WHITELIST_CHANGED` broadcast was received. All other places that
listen to that broadcast retrieve both user and system app IDs.
The only place where `mDeviceIdleWhitelistAppIds` array is checked is in `isWhitelistedLocked()`,
which is called only by `updateTaskStateLocked()` to check whether the app is on the device idle whitelist.
It's not clear why DeviceIdleJobsController ignores system apps.
File level comment doesn't mention the distinction between system and user apps:
"When device is dozing, set constraint for all jobs, except whitelisted apps, as not satisfied."
Comment for isWhitelistedLocked() does, however:
"Checks if the given job's scheduling app id exists in the device idle user whitelist."
However, that method is called for both system and user apps, and returns false for system apps
because only whitelist of user apps is checked. This leads to long delays for jobs that were
submitted by whitelisted system apps when device is in the Doze mode. No such delays happen with
whitelisted user apps.
Other places use a different naming for array of app IDs that includes only user apps,
eg `mDeviceIdleWhitelistUserAppIds`, not `mDeviceIdleWhitelistAppIds`.
I've looked through the Git history of DeviceIdleJobsController and JobSchedulerService, but didn't
find a reason for this behavior. Perhaps, system apps were exempted from device idle JobScheduler
restricitions in some other place previously, or this was a bug from the start.
Tested on an emulator with the Messaging app, which uses JobScheduler
during processing of incoming SMS:
1. Check that Messaging app is on system deviceidle whitelist:
```
$ dumpsys deviceidle whitelist | grep com.android.messaging
system-excidle,com.android.messaging,10090
system,com.android.messaging,10090
```
2. Simulate sending an SMS: it appears immediately
3. Simulate Doze mode: `$ dumpsys deviceidle force-idle`
4. Simulate sending an SMS again. Message doesn't appear, even if the Messaging app is open
5. Exit Doze mode: `$ dumpsys deviceidle unforce`. All pending messages appear immediately
6. Add Messaging app to the user whitelist:
```
$ dumpsys deviceidle whitelist +com.android.messaging
$ dumpsys deviceidle whitelist | grep com.android.messaging
system-excidle,com.android.messaging,10090
system,com.android.messaging,10090
user,com.android.messaging,10090
```
7. Simulate Doze mode again: `$ dumpsys deviceidle force-idle`
8. Simulate sending an SMS, note that it appears immediately this time
Also made a test system app to make sure that this issue isn't caused by low targetSdk of the
Messaging app (it targets SDK 24). Same issue with targetSdk 32 app.
In both cases, applying this patch fixes the issue.
---
.../java/com/android/server/DeviceIdleInternal.java | 2 +-
.../java/com/android/server/DeviceIdleController.java | 6 +++---
.../server/job/controllers/DeviceIdleJobsController.java | 6 +++---
3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/apex/jobscheduler/framework/java/com/android/server/DeviceIdleInternal.java b/apex/jobscheduler/framework/java/com/android/server/DeviceIdleInternal.java
index caf7e7f4a4ed..1b1d2252dae1 100644
--- a/apex/jobscheduler/framework/java/com/android/server/DeviceIdleInternal.java
+++ b/apex/jobscheduler/framework/java/com/android/server/DeviceIdleInternal.java
@@ -73,7 +73,7 @@ public interface DeviceIdleInternal {
boolean isAppOnWhitelist(int appid);
- int[] getPowerSaveWhitelistUserAppIds();
+ int[] getPowerSaveWhitelistAppIds();
int[] getPowerSaveTempWhitelistAppIds();
diff --git a/apex/jobscheduler/service/java/com/android/server/DeviceIdleController.java b/apex/jobscheduler/service/java/com/android/server/DeviceIdleController.java
index 6383ed873e59..f5289001cc32 100644
--- a/apex/jobscheduler/service/java/com/android/server/DeviceIdleController.java
+++ b/apex/jobscheduler/service/java/com/android/server/DeviceIdleController.java
@@ -2375,14 +2375,14 @@ public class DeviceIdleController extends SystemService
}
/**
- * Returns the array of app ids whitelisted by user. Take care not to
+ * Returns the array of whitelisted app ids. Take care not to
* modify this, as it is a reference to the original copy. But the reference
* can change when the list changes, so it needs to be re-acquired when
* {@link PowerManager#ACTION_POWER_SAVE_WHITELIST_CHANGED} is sent.
*/
@Override
- public int[] getPowerSaveWhitelistUserAppIds() {
- return DeviceIdleController.this.getPowerSaveWhitelistUserAppIds();
+ public int[] getPowerSaveWhitelistAppIds() {
+ return DeviceIdleController.this.getAppIdWhitelistInternal();
}
@Override
diff --git a/apex/jobscheduler/service/java/com/android/server/job/controllers/DeviceIdleJobsController.java b/apex/jobscheduler/service/java/com/android/server/job/controllers/DeviceIdleJobsController.java
index d5c9ae615486..9e3ebb9cf6bc 100644
--- a/apex/jobscheduler/service/java/com/android/server/job/controllers/DeviceIdleJobsController.java
+++ b/apex/jobscheduler/service/java/com/android/server/job/controllers/DeviceIdleJobsController.java
@@ -90,7 +90,7 @@ public final class DeviceIdleJobsController extends StateController {
case PowerManager.ACTION_POWER_SAVE_WHITELIST_CHANGED:
synchronized (mLock) {
mDeviceIdleWhitelistAppIds =
- mLocalDeviceIdleController.getPowerSaveWhitelistUserAppIds();
+ mLocalDeviceIdleController.getPowerSaveWhitelistAppIds();
if (DEBUG) {
Slog.d(TAG, "Got whitelist "
+ Arrays.toString(mDeviceIdleWhitelistAppIds));
@@ -133,7 +133,7 @@ public final class DeviceIdleJobsController extends StateController {
mPowerManager = (PowerManager) mContext.getSystemService(Context.POWER_SERVICE);
mLocalDeviceIdleController =
LocalServices.getService(DeviceIdleInternal.class);
- mDeviceIdleWhitelistAppIds = mLocalDeviceIdleController.getPowerSaveWhitelistUserAppIds();
+ mDeviceIdleWhitelistAppIds = mLocalDeviceIdleController.getPowerSaveWhitelistAppIds();
mPowerSaveTempWhitelistAppIds =
mLocalDeviceIdleController.getPowerSaveTempWhitelistAppIds();
mDeviceIdleUpdateFunctor = new DeviceIdleUpdateFunctor();
@@ -194,7 +194,7 @@ public final class DeviceIdleJobsController extends StateController {
}
/**
- * Checks if the given job's scheduling app id exists in the device idle user whitelist.
+ * Checks if the given job's scheduling app id exists in the device idle whitelist.
*/
boolean isWhitelistedLocked(JobStatus job) {
return Arrays.binarySearch(mDeviceIdleWhitelistAppIds,

View File

@ -30,10 +30,10 @@ Change-Id: I64a252aac9bb196a11ed7b4b5d8c7e59a3413bd4
4 files changed, 118 insertions(+), 7 deletions(-)
diff --git a/core/java/android/content/pm/SigningDetails.java b/core/java/android/content/pm/SigningDetails.java
index 8c2197470a8b..03fabcd21ffd 100644
index bb09ad23f6ec..38f9a41bae90 100644
--- a/core/java/android/content/pm/SigningDetails.java
+++ b/core/java/android/content/pm/SigningDetails.java
@@ -798,6 +798,38 @@ public final class SigningDetails implements Parcelable {
@@ -801,6 +801,38 @@ public final class SigningDetails implements Parcelable {
return false;
}
@ -72,7 +72,7 @@ index 8c2197470a8b..03fabcd21ffd 100644
/** Returns true if the signatures in this and other match exactly. */
public boolean signaturesMatchExactly(@NonNull SigningDetails other) {
return Signature.areExactMatch(this, other);
@@ -1003,10 +1035,10 @@ public final class SigningDetails implements Parcelable {
@@ -1006,10 +1038,10 @@ public final class SigningDetails implements Parcelable {
}
@DataClass.Generated(
@ -86,10 +86,10 @@ index 8c2197470a8b..03fabcd21ffd 100644
private void __metadata() {}
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index be714871ad0f..0039f6c4d8ad 100644
index 34ddab5adae1..1dcc8c93fe31 100644
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -2124,6 +2124,8 @@
@@ -2140,6 +2140,8 @@
<string-array name="config_locationProviderPackageNames" translatable="false">
<!-- The standard AOSP fused location provider -->
<item>com.android.location.fused</item>
@ -97,9 +97,9 @@ index be714871ad0f..0039f6c4d8ad 100644
+ <item>com.google.android.gms</item> -->
</string-array>
<!-- Package name(s) of Advanced Driver Assistance applications. These packages have additional
<!-- Package name of the extension software fallback. -->
diff --git a/services/core/java/com/android/server/pm/AppsFilterImpl.java b/services/core/java/com/android/server/pm/AppsFilterImpl.java
index 82622d9a4ea8..3b49300d87b7 100644
index cc4c2b5bf893..c774c88f1da6 100644
--- a/services/core/java/com/android/server/pm/AppsFilterImpl.java
+++ b/services/core/java/com/android/server/pm/AppsFilterImpl.java
@@ -555,6 +555,15 @@ public final class AppsFilterImpl extends AppsFilterLocked implements Watchable,
@ -137,10 +137,10 @@ index 82622d9a4ea8..3b49300d87b7 100644
|| newPkg.isForceQueryable()
|| ArrayUtils.contains(mForceQueryableByDevicePackageNames,
diff --git a/services/core/java/com/android/server/pm/ComputerEngine.java b/services/core/java/com/android/server/pm/ComputerEngine.java
index 063fc92dddb8..f7b163e42587 100644
index b76683e29e42..9b999426c06c 100644
--- a/services/core/java/com/android/server/pm/ComputerEngine.java
+++ b/services/core/java/com/android/server/pm/ComputerEngine.java
@@ -84,6 +84,7 @@ import android.content.pm.InstantAppResolveInfo;
@@ -86,6 +86,7 @@ import android.content.pm.InstantAppResolveInfo;
import android.content.pm.InstrumentationInfo;
import android.content.pm.KeySet;
import android.content.pm.PackageInfo;
@ -148,7 +148,7 @@ index 063fc92dddb8..f7b163e42587 100644
import android.content.pm.PackageManager;
import android.content.pm.PackageManagerInternal;
import android.content.pm.ParceledListSlice;
@@ -104,6 +105,7 @@ import android.os.IBinder;
@@ -106,6 +107,7 @@ import android.os.IBinder;
import android.os.ParcelableException;
import android.os.PatternMatcher;
import android.os.Process;
@ -156,7 +156,7 @@ index 063fc92dddb8..f7b163e42587 100644
import android.os.Trace;
import android.os.UserHandle;
import android.os.UserManager;
@@ -1491,18 +1493,34 @@ public class ComputerEngine implements Computer {
@@ -1493,18 +1495,34 @@ public class ComputerEngine implements Computer {
// Compute GIDs only if requested
final int[] gids = (flags & PackageManager.GET_GIDS) == 0 ? EMPTY_INT_ARRAY
: mPermissionManager.getGidsForUid(UserHandle.getUid(userId, ps.getAppId()));
@ -196,7 +196,7 @@ index 063fc92dddb8..f7b163e42587 100644
if (packageInfo == null) {
return null;
@@ -1551,6 +1569,34 @@ public class ComputerEngine implements Computer {
@@ -1561,6 +1579,34 @@ public class ComputerEngine implements Computer {
}
}
@ -231,7 +231,7 @@ index 063fc92dddb8..f7b163e42587 100644
public final PackageInfo getPackageInfo(String packageName,
@PackageManager.PackageInfoFlagsBits long flags, int userId) {
return getPackageInfoInternal(packageName, PackageManager.VERSION_CODE_HIGHEST,
@@ -5082,6 +5128,20 @@ public class ComputerEngine implements Computer {
@@ -5100,6 +5146,20 @@ public class ComputerEngine implements Computer {
return null;
}

View File

@ -13,10 +13,10 @@ Change-Id: Ic5ddb78b1014ce567d1a5c57fc79f79edd1154c0
1 file changed, 13 insertions(+)
diff --git a/services/core/java/com/android/server/pm/AppsFilterBase.java b/services/core/java/com/android/server/pm/AppsFilterBase.java
index a5bc2c36a5a8..0c1d307a4aa9 100644
index 98b7c9610295..28942cd262d6 100644
--- a/services/core/java/com/android/server/pm/AppsFilterBase.java
+++ b/services/core/java/com/android/server/pm/AppsFilterBase.java
@@ -37,6 +37,7 @@ import android.util.Slog;
@@ -38,6 +38,7 @@ import android.util.Slog;
import android.util.SparseArray;
import com.android.internal.annotations.VisibleForTesting;
@ -24,7 +24,7 @@ index a5bc2c36a5a8..0c1d307a4aa9 100644
import com.android.internal.util.function.QuadFunction;
import com.android.server.om.OverlayReferenceMapper;
import com.android.server.pm.pkg.AndroidPackage;
@@ -63,6 +64,9 @@ import java.util.concurrent.atomic.AtomicBoolean;
@@ -64,6 +65,9 @@ import java.util.concurrent.atomic.AtomicBoolean;
public abstract class AppsFilterBase implements AppsFilterSnapshot {
protected static final String TAG = "AppsFilter";
@ -34,7 +34,7 @@ index a5bc2c36a5a8..0c1d307a4aa9 100644
// Logs all filtering instead of enforcing
protected static final boolean DEBUG_ALLOW_ALL = false;
protected static final boolean DEBUG_LOGGING = false;
@@ -510,6 +514,15 @@ public abstract class AppsFilterBase implements AppsFilterSnapshot {
@@ -518,6 +522,15 @@ public abstract class AppsFilterBase implements AppsFilterSnapshot {
if (DEBUG_LOGGING) {
log(callingSetting, targetPkgSetting, "force queryable");
}

View File

@ -108,10 +108,10 @@ index 000000000000..007b65349e55
+ });
+}
diff --git a/services/core/java/com/android/server/pm/AppsFilterBase.java b/services/core/java/com/android/server/pm/AppsFilterBase.java
index 0c1d307a4aa9..b0855bb53131 100644
index 28942cd262d6..cf8da62167e5 100644
--- a/services/core/java/com/android/server/pm/AppsFilterBase.java
+++ b/services/core/java/com/android/server/pm/AppsFilterBase.java
@@ -39,6 +39,7 @@ import android.util.SparseArray;
@@ -40,6 +40,7 @@ import android.util.SparseArray;
import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.util.ArrayUtils;
import com.android.internal.util.function.QuadFunction;
@ -119,7 +119,7 @@ index 0c1d307a4aa9..b0855bb53131 100644
import com.android.server.om.OverlayReferenceMapper;
import com.android.server.pm.pkg.AndroidPackage;
import com.android.server.pm.pkg.PackageStateInternal;
@@ -449,6 +450,11 @@ public abstract class AppsFilterBase implements AppsFilterSnapshot {
@@ -457,6 +458,11 @@ public abstract class AppsFilterBase implements AppsFilterSnapshot {
Trace.traceEnd(TRACE_TAG_PACKAGE_MANAGER);
}
@ -132,10 +132,10 @@ index 0c1d307a4aa9..b0855bb53131 100644
if (callingPkgSetting.getPkg() != null
&& !mFeatureConfig.packageIsEnabled(callingPkgSetting.getPkg())) {
diff --git a/services/core/java/com/android/server/pm/Settings.java b/services/core/java/com/android/server/pm/Settings.java
index b097b52cd759..126b212c9eb1 100644
index 475859fbc2e5..0ad5485ee643 100644
--- a/services/core/java/com/android/server/pm/Settings.java
+++ b/services/core/java/com/android/server/pm/Settings.java
@@ -106,6 +106,7 @@ import com.android.permission.persistence.RuntimePermissionsPersistence;
@@ -107,6 +107,7 @@ import com.android.permission.persistence.RuntimePermissionsPersistence;
import com.android.permission.persistence.RuntimePermissionsState;
import com.android.server.LocalServices;
import com.android.server.backup.PreferredActivityBackupHelper;
@ -143,7 +143,7 @@ index b097b52cd759..126b212c9eb1 100644
import com.android.server.pm.Installer.InstallerException;
import com.android.server.pm.parsing.PackageInfoUtils;
import com.android.server.pm.permission.LegacyPermissionDataProvider;
@@ -1927,8 +1928,11 @@ public final class Settings implements Watchable, Snappable, ResilientAtomicFile
@@ -1913,8 +1914,11 @@ public final class Settings implements Watchable, Snappable, ResilientAtomicFile
parser.getAttributeBoolean(null, ATTR_INSTANT_APP, false);
final boolean virtualPreload =
parser.getAttributeBoolean(null, ATTR_VIRTUAL_PRELOAD, false);
@ -158,7 +158,7 @@ index b097b52cd759..126b212c9eb1 100644
ATTR_ENABLED_CALLER);
final String harmfulAppWarning =
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 b771b6ba1726..b4a761a8da25 100644
index cd1d7996fbac..f7dcd5c20975 100644
--- a/services/core/java/com/android/server/pm/permission/PermissionManagerServiceImpl.java
+++ b/services/core/java/com/android/server/pm/permission/PermissionManagerServiceImpl.java
@@ -135,6 +135,7 @@ import com.android.server.PermissionThread;
@ -169,7 +169,7 @@ index b771b6ba1726..b4a761a8da25 100644
import com.android.server.pm.ApexManager;
import com.android.server.pm.KnownPackages;
import com.android.server.pm.PackageInstallerService;
@@ -1360,6 +1361,13 @@ public class PermissionManagerServiceImpl implements PermissionManagerServiceInt
@@ -1369,6 +1370,13 @@ public class PermissionManagerServiceImpl implements PermissionManagerServiceInt
isRolePermission = permission.isRole();
isSoftRestrictedPermission = permission.isSoftRestricted();
}
@ -183,7 +183,7 @@ index b771b6ba1726..b4a761a8da25 100644
final boolean mayGrantRolePermission = isRolePermission
&& mayManageRolePermission(callingUid);
final boolean mayGrantSoftRestrictedPermission = isSoftRestrictedPermission
@@ -2931,6 +2939,11 @@ public class PermissionManagerServiceImpl implements PermissionManagerServiceInt
@@ -2918,6 +2926,11 @@ public class PermissionManagerServiceImpl implements PermissionManagerServiceInt
Slog.wtf(LOG_TAG, "Unknown permission protection " + bp.getProtection()
+ " for permission " + bp.getName());
}

View File

@ -9,24 +9,29 @@ Depends on commit: "don't crash apps that depend on missing Gservices provider"
Change-Id: I49e3ff6f2ce8d74383da1c4dfd42913c713016c6
---
data/etc/preinstalled-packages-platform.xml | 6 ++++
data/etc/preinstalled-packages-platform.xml | 7 ++++-
.../server/ext/PackageManagerHooks.java | 31 +++++++++++++++++++
2 files changed, 37 insertions(+)
2 files changed, 37 insertions(+), 1 deletion(-)
diff --git a/data/etc/preinstalled-packages-platform.xml b/data/etc/preinstalled-packages-platform.xml
index 421bc25d60e9..7e46319dca38 100644
index 782327713fdc..b1d803b0d905 100644
--- a/data/etc/preinstalled-packages-platform.xml
+++ b/data/etc/preinstalled-packages-platform.xml
@@ -128,4 +128,10 @@ to pre-existing users, but cannot uninstall pre-existing system packages from pr
@@ -129,9 +129,14 @@ to pre-existing users, but cannot uninstall pre-existing system packages from pr
<install-in-user-type package="com.android.wallpaperbackup">
<install-in user-type="FULL" />
</install-in-user-type>
-
<!-- AvatarPicker (AvatarPicker app)-->
<install-in-user-type package="com.android.avatarpicker">
<install-in user-type="FULL" />
+
+ <install-in-user-type package="com.google.euiccpixel">
+ <install-in user-type="SYSTEM" />
+ </install-in-user-type>
+ <install-in-user-type package="im.angry.openeuicc">
+ <install-in user-type="SYSTEM" />
+ </install-in-user-type>
</install-in-user-type>
</config>
diff --git a/services/core/java/com/android/server/ext/PackageManagerHooks.java b/services/core/java/com/android/server/ext/PackageManagerHooks.java
index 007b65349e55..3c38b9e73049 100644

View File

@ -11,10 +11,10 @@ Subject: [PATCH] SystemUI: require unlocking to use QS tiles by default
4 files changed, 45 insertions(+), 3 deletions(-)
diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSHost.java b/packages/SystemUI/src/com/android/systemui/qs/QSHost.java
index 919b99604fd5..3b73cb8bf7a3 100644
index ba3357c8b591..57c6966da8ab 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/QSHost.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/QSHost.java
@@ -55,6 +55,7 @@ public interface QSHost {
@@ -49,6 +49,7 @@ public interface QSHost {
Context getUserContext();
int getUserId();
Collection<QSTile> getTiles();
@ -84,7 +84,7 @@ index cc370ff50c52..6cbef8241a48 100644
public Collection<QSTile> getTiles() {
return mTiles.values();
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSTileImpl.java b/packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSTileImpl.java
index 529d68407ce9..5cb51840bb52 100644
index 35cac4b2adb2..a4c69237693d 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSTileImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSTileImpl.java
@@ -68,6 +68,7 @@ import com.android.systemui.qs.QSHost;
@ -94,8 +94,8 @@ index 529d68407ce9..5cb51840bb52 100644
+import com.android.systemui.statusbar.policy.KeyguardStateController;
import java.io.PrintWriter;
import java.util.ArrayList;
@@ -269,6 +270,32 @@ public abstract class QSTileImpl<TState extends State> implements QSTile, Lifecy
@@ -268,6 +269,32 @@ public abstract class QSTileImpl<TState extends State> implements QSTile, Lifecy
return true;
}
@ -128,7 +128,7 @@ index 529d68407ce9..5cb51840bb52 100644
// safe to call from any thread
public void addCallback(Callback callback) {
@@ -592,16 +619,19 @@ public abstract class QSTileImpl<TState extends State> implements QSTile, Lifecy
@@ -591,16 +618,19 @@ public abstract class QSTileImpl<TState extends State> implements QSTile, Lifecy
mActivityStarter.postStartActivityDismissingKeyguard(intent, 0);
} else {
mQSLogger.logHandleClick(mTileSpec, msg.arg1);

View File

@ -0,0 +1,223 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Tavi <tavi@divested.dev>
Date: Thu, 5 Dec 2024 13:59:39 -0500
Subject: [PATCH] Revert "Allow signature spoofing for microG
Companion/Services"
This reverts commit 6b793fa98a40dd6c2d6eb02988161ed123439428.
Change-Id: I63acd724cfcdeba12bc2abfedd382d21842bba77
---
.../com/android/server/pm/AppsFilterImpl.java | 2 -
.../com/android/server/pm/ComputerEngine.java | 57 -------------------
services/core/jni/Android.bp | 7 ---
.../com_android_server_pm_ComputerEngine.cpp | 38 -------------
services/core/jni/onload.cpp | 2 -
5 files changed, 106 deletions(-)
delete mode 100644 services/core/jni/com_android_server_pm_ComputerEngine.cpp
diff --git a/services/core/java/com/android/server/pm/AppsFilterImpl.java b/services/core/java/com/android/server/pm/AppsFilterImpl.java
index 57263da936d6..cc4c2b5bf893 100644
--- a/services/core/java/com/android/server/pm/AppsFilterImpl.java
+++ b/services/core/java/com/android/server/pm/AppsFilterImpl.java
@@ -36,7 +36,6 @@ import static com.android.server.pm.AppsFilterUtils.canQueryAsUpdateOwner;
import static com.android.server.pm.AppsFilterUtils.canQueryViaComponents;
import static com.android.server.pm.AppsFilterUtils.canQueryViaPackage;
import static com.android.server.pm.AppsFilterUtils.canQueryViaUsesLibrary;
-import static com.android.server.pm.ComputerEngine.isMicrogSigned;
import android.annotation.NonNull;
import android.annotation.Nullable;
@@ -600,7 +599,6 @@ public final class AppsFilterImpl extends AppsFilterLocked implements Watchable,
newIsForceQueryable = mForceQueryable.contains(newPkgSetting.getAppId())
/* shared user that is already force queryable */
|| newPkgSetting.isForceQueryableOverride() /* adb override */
- || (newPkg.isForceQueryable() && isMicrogSigned(newPkg))
|| (newPkgSetting.isSystem() && (mSystemAppsQueryable
|| newPkg.isForceQueryable()
|| ArrayUtils.contains(mForceQueryableByDevicePackageNames,
diff --git a/services/core/java/com/android/server/pm/ComputerEngine.java b/services/core/java/com/android/server/pm/ComputerEngine.java
index 774033e0fb15..06b16becd3fe 100644
--- a/services/core/java/com/android/server/pm/ComputerEngine.java
+++ b/services/core/java/com/android/server/pm/ComputerEngine.java
@@ -102,7 +102,6 @@ import android.content.pm.UserPackage;
import android.content.pm.VersionedPackage;
import android.os.Binder;
import android.os.Build;
-import android.os.Bundle;
import android.os.IBinder;
import android.os.ParcelableException;
import android.os.PatternMatcher;
@@ -175,7 +174,6 @@ import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.Objects;
-import java.util.Optional;
import java.util.Set;
import java.util.UUID;
@@ -425,10 +423,6 @@ public class ComputerEngine implements Computer {
private final PackageManagerInternal.ExternalSourcesPolicy mExternalSourcesPolicy;
private final CrossProfileIntentResolverEngine mCrossProfileIntentResolverEngine;
- // Signatures used by microG
- private static final Signature MICROG_FAKE_SIGNATURE = new Signature("308204433082032ba003020102020900c2e08746644a308d300d06092a864886f70d01010405003074310b3009060355040613025553311330110603550408130a43616c69666f726e6961311630140603550407130d4d6f756e7461696e205669657731143012060355040a130b476f6f676c6520496e632e3110300e060355040b1307416e64726f69643110300e06035504031307416e64726f6964301e170d3038303832313233313333345a170d3336303130373233313333345a3074310b3009060355040613025553311330110603550408130a43616c69666f726e6961311630140603550407130d4d6f756e7461696e205669657731143012060355040a130b476f6f676c6520496e632e3110300e060355040b1307416e64726f69643110300e06035504031307416e64726f696430820120300d06092a864886f70d01010105000382010d00308201080282010100ab562e00d83ba208ae0a966f124e29da11f2ab56d08f58e2cca91303e9b754d372f640a71b1dcb130967624e4656a7776a92193db2e5bfb724a91e77188b0e6a47a43b33d9609b77183145ccdf7b2e586674c9e1565b1f4c6a5955bff251a63dabf9c55c27222252e875e4f8154a645f897168c0b1bfc612eabf785769bb34aa7984dc7e2ea2764cae8307d8c17154d7ee5f64a51a44a602c249054157dc02cd5f5c0e55fbef8519fbe327f0b1511692c5a06f19d18385f5c4dbc2d6b93f68cc2979c70e18ab93866b3bd5db8999552a0e3b4c99df58fb918bedc182ba35e003c1b4b10dd244a8ee24fffd333872ab5221985edab0fc0d0b145b6aa192858e79020103a381d93081d6301d0603551d0e04160414c77d8cc2211756259a7fd382df6be398e4d786a53081a60603551d2304819e30819b8014c77d8cc2211756259a7fd382df6be398e4d786a5a178a4763074310b3009060355040613025553311330110603550408130a43616c69666f726e6961311630140603550407130d4d6f756e7461696e205669657731143012060355040a130b476f6f676c6520496e632e3110300e060355040b1307416e64726f69643110300e06035504031307416e64726f6964820900c2e08746644a308d300c0603551d13040530030101ff300d06092a864886f70d010104050003820101006dd252ceef85302c360aaace939bcff2cca904bb5d7a1661f8ae46b2994204d0ff4a68c7ed1a531ec4595a623ce60763b167297a7ae35712c407f208f0cb109429124d7b106219c084ca3eb3f9ad5fb871ef92269a8be28bf16d44c8d9a08e6cb2f005bb3fe2cb96447e868e731076ad45b33f6009ea19c161e62641aa99271dfd5228c5c587875ddb7f452758d661f6cc0cccb7352e424cc4365c523532f7325137593c4ae341f4db41edda0d0b1071a7c440f0fe9ea01cb627ca674369d084bd2fd911ff06cdbf2cfa10dc0f893ae35762919048c7efc64c7144178342f70581c9de573af55b390dd7fdb9418631895d5f759f30112687ff621410c069308a");
- private static final Signature MICROG_REAL_SIGNATURE = new Signature("308202ed308201d5a003020102020426ffa009300d06092a864886f70d01010b05003027310b300906035504061302444531183016060355040a130f4e4f47415050532050726f6a656374301e170d3132313030363132303533325a170d3337303933303132303533325a3027310b300906035504061302444531183016060355040a130f4e4f47415050532050726f6a65637430820122300d06092a864886f70d01010105000382010f003082010a02820101009a8d2a5336b0eaaad89ce447828c7753b157459b79e3215dc962ca48f58c2cd7650df67d2dd7bda0880c682791f32b35c504e43e77b43c3e4e541f86e35a8293a54fb46e6b16af54d3a4eda458f1a7c8bc1b7479861ca7043337180e40079d9cdccb7e051ada9b6c88c9ec635541e2ebf0842521c3024c826f6fd6db6fd117c74e859d5af4db04448965ab5469b71ce719939a06ef30580f50febf96c474a7d265bb63f86a822ff7b643de6b76e966a18553c2858416cf3309dd24278374bdd82b4404ef6f7f122cec93859351fc6e5ea947e3ceb9d67374fe970e593e5cd05c905e1d24f5a5484f4aadef766e498adf64f7cf04bddd602ae8137b6eea40722d0203010001a321301f301d0603551d0e04160414110b7aa9ebc840b20399f69a431f4dba6ac42a64300d06092a864886f70d01010b0500038201010007c32ad893349cf86952fb5a49cfdc9b13f5e3c800aece77b2e7e0e9c83e34052f140f357ec7e6f4b432dc1ed542218a14835acd2df2deea7efd3fd5e8f1c34e1fb39ec6a427c6e6f4178b609b369040ac1f8844b789f3694dc640de06e44b247afed11637173f36f5886170fafd74954049858c6096308fc93c1bc4dd5685fa7a1f982a422f2a3b36baa8c9500474cf2af91c39cbec1bc898d10194d368aa5e91f1137ec115087c31962d8f76cd120d28c249cf76f4c70f5baa08c70a7234ce4123be080cee789477401965cfe537b924ef36747e8caca62dfefdd1a6288dcb1c4fd2aaa6131a7ad254e9742022cfd597d2ca5c660ce9e41ff537e5a4041e37");
-
// PackageManagerService attributes that are primitives are referenced through the
// pms object directly. Primitives are the only attributes so referenced.
protected final PackageManagerService mService;
@@ -1471,53 +1465,6 @@ public class ComputerEngine implements Computer {
return result;
}
- private static native boolean isDebuggable();
-
- public static boolean isMicrogSigned(AndroidPackage p) {
- if (!isDebuggable()) {
- return false;
- }
-
- // Allowlist the following apps:
- // * com.android.vending - microG Companion
- // * com.google.android.gms - microG Services
- if (!p.getPackageName().equals("com.android.vending") &&
- !p.getPackageName().equals("com.google.android.gms")) {
- return false;
- }
-
- Signature[] signatures = p.getSigningDetails().getSignatures();
- if (signatures == null) {
- return false;
- }
-
- return Signature.areExactMatch(signatures, new Signature[]{MICROG_REAL_SIGNATURE});
- }
-
- private static Optional<Signature> generateFakeSignature(AndroidPackage p) {
- if (!isMicrogSigned(p)) {
- return Optional.empty();
- }
-
- Bundle metadata = p.getMetaData();
- if (metadata == null) {
- return Optional.empty();
- }
-
- String fakeSignatureStr = metadata.getString("fake-signature");
- if (TextUtils.isEmpty(fakeSignatureStr)) {
- return Optional.empty();
- }
-
- // Only MICROG_FAKE_SIGNATURE can be faked
- Signature fakeSignature = new Signature(fakeSignatureStr);
- if (!fakeSignature.equals(MICROG_FAKE_SIGNATURE)) {
- return Optional.empty();
- }
-
- return Optional.of(fakeSignature);
- }
-
public final PackageInfo generatePackageInfo(PackageStateInternal ps,
@PackageManager.PackageInfoFlagsBits long flags, int userId) {
if (!mUserManager.exists(userId)) return null;
@@ -1574,10 +1521,6 @@ public class ComputerEngine implements Computer {
}
}
- generateFakeSignature(p).ifPresent(fakeSignature -> {
- packageInfo.signatures = new Signature[]{fakeSignature};
- });
-
return packageInfo;
} else if ((flags & (MATCH_UNINSTALLED_PACKAGES | MATCH_ARCHIVED_PACKAGES)) != 0
&& PackageUserStateUtils.isAvailable(state, flags)) {
diff --git a/services/core/jni/Android.bp b/services/core/jni/Android.bp
index e078c6e34912..3607dddc66d5 100644
--- a/services/core/jni/Android.bp
+++ b/services/core/jni/Android.bp
@@ -73,7 +73,6 @@ cc_library_static {
"com_android_server_vibrator_VibratorManagerService.cpp",
"com_android_server_pdb_PersistentDataBlockService.cpp",
"com_android_server_am_LowMemDetector.cpp",
- "com_android_server_pm_ComputerEngine.cpp",
"com_android_server_pm_PackageManagerShellCommandDataLoader.cpp",
"com_android_server_sensor_SensorService.cpp",
"com_android_server_wm_TaskFpsCallbackController.cpp",
@@ -96,12 +95,6 @@ cc_library_static {
header_libs: [
"bionic_libc_platform_headers",
],
-
- product_variables: {
- debuggable: {
- cflags: ["-DANDROID_DEBUGGABLE"],
- }
- },
}
cc_defaults {
diff --git a/services/core/jni/com_android_server_pm_ComputerEngine.cpp b/services/core/jni/com_android_server_pm_ComputerEngine.cpp
deleted file mode 100644
index bbe298097a2a..000000000000
--- a/services/core/jni/com_android_server_pm_ComputerEngine.cpp
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (C) 2024 The LineageOS 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.
- */
-
-#include <nativehelper/JNIHelp.h>
-
-namespace android {
-
-static bool isDebuggable(JNIEnv* env) {
-#ifdef ANDROID_DEBUGGABLE
- return true;
-#else
- return false;
-#endif
-}
-
-static const JNINativeMethod method_table[] = {
- {"isDebuggable", "()Z", (void*)isDebuggable},
-};
-
-int register_android_server_com_android_server_pm_ComputerEngine(JNIEnv* env) {
- return jniRegisterNativeMethods(env, "com/android/server/pm/ComputerEngine",
- method_table, NELEM(method_table));
-}
-
-} // namespace android
diff --git a/services/core/jni/onload.cpp b/services/core/jni/onload.cpp
index 30bc8c5403a6..0936888b24a0 100644
--- a/services/core/jni/onload.cpp
+++ b/services/core/jni/onload.cpp
@@ -58,7 +58,6 @@ int register_android_server_am_LowMemDetector(JNIEnv* env);
int register_android_server_utils_AnrTimer(JNIEnv *env);
int register_com_android_server_soundtrigger_middleware_AudioSessionProviderImpl(JNIEnv* env);
int register_com_android_server_soundtrigger_middleware_ExternalCaptureStateTracker(JNIEnv* env);
-int register_android_server_com_android_server_pm_ComputerEngine(JNIEnv* env);
int register_android_server_com_android_server_pm_PackageManagerShellCommandDataLoader(JNIEnv* env);
int register_android_server_AdbDebuggingManager(JNIEnv* env);
int register_android_server_FaceService(JNIEnv* env);
@@ -122,7 +121,6 @@ extern "C" jint JNI_OnLoad(JavaVM* vm, void* /* reserved */)
register_android_server_utils_AnrTimer(env);
register_com_android_server_soundtrigger_middleware_AudioSessionProviderImpl(env);
register_com_android_server_soundtrigger_middleware_ExternalCaptureStateTracker(env);
- register_android_server_com_android_server_pm_ComputerEngine(env);
register_android_server_com_android_server_pm_PackageManagerShellCommandDataLoader(env);
register_android_server_AdbDebuggingManager(env);
register_android_server_FaceService(env);

View File

@ -1,22 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Daniel Micay <danielmicay@gmail.com>
Date: Mon, 4 Jan 2021 19:56:14 -0500
Subject: [PATCH] constify JNINativeMethod table
---
framesequence/jni/FrameSequenceJNI.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/framesequence/jni/FrameSequenceJNI.cpp b/framesequence/jni/FrameSequenceJNI.cpp
index c701f033..4041733d 100644
--- a/framesequence/jni/FrameSequenceJNI.cpp
+++ b/framesequence/jni/FrameSequenceJNI.cpp
@@ -141,7 +141,7 @@ static jlong JNICALL nativeGetFrame(
return delayMs;
}
-static JNINativeMethod gMethods[] = {
+static const JNINativeMethod gMethods[] = {
{ "nativeDecodeByteArray",
"([BII)L" JNI_PACKAGE "/FrameSequence;",
(void*) nativeDecodeByteArray

View File

@ -8,7 +8,7 @@ Subject: [PATCH] invalidate icon cache between OS releases
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/iconloaderlib/src/com/android/launcher3/icons/cache/BaseIconCache.java b/iconloaderlib/src/com/android/launcher3/icons/cache/BaseIconCache.java
index d6cd0f2..acb5d9f 100644
index 072bcbf..873735d 100644
--- a/iconloaderlib/src/com/android/launcher3/icons/cache/BaseIconCache.java
+++ b/iconloaderlib/src/com/android/launcher3/icons/cache/BaseIconCache.java
@@ -273,7 +273,7 @@ public abstract class BaseIconCache {

View File

@ -10,10 +10,10 @@ Change-Id: Id5e3b8f7793d0783104b8b59581688c8ef821396
1 file changed, 1 insertion(+), 25 deletions(-)
diff --git a/src/java/com/android/ims/ImsManager.java b/src/java/com/android/ims/ImsManager.java
index c9252f24..d822cf1d 100644
index 217a26f2..214dd9fc 100644
--- a/src/java/com/android/ims/ImsManager.java
+++ b/src/java/com/android/ims/ImsManager.java
@@ -549,13 +549,6 @@ public class ImsManager implements FeatureUpdates {
@@ -550,13 +550,6 @@ public class ImsManager implements FeatureUpdates {
*/
@UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553)
public static boolean isEnhanced4gLteModeSettingEnabledByUser(Context context) {
@ -27,7 +27,7 @@ index c9252f24..d822cf1d 100644
return false;
}
@@ -570,24 +563,7 @@ public class ImsManager implements FeatureUpdates {
@@ -571,24 +564,7 @@ public class ImsManager implements FeatureUpdates {
* return the default value.
*/
public boolean isEnhanced4gLteModeSettingEnabledByUser() {

View File

@ -75,7 +75,7 @@ index 246c7b36a..86e17c570 100644
public synchronized boolean isAutoJoinEnabled() {
if (mTargetWifiConfig == null) {
diff --git a/libs/WifiTrackerLib/src/com/android/wifitrackerlib/WifiEntry.java b/libs/WifiTrackerLib/src/com/android/wifitrackerlib/WifiEntry.java
index 09dfd89e3..358b534db 100644
index 6843d5a75..495fa7959 100644
--- a/libs/WifiTrackerLib/src/com/android/wifitrackerlib/WifiEntry.java
+++ b/libs/WifiTrackerLib/src/com/android/wifitrackerlib/WifiEntry.java
@@ -142,6 +142,7 @@ public class WifiEntry {

View File

@ -21,7 +21,7 @@ Change-Id: I694c683c9bfde60343f0f6ea8d806bc5e24437e6
2 files changed, 6 insertions(+)
diff --git a/hal/audio_extn/audio_extn.h b/hal/audio_extn/audio_extn.h
index d75dd5a064..080cfabd4e 100644
index aeea8f1e56..ec86b72a5d 100644
--- a/hal/audio_extn/audio_extn.h
+++ b/hal/audio_extn/audio_extn.h
@@ -873,7 +873,11 @@ bool audio_extn_utils_is_dolby_format(audio_format_t format);

View File

@ -136,10 +136,10 @@ index e99edd6c4f9..61b75bcd358 100644
};
void register_libcore_io_AsynchronousCloseMonitor(JNIEnv* env) {
diff --git a/luni/src/main/native/libcore_io_Linux.cpp b/luni/src/main/native/libcore_io_Linux.cpp
index adf7b75ad95..53c362616ab 100644
index 3c87e6328aa..532e8101e22 100644
--- a/luni/src/main/native/libcore_io_Linux.cpp
+++ b/luni/src/main/native/libcore_io_Linux.cpp
@@ -2759,7 +2759,7 @@ static jint Linux_writev(JNIEnv* env, jobject, jobject javaFd, jobjectArray buff
@@ -2761,7 +2761,7 @@ static jint Linux_writev(JNIEnv* env, jobject, jobject javaFd, jobjectArray buff
#define NATIVE_METHOD_OVERLOAD(className, functionName, signature, variant) \
{ #functionName, signature, reinterpret_cast<void*>(className ## _ ## functionName ## variant) }
@ -301,10 +301,10 @@ index 36cc6cf4bc1..39ff9241791 100644
NATIVE_METHOD(DatagramDispatcher, readv0, "(Ljava/io/FileDescriptor;JI)J"),
NATIVE_METHOD(DatagramDispatcher, write0, "(Ljava/io/FileDescriptor;JI)I"),
diff --git a/ojluni/src/main/native/Deflater.c b/ojluni/src/main/native/Deflater.c
index 9ee032619dd..2230f8c9519 100644
index 9dfff0a3593..a20456df0be 100644
--- a/ojluni/src/main/native/Deflater.c
+++ b/ojluni/src/main/native/Deflater.c
@@ -240,7 +240,7 @@ Deflater_end(JNIEnv *env, jclass cls, jlong addr)
@@ -313,7 +313,7 @@ Deflater_end(JNIEnv *env, jclass cls, jlong addr)
}
}
@ -312,7 +312,7 @@ index 9ee032619dd..2230f8c9519 100644
+static const JNINativeMethod gMethods[] = {
NATIVE_METHOD(Deflater, init, "(IIZ)J"),
NATIVE_METHOD(Deflater, setDictionary, "(J[BII)V"),
NATIVE_METHOD(Deflater, deflateBytes, "(J[BIII)I"),
NATIVE_METHOD(Deflater, setDictionaryBuffer, "(JJI)V"),
diff --git a/ojluni/src/main/native/Double.c b/ojluni/src/main/native/Double.c
index 8382b889945..2bcb97a653f 100644
--- a/ojluni/src/main/native/Double.c
@ -340,18 +340,18 @@ index 51339dff9c1..6d5c075e835 100644
NATIVE_METHOD(FileChannelImpl, map0, "(IJJ)J"),
NATIVE_METHOD(FileChannelImpl, unmap0, "(JJ)I"),
diff --git a/ojluni/src/main/native/FileDescriptor_md.c b/ojluni/src/main/native/FileDescriptor_md.c
index 880f5ea56ad..3ba1c1343a0 100644
index a838507e145..35eb7837a94 100644
--- a/ojluni/src/main/native/FileDescriptor_md.c
+++ b/ojluni/src/main/native/FileDescriptor_md.c
@@ -70,7 +70,7 @@ JNIEXPORT jboolean JNICALL FileDescriptor_isSocket(JNIEnv *env, jclass ignored,
// END Android-changed: isSocket - do not clear socket error code
@@ -75,7 +75,7 @@ FileDescriptor_getAppend(jint fd) {
}
-static JNINativeMethod gMethods[] = {
+static const JNINativeMethod gMethods[] = {
NATIVE_METHOD(FileDescriptor, sync, "()V"),
NATIVE_METHOD(FileDescriptor, isSocket, "(I)Z"),
};
CRITICAL_NATIVE_METHOD(FileDescriptor, isSocket, "(I)Z"),
CRITICAL_NATIVE_METHOD(FileDescriptor, getAppend, "(I)Z"),
diff --git a/ojluni/src/main/native/FileDispatcherImpl.c b/ojluni/src/main/native/FileDispatcherImpl.c
index 3e8e4f3e0f2..facede4cf14 100644
--- a/ojluni/src/main/native/FileDispatcherImpl.c
@ -366,18 +366,18 @@ index 3e8e4f3e0f2..facede4cf14 100644
NATIVE_METHOD(FileDispatcherImpl, preClose0, "(Ljava/io/FileDescriptor;)V"),
NATIVE_METHOD(FileDispatcherImpl, close0, "(Ljava/io/FileDescriptor;)V"),
diff --git a/ojluni/src/main/native/FileInputStream.c b/ojluni/src/main/native/FileInputStream.c
index 650cb6c9040..bd2f64e68f0 100644
index adb5c409114..5f0ad56c57f 100644
--- a/ojluni/src/main/native/FileInputStream.c
+++ b/ojluni/src/main/native/FileInputStream.c
@@ -145,7 +145,7 @@ FileInputStream_available0(JNIEnv *env, jobject this) {
@@ -179,7 +179,7 @@ Java_java_io_FileInputStream_available0(JNIEnv *env, jobject this) {
return 0;
}
-static JNINativeMethod gMethods[] = {
+static const JNINativeMethod gMethods[] = {
NATIVE_METHOD(FileInputStream, skip0, "(J)J"),
NATIVE_METHOD(FileInputStream, available0, "()I"),
};
NATIVE_METHOD(Java_java_io_FileInputStream, length0, "()J"),
NATIVE_METHOD(Java_java_io_FileInputStream, position0, "()J"),
NATIVE_METHOD(Java_java_io_FileInputStream, skip0, "(J)J"),
diff --git a/ojluni/src/main/native/FileKey.c b/ojluni/src/main/native/FileKey.c
index c3b5d2a00fe..61d3c2ae896 100644
--- a/ojluni/src/main/native/FileKey.c
@ -431,10 +431,10 @@ index d2a8cf1a2e9..de47c111b1b 100644
NATIVE_METHOD(IOUtil, fdLimit, "()I"),
NATIVE_METHOD(IOUtil, drain, "(I)Z"),
diff --git a/ojluni/src/main/native/Inflater.c b/ojluni/src/main/native/Inflater.c
index c4c24f0fed1..23b107426db 100644
index 2b664db516a..dc3736b822d 100644
--- a/ojluni/src/main/native/Inflater.c
+++ b/ojluni/src/main/native/Inflater.c
@@ -201,7 +201,7 @@ Inflater_end(JNIEnv *env, jclass cls, jlong addr)
@@ -307,7 +307,7 @@ Inflater_end(JNIEnv *env, jclass cls, jlong addr)
}
}
@ -442,7 +442,7 @@ index c4c24f0fed1..23b107426db 100644
+static const JNINativeMethod gMethods[] = {
NATIVE_METHOD(Inflater, init, "(Z)J"),
NATIVE_METHOD(Inflater, setDictionary, "(J[BII)V"),
NATIVE_METHOD(Inflater, inflateBytes, "(J[BII)I"),
NATIVE_METHOD(Inflater, setDictionaryBuffer, "(JJI)V"),
diff --git a/ojluni/src/main/native/MappedByteBuffer.c b/ojluni/src/main/native/MappedByteBuffer.c
index e68ba04cb3c..013273b5433 100644
--- a/ojluni/src/main/native/MappedByteBuffer.c
@ -691,10 +691,10 @@ index 6710e13be51..47dc1213422 100644
NATIVE_METHOD(Java_sun_nio_fs_UnixNativeDispatcher, dup, "(I)I"),
NATIVE_METHOD(Java_sun_nio_fs_UnixNativeDispatcher, open0, "(JII)I"),
diff --git a/ojluni/src/main/native/ZipFile.c b/ojluni/src/main/native/ZipFile.c
index 314b6c7aa79..2abdede0ca3 100644
index fcdd41c7c65..8896e62eb3e 100644
--- a/ojluni/src/main/native/ZipFile.c
+++ b/ojluni/src/main/native/ZipFile.c
@@ -398,7 +398,7 @@ JarFile_getMetaInfEntryNames(JNIEnv *env, jobject obj)
@@ -388,7 +388,7 @@ JarFile_getMetaInfEntryNames(JNIEnv *env, jobject obj)
return result;
}
@ -703,7 +703,7 @@ index 314b6c7aa79..2abdede0ca3 100644
NATIVE_METHOD(ZipFile, getFileDescriptor, "(J)I"),
NATIVE_METHOD(ZipFile, getEntry, "(J[BZ)J"),
NATIVE_METHOD(ZipFile, freeEntry, "(JJ)V"),
@@ -419,7 +419,7 @@ static JNINativeMethod gMethods[] = {
@@ -409,7 +409,7 @@ static JNINativeMethod gMethods[] = {
NATIVE_METHOD(ZipFile, getZipMessage, "(J)Ljava/lang/String;"),
};

View File

@ -9,7 +9,7 @@ Subject: [PATCH] add parameter for avoiding full preload with exec
2 files changed, 24 insertions(+), 2 deletions(-)
diff --git a/api/module-lib-current.txt b/api/module-lib-current.txt
index 0ff15eaf273..5c3a486fff9 100644
index ad36b7d6f93..a0589f3d6dd 100644
--- a/api/module-lib-current.txt
+++ b/api/module-lib-current.txt
@@ -365,7 +365,9 @@ package dalvik.system {

View File

@ -13,10 +13,10 @@ Change-Id: Ie3990a6e789be22da0c7771d85ad71034ed334eb
1 file changed, 60 insertions(+)
diff --git a/packages/LineageSettingsProvider/src/org/lineageos/lineagesettings/LineageDatabaseHelper.java b/packages/LineageSettingsProvider/src/org/lineageos/lineagesettings/LineageDatabaseHelper.java
index 2a77cec7..83322355 100644
index ac19ea8d..32e3b608 100644
--- a/packages/LineageSettingsProvider/src/org/lineageos/lineagesettings/LineageDatabaseHelper.java
+++ b/packages/LineageSettingsProvider/src/org/lineageos/lineagesettings/LineageDatabaseHelper.java
@@ -120,6 +120,66 @@ public class LineageDatabaseHelper extends SQLiteOpenHelper{
@@ -109,6 +109,66 @@ public class LineageDatabaseHelper extends SQLiteOpenHelper{
} catch (PackageManager.NameNotFoundException e) {
e.printStackTrace();
}

View File

@ -27,7 +27,7 @@ index d678715e7..1e866e3ca 100644
<bool name="show_extreme_alert_settings">true</bool>
<!-- Whether to show severe alert settings -->
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 66a8a306c..10d43df0a 100644
index c234c924c..647d9e3d6 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -392,4 +392,6 @@
@ -53,10 +53,10 @@ index fc0649e24..08c1ccf30 100644
<!-- Enable CMAS Extreme Threat alerts -->
diff --git a/src/com/android/cellbroadcastreceiver/CellBroadcastAlertService.java b/src/com/android/cellbroadcastreceiver/CellBroadcastAlertService.java
index 0f9a5ed16..d45b8f854 100644
index 2ac1402bf..3e8f3b65d 100644
--- a/src/com/android/cellbroadcastreceiver/CellBroadcastAlertService.java
+++ b/src/com/android/cellbroadcastreceiver/CellBroadcastAlertService.java
@@ -575,8 +575,8 @@ public class CellBroadcastAlertService extends Service {
@@ -580,8 +580,8 @@ public class CellBroadcastAlertService extends Service {
}
// CMAS warning types
if (resourcesKey == R.array.cmas_presidential_alerts_channels_range_strings) {
@ -85,10 +85,10 @@ index eaca6d741..e4cf7a509 100644
case KEY_SCREEN_ON_DURATION:
mScreenOnDuration = Integer.parseInt(value);
diff --git a/src/com/android/cellbroadcastreceiver/CellBroadcastReceiver.java b/src/com/android/cellbroadcastreceiver/CellBroadcastReceiver.java
index e8b55feb1..4b6541011 100644
index 642cfd85a..0e088e662 100644
--- a/src/com/android/cellbroadcastreceiver/CellBroadcastReceiver.java
+++ b/src/com/android/cellbroadcastreceiver/CellBroadcastReceiver.java
@@ -660,6 +660,8 @@ public class CellBroadcastReceiver extends BroadcastReceiver {
@@ -672,6 +672,8 @@ public class CellBroadcastReceiver extends BroadcastReceiver {
break;
case CdmaSmsCbProgramData.OPERATION_CLEAR_CATEGORIES:
@ -97,7 +97,7 @@ index e8b55feb1..4b6541011 100644
tryCdmaSetCategory(mContext,
CdmaSmsCbProgramData.CATEGORY_CMAS_EXTREME_THREAT, false);
tryCdmaSetCategory(mContext,
@@ -687,6 +689,12 @@ public class CellBroadcastReceiver extends BroadcastReceiver {
@@ -699,6 +701,12 @@ public class CellBroadcastReceiver extends BroadcastReceiver {
SharedPreferences sharedPrefs = PreferenceManager.getDefaultSharedPreferences(context);
switch (category) {

View File

@ -10,10 +10,10 @@ Subject: [PATCH] constify JNINativeMethod tables
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/nci/jni/NativeNfcManager.cpp b/nci/jni/NativeNfcManager.cpp
index 603d8ab6..8fc42860 100644
index 2c6e7aa0..a746f101 100644
--- a/nci/jni/NativeNfcManager.cpp
+++ b/nci/jni/NativeNfcManager.cpp
@@ -1994,7 +1994,7 @@ static jbyteArray nfcManager_doGetRoutingTable(JNIEnv* e, jobject o) {
@@ -2273,7 +2273,7 @@ static void sendRawVsCmdCallback(uint8_t event, uint16_t param_len,
** JNI functions for android-4.0.1_r1
**
*****************************************************************************/
@ -23,10 +23,10 @@ index 603d8ab6..8fc42860 100644
{"initializeNativeStructure", "()Z", (void*)nfcManager_initNativeStruc},
diff --git a/nci/jni/NativeNfcTag.cpp b/nci/jni/NativeNfcTag.cpp
index d9c59953..a1eb7953 100644
index 53e1fb41..f846c4af 100644
--- a/nci/jni/NativeNfcTag.cpp
+++ b/nci/jni/NativeNfcTag.cpp
@@ -1739,7 +1739,7 @@ void nativeNfcTag_releaseRfInterfaceMutexLock() {
@@ -1699,7 +1699,7 @@ void nativeNfcTag_releaseRfInterfaceMutexLock() {
** JNI functions for Android 4.0.3
**
*****************************************************************************/
@ -36,10 +36,10 @@ index d9c59953..a1eb7953 100644
{"doDisconnect", "()Z", (void*)nativeNfcTag_doDisconnect},
{"doReconnect", "()I", (void*)nativeNfcTag_doReconnect},
diff --git a/nci/jni/NativeP2pDevice.cpp b/nci/jni/NativeP2pDevice.cpp
index 23f5db41..396c6d0c 100644
index efb82526..a2215870 100644
--- a/nci/jni/NativeP2pDevice.cpp
+++ b/nci/jni/NativeP2pDevice.cpp
@@ -58,7 +58,7 @@ static jboolean nativeP2pDeviceDoSend(JNIEnv*, jobject, jbyteArray) {
@@ -56,7 +56,7 @@ static jboolean nativeP2pDeviceDoSend(JNIEnv*, jobject, jbyteArray) {
** Description: JNI functions
**
*****************************************************************************/

View File

@ -89,7 +89,7 @@ index 12e29e693b7..b264bef20a9 100644
android:id="@+id/private_dns_mode_opportunistic"
layout="@layout/preference_widget_dialog_radiobutton"/>
diff --git a/res/values/cm_strings.xml b/res/values/cm_strings.xml
index aa89f73f47c..f0dd5226d1c 100644
index 036f6d3327e..3959c81fce7 100644
--- a/res/values/cm_strings.xml
+++ b/res/values/cm_strings.xml
@@ -15,6 +15,52 @@

View File

@ -29,7 +29,7 @@ index 7c765d5a22f..12e29e693b7 100644
android:id="@+id/private_dns_mode_opportunistic"
layout="@layout/preference_widget_dialog_radiobutton"/>
diff --git a/res/values/cm_strings.xml b/res/values/cm_strings.xml
index d5c162e6650..aa89f73f47c 100644
index f6e4e274926..036f6d3327e 100644
--- a/res/values/cm_strings.xml
+++ b/res/values/cm_strings.xml
@@ -15,11 +15,6 @@

View File

@ -13,7 +13,7 @@ Subject: [PATCH] add auto-reboot setting
create mode 100644 src/com/android/settings/security/AutoRebootPreferenceController.java
diff --git a/res/values/arrays.xml b/res/values/arrays.xml
index f84afec09fc..954e3047f57 100644
index 0e35fed6a11..b6fe89a9bce 100644
--- a/res/values/arrays.xml
+++ b/res/values/arrays.xml
@@ -105,6 +105,37 @@
@ -55,10 +55,10 @@ index f84afec09fc..954e3047f57 100644
<!-- Match this with the order of NetworkInfo.DetailedState. --> <skip />
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 8fcbcbf6b49..9713adcc767 100644
index 61aa1b265e6..bf2c65eefec 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -627,6 +627,9 @@
@@ -624,6 +624,9 @@
<!-- Text shown for title of owner info setting [CHAR LIMIT=30]-->
<string name="owner_info_settings_title">Add text on lock screen</string>

View File

@ -12,7 +12,7 @@ Subject: [PATCH] add bluetooth auto-turn-off setting
create mode 100644 src/com/android/settings/bluetooth/BluetoothTimeoutPreferenceController.java
diff --git a/res/values/arrays.xml b/res/values/arrays.xml
index 954e3047f57..8982867bb0e 100644
index b6fe89a9bce..8bc2d2a97e8 100644
--- a/res/values/arrays.xml
+++ b/res/values/arrays.xml
@@ -18,6 +18,50 @@
@ -67,7 +67,7 @@ index 954e3047f57..8982867bb0e 100644
<string-array name="screen_timeout_entries">
<item>15 seconds</item>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 9713adcc767..48b67197e77 100644
index bf2c65eefec..3f8e5f12cc6 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -27,6 +27,25 @@
@ -97,12 +97,12 @@ index 9713adcc767..48b67197e77 100644
<string name="device_info_default">Unknown</string>
<!-- String for removal of sensitive info on about, depending on tap -->
diff --git a/res/xml/connected_devices.xml b/res/xml/connected_devices.xml
index 1d2dd24e26c..24ba25f536e 100644
index 40ab145bc89..47ad1b67831 100644
--- a/res/xml/connected_devices.xml
+++ b/res/xml/connected_devices.xml
@@ -60,6 +60,14 @@
@@ -46,6 +46,14 @@
settings:useAdminDisabledSummary="true"
settings:controller="com.android.settings.connecteddevice.AddDevicePreferenceController"/>
settings:userRestriction="no_config_bluetooth" />
+ <androidx.preference.ListPreference
+ android:key="bluetooth_timeout"

View File

@ -12,7 +12,7 @@ Subject: [PATCH] add Wi-Fi timeout feature
create mode 100644 src/com/android/settings/wifi/WifiTimeoutPreferenceController.java
diff --git a/res/values/arrays.xml b/res/values/arrays.xml
index 8982867bb0e..085a33bc53f 100644
index 8bc2d2a97e8..99f52b499c2 100644
--- a/res/values/arrays.xml
+++ b/res/values/arrays.xml
@@ -62,6 +62,50 @@
@ -67,7 +67,7 @@ index 8982867bb0e..085a33bc53f 100644
<string-array name="screen_timeout_entries">
<item>15 seconds</item>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 48b67197e77..de8ed4718e4 100644
index 3f8e5f12cc6..9f0e7336f1d 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -46,6 +46,25 @@
@ -97,7 +97,7 @@ index 48b67197e77..de8ed4718e4 100644
<string name="device_info_default">Unknown</string>
<!-- String for removal of sensitive info on about, depending on tap -->
diff --git a/res/xml/wifi_configure_settings.xml b/res/xml/wifi_configure_settings.xml
index bf795d057d1..63ad940984f 100644
index 5866c5898d9..663e3109d76 100644
--- a/res/xml/wifi_configure_settings.xml
+++ b/res/xml/wifi_configure_settings.xml
@@ -26,6 +26,14 @@

View File

@ -12,10 +12,10 @@ Subject: [PATCH] add native debugging setting
create mode 100644 src/com/android/settings/security/NativeDebugPreferenceController.java
diff --git a/res/values/strings.xml b/res/values/strings.xml
index de8ed4718e4..8ad86f32445 100644
index 9f0e7336f1d..d9a023e091f 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -668,6 +668,9 @@
@@ -665,6 +665,9 @@
<string name="auto_reboot_title">Auto reboot</string>
<string name="auto_reboot_summary">Automatically reboot the device, if the phone hasn\'t been unlocked within the selected number of hours.</string>

View File

@ -12,10 +12,10 @@ Subject: [PATCH] add exec spawning toggle
create mode 100644 src/com/android/settings/security/ExecSpawnPreferenceController.java
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 8ad86f32445..2905e96d006 100644
index d9a023e091f..0b0f47c2ba3 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -668,6 +668,9 @@
@@ -665,6 +665,9 @@
<string name="auto_reboot_title">Auto reboot</string>
<string name="auto_reboot_summary">Automatically reboot the device, if the phone hasn\'t been unlocked within the selected number of hours.</string>

View File

@ -13,10 +13,10 @@ RANDOMIZATION_ALWAYS is set as the default option
5 files changed, 31 insertions(+), 9 deletions(-)
diff --git a/res/layout/wifi_network_config.xml b/res/layout/wifi_network_config.xml
index 77afedc3042..075b751e710 100644
index 3de1a38c3ea..52cc8cf9e74 100644
--- a/res/layout/wifi_network_config.xml
+++ b/res/layout/wifi_network_config.xml
@@ -694,7 +694,7 @@
@@ -707,7 +707,7 @@
android:layout_height="wrap_content"
style="@style/wifi_item_spinner"
android:prompt="@string/wifi_privacy_settings"
@ -26,10 +26,10 @@ index 77afedc3042..075b751e710 100644
<LinearLayout
diff --git a/res/values/arrays.xml b/res/values/arrays.xml
index 085a33bc53f..b3511593319 100644
index 99f52b499c2..a0030084801 100644
--- a/res/values/arrays.xml
+++ b/res/values/arrays.xml
@@ -1172,6 +1172,12 @@
@@ -1192,6 +1192,12 @@
<item>Treat as unmetered</item>
</string-array>
@ -42,7 +42,7 @@ index 085a33bc53f..b3511593319 100644
<string-array name="wifi_privacy_entries">
<item>Use randomized MAC (default)</item>
<item>Use device MAC</item>
@@ -1189,6 +1195,7 @@
@@ -1209,6 +1215,7 @@
</string-array>
<string-array name="wifi_privacy_values" translatable="false">
@ -51,7 +51,7 @@ index 085a33bc53f..b3511593319 100644
<item>0</item>
</string-array>
diff --git a/res/xml/wifi_network_details_fragment2.xml b/res/xml/wifi_network_details_fragment2.xml
index daff20f5a28..7c54ee1fc1d 100644
index 598f9d86173..fa1fa6cab61 100644
--- a/res/xml/wifi_network_details_fragment2.xml
+++ b/res/xml/wifi_network_details_fragment2.xml
@@ -94,7 +94,7 @@
@ -62,7 +62,7 @@ index daff20f5a28..7c54ee1fc1d 100644
+ android:entries="@array/wifi_privacy_entries_extended"
android:entryValues="@array/wifi_privacy_values"/>
<Preference
<com.android.settings.spa.preference.ComposePreference
diff --git a/src/com/android/settings/wifi/details2/WifiDetailPreferenceController2.java b/src/com/android/settings/wifi/details2/WifiDetailPreferenceController2.java
index b67c84832fb..e0c9ba89ab7 100644
--- a/src/com/android/settings/wifi/details2/WifiDetailPreferenceController2.java
@ -77,7 +77,7 @@ index b67c84832fb..e0c9ba89ab7 100644
? R.string.wifi_advanced_randomized_mac_address_title
: R.string.wifi_advanced_randomized_mac_address_disconnected_title;
diff --git a/src/com/android/settings/wifi/details2/WifiPrivacyPreferenceController2.java b/src/com/android/settings/wifi/details2/WifiPrivacyPreferenceController2.java
index 8c78e805d69..4ec97ba5f42 100644
index 5d393e54a21..504ec1f9dd5 100644
--- a/src/com/android/settings/wifi/details2/WifiPrivacyPreferenceController2.java
+++ b/src/com/android/settings/wifi/details2/WifiPrivacyPreferenceController2.java
@@ -17,6 +17,7 @@
@ -88,7 +88,7 @@ index 8c78e805d69..4ec97ba5f42 100644
import android.net.wifi.WifiManager;
import androidx.annotation.NonNull;
@@ -38,6 +39,10 @@ public class WifiPrivacyPreferenceController2 extends BasePreferenceController i
@@ -39,6 +40,10 @@ public class WifiPrivacyPreferenceController2 extends BasePreferenceController i
private final WifiManager mWifiManager;
private WifiEntry mWifiEntry;
@ -99,7 +99,7 @@ index 8c78e805d69..4ec97ba5f42 100644
public WifiPrivacyPreferenceController2(Context context) {
super(context, KEY_WIFI_PRIVACY);
@@ -93,8 +98,6 @@ public class WifiPrivacyPreferenceController2 extends BasePreferenceController i
@@ -94,8 +99,6 @@ public class WifiPrivacyPreferenceController2 extends BasePreferenceController i
return mWifiEntry.getPrivacy();
}
@ -108,7 +108,7 @@ index 8c78e805d69..4ec97ba5f42 100644
/**
* Returns preference index value.
@@ -103,8 +106,14 @@ public class WifiPrivacyPreferenceController2 extends BasePreferenceController i
@@ -104,8 +107,14 @@ public class WifiPrivacyPreferenceController2 extends BasePreferenceController i
* @return index value of preference
*/
public static int translateMacRandomizedValueToPrefValue(int macRandomized) {
@ -125,7 +125,7 @@ index 8c78e805d69..4ec97ba5f42 100644
}
/**
@@ -114,8 +123,14 @@ public class WifiPrivacyPreferenceController2 extends BasePreferenceController i
@@ -115,8 +124,14 @@ public class WifiPrivacyPreferenceController2 extends BasePreferenceController i
* @return mac randomized value
*/
public static int translatePrefValueToMacRandomizedValue(int prefMacRandomized) {

View File

@ -16,10 +16,10 @@ Change-Id: Ic01a142722372d9d57f52947025cd9db23e58ef4
create mode 100644 src/com/android/settings/security/HostsPreferenceController.java
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 2905e96d006..1ad831e1b7e 100644
index 0b0f47c2ba3..9afe2bd2a30 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -674,6 +674,9 @@
@@ -671,6 +671,9 @@
<string name="native_debug_title">Enable native code debugging</string>
<string name="native_debug_summary">Generate useful logs / bug reports from crashes and permit debugging native code.</string>

View File

@ -25,7 +25,7 @@ Change-Id: I8a762d0f29ac42fce3dcfc7189e8ff216a8f8d1a
create mode 100644 src/com/android/settings/network/ConnectivityCheckPreferenceController.java
diff --git a/res/values/arrays.xml b/res/values/arrays.xml
index b3511593319..bd9f5f06ae0 100644
index a0030084801..7aa5fec4487 100644
--- a/res/values/arrays.xml
+++ b/res/values/arrays.xml
@@ -157,6 +157,36 @@
@ -66,10 +66,10 @@ index b3511593319..bd9f5f06ae0 100644
These are shown in a list dialog. -->
<string-array name="lock_after_timeout_entries">
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 1ad831e1b7e..04722ef295b 100644
index 9afe2bd2a30..70ea886db71 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -12461,6 +12461,9 @@
@@ -12834,6 +12834,9 @@
<!-- [CHAR LIMIT=NONE] Hint for QR code process failure -->
<string name="bt_le_audio_qr_code_is_not_valid_format">QR code isn\u0027t a valid format</string>

View File

@ -14,10 +14,10 @@ Co-authored-by: flawedworld <flawedworld@flawed.world>
3 files changed, 30 insertions(+), 2 deletions(-)
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 04722ef295b..980ecbdbd9a 100644
index 70ea886db71..58e02007982 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -11097,6 +11097,8 @@
@@ -11340,6 +11340,8 @@
<string name="preferred_network_mode_cdma_evdo_gsm_wcdma_summary">Preferred network mode: CDMA/EvDo/GSM/WCDMA</string>
<!-- LTE [CHAR LIMIT=NONE] -->
<string name="preferred_network_mode_lte_summary">Preferred network mode: LTE </string>
@ -26,7 +26,7 @@ index 04722ef295b..980ecbdbd9a 100644
<!-- GSM/WCDMA/LTE [CHAR LIMIT=NONE] -->
<string name="preferred_network_mode_lte_gsm_wcdma_summary">Preferred network mode: GSM/WCDMA/LTE</string>
<!-- CDMA+LTE/EVDO [CHAR LIMIT=NONE] -->
@@ -11162,8 +11164,12 @@
@@ -11405,8 +11407,12 @@
<string name="network_4G_pure" translatable="false">4G</string>
<!-- Text for Network lte [CHAR LIMIT=NONE] -->
<string name="network_lte">LTE (recommended)</string>
@ -40,10 +40,10 @@ index 04722ef295b..980ecbdbd9a 100644
<string name="network_3G" translatable="false">3G</string>
<!-- Text for Network 2g [CHAR LIMIT=NONE] -->
diff --git a/src/com/android/settings/network/telephony/EnabledNetworkModePreferenceController.java b/src/com/android/settings/network/telephony/EnabledNetworkModePreferenceController.java
index 2a355adaae4..03d5f20f16f 100644
index 56ce9e7a301..0b4646cf413 100644
--- a/src/com/android/settings/network/telephony/EnabledNetworkModePreferenceController.java
+++ b/src/com/android/settings/network/telephony/EnabledNetworkModePreferenceController.java
@@ -95,7 +95,7 @@ public class EnabledNetworkModePreferenceController extends
@@ -101,7 +101,7 @@ public class EnabledNetworkModePreferenceController extends
CarrierConfigManager.KEY_HIDE_CARRIER_NETWORK_SETTINGS_BOOL)
|| carrierConfig.getBoolean(
CarrierConfigManager.KEY_HIDE_PREFERRED_NETWORK_TYPE_BOOL)) {
@ -52,7 +52,7 @@ index 2a355adaae4..03d5f20f16f 100644
} else if (carrierConfig.getBoolean(CarrierConfigManager.KEY_WORLD_PHONE_BOOL)) {
visible = false;
} else if (!isCallStateIdle()) {
@@ -290,6 +290,7 @@ public class EnabledNetworkModePreferenceController extends
@@ -305,6 +305,7 @@ public class EnabledNetworkModePreferenceController extends
}
void setPreferenceEntries() {
@ -60,7 +60,7 @@ index 2a355adaae4..03d5f20f16f 100644
mTelephonyManager = mTelephonyManager.createForSubscriptionId(mSubId);
clearAllEntries();
@@ -305,6 +306,7 @@ public class EnabledNetworkModePreferenceController extends
@@ -320,6 +321,7 @@ public class EnabledNetworkModePreferenceController extends
.addFormat(UiOptions.PresentFormat.addGlobalEntry);
break;
case ENABLED_NETWORKS_CDMA_NO_LTE_CHOICES:
@ -68,7 +68,7 @@ index 2a355adaae4..03d5f20f16f 100644
uiOptions = uiOptions
.setChoices(R.array.enabled_networks_cdma_no_lte_values)
.addFormat(UiOptions.PresentFormat.add3gEntry)
@@ -324,6 +326,7 @@ public class EnabledNetworkModePreferenceController extends
@@ -339,6 +341,7 @@ public class EnabledNetworkModePreferenceController extends
.addFormat(UiOptions.PresentFormat.add2gEntry);
break;
case ENABLED_NETWORKS_EXCEPT_GSM_LTE_CHOICES:
@ -76,7 +76,7 @@ index 2a355adaae4..03d5f20f16f 100644
uiOptions = uiOptions
.setChoices(R.array.enabled_networks_except_gsm_lte_values)
.addFormat(UiOptions.PresentFormat.add3gEntry);
@@ -341,6 +344,7 @@ public class EnabledNetworkModePreferenceController extends
@@ -356,6 +359,7 @@ public class EnabledNetworkModePreferenceController extends
.addFormat(UiOptions.PresentFormat.add3gEntry);
break;
case ENABLED_NETWORKS_EXCEPT_LTE_CHOICES:
@ -84,7 +84,7 @@ index 2a355adaae4..03d5f20f16f 100644
uiOptions = uiOptions
.setChoices(R.array.enabled_networks_except_lte_values)
.addFormat(UiOptions.PresentFormat.add3gEntry)
@@ -389,6 +393,11 @@ public class EnabledNetworkModePreferenceController extends
@@ -404,6 +408,11 @@ public class EnabledNetworkModePreferenceController extends
throw new IllegalArgumentException(
uiOptions.getType().name() + " index error.");
}
@ -96,7 +96,7 @@ index 2a355adaae4..03d5f20f16f 100644
// Compose options based on given values and formats.
IntStream.range(0, formatList.size()).forEach(entryIndex -> {
switch (formatList.get(entryIndex)) {
@@ -575,6 +584,9 @@ public class EnabledNetworkModePreferenceController extends
@@ -590,6 +599,9 @@ public class EnabledNetworkModePreferenceController extends
break;
}
case TelephonyManagerConstants.NETWORK_MODE_LTE_ONLY:
@ -106,7 +106,7 @@ index 2a355adaae4..03d5f20f16f 100644
case TelephonyManagerConstants.NETWORK_MODE_LTE_WCDMA:
if (!mIsGlobalCdma) {
setSelectedEntry(
@@ -840,6 +852,16 @@ public class EnabledNetworkModePreferenceController extends
@@ -855,6 +867,16 @@ public class EnabledNetworkModePreferenceController extends
mEntriesValue.add(value);
}

View File

@ -11,10 +11,10 @@ Subject: [PATCH] add a toggle for forcibly disabling SUPL
create mode 100644 src/com/android/settings/location/ForceDisableSuplPrefController.java
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 980ecbdbd9a..6b86c5a12bc 100644
index 58e02007982..aed5ad9020f 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -12470,6 +12470,9 @@
@@ -12843,6 +12843,9 @@
<string name="connectivity_check_title">Internet connectivity check</string>
<string name="connectivity_check_summary">HTTP endpoints to use for performing internet connectivity checks.</string>

View File

@ -16,10 +16,10 @@ Signed-off-by: Tad <tad@spotco.us>
create mode 100644 src/com/android/settings/security/SigSpoofPreferenceController.java
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 6b86c5a12bc..06ab1e345df 100644
index aed5ad9020f..5d99076843f 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -677,6 +677,9 @@
@@ -674,6 +674,9 @@
<string name="hosts_disable_title">Disable DNS content blocker</string>
<string name="hosts_disable_summary">Disables use of the included /etc/hosts database for data collection and malware blocking.</string>

View File

@ -16,10 +16,10 @@ Signed-off-by: Tad <tad@spotco.us>
create mode 100644 src/com/android/settings/security/OpenEuiccPreferenceController.java
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 06ab1e345df..2cfe705e467 100644
index 5d99076843f..44aacacb5a7 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -680,6 +680,9 @@
@@ -677,6 +677,9 @@
<string name="sig_spoof_title">Unprivileged microG enablement</string>
<string name="sig_spoof_summary">Allows official builds of microG apps to function. Not supported, not recommended. May break apps and/or degrade their security model. Notes: 1) microG connects directly to Google, 2) apps talking to microG do so using proprietary Google libraries, 3) microG can download/execute proprietary code from Google.</string>

View File

@ -0,0 +1,173 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Tad <tad@spotco.us>
Date: Wed, 20 Apr 2022 01:04:27 -0400
Subject: [PATCH] Add a toggle for CarrierConfig2 enablement
Copy and pasted from the GrapheneOS exec spawning toggle patch
TODO: MOVE OUT OF SECURITY CATEGORY
Change-Id: Ibea6ea9bed1c2ae3491f403d9e5c17c1d1c403f1
Signed-off-by: Tad <tad@spotco.us>
---
res/values/strings.xml | 3 +
res/xml/security_dashboard_settings.xml | 6 +
.../CarrierConfig2PreferenceController.java | 106 ++++++++++++++++++
.../settings/security/SecuritySettings.java | 1 +
4 files changed, 116 insertions(+)
create mode 100644 src/com/android/settings/security/CarrierConfig2PreferenceController.java
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 44aacacb5a7..4766f048364 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -680,6 +680,9 @@
<string name="openeuicc_title">Enable eUICC management</string>
<string name="openeuicc_summary">Enables the OpenEUICC app to allow management of virtual (eSIM) and physical eUICC cards. Reboot required after toggling.</string>
+ <string name="carrierconfig2_title">Enable CarrierConfig2</string>
+ <string name="carrierconfig2_summary">Use a larger Google database instead of the AOSP database for carrier specific configurations. May improve cellular network compatibility &amp; functionality. Requires reboot.</string>
+
<!-- Text shown for summary of owner info setting (if none set) [CHAR LIMIT=40]-->
<string name="owner_info_settings_summary">None</string>
<!-- Hint text shown in owner info edit text [CHAR LIMIT=50] -->
diff --git a/res/xml/security_dashboard_settings.xml b/res/xml/security_dashboard_settings.xml
index de90cec5bcc..d8766ab41a3 100644
--- a/res/xml/security_dashboard_settings.xml
+++ b/res/xml/security_dashboard_settings.xml
@@ -98,6 +98,12 @@
android:title="@string/openeuicc_title"
android:summary="@string/openeuicc_summary"
android:persistent="false" />
+
+ <SwitchPreference
+ android:key="carrierconfig2"
+ android:title="@string/carrierconfig2_title"
+ android:summary="@string/carrierconfig2_summary"
+ android:persistent="false" />
</PreferenceCategory>
<Preference
diff --git a/src/com/android/settings/security/CarrierConfig2PreferenceController.java b/src/com/android/settings/security/CarrierConfig2PreferenceController.java
new file mode 100644
index 00000000000..a3e5aa17591
--- /dev/null
+++ b/src/com/android/settings/security/CarrierConfig2PreferenceController.java
@@ -0,0 +1,106 @@
+/*
+ * Copyright (C) 2022 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
+ */
+
+package com.android.settings.security;
+
+import android.content.Context;
+
+import android.os.UserHandle;
+import android.os.UserManager;
+import android.os.SystemProperties;
+
+import android.provider.Settings;
+
+import androidx.preference.Preference;
+import androidx.preference.PreferenceCategory;
+import androidx.preference.PreferenceGroup;
+import androidx.preference.PreferenceScreen;
+import androidx.preference.TwoStatePreference;
+import androidx.preference.SwitchPreference;
+
+import com.android.internal.widget.LockPatternUtils;
+import com.android.settings.core.PreferenceControllerMixin;
+import com.android.settingslib.core.AbstractPreferenceController;
+import com.android.settingslib.core.lifecycle.events.OnResume;
+
+public class CarrierConfig2PreferenceController extends AbstractPreferenceController
+ implements PreferenceControllerMixin, OnResume, Preference.OnPreferenceChangeListener {
+
+ private static final String SYS_KEY_CARRIERCONFIG2_ENABLE = "persist.security.carrierconfig2";
+ private static final String PREF_KEY_CARRIERCONFIG2_ENABLE = "carrierconfig2";
+ private static final String PREF_KEY_SECURITY_CATEGORY = "security_category";
+
+ private PreferenceCategory mSecurityCategory;
+ private SwitchPreference mCarrierConfig2Enable;
+ private boolean mIsAdmin;
+ private UserManager mUm;
+
+ public CarrierConfig2PreferenceController(Context context) {
+ super(context);
+ mUm = UserManager.get(context);
+ }
+
+ @Override
+ public void displayPreference(PreferenceScreen screen) {
+ super.displayPreference(screen);
+ mSecurityCategory = screen.findPreference(PREF_KEY_SECURITY_CATEGORY);
+ updatePreferenceState();
+ }
+
+ @Override
+ public boolean isAvailable() {
+ mIsAdmin = mUm.isAdminUser();
+ return mIsAdmin;
+ }
+
+ @Override
+ public String getPreferenceKey() {
+ return PREF_KEY_CARRIERCONFIG2_ENABLE;
+ }
+
+ // TODO: should we use onCreatePreferences() instead?
+ private void updatePreferenceState() {
+ if (mSecurityCategory == null) {
+ return;
+ }
+
+ if (mIsAdmin) {
+ mCarrierConfig2Enable = (SwitchPreference) mSecurityCategory.findPreference(PREF_KEY_CARRIERCONFIG2_ENABLE);
+ mCarrierConfig2Enable.setChecked(SystemProperties.getInt(SYS_KEY_CARRIERCONFIG2_ENABLE, 0) == 1);
+ } else {
+ mSecurityCategory.removePreference(mSecurityCategory.findPreference(PREF_KEY_CARRIERCONFIG2_ENABLE));
+ }
+ }
+
+ @Override
+ public void onResume() {
+ updatePreferenceState();
+ if (mCarrierConfig2Enable != null) {
+ boolean mode = mCarrierConfig2Enable.isChecked();
+ SystemProperties.set(SYS_KEY_CARRIERCONFIG2_ENABLE, mode ? "1" : "0");
+ }
+ }
+
+ @Override
+ public boolean onPreferenceChange(Preference preference, Object value) {
+ final String key = preference.getKey();
+ if (PREF_KEY_CARRIERCONFIG2_ENABLE.equals(key)) {
+ final boolean mode = !mCarrierConfig2Enable.isChecked();
+ SystemProperties.set(SYS_KEY_CARRIERCONFIG2_ENABLE, mode ? "1" : "0");
+ }
+ return true;
+ }
+}
diff --git a/src/com/android/settings/security/SecuritySettings.java b/src/com/android/settings/security/SecuritySettings.java
index ee9acc01f6b..c52bb957697 100644
--- a/src/com/android/settings/security/SecuritySettings.java
+++ b/src/com/android/settings/security/SecuritySettings.java
@@ -111,6 +111,7 @@ public class SecuritySettings extends DashboardFragment {
securityPreferenceControllers.add(new HostsPreferenceController(context));
securityPreferenceControllers.add(new SigSpoofPreferenceController(context));
securityPreferenceControllers.add(new OpenEuiccPreferenceController(context));
+ securityPreferenceControllers.add(new CarrierConfig2PreferenceController(context));
controllers.add(new PreferenceCategoryController(context, SECURITY_CATEGORY)
.setChildren(securityPreferenceControllers));
controllers.addAll(securityPreferenceControllers);

View File

@ -9,10 +9,10 @@ Subject: [PATCH] add an ability to disable non-system apps from the "App info"
1 file changed, 39 insertions(+), 2 deletions(-)
diff --git a/src/com/android/settings/applications/appinfo/AppButtonsPreferenceController.java b/src/com/android/settings/applications/appinfo/AppButtonsPreferenceController.java
index 03053fdeeb6..e0d2d2ee61c 100644
index b80de32cf86..b7bc37c2425 100644
--- a/src/com/android/settings/applications/appinfo/AppButtonsPreferenceController.java
+++ b/src/com/android/settings/applications/appinfo/AppButtonsPreferenceController.java
@@ -205,6 +205,15 @@ public class AppButtonsPreferenceController extends BasePreferenceController imp
@@ -206,6 +206,15 @@ public class AppButtonsPreferenceController extends BasePreferenceController imp
}
private class UninstallAndDisableButtonListener implements View.OnClickListener {
@ -28,7 +28,7 @@ index 03053fdeeb6..e0d2d2ee61c 100644
@Override
public void onClick(View v) {
@@ -236,8 +245,13 @@ public class AppButtonsPreferenceController extends BasePreferenceController imp
@@ -237,8 +246,13 @@ public class AppButtonsPreferenceController extends BasePreferenceController imp
mUserId);
if (admin != null && !uninstallBlockedBySystem) {
RestrictedLockUtils.sendShowAdminSupportDetailsIntent(mActivity, admin);
@ -43,7 +43,7 @@ index 03053fdeeb6..e0d2d2ee61c 100644
showDialogInner(ButtonActionDialogFragment.DialogType.DISABLE);
} else {
mMetricsFeatureProvider.action(
@@ -468,6 +482,25 @@ public class AppButtonsPreferenceController extends BasePreferenceController imp
@@ -477,6 +491,25 @@ public class AppButtonsPreferenceController extends BasePreferenceController imp
}
mButtonsPref.setButton2Enabled(enabled);
@ -69,7 +69,7 @@ index 03053fdeeb6..e0d2d2ee61c 100644
}
/**
@@ -491,7 +524,9 @@ public class AppButtonsPreferenceController extends BasePreferenceController imp
@@ -500,7 +533,9 @@ public class AppButtonsPreferenceController extends BasePreferenceController imp
@VisibleForTesting
void updateForceStopButton() {
@ -80,7 +80,7 @@ index 03053fdeeb6..e0d2d2ee61c 100644
// User can't force stop device admin.
Log.w(TAG, "User can't force stop device admin");
updateForceStopButtonInner(false /* enabled */);
@@ -516,6 +551,7 @@ public class AppButtonsPreferenceController extends BasePreferenceController imp
@@ -525,6 +560,7 @@ public class AppButtonsPreferenceController extends BasePreferenceController imp
@VisibleForTesting
void updateForceStopButtonInner(boolean enabled) {
@ -88,7 +88,7 @@ index 03053fdeeb6..e0d2d2ee61c 100644
if (mAppsControlDisallowedBySystem) {
mButtonsPref.setButton3Enabled(false);
} else {
@@ -530,6 +566,7 @@ public class AppButtonsPreferenceController extends BasePreferenceController imp
@@ -539,6 +575,7 @@ public class AppButtonsPreferenceController extends BasePreferenceController imp
Uri packageUri = Uri.parse("package:" + packageName);
Intent uninstallIntent = new Intent(Intent.ACTION_UNINSTALL_PACKAGE, packageUri);
uninstallIntent.putExtra(Intent.EXTRA_UNINSTALL_ALL_USERS, allUsers);

View File

@ -127,10 +127,10 @@ index 974bd15..0632e32 100644
if (mSupportsKeyDisabler) {
final Bundle myPageBundle = mSetupWizardApp.getSettingsBundle();
diff --git a/src/org/lineageos/setupwizard/SetupWizardApp.java b/src/org/lineageos/setupwizard/SetupWizardApp.java
index 34b8b1b..2aa217c 100644
index d635bfa..0a7aa36 100644
--- a/src/org/lineageos/setupwizard/SetupWizardApp.java
+++ b/src/org/lineageos/setupwizard/SetupWizardApp.java
@@ -36,7 +36,6 @@ public class SetupWizardApp extends Application {
@@ -37,7 +37,6 @@ public class SetupWizardApp extends Application {
public static final String EXTRA_PREFS_SET_BACK_TEXT = "extra_prefs_set_back_text";
public static final String EXTRA_ENABLE_NEXT_ON_CONNECT = "wifi_enable_next_on_connect";
@ -139,7 +139,7 @@ index 34b8b1b..2aa217c 100644
public static final String ENABLE_RECOVERY_UPDATE = "enable_recovery_update";
public static final String UPDATE_RECOVERY_PROP = "persist.vendor.recovery_update";
diff --git a/src/org/lineageos/setupwizard/util/SetupWizardUtils.java b/src/org/lineageos/setupwizard/util/SetupWizardUtils.java
index 7b10a1f..99f0156 100644
index fb10760..83a2257 100644
--- a/src/org/lineageos/setupwizard/util/SetupWizardUtils.java
+++ b/src/org/lineageos/setupwizard/util/SetupWizardUtils.java
@@ -20,7 +20,6 @@ import static com.google.android.setupcompat.util.ResultCodes.RESULT_SKIP;
@ -150,7 +150,7 @@ index 7b10a1f..99f0156 100644
import static org.lineageos.setupwizard.SetupWizardApp.LOGV;
import static org.lineageos.setupwizard.SetupWizardApp.NAVIGATION_OPTION_KEY;
import static org.lineageos.setupwizard.SetupWizardApp.UPDATE_RECOVERY_PROP;
@@ -195,7 +194,6 @@ public class SetupWizardUtils {
@@ -190,7 +189,6 @@ public class SetupWizardUtils {
Settings.Secure.TV_USER_SETUP_COMPLETE, 1);
}
@ -158,7 +158,7 @@ index 7b10a1f..99f0156 100644
handleNavKeys(context);
handleRecoveryUpdate();
handleNavigationOption();
@@ -293,17 +291,6 @@ public class SetupWizardUtils {
@@ -270,17 +268,6 @@ public class SetupWizardUtils {
enabledState, DONT_KILL_APP);
}

View File

@ -50,7 +50,7 @@ index 83ef5b3bd2..a10c0f5365 100644
android:key="pref_desktop_show_labels"
android:title="@string/desktop_show_labels"
diff --git a/src/com/android/launcher3/InvariantDeviceProfile.java b/src/com/android/launcher3/InvariantDeviceProfile.java
index 6e03a40ce2..65708a349e 100644
index 9cf38eee18..738bbe134c 100644
--- a/src/com/android/launcher3/InvariantDeviceProfile.java
+++ b/src/com/android/launcher3/InvariantDeviceProfile.java
@@ -94,10 +94,13 @@ public class InvariantDeviceProfile implements OnSharedPreferenceChangeListener
@ -67,7 +67,7 @@ index 6e03a40ce2..65708a349e 100644
// Constants that affects the interpolation curve between statically defined device profile
// buckets.
private static final float KNEARESTNEIGHBOR = 3;
@@ -356,6 +359,8 @@ public class InvariantDeviceProfile implements OnSharedPreferenceChangeListener
@@ -357,6 +360,8 @@ public class InvariantDeviceProfile implements OnSharedPreferenceChangeListener
@Override
public void onSharedPreferenceChanged(SharedPreferences prefs, String key) {
switch (key) {

View File

@ -178,7 +178,7 @@ index 3494947..7a7f7cf 100644
}
}
diff --git a/app/src/main/java/org/lineageos/updater/download/HttpURLConnectionClient.java b/app/src/main/java/org/lineageos/updater/download/HttpURLConnectionClient.java
index b9c4b5d..b94fff0 100644
index 6306761..eace948 100644
--- a/app/src/main/java/org/lineageos/updater/download/HttpURLConnectionClient.java
+++ b/app/src/main/java/org/lineageos/updater/download/HttpURLConnectionClient.java
@@ -18,12 +18,16 @@ package org.lineageos.updater.download;
@ -376,7 +376,7 @@ index c1b4356..93f1bfc 100644
android:id="@+id/preferences_auto_delete_updates"
android:layout_width="match_parent"
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index b59cea4..841be10 100644
index 744d46f..eb80934 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -79,6 +79,7 @@

View File

@ -176,7 +176,7 @@ index 287c221..777c8ef 100644
+ </string-array>
</resources>
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 841be10..7f59845 100644
index eb80934..cd892b2 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -79,6 +79,11 @@

View File

@ -31,10 +31,10 @@ Change-Id: I5926493864d4b1291ae83f8b601bf5dcc54085cd
create mode 100644 hosts_cache.h
diff --git a/Android.bp b/Android.bp
index 4047527d..31f16ca7 100644
index 7d60d768..24a2a34e 100644
--- a/Android.bp
+++ b/Android.bp
@@ -238,6 +238,7 @@ cc_library {
@@ -243,6 +243,7 @@ cc_library {
"getaddrinfo.cpp",
"gethnamaddr.cpp",
"sethostent.cpp",
@ -633,7 +633,7 @@ index 00000000..55138dcb
+
+#endif
diff --git a/sethostent.cpp b/sethostent.cpp
index a9b0de6e..d19ab461 100644
index 1bd8ab4c..0bc71870 100644
--- a/sethostent.cpp
+++ b/sethostent.cpp
@@ -43,6 +43,8 @@
@ -654,6 +654,6 @@ index a9b0de6e..d19ab461 100644
+ return (rc == NETDB_SUCCESS ? 0 : EAI_NODATA);
+ }
+
// TODO: Wrap the 'hf' into a RAII class or std::shared_ptr and modify the
// sethostent_r()/endhostent_r() to get rid of manually endhostent_r(&hf) everywhere.
FILE* hf = NULL;
sethostent_r(&hf);
if (hf == NULL) {

View File

@ -8,7 +8,7 @@ Subject: [PATCH] avoid reusing DHCP state for full MAC randomization
1 file changed, 28 insertions(+), 1 deletion(-)
diff --git a/src/android/net/dhcp/DhcpClient.java b/src/android/net/dhcp/DhcpClient.java
index b0bac047..e5e79362 100644
index e4156983..76dcafc0 100644
--- a/src/android/net/dhcp/DhcpClient.java
+++ b/src/android/net/dhcp/DhcpClient.java
@@ -75,6 +75,9 @@ import android.net.metrics.IpConnectivityLog;

View File

@ -11,10 +11,10 @@ integrate better with the new camera and microphone indicators.
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/PermissionController/src/com/android/permissioncontroller/permission/utils/KotlinUtils.kt b/PermissionController/src/com/android/permissioncontroller/permission/utils/KotlinUtils.kt
index 5e850f887..3ebec4fd4 100644
index 2aad0154b..16c6d5aa9 100644
--- a/PermissionController/src/com/android/permissioncontroller/permission/utils/KotlinUtils.kt
+++ b/PermissionController/src/com/android/permissioncontroller/permission/utils/KotlinUtils.kt
@@ -198,7 +198,7 @@ object KotlinUtils {
@@ -197,7 +197,7 @@ object KotlinUtils {
DeviceConfig.getBoolean(
DeviceConfig.NAMESPACE_PRIVACY,
PROPERTY_LOCATION_INDICATORS_ENABLED,

View File

@ -12,10 +12,10 @@ Co-authored-by: renlord <me@renlord.com>
4 files changed, 18 insertions(+), 5 deletions(-)
diff --git a/framework/api/current.txt b/framework/api/current.txt
index 40d2765497..8566ca7fc7 100644
index ccdd8a7daa..fa4017bf3c 100644
--- a/framework/api/current.txt
+++ b/framework/api/current.txt
@@ -172,6 +172,7 @@ package android.net.wifi {
@@ -174,6 +174,7 @@ package android.net.wifi {
method @Deprecated public void writeToParcel(android.os.Parcel, int);
field @Deprecated public String BSSID;
field @Deprecated public String FQDN;
@ -24,10 +24,10 @@ index 40d2765497..8566ca7fc7 100644
field @Deprecated public static final int RANDOMIZATION_NONE = 0; // 0x0
field @Deprecated public static final int RANDOMIZATION_NON_PERSISTENT = 2; // 0x2
diff --git a/framework/java/android/net/wifi/WifiConfiguration.java b/framework/java/android/net/wifi/WifiConfiguration.java
index 0b63780ca2..0ead2c76c0 100644
index 88582dde76..0d4e3fcc38 100644
--- a/framework/java/android/net/wifi/WifiConfiguration.java
+++ b/framework/java/android/net/wifi/WifiConfiguration.java
@@ -1856,7 +1856,8 @@ public class WifiConfiguration implements Parcelable {
@@ -1865,7 +1865,8 @@ public class WifiConfiguration implements Parcelable {
RANDOMIZATION_NONE,
RANDOMIZATION_PERSISTENT,
RANDOMIZATION_NON_PERSISTENT,
@ -37,7 +37,7 @@ index 0b63780ca2..0ead2c76c0 100644
public @interface MacRandomizationSetting {}
/**
@@ -1880,16 +1881,22 @@ public class WifiConfiguration implements Parcelable {
@@ -1889,16 +1890,22 @@ public class WifiConfiguration implements Parcelable {
*/
public static final int RANDOMIZATION_AUTO = 3;
@ -63,10 +63,10 @@ index 0b63780ca2..0ead2c76c0 100644
/**
* Set the MAC randomization setting for this network.
diff --git a/service/java/com/android/server/wifi/WifiConfigManager.java b/service/java/com/android/server/wifi/WifiConfigManager.java
index ec6359f900..143f8b98e2 100644
index d2f26183c3..e758344204 100644
--- a/service/java/com/android/server/wifi/WifiConfigManager.java
+++ b/service/java/com/android/server/wifi/WifiConfigManager.java
@@ -491,6 +491,10 @@ public class WifiConfigManager {
@@ -492,6 +492,10 @@ public class WifiConfigManager {
* @return
*/
public boolean shouldUseNonPersistentRandomization(WifiConfiguration config) {
@ -77,7 +77,7 @@ index ec6359f900..143f8b98e2 100644
if (!isMacRandomizationSupported()
|| config.macRandomizationSetting == WifiConfiguration.RANDOMIZATION_NONE) {
return false;
@@ -640,7 +644,8 @@ public class WifiConfigManager {
@@ -641,7 +645,8 @@ public class WifiConfigManager {
private MacAddress updateRandomizedMacIfNeeded(WifiConfiguration config) {
boolean shouldUpdateMac = config.randomizedMacExpirationTimeMs
< mClock.getWallClockMillis() || mClock.getWallClockMillis()
@ -88,10 +88,10 @@ index ec6359f900..143f8b98e2 100644
return config.getRandomizedMacAddress();
}
diff --git a/service/java/com/android/server/wifi/WifiConfigurationUtil.java b/service/java/com/android/server/wifi/WifiConfigurationUtil.java
index a1bfb7a9cb..c6ca8766d7 100644
index 501a071b34..fb73e08a02 100644
--- a/service/java/com/android/server/wifi/WifiConfigurationUtil.java
+++ b/service/java/com/android/server/wifi/WifiConfigurationUtil.java
@@ -265,7 +265,7 @@ public class WifiConfigurationUtil {
@@ -271,7 +271,7 @@ public class WifiConfigurationUtil {
public static boolean hasMacRandomizationSettingsChanged(WifiConfiguration existingConfig,
WifiConfiguration newConfig) {
if (existingConfig == null) {

View File

@ -0,0 +1,39 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Tavi <tavi@divested.dev>
Date: Tue, 25 Jun 2024 02:39:28 -0400
Subject: [PATCH] Runtime control of platform carrier config package
Change-Id: I8cc8f2bda264bd42fe83d5c96fa6382e63a88410
Signed-off-by: Tavi <tavi@divested.dev>
---
src/com/android/phone/CarrierConfigLoader.java | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/src/com/android/phone/CarrierConfigLoader.java b/src/com/android/phone/CarrierConfigLoader.java
index d565c4911..8444847eb 100644
--- a/src/com/android/phone/CarrierConfigLoader.java
+++ b/src/com/android/phone/CarrierConfigLoader.java
@@ -47,6 +47,7 @@ import android.os.PersistableBundle;
import android.os.Process;
import android.os.RemoteException;
import android.os.ResultReceiver;
+import android.os.SystemProperties;
import android.os.UserHandle;
import android.preference.PreferenceManager;
import android.service.carrier.CarrierIdentifier;
@@ -708,8 +709,13 @@ public class CarrierConfigLoader extends ICarrierConfigLoader.Stub {
@NonNull FeatureFlags featureFlags) {
super(PermissionEnforcer.fromContext(context));
mContext = context;
- mPlatformCarrierConfigPackage =
- mContext.getString(R.string.platform_carrier_config_package);
+ if (SystemProperties.getBoolean("persist.security.carrierconfig2", false)) {
+ mPlatformCarrierConfigPackage = "app.grapheneos.carrierconfig2";
+ } else {
+ //mPlatformCarrierConfigPackage = "com.android.carrierconfig";
+ mPlatformCarrierConfigPackage =
+ mContext.getString(R.string.platform_carrier_config_package);
+ }
mHandler = new ConfigHandler(looper);
IntentFilter systemEventsFilter = new IntentFilter();

View File

@ -12,10 +12,10 @@ Change-Id: I46e3fc4ac896a509ab8ca90ae4ce09b820da434b
2 files changed, 14 insertions(+), 3 deletions(-)
diff --git a/init/first_stage_init.cpp b/init/first_stage_init.cpp
index e48fa1554..43edd67fa 100644
index c4d0f758d..dfa37532e 100644
--- a/init/first_stage_init.cpp
+++ b/init/first_stage_init.cpp
@@ -333,9 +333,9 @@ int FirstStageMain(int argc, char** argv) {
@@ -334,9 +334,9 @@ int FirstStageMain(int argc, char** argv) {
CHECKCALL(mkdir("/dev/pts", 0755));
CHECKCALL(mkdir("/dev/socket", 0755));
CHECKCALL(mkdir("/dev/dm-user", 0755));
@ -27,7 +27,7 @@ index e48fa1554..43edd67fa 100644
#undef MAKE_STR
// Don't expose the raw commandline to unprivileged processes.
CHECKCALL(chmod("/proc/cmdline", 0440));
@@ -347,7 +347,7 @@ int FirstStageMain(int argc, char** argv) {
@@ -348,7 +348,7 @@ int FirstStageMain(int argc, char** argv) {
android::base::ReadFileToString("/proc/bootconfig", &bootconfig);
gid_t groups[] = {AID_READPROC};
CHECKCALL(setgroups(arraysize(groups), groups));
@ -37,10 +37,10 @@ index e48fa1554..43edd67fa 100644
CHECKCALL(mknod("/dev/kmsg", S_IFCHR | 0600, makedev(1, 11)));
diff --git a/rootdir/init.rc b/rootdir/init.rc
index eb67c8cd0..0a8dd41f1 100644
index 92e8f27ba..b03cca5e8 100644
--- a/rootdir/init.rc
+++ b/rootdir/init.rc
@@ -310,6 +310,17 @@ on init
@@ -320,6 +320,17 @@ on init
write /proc/sys/kernel/sched_wakeup_granularity_ns 2000000
write /proc/sys/kernel/sched_child_runs_first 0

View File

@ -9,10 +9,10 @@ Signed-off-by: anupritaisno1 <www.anuprita804@gmail.com>
1 file changed, 6 insertions(+)
diff --git a/rootdir/init.rc b/rootdir/init.rc
index 0a8dd41f1..f261ebe49 100644
index b03cca5e8..7250b2ac3 100644
--- a/rootdir/init.rc
+++ b/rootdir/init.rc
@@ -1231,6 +1231,12 @@ on property:perf.drop_caches=3
@@ -1247,6 +1247,12 @@ on property:perf.drop_caches=3
on property:net.tcp_def_init_rwnd=*
write /proc/sys/net/ipv4/tcp_default_init_rwnd ${net.tcp_def_init_rwnd}

View File

@ -9,10 +9,10 @@ Signed-off-by: anupritaisno1 <www.anuprita804@gmail.com>
1 file changed, 2 insertions(+)
diff --git a/rootdir/init.rc b/rootdir/init.rc
index f261ebe49..1c6826f68 100644
index 7250b2ac3..4083c92ad 100644
--- a/rootdir/init.rc
+++ b/rootdir/init.rc
@@ -1121,6 +1121,8 @@ on boot
@@ -1137,6 +1137,8 @@ on boot
symlink /sys/class/block/${dev.mnt.dev.data} /dev/sys/block/by-name/userdata
symlink /sys/class/block/${dev.mnt.rootdisk.data} /dev/sys/block/by-name/rootdisk

View File

@ -12,10 +12,10 @@ Signed-off-by: anupritaisno1 <www.anuprita804@gmail.com>
1 file changed, 2 insertions(+), 12 deletions(-)
diff --git a/libfscrypt/fscrypt.cpp b/libfscrypt/fscrypt.cpp
index 174cecad..a28f988f 100644
index 4c756b18..16f81847 100644
--- a/libfscrypt/fscrypt.cpp
+++ b/libfscrypt/fscrypt.cpp
@@ -228,18 +228,8 @@ bool ParseOptionsForApiLevel(unsigned int first_api_level, const std::string& op
@@ -235,18 +235,8 @@ bool ParseOptionsForApiLevel(unsigned int first_api_level, const std::string& op
}
}

View File

@ -103,7 +103,7 @@ index c0a15f767..26213b258 100644
genfscon proc /sys/fs/suid_dumpable u:object_r:proc_security:s0
genfscon proc /sys/kernel/bpf_ u:object_r:proc_bpf:s0
diff --git a/private/genfs_contexts b/private/genfs_contexts
index 41c60df06..19083cef2 100644
index e4baeeeda..c27fa76cc 100644
--- a/private/genfs_contexts
+++ b/private/genfs_contexts
@@ -41,7 +41,9 @@ genfscon proc /sysrq-trigger u:object_r:proc_sysrq:s0

View File

@ -259,10 +259,10 @@ index a399b3aeb..05e8443c1 100644
allow init dev_type:blk_file r_file_perms;
allowxperm init dev_type:blk_file ioctl BLKROSET;
diff --git a/private/domain.te b/private/domain.te
index 2f107dde0..77f09d959 100644
index 66bce05e2..7e2af14f3 100644
--- a/private/domain.te
+++ b/private/domain.te
@@ -203,6 +203,7 @@ neverallow {
@@ -233,6 +233,7 @@ neverallow {
# with other UIDs to these allowlisted domains.
neverallow {
domain
@ -271,7 +271,7 @@ index 2f107dde0..77f09d959 100644
userdebug_or_eng(`-llkd')
-dumpstate
diff --git a/private/genfs_contexts b/private/genfs_contexts
index 19083cef2..393d8a6c7 100644
index c27fa76cc..421c5b748 100644
--- a/private/genfs_contexts
+++ b/private/genfs_contexts
@@ -79,6 +79,7 @@ genfscon proc /sys/kernel/sched_wakeup_granularity_ns u:object_r:proc_sched:s0
@ -283,10 +283,10 @@ index 19083cef2..393d8a6c7 100644
genfscon proc /sys/net/core/bpf_ u:object_r:proc_bpf:s0
genfscon proc /sys/vm/dirty_background_ratio u:object_r:proc_dirty:s0
diff --git a/public/init.te b/public/init.te
index 29dd42d43..08f9a7075 100644
index 47b8603b5..a10a96852 100644
--- a/public/init.te
+++ b/public/init.te
@@ -156,6 +156,9 @@ allow init self:global_capability_class_set sys_time;
@@ -157,6 +157,9 @@ allow init self:global_capability_class_set sys_time;
allow init self:global_capability_class_set { sys_rawio mknod };

View File

@ -89,7 +89,7 @@ index 433144e4e..66f7bab41 100644
persist.logd. u:object_r:logd_prop:s0
ro.logd. u:object_r:logd_prop:s0
diff --git a/private/property_contexts b/private/property_contexts
index 5bd75ee14..6b5506bc4 100644
index 1e4330ed0..92b1f9c2e 100644
--- a/private/property_contexts
+++ b/private/property_contexts
@@ -59,6 +59,7 @@ persist.nfc. u:object_r:nfc_prop:s0

View File

@ -33,7 +33,7 @@ export -f scanWorkspaceForMalware;
buildDevice() {
cd "$DOS_BUILD_BASE";
if [[ -d "$DOS_SIGNING_KEYS/$1" ]]; then
breakfast "lineage_$1-ap1a-user" && mka target-files-package otatools && processRelease $1 true $2;
breakfast "lineage_$1-ap2a-user" && mka target-files-package otatools && processRelease $1 true $2;
else
echo -e "\e[0;31mNo signing keys available for $1\e[0m";
fi;

View File

@ -69,7 +69,7 @@ applyPatch "$DOS_PATCHES/android_bionic/0001-HM-Runtime_Control-3.patch"; #Suppo
applyPatch "$DOS_PATCHES/android_bionic/0001-HM-Workaround-1.patch"; #Disable hardened_malloc for Pixel camera provider service (GrapheneOS)
applyPatch "$DOS_PATCHES/android_bionic/0001-HM-Workaround-2.patch"; #Disable hardened_malloc for surfaceflinger (GrapheneOS)
applyPatch "$DOS_PATCHES/android_bionic/0001-HM-No_GWP_ASan.patch"; #Never enable GWP-ASan (GrapheneOS)
applyPatch "$DOS_PATCHES/android_bionic/0002-Graphene_Bionic_Hardening-1.patch"; #Add a real explicit_bzero implementation (GrapheneOS) #TODO REBASE
applyPatch "$DOS_PATCHES/android_bionic/0002-Graphene_Bionic_Hardening-1.patch"; #Add a real explicit_bzero implementation (GrapheneOS)
#applyPatch "$DOS_PATCHES/android_bionic/0002-Graphene_Bionic_Hardening-2.patch"; #Replace brk and sbrk with stubs (GrapheneOS) #XXX: some vendor blobs use sbrk
#applyPatch "$DOS_PATCHES/android_bionic/0002-Graphene_Bionic_Hardening-3.patch"; #Use blocking getrandom and avoid urandom fallback (GrapheneOS) #XXX: some kernels do not have (working) getrandom
applyPatch "$DOS_PATCHES/android_bionic/0002-Graphene_Bionic_Hardening-4.patch"; #Fix undefined out-of-bounds accesses in sched.h (GrapheneOS)
@ -103,7 +103,6 @@ fi;
if enterAndClear "build/soong"; then
applyPatch "$DOS_PATCHES/android_build_soong/0001-Enable_fwrapv.patch"; #Use -fwrapv at a minimum (GrapheneOS)
applyPatch "$DOS_PATCHES/android_build_soong/0002-hm_available.patch"; #(GrapheneOS)
fi;
if enterAndClear "external/chromium-webview"; then
@ -114,6 +113,15 @@ if enterAndClear "external/conscrypt"; then
applyPatch "$DOS_PATCHES/android_external_conscrypt/0001-constify_JNINativeMethod.patch"; #Constify JNINativeMethod tables (GrapheneOS)
fi;
if enterAndClear "external/expat"; then
applyPatch "$DOS_PATCHES/android_external_expat/0001-lib-Detect-integer-overflow-in-function-nextScaffold.patch";
applyPatch "$DOS_PATCHES/android_external_expat/0002-lib-Reject-negative-len-for-XML_ParseBuffer.patch";
applyPatch "$DOS_PATCHES/android_external_expat/0003-tests-Cover-len-0-for-both-XML_Parse-and-XML_ParseBu.patch";
applyPatch "$DOS_PATCHES/android_external_expat/0004-doc-Document-that-XML_Parse-XML_ParseBuffer-reject-l.patch";
applyPatch "$DOS_PATCHES/android_external_expat/0005-lib-Detect-integer-overflow-in-dtdCopy.patch";
applyPatch "$DOS_PATCHES/android_external_expat/0006-lib-xmlparse.c-Detect-billion-laughs-attack-with-iso.patch";
fi;
if enterAndClear "external/hardened_malloc"; then
applyPatch "$DOS_PATCHES_COMMON/android_external_hardened_malloc/0001-Broken_Cameras-1.patch"; #Workarounds for Pixel 3 SoC era camera driver bugs (GrapheneOS)
applyPatch "$DOS_PATCHES_COMMON/android_external_hardened_malloc/0001-Broken_Cameras-2.patch"; #Expand workaround to all camera executables (DivestOS)
@ -123,26 +131,25 @@ sed -i -e '76,78d;' Android.bp; #fix compile under A13
fi;
if enterAndClear "frameworks/base"; then
git revert --no-edit 32602dc51dc88664133eaa905bee62ed20c40c43; #Reverts "JobScheduler: Respect allow-in-power-save perm" in favor of below patch
git revert --no-edit f9b5586a3887e70aa5580f8073611826eed2b88f; #Reverts "Remove sensitive info from SUPL requests" in favor of below patch
git revert --no-edit 18f3b5a2615efe61636ff952b500b19d891bdc80; #Reverts "fixup! Allow signature spoofing for microG Companion/Services" in favor of below patch
git revert --no-edit 6b793fa98a40dd6c2d6eb02988161ed123439428; #Reverts "Allow signature spoofing for microG Companion/Services" in favor of below patch
applyPatch "$DOS_PATCHES/android_frameworks_base/revert-6b793fa9.patch"; #Reverts "Allow signature spoofing for microG Companion/Services" in favor of below patch
applyPatch "$DOS_PATCHES/android_frameworks_base/0007-Always_Restict_Serial.patch"; #Always restrict access to Build.SERIAL (GrapheneOS)
applyPatch "$DOS_PATCHES/android_frameworks_base/0008-Browser_No_Location.patch"; #Don't grant location permission to system browsers (GrapheneOS)
applyPatch "$DOS_PATCHES/android_frameworks_base/0003-SUPL_No_IMSI.patch"; #Don't send IMSI to SUPL (MSe1969)
applyPatch "$DOS_PATCHES/android_frameworks_base/0004-Fingerprint_Lockout.patch"; #Enable fingerprint lockout after five failed attempts (GrapheneOS)
applyPatch "$DOS_PATCHES/android_frameworks_base/0005-User_Logout.patch"; #Enable secondary user logout support by default (GrapheneOS)
applyPatch "$DOS_PATCHES/android_frameworks_base/0005-User_Logout-a1.patch"; #Fix DevicePolicyManager#logoutUser() never succeeding (GrapheneOS)
applyPatch "$DOS_PATCHES/android_frameworks_base/0013-Special_Permissions-1.patch"; #Support new special runtime permissions (GrapheneOS)
applyPatch "$DOS_PATCHES/android_frameworks_base/0013-Special_Permissions-2.patch"; #Make INTERNET into a special runtime permission (GrapheneOS)
applyPatch "$DOS_PATCHES/android_frameworks_base/0013-Special_Permissions-3.patch"; #Add special runtime permission for other sensors (GrapheneOS)
applyPatch "$DOS_PATCHES/android_frameworks_base/0013-Special_Permissions-4.patch"; #Infrastructure for spoofing self permission checks (GrapheneOS)
applyPatch "$DOS_PATCHES/android_frameworks_base/0013-Special_Permissions-5.patch"; #App-side infrastructure for special runtime permissions (GrapheneOS)
applyPatch "$DOS_PATCHES/android_frameworks_base/0013-Special_Permissions-6.patch"; #Improve compatibility of INTERNET special runtime permission (GrapheneOS)
applyPatch "$DOS_PATCHES/android_frameworks_base/0013-Special_Permissions-7.patch"; #Mark UserHandle#get{Uid, UserId} as module SystemApi (GrapheneOS)
applyPatch "$DOS_PATCHES/android_frameworks_base/0013-Special_Permissions-8.patch"; #Improve compatibility with revoked INTERNET in DownloadManager (GrapheneOS)
applyPatch "$DOS_PATCHES/android_frameworks_base/0013-Special_Permissions-9.patch"; #Ignore pid when spoofing permission checks (GrapheneOS)
applyPatch "$DOS_PATCHES/android_frameworks_base/0013-Special_Permissions-10.patch"; #srt permissions: don't auto-grant denied ones when permissions are reset (GrapheneOS)
#applyPatch "$DOS_PATCHES/android_frameworks_base/0013-Special_Permissions-1.patch"; #Support new special runtime permissions (GrapheneOS)
#applyPatch "$DOS_PATCHES/android_frameworks_base/0013-Special_Permissions-2.patch"; #Make INTERNET into a special runtime permission (GrapheneOS)
#applyPatch "$DOS_PATCHES/android_frameworks_base/0013-Special_Permissions-3.patch"; #Add special runtime permission for other sensors (GrapheneOS)
#applyPatch "$DOS_PATCHES/android_frameworks_base/0013-Special_Permissions-4.patch"; #Infrastructure for spoofing self permission checks (GrapheneOS) #TODO: 21REBASE
#applyPatch "$DOS_PATCHES/android_frameworks_base/0013-Special_Permissions-5.patch"; #App-side infrastructure for special runtime permissions (GrapheneOS)
#applyPatch "$DOS_PATCHES/android_frameworks_base/0013-Special_Permissions-6.patch"; #Improve compatibility of INTERNET special runtime permission (GrapheneOS)
#applyPatch "$DOS_PATCHES/android_frameworks_base/0013-Special_Permissions-7.patch"; #Mark UserHandle#get{Uid, UserId} as module SystemApi (GrapheneOS)
#applyPatch "$DOS_PATCHES/android_frameworks_base/0013-Special_Permissions-8.patch"; #Improve compatibility with revoked INTERNET in DownloadManager (GrapheneOS)
#applyPatch "$DOS_PATCHES/android_frameworks_base/0013-Special_Permissions-9.patch"; #Ignore pid when spoofing permission checks (GrapheneOS)
#applyPatch "$DOS_PATCHES/android_frameworks_base/0013-Special_Permissions-10.patch"; #srt permissions: don't auto-grant denied ones when permissions are reset (GrapheneOS)
applyPatch "$DOS_PATCHES/android_frameworks_base/0014-Automatic_Reboot.patch"; #Timeout for reboot (GrapheneOS)
applyPatch "$DOS_PATCHES/android_frameworks_base/0015-System_Server_Extensions.patch"; #Timeout for Bluetooth (GrapheneOS)
applyPatch "$DOS_PATCHES/android_frameworks_base/0015-WiFi_Timeout.patch"; #Timeout for Wi-Fi (GrapheneOS)
@ -179,8 +186,7 @@ applyPatch "$DOS_PATCHES/android_frameworks_base/0031-appops_reset_fix-1.patch";
applyPatch "$DOS_PATCHES/android_frameworks_base/0031-appops_reset_fix-2.patch"; #appops: skip ops for invalid null package during state serialization (GrapheneOS)
applyPatch "$DOS_PATCHES/android_frameworks_base/0032-SUPL_Toggle.patch"; #Add a setting for forcibly disabling SUPL (GrapheneOS)
applyPatch "$DOS_PATCHES/android_frameworks_base/0033-Ugly_Orbot_Workaround.patch"; #Always add Briar and Tor Browser to Orbot's lockdown allowlist (CalyxOS)
applyPatch "$DOS_PATCHES/android_frameworks_base/0034-Allow_Disabling_NTP.patch"; #Dont ping ntp server when nitz time update is toggled off (GrapheneOS)
applyPatch "$DOS_PATCHES/android_frameworks_base/0035-System_JobScheduler_Allowance.patch"; #DeviceIdleJobsController: don't ignore whitelisted system apps (GrapheneOS)
#applyPatch "$DOS_PATCHES/android_frameworks_base/0034-Allow_Disabling_NTP.patch"; #Dont ping ntp server when nitz time update is toggled off (GrapheneOS)
applyPatch "$DOS_PATCHES/android_frameworks_base/0036-Unprivileged_microG_Handling.patch"; #Unprivileged microG handling (heavily based off of a CalyxOS patch)
applyPatch "$DOS_PATCHES/android_frameworks_base/0037-filter-gms.patch"; #Filter select package queries for GMS (CalyxOS)
applyPatch "$DOS_PATCHES/android_frameworks_base/0038-no-camera-lpad.patch"; #Do not auto-grant Camera permission to the eUICC LPA UI app (GrapheneOS)
@ -200,19 +206,15 @@ sed -i 's/DEFAULT_STRONG_AUTH_TIMEOUT_MS = 72 \* 60 \* 60 \* 1000;/DEFAULT_STRON
rm -rf packages/PrintRecommendationService; #Creates popups to install proprietary print apps
fi;
if enterAndClear "frameworks/ex"; then
applyPatch "$DOS_PATCHES/android_frameworks_ex/0001-constify_JNINativeMethod.patch"; #Constify JNINativeMethod tables (GrapheneOS)
fi;
if enterAndClear "frameworks/libs/systemui"; then
applyPatch "$DOS_PATCHES/android_frameworks_libs_systemui/0001-Icon_Cache.patch"; #Invalidate icon cache between OS releases (GrapheneOS)
fi;
if enterAndClear "frameworks/native"; then
applyPatch "$DOS_PATCHES/android_frameworks_native/0001-Sensors_Permission-1.patch"; #Require OTHER_SENSORS permission for sensors (GrapheneOS)
applyPatch "$DOS_PATCHES/android_frameworks_native/0001-Sensors_Permission-2.patch"; #Protect step sensors with OTHER_SENSORS permission for targetSdk<29 apps (GrapheneOS)
applyPatch "$DOS_PATCHES/android_frameworks_native/0001-Sensors_Permission-3.patch"; #Exempt system processes from OTHER_SENSORS permission enforcement (GrapheneOS)
fi;
#if enterAndClear "frameworks/native"; then
#applyPatch "$DOS_PATCHES/android_frameworks_native/0001-Sensors_Permission-1.patch"; #Require OTHER_SENSORS permission for sensors (GrapheneOS)
#applyPatch "$DOS_PATCHES/android_frameworks_native/0001-Sensors_Permission-2.patch"; #Protect step sensors with OTHER_SENSORS permission for targetSdk<29 apps (GrapheneOS)
#applyPatch "$DOS_PATCHES/android_frameworks_native/0001-Sensors_Permission-3.patch"; #Exempt system processes from OTHER_SENSORS permission enforcement (GrapheneOS)
#fi;
if [ "$DOS_DEBLOBBER_REMOVE_IMS" = true ]; then
if enterAndClear "frameworks/opt/net/ims"; then
@ -253,7 +255,7 @@ applyPatch "$DOS_PATCHES/android_hardware_qcom_audio/0001-Unused-sm8350.patch";
fi;
if enterAndClear "libcore"; then
applyPatch "$DOS_PATCHES/android_libcore/0001-Network_Permission.patch"; #Don't throw SecurityException when INTERNET permission is revoked (GrapheneOS)
#applyPatch "$DOS_PATCHES/android_libcore/0001-Network_Permission.patch"; #Don't throw SecurityException when INTERNET permission is revoked (GrapheneOS)
applyPatch "$DOS_PATCHES/android_libcore/0002-constify_JNINativeMethod.patch"; #Constify JNINativeMethod tables (GrapheneOS)
applyPatch "$DOS_PATCHES/android_libcore/0003-Exec_Based_Spawning-1.patch"; #Add exec-based spawning support (GrapheneOS)
applyPatch "$DOS_PATCHES/android_libcore/0003-Exec_Based_Spawning-2.patch";
@ -270,7 +272,7 @@ fi;
if enterAndClear "packages/apps/Contacts"; then
applyPatch "$DOS_PATCHES_COMMON/android_packages_apps_Contacts/0001-No_Google_Links.patch"; #Remove Privacy Policy and Terms of Service links (GrapheneOS)
applyPatch "$DOS_PATCHES_COMMON/android_packages_apps_Contacts/0002-No_Google_Backup.patch"; #Backups are not sent to Google (GrapheneOS)
applyPatch "$DOS_PATCHES_COMMON/android_packages_apps_Contacts/0003-Skip_Accounts.patch"; #Don't prompt to add account when creating a contact (CalyxOS)
#applyPatch "$DOS_PATCHES_COMMON/android_packages_apps_Contacts/0003-Skip_Accounts.patch"; #Don't prompt to add account when creating a contact (CalyxOS) #TODO: 21REBASE
applyPatch "$DOS_PATCHES_COMMON/android_packages_apps_Contacts/0004-No_GMaps.patch"; #Use common intent for directions instead of Google Maps URL (GrapheneOS)
fi;
@ -312,6 +314,7 @@ applyPatch "$DOS_PATCHES/android_packages_apps_Settings/0014-LTE_Only_Mode.patch
applyPatch "$DOS_PATCHES/android_packages_apps_Settings/0015-SUPL_Toggle.patch"; #Add a toggle for forcibly disabling SUPL (GrapheneOS)
applyPatch "$DOS_PATCHES/android_packages_apps_Settings/0016-microG_Toggle.patch"; #Add a toggle for microG enablement (heavily based off of a GrapheneOS patch)
if [ "$DOS_DEBLOBBER_REMOVE_EUICC_FULL" = false ]; then applyPatch "$DOS_PATCHES/android_packages_apps_Settings/0017-OpenEUICC_Toggle.patch"; fi; #Add a toggle for OpenEUICC enablement (heavily based off of a GrapheneOS patch)
if [ -d "$DOS_BUILD_BASE"/vendor/divested-carriersettings ]; then applyPatch "$DOS_PATCHES/android_packages_apps_Settings/0018-CC2_Toggle.patch"; fi; #Add a toggle for CarrierConfig2 enablement (heavily based off of a GrapheneOS patch)
applyPatch "$DOS_PATCHES/android_packages_apps_Settings/0018-disable_apps.patch"; #Add an ability to disable non-system apps from the "App info" screen (GrapheneOS)
fi;
@ -336,12 +339,12 @@ applyPatch "$DOS_PATCHES/android_packages_inputmethods_LatinIME/0001-Voice.patch
applyPatch "$DOS_PATCHES/android_packages_inputmethods_LatinIME/0002-Disable_Personalization.patch"; #Disable personalization dictionary by default (GrapheneOS)
fi;
if enterAndClear "packages/modules/Connectivity"; then
applyPatch "$DOS_PATCHES/android_packages_modules_Connectivity/0001-Network_Permission-1.patch"; #Enforce INTERNET permission per-uid instead of per-appId (GrapheneOS) #XXX: 21REBASE PROBABLY BROKEN
applyPatch "$DOS_PATCHES/android_packages_modules_Connectivity/0001-Network_Permission-2.patch"; #Don't crash INTERNET-unaware apps that try to access NsdManager (GrapheneOS)
applyPatch "$DOS_PATCHES/android_packages_modules_Connectivity/0001-Network_Permission-3.patch"; #ConnectivityManager: pretend that network is down to INTERNET-unaware callers (GrapheneOS)
applyPatch "$DOS_PATCHES/android_packages_modules_Connectivity/0001-Network_Permission-4.patch"; #Fixup! don't crash INTERNET-unaware apps that try to access NsdManager (GrapheneOS)
fi;
#if enterAndClear "packages/modules/Connectivity"; then
#applyPatch "$DOS_PATCHES/android_packages_modules_Connectivity/0001-Network_Permission-1.patch"; #Enforce INTERNET permission per-uid instead of per-appId (GrapheneOS) #XXX: 21REBASE PROBABLY BROKEN
#applyPatch "$DOS_PATCHES/android_packages_modules_Connectivity/0001-Network_Permission-2.patch"; #Don't crash INTERNET-unaware apps that try to access NsdManager (GrapheneOS)
#applyPatch "$DOS_PATCHES/android_packages_modules_Connectivity/0001-Network_Permission-3.patch"; #ConnectivityManager: pretend that network is down to INTERNET-unaware callers (GrapheneOS)
#applyPatch "$DOS_PATCHES/android_packages_modules_Connectivity/0001-Network_Permission-4.patch"; #Fixup! don't crash INTERNET-unaware apps that try to access NsdManager (GrapheneOS)
#fi;
if enterAndClear "packages/modules/DnsResolver"; then
applyPatch "$DOS_PATCHES/android_packages_modules_DnsResolver/0001-Hosts_Cache.patch"; #DnsResolver: Sort and cache hosts file data for fast lookup (tdm)
@ -355,8 +358,8 @@ applyPatch "$DOS_PATCHES/android_packages_modules_NetworkStack/0001-Random_MAC.p
fi;
if enterAndClear "packages/modules/Permission"; then
applyPatch "$DOS_PATCHES/android_packages_modules_Permission/0004-Special_Permissions-1.patch"; #Add special handling for INTERNET/OTHER_SENSORS (GrapheneOS)
applyPatch "$DOS_PATCHES/android_packages_modules_Permission/0004-Special_Permissions-2.patch"; #Fix usage UI summary for Network/Sensors (GrapheneOS)
#applyPatch "$DOS_PATCHES/android_packages_modules_Permission/0004-Special_Permissions-1.patch"; #Add special handling for INTERNET/OTHER_SENSORS (GrapheneOS)
#applyPatch "$DOS_PATCHES/android_packages_modules_Permission/0004-Special_Permissions-2.patch"; #Fix usage UI summary for Network/Sensors (GrapheneOS)
applyPatch "$DOS_PATCHES/android_packages_modules_Permission/0005-Browser_No_Location.patch"; #Stop auto-granting location to system browsers (GrapheneOS)
applyPatch "$DOS_PATCHES/android_packages_modules_Permission/0006-Location_Indicators.patch"; #SystemUI: Use new privacy indicators for location (GrapheneOS)
fi;
@ -369,6 +372,10 @@ if enterAndClear "packages/providers/DownloadProvider"; then
applyPatch "$DOS_PATCHES/android_packages_providers_DownloadProvider/0001-Network_Permission.patch"; #Expose the NETWORK permission (GrapheneOS)
fi;
if enterAndClear "packages/services/Telephony"; then
if [ -d "$DOS_BUILD_BASE"/vendor/divested-carriersettings ]; then applyPatch "$DOS_PATCHES/android_packages_services_Telephony/0001-CC2.patch"; fi; #Runtime control of platform carrier config package (DivestOS)
fi;
if enterAndClear "system/ca-certificates"; then
rm -rf files; #Remove old certs
cp -r "$DOS_PATCHES_COMMON/android_system_ca-certificates/files" .; #Copy the new ones into place