summaryrefslogtreecommitdiff
path: root/tools
AgeCommit message (Collapse)Author
2025-03-24Fix: Replace modsFlagOnOrNone with mods in CachedProperty Piyush Singhania
Flag: EXEMPT bugfix Test: atest cached-property-annotation-processor-test Bug: 404520337 Change-Id: I4af8059635bbe1ddaa15bb198c612e4e599b08dd
2025-03-19Fix typo in aapt2 CLI --help Adam Soutar
Hi, just noticed this difference while reading through docs and then invoking `aapt2 --help` The updated spelling matches the public documentation for this CLI switch: https://developer.android.com/tools/aapt2 Change-Id: I37788ab78d7ec6df409b3aa2e1e365626a47ab72 Flag: EXEMPT log only update
2025-03-19Merge "Collect parsing errors to report them at the end" into main Treehugger Robot
2025-03-19Merge "Make protolog common srcs a library" into main Pablo Gamito
2025-03-19Merge "Format Android.bp files" into main Treehugger Robot
2025-03-18Collect parsing errors to report them at the end Pablo Gamito
Bug: 403564102 Flag: EXEMPT code processing tool changes Test: atest com.android.protolog.tool Change-Id: Idd3a0623d41b2ebd529ab1dc5e9781ec1165ca5b
2025-03-18Handle invalid protolog message format more gracefully Pablo Gamito
Will now throw error with the following prefix: 'Code processing error in MyFile.java:123' Bug: 403564102 Test: atest com.android.protolog.tool.ProtoLogCallProcessorImplTest Flag: EXEMPT minor error handling change Change-Id: Ifa7d566fae22d1bd2607a41e735113119bfbd7e0
2025-03-18Make protolog common srcs a library Pablo Gamito
This is so that we can import the platform annotations (specifically for the ravenwood annotations) as the library instead of the sources directly which are not visibile at this level. Flag: EXEMPT build rules only Change-Id: Iad6e03cc5924ba94941a1737e7a5a3a6bff8e2f1
2025-03-18Format Android.bp files Pablo Gamito
Flag: EXEMPT Andoid.bp format changes only Change-Id: I7770d5b3e404fbc544b63482df778dad4d64240c
2025-03-17Merge "Fix persisting which resources use feature flags" into main Jeremy Meyer
2025-03-14Fix persisting which resources use feature flags Jeremy Meyer
File resources get into the table a different way when they haven't been modified by the FlaggedXmlVersioner or XmlCompatVersioner and this addresses that path. With this change, during compile we now find if an xml resource uses flags and store that in the XmlResource which is then persisted to and retrieved from the proto. This means the FlaggedXmlVersioner doesn't have to look for them in the case that the file config or minsdk is >= baklava. This also moved the FeatureFlagsFilter to before we version the files. The FeatureFlagsFilter is what strips elements behind disabled read only flags at compile time and removed the featureFlag attribute when the element is behind an enabled read only flag. This is so that the FlaggedXmlVersioner doesn't have to worry if the flags it sees are read/write or readonly. It should only ever encounter read/write flags. Test: Automation Bug: 377974898 Flag: android.content.res.layout_readwrite_flags Change-Id: Ia6cbf55bc9f8d594eeb5c44c143565e93684ae2c
2025-03-12aapt2: Ensure sparse encoding isn't used on unsupported platforms Mark Punzalan
Current behavior: - When --enable-sparse-encoding is used, sparse encode when minSdkVersion is missing or is >= 32 (S_v2) - When --force-sparse-encoding is used, always sparse encode regardless of minSdkVersion New behavior: - When --enable-sparse-encoding is used, sparse encode when minSdkVersion is >= 32 (S_v2) - When --force-sparse-encoding is used, sparse encode when minSdkVersion is missing or is >= 32 (S_v2) Bug: 398187461 Test: build + boot on Pixel 6 Pro Flag: EXEMPT build tool Change-Id: Ide4e37f565107a33ecafc269ed81633e616b1a19
2025-03-06Persist whether xml resources have flags Jeremy Meyer
This stores whether an xml document has feature flags in it in a ResTable_entry so that at runtime we can know not to do extra work looking for flags. Test: Automation Bug: 377974898 Flag: android.content.res.layout_readwrite_flags Change-Id: Id43b2d9941d1fab8c654d081bf19df5a33a464f3
2025-03-04Fixes for Kotlin 2.1 Dave Mankoff
Replace appendln with appendLine to make Kotlin 2.1 happy. This fixes the following error when compiling with 2.1.10: ``` error: 'fun Appendable.appendln(value: CharSequence?): Appendable' is deprecated. Use appendLine instead. ``` Fix nullability in various usages of `com.google.common.truth.Subject.Factory`: - IgnoreableExpect - TransitionStateSubject - DpOffsetSubject Bug: 399463072 Test: m intdef-annotation-processor Change-Id: I11eadb3e26dd09bfc7b92c07ccad68f56f1ebba2
2025-03-04Merge "Fixes for Kotlin 2.1 in codegen_cli" into main Dave Mankoff
2025-03-04Fixes for Kotlin 2.1 in codegen_cli Dave Mankoff
Replace `toLowerCase()` with `lowercase`. Replace `appendln()` with `appendLine()`. Bug: 399463072 Flag: EXEMPT minor refactor Test: m out/soong/.intermediates/frameworks/base/tools/codegen/codegen_cli/linux_glibc_common/kotlin/codegen_cli.jar Change-Id: Iab0e484380d65f7b764c74c26bc592e65c567f0e
2025-03-03Merge "Cleanup python version properties" into main am: cdcb8e5383 am: ↵ Treehugger Robot
222618a85a Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/3518372 Change-Id: I39e4058d3ab82a29acfdcb24df216e1b8770c008 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2025-03-03Merge "Cleanup python version properties" into main am: cdcb8e5383 Treehugger Robot
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/3518372 Change-Id: I59ffc01740ae7f3f8e6eb530ad68e6dcec799775 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2025-02-28Cleanup python version properties Cole Faust
Now that python 2 is fully removed, there's no need for version-specific properties. Remove them. Also remove usages of embedded_launcher: true, as that is the new default value. Bug: 399954452 Test: Presubmits Change-Id: Ie0525d27ce70767c739079434a3d30c762632fdc
2025-02-27Merge 25Q1 (ab/12770256) to aosp-main-future Xin Li
Bug: 385190204 Merged-In: Ibc80f09d54bec2c83814874d94a8f8eb22b5075f Change-Id: If7779ae57fd91631d08bd8af5434c2ddd963aad7
2025-02-27Merge "[owners] Remove chiuwinson@google.com from tools/codegen/OWNERS" into ↵ Owner Cleanup Bot
main am: 6a4817356b am: 7949b3ef2f Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/3506657 Change-Id: I1f390770ebf8745b39ab4e9943a477029983844f Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2025-02-27Merge "[owners] Remove chiuwinson@google.com from tools/codegen/OWNERS" into ↵ Owner Cleanup Bot
main
2025-02-26Merge "[owners] Remove jsharkey@google.com from tools/lint/OWNERS" into main ↵ Ronald Braunstein
am: ab49afe6f4 am: 1d1fd5304b Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/3506557 Change-Id: I2882c2580387b72fa7972bca18284049feff912f Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2025-02-26Merge "[owners] Remove satayev@google.com from tools/hiddenapi/OWNERS" into ↵ Owner Cleanup Bot
main am: 5b8f1fdf52 am: e19c7ad34e Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/3506658 Change-Id: Ic7140610dca20bdbdfedbae8abee22196abad4ad Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2025-02-25[owners] Remove jsharkey@google.com from tools/lint/OWNERS Owner Cleanup Bot
This suggested change is automatically generated based on group memberships and affiliations. Please approve this change and vote the highest CR. This will keep the OWNERs file tidy. We ask that you do not ignore this change and approve it unless you know a reason the OWNER should remain. It can always be reverted if needed. If this change is in error, vote the lowest CR value (i.e. reject the CL) and the bot will abandon it. See the owner's recent review activity for context: https://android-review.googlesource.com/q/jsharkey@google.com To report an issue, file a bug in the Infra>Codereview component. Change-Id: I2b62f80fc2e80cce968d1649f45c7675eb3326be
2025-02-25Merge "Only have featureFlag attr in xml when v>baklava" into main Jeremy Meyer
2025-02-25Only have featureFlag attr in xml when v>baklava Jeremy Meyer
This makes it so that if there are xml files that use the featureFlag attribute they are split into a pre-B file where all flags are assumed false and a B version that is the file as is. Test: Automation Bug: 377974898 Flag: android.content.res.layout_readwrite_flags Change-Id: Iab1a69a6d0b3e7efd7033887c351430fb2aabd19
2025-02-25[owners] Remove satayev@google.com from tools/hiddenapi/OWNERS Owner Cleanup Bot
This suggested change is automatically generated based on group memberships and affiliations. Please approve this change and vote the highest CR. This will keep the OWNERs file tidy. We ask that you do not ignore this change and approve it unless you know a reason the OWNER should remain. It can always be reverted if needed. If this change is in error, vote the lowest CR value (i.e. reject the CL) and the bot will abandon it. See the owner's recent review activity for context: https://android-review.googlesource.com/q/satayev@google.com To report an issue, file a bug in the Infra>Codereview component. Change-Id: I41b029663ee7f2035d4223e0ff87d71db309d022
2025-02-25[owners] Remove chiuwinson@google.com from tools/codegen/OWNERS Owner Cleanup Bot
This suggested change is automatically generated based on group memberships and affiliations. Please approve this change and vote the highest CR. This will keep the OWNERs file tidy. We ask that you do not ignore this change and approve it unless you know a reason the OWNER should remain. It can always be reverted if needed. If this change is in error, vote the lowest CR value (i.e. reject the CL) and the bot will abandon it. See the owner's recent review activity for context: https://android-review.googlesource.com/q/chiuwinson@google.com To report an issue, file a bug in the Infra>Codereview component. Change-Id: I394cecca563d925ed7cd16a5a9389a05ee44f6d2
2025-02-24Merge "[owners] Remove ashleyrose@google.com from ↵ Aurimas Liutikas
tools/processors/view_inspector/OWNERS" into main am: 9df1b29025 am: 560afe0f38 Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/3506196 Change-Id: I8b5771c85de17d609bb44307d80cdcf6838a84d7 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2025-02-24[owners] Remove ashleyrose@google.com from ↵ Owner Cleanup Bot
tools/processors/view_inspector/OWNERS This suggested change is automatically generated based on group memberships and affiliations. Please approve this change and vote the highest CR. This will keep the OWNERs file tidy. We ask that you do not ignore this change and approve it unless you know a reason the OWNER should remain. It can always be reverted if needed. If this change is in error, vote the lowest CR value (i.e. reject the CL) and the bot will abandon it. See the owner's recent review activity for context: https://android-review.googlesource.com/q/ashleyrose@google.com To report an issue, file a bug in the Infra>Codereview component. Change-Id: Id2f0ce650993a7ff6599706a5547137fe70144fb
2025-02-20Add a test to verify that flags in resource paths must be readonly Jeremy Meyer
Test: this Flag: EXEMPT adding a test Change-Id: Idaefa542c03ab9ad7373ca4a1c53c98695a5b178
2025-02-19Merge "Add flag to not compress fonts in the APK" into main Shai Barack
2025-02-19Add flag to not compress fonts in the APK Shai Barack
Font assets can be mmap'ed if they're not compressed. This is much more efficient than decompressing them first. Bug: 395153140 Bug: 393177415 Flag: EXEMPT Aconfig not supported on host tools Change-Id: I7163746e05a637962d48c0c5a1eb47517435ebf7
2025-02-12[res] Small cleanup in aapt2 output + optimization Yurii Zubrytskyi
Don't print the header line when there are no flag-disabled items follow. + move the heavy string allocation to the tightest scope it is used in Test: manual Flag: EXEMPT bugfix Change-Id: I74902f5fb14b64f2ce3624e72d7774042441213b
2025-02-12Merge "[aapt2] Fix aapt2 diff for added/removed resources" into main Treehugger Robot
2025-02-11[aapt2] Fix aapt2 diff for added/removed resources Yurii Zubrytskyi
The old implementation used to iterate over both apks in parallel, making the whole output wrong as soon as they get out of sync because of an added or removed resource. New code performs a lookup for each resource, making it much less efficient (quadratic complexity), but actually produces useful output. Performance is enough to run a framework-res.apk diff in milliseconds - no need to make a lookup table. + print the output into STDOUT instead of STDERR, as it's supposed to be + add a --ignore-id-shift command line flag to skip printing differences in IDs if those are the only differences. Any added or removed resource will make all subsequent IDs change, making the output almost unusable Bug: 396020063 Flag: EXEMPT bugfix Test: manual on framework-res.apk Change-Id: I8d13038b5e4ddccd465393529e17809245c3b9ad
2025-02-07Merge "Revert "Always enable sparse encoding if minSdk >= 32"" into main Mark Punzalan
2025-02-07Revert "Always enable sparse encoding if minSdk >= 32" Mark Punzalan
This reverts commit c9c3150896e1b637df6c8ecc485cb0e3384448c7. Reason for revert: Sparse encoding got enabled for minSdk < 32 (b/395135057). Keeping the minor version bump to 2.20. Change-Id: I8e143038a2e2a59be84669787764a9bf69210cd0
2025-02-06Allow read/write flags on xml elements Jeremy Meyer
This changes aapt2 so that it now allows xml elements with the android:featureFlag attribute even when that attribute is read/write (or not found altogether). This also makes it so that attribute is removed when the flag is read only. Bug: 377974898 Test: Automated Flag: EXEMPT Aconfig not supported on host tools Change-Id: I330eefe897ab6dd1301b073d7f69443e3428b5b6
2025-02-05Merge "Add a script to ease submitting changes from internal trees to AOSP ↵ Treehugger Robot
Gerrit" into main am: 3f1d9ed28c am: da3efd630e Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/3479250 Change-Id: I9b8c935e91d7db0ec748130c5962b5f1f5a9ea3c Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2025-02-06Add a script to ease submitting changes from internal trees to AOSP Gerrit James Willcox
Bug: none Test: manual Change-Id: I5eb0f04888f777ecb1273de3777f8761e0a35df1
2025-01-31Merge "Add benchmarks for LocaleDataLookup" into main am: 533fa597f9 am: ↵ Treehugger Robot
8c1b836852 Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/3471369 Change-Id: I46d68a04b213a71d2c5a3b4dd7350a669d0fb17e Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2025-01-31Add benchmarks for LocaleDataLookup Victor Chang
on aosp_cf_x86_64_phone-userdebug, the benchmark result is libandroidfw_benchmarks#BM_LocaleDataLookupIsLocaleRepresentative: PASSED (0ms) cpu_time_ns: 55.07607273354898 real_time_ns: 55.19976479889459 libandroidfw_benchmarks#BM_LocaleDataLookupLikelyScript: PASSED (0ms) cpu_time_ns: 87.99205759931041 real_time_ns: 88.19010674954154 With the unordered_set and unordered_map, the result is libandroidfw_benchmarks#BM_LocaleDataLookupIsLocaleRepresentative: PASSED (0ms) cpu_time_ns: 113.01179143336402 real_time_ns: 113.3695957412614 libandroidfw_benchmarks#BM_LocaleDataLookupLikelyScript: PASSED (1ms) cpu_time_ns: 109.63471229710265 real_time_ns: 109.91545630537807 With std::binary_search, the result is libandroidfw_benchmarks#BM_LocaleDataLookupIsLocaleRepresentative: PASSED (0ms) cpu_time_ns: 123.82590108826805 real_time_ns: 123.98891085230711 Let's keep the current implementation, and add a TODO about the disk size. Bug: 383096413 Test: atest libandroidfw_benchmarks Change-Id: Iaa5f1ab5ac4dcc6bbdd3c4b66fe129c61d75c1d1
2025-01-23Treat resources without flags as disabled Linus Tufvesson
Also tweaked output to print out which flags finalized which resources (or didn't finalize them) Flag: EXEMPTE modifying a script used for finalization Bug: 376680864 Bug: 390120561 Test: frameworks/base/tools/aapt2/tools/finalize_res.py frameworks/base/core/res/res/values/public-staging.xml frameworks/base/core/res/res/values/public-final.xml Change-Id: Ie404481b0219091344750ba562fca7c12fbbf5fa
2025-01-23Merge "Make finalize_res flag aware" into main Linus Tufvesson
2025-01-22Make finalize_res flag aware Linus Tufvesson
This continues down the rabbit hole of using regex to parse the staging file. Modified finalize_item to be called directly with matches and return a tuple of strings that go in various places. It is a bit cryptic but so was the inline regex modification before too. The proper solution is to parse the xml and handle it. As it is now it is very brittle 1. "removed_" being a magic constant that the rest of the resource frameworks knows how to handle 2. It still doesn't handle proper xml and has strong assumptions about how the items are listed 3. There is lots of room for improving the python code :) It is however the path of least resistant right now to get finalization moving forward. Flag: EXEMPTE modifying a script used for finalization Bug: 390120561 Test: frameworks/base/tools/aapt2/tools/finalize_res.py frameworks/base/core/res/res/values/public-staging.xml frameworks/base/core/res/res/values/public-final.xml Change-Id: I8e3bda38a5229754fa679a79061527bc246d9e08
2025-01-21Merge "Adding multiuser pendingintent linting to default Android linting" ↵ Treehugger Robot
into main am: ddef60b612 am: 27047a29c9 Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/3416160 Change-Id: I17b1e4c9077fc60d700132441e00cacc2cea0f30 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2025-01-20B is 36. Linus Tufvesson
It's square! It's triangular! It might only be semiperfect, but it is the next Android release! Flag: EXEMPT Baklava Finalization Bug: 376680864 Test: presubmit Change-Id: I0647974b7b2696a46158e65e81c6890faf98c009
2025-01-17Adding multiuser pendingintent linting to default Android linting Nikhil Kumar
Creates a Lint warning for usages of `PendingIntent.getActivity`. This is a heuristic for identifying calls that may not be multiuser-aware, with the suggested solutions being using `PendingIntent.getActivityAsUser()`. Bug: 314301774 Change-Id: Id784435c436e172be99c6e5c390cebe1ddcf6697 Test: atest PendingIntentGetActivityDetectorTest -c Flags: EXEMPT lint check