Commit Graph

9486 Commits

Author SHA1 Message Date
Zhi Dou
436f1368cd flush mmap file to disk after updating
The change was applied in the file in memory. Without explicitly calling
msync, there is no guarantee that the changes are written back to disk.
Thus the flag value may not be changed.

Bug: b/348693143
Test: atest aconfig_storage_write_api.test.cpp
aconfig_storage_write_api.test.rust

Change-Id: I8b1e0cbbb90bcb3c2e5bbf418a6a1a9cd047c81b
2024-06-24 21:14:52 +00:00
Jooyung Han
972804b81e Fix a bug in the releasetools common.py script.
The script was not breaking out of the loop when a handler was found, which could lead to multiple handlers being called for the same option.

This fixes the issue that a single option can be handled in two handlers.

Bug: 345402175
Test: sign_target_files_apks -k ..
Change-Id: I9f4ef801df99a4a0f2ba5be994b3f37fbedc22c0
2024-06-21 22:42:48 +00:00
Zhuoyao Zhang
d067588a26 Support uploading host_name info in the tool event logger
host_name info is useful in several use cases including
1) to distinguish the concurrent tool invocations from the same user.
2) to understand the potential different performance from different hosts (e.g. local workstation VS cloudtop).
3) required to integrate the tool event log with the EPR system.

Test: atest tool_event_logger_test
Bug: 348482213

Change-Id: I98422b3f8ccec73d57fcdcdedac91780c448dc47
2024-06-21 21:03:03 +00:00
Jakub Czapiga
9de3473305 Merge "Drop legacy vboot support." into main 2024-06-19 07:32:35 +00:00
Treehugger Robot
8715d314e6 Merge "Support license information in SBOM writers library." into main 2024-06-18 20:41:52 +00:00
Wei Li
c6b4046787 Support license information in SBOM writers library.
Bug: 324465531
Test: CIs
Test: atest --host sbom_data_test sbom_writers_test
Test: build/soong/tests/sbom_test.sh
Change-Id: Iac2be2e65f308caabb11237e72dbdc6b047cfd55
2024-06-18 12:34:30 -07:00
Jakub Czapiga
31f6e08fc9 Drop legacy vboot support.
Bug: 291329969
Bug: 347885843
Bug: 347899892
Test: m
Test: CIs
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:5071b95a067c9392b7bfa4d95957307ff0ccdcc3)
Merged-In: I5f30f63553cc2670650897e259ba51baf8ced05d
Change-Id: I5f30f63553cc2670650897e259ba51baf8ced05d
2024-06-18 15:40:14 +00:00
Treehugger Robot
bb4e87008f Merge "aflags: Ensure <partition>/aconfig_flags.pb exists before reading" into main 2024-06-18 15:27:36 +00:00
Luca Stefani
bc962db1ea aflags: Ensure <partition>/aconfig_flags.pb exists before reading
In some build targets/combinations aconfig_flags.pb
may not be generated.

For example in GSI only system/aconfig_flags.pb exists
and system-only updates won't have vendor/aconfig_flags.pb.

Test: m, aflags
Change-Id: I136345a8748bc6d80bd98e673f90e0a2ab380ab1
2024-06-18 06:59:52 +00:00
Ted Bauer
6e11172c6b Add defaults target for shared linking
Add a defaults target that all targets linking to aconfig codegen with
the new storage API dependencies will need. The target takes the new
storage APIs conditionally behind a flag, so we can disable it easily.

In this topic, we add it to a single target to see that it builds and
adds the dependency. In follow-on CLs we can add it to the rest of the
targets.

Test: m audiopolicy_tests
Bug: 347701310
Change-Id: I67643205b283301f72c5466401060212b637388f
Merged-In: I67643205b283301f72c5466401060212b637388f
2024-06-17 21:16:51 +00:00
Xin Li
3ab9f3fdb9 Merge "Merge Android 14 QPR3 to AOSP main" into main 2024-06-17 18:51:26 +00:00
Ted Bauer
5223a70887 Add root check to aflags
aflags scans the apex/ dir, which requires root access to read.
Currently the command fails with "Error: Permission denied", which
doesn't tell the user how to fix the problem. This CL adds a more
descriptive error message.

Test: adb unroot && adb shell aflags list
Bug: 347692127
Change-Id: I98a7a1ba10ef52ec47035816fa66119ea84f281d
2024-06-17 15:25:02 +00:00
Steven Moreland
cffced3727 zipalign: succesful -> successful
Bugs: me
Change-Id: I6cc866b3d8765ed6ef553f2de80bba995bdbc095
Test: n/a
2024-06-11 17:07:44 +00:00
Mårten Kongstad
21d8395879 Merge changes from topic "check-flagged-apis-list-subcommand" into main am: ac9a2abad8
Original change: https://android-review.googlesource.com/c/platform/build/+/3121994

Change-Id: I42b6876b78e9369280b2737b82c5d04233faff77
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-06-11 12:51:22 +00:00
Mårten Kongstad
1692a36da7 check-flagged-apis: add list subcommand
Add a new subcommand to list all flagged APIs and corresponding flags.
This provides an overview of what flagged APIs exist in the Android
tree.

Bug: 345207706
Test: build/tools/check-flagged-apis/check-flagged-apis.sh list
Test: atest check-flagged-apis-test
Flag: EXEMPT host side tool
Change-Id: Icc224f3787480353baabbd3946f36f003f35db59
2024-06-11 13:11:28 +02:00
Mårten Kongstad
576e818880 check-flagged-apis: extract argument names into constants
Extract the command line argument names (and help texts) into constants.
This will allow future subcommands to re-use the same names and keep
things consistent.

Bug: 345207706
Test: atest check-flagged-apis-test
Flag: EXEMPT host side tool
Change-Id: I430f36c99f28aab8511a357f572086ee238d653b
2024-06-10 16:26:17 +02:00
Mårten Kongstad
d5ce20fc07 check-flagged-apis: add support for subcommands
The tool currently only supports a single subcommand, the "check"
command. Follow-up CLs will add new subcommands.

Bug: 345207706
Test: build/tools/check-flagged-apis/check-flagged-apis.sh
Flag: EXEMPT host side tool
Change-Id: I1aaaf313db8a10a7427aab378aac8d946d5a8a3d
2024-06-10 16:26:16 +02:00
Treehugger Robot
edbd06d8a4 Merge "aconfig: update java read api for performance" into main am: 910ad04d2f
Original change: https://android-review.googlesource.com/c/platform/build/+/3112419

Change-Id: I44714409822a6a37244b417e28c9993b37ad3a98
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-06-04 23:33:50 +00:00
Treehugger Robot
910ad04d2f Merge "aconfig: update java read api for performance" into main 2024-06-04 23:29:18 +00:00
Joe Onorato
070808646e Merge "Add new simplified lunch function (lunch2)" into main am: fc19715ebf
Original change: https://android-review.googlesource.com/c/platform/build/+/3101473

Change-Id: I1f41c20816e37c542468fc32da3bde4d2f380d38
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-06-04 23:26:13 +00:00
Joe Onorato
590ae9f785 Add new simplified lunch function (lunch2)
Includes tests for envsetup.sh

After we've tried this for a bit and are happy, this will be swapped out
to become the new standard lunch and all of the menus and stuff will be
removed.

Test: build/make/tools/envsetup/run_envsetup_tests
Change-Id: Idebeeb1153406238b6c32f3f564c7bc1e7ced7e6
2024-06-04 16:04:49 -07:00
Treehugger Robot
9830e817d6 Merge "Reland "check_elf_file: check prebuilts are aligned"" into main am: 69e8c9be5f
Original change: https://android-review.googlesource.com/c/platform/build/+/3110301

Change-Id: I53a7274547eb1731191a5ea4690d4627926f9e13
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-06-04 21:47:36 +00:00
Steven Moreland
52c2371ae8 Reland "check_elf_file: check prebuilts are aligned"
This reverts commit 411fb17537.

Reason for revert: reland after other targets are fixed b/342466032

Bug: 342466032
Test: build, w/ and w/o checking enabled

Change-Id: I830166faffec781cf6cc4fea47140a60b0a12466
2024-06-04 17:26:12 +00:00
Dennis Shen
a8e28dfe87 aconfig: update java read api for performance
With this update, cold flag read (first flag in a namespace) is now 6x
faster compared to device config.

Bug: b/321077378
Test: atest -c
Change-Id: I52ffd897fdd487b2a44d07be50f2975f0ef5b9b3
2024-06-04 17:24:53 +00:00
Priyanka Advani
9b6857d6f8 Merge "Revert "check_elf_file: check prebuilts are aligned"" into main am: 8d5b8c1f98
Original change: https://android-review.googlesource.com/c/platform/build/+/3110411

Change-Id: I25ab04d528185a17f3f82b089b1292a97a9d65fd
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-31 22:37:38 +00:00
Priyanka Advani
8d5b8c1f98 Merge "Revert "check_elf_file: check prebuilts are aligned"" into main 2024-05-31 22:27:08 +00:00
Priyanka Advani
411fb17537 Revert "check_elf_file: check prebuilts are aligned"
This reverts commit 432bd660dc.

Reason for revert: Droidmonitor created revert due to breakage in b/344033120

Change-Id: I40f3e1becf3e7d944fdc868bd4000d7602db1d15
2024-05-31 22:14:22 +00:00
Steven Moreland
b716e006ed Merge "check_elf_file: check prebuilts are aligned" into main am: 26bb2346de
Original change: https://android-review.googlesource.com/c/platform/build/+/3101471

Change-Id: I29118e75b78ccfbfcc1b69640d0f2078804e21d0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-31 22:11:13 +00:00
Steven Moreland
26bb2346de Merge "check_elf_file: check prebuilts are aligned" into main 2024-05-31 22:02:55 +00:00
Dennis Shen
845de05ab4 Merge "aconfig: create first implementation of aconfig storage java read api" into main am: ca6602821b
Original change: https://android-review.googlesource.com/c/platform/build/+/3106837

Change-Id: I9c8280841afb2153c7e716ceea4947026744129a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-30 22:36:10 +00:00
Steven Moreland
432bd660dc check_elf_file: check prebuilts are aligned
WARNING: two things still need to be done
1. this should probably only be enabled when PAGE_SIZE
   is undefined, but I'm curious what other targets
   break now.
2. we may need a per-prebuilt way to disable this,
   like some of the other settings here.

For prebuilts added onto a device, we can check the
page alignment matches the one declared in the build
configuration.

Bug: 342466032
Test: manually, by changing the script to require 64 KB
  alignment, I was able to see its errors on new targets.
Change-Id: Ic118245e64d67204bf5fa740a3e1afb7325b34f5
2024-05-30 17:31:08 +00:00
Dennis Shen
e5dd91bca7 aconfig: create first implementation of aconfig storage java read api
1, See AconfigStorageReadAPI.java to see java APIs to map storage files
and read flag values. It is using fast native annotation, in theory it
should be faster than regular JNI without much of the overhead.

2, The java api calls into Rust wrapper in srcs/lib.rs, note that
MappedByteBuffer is not copied during JNI. In the rust side
implementation we get the underlying raw pointer and buffer size and
reconstruct a rust slice. However, at current implmentation, the string
input such as package name and flag name are most likely copied. They
are converted from JStirng to JavaStr first without copy, then the
into() call to convert it to Rust string. We could potentially optimize
it to without copy.

3, Add an android_test target to lock down the API behaviors.

Bug: b/321077378
Test: atest -c
Change-Id: I8915fe70e8eb341be563c70f85e19e644e8aa6be
2024-05-30 00:32:42 +00:00
Xin Li
2389748ddb Merge "Merge Android 24Q2 Release (ab/11526283) to aosp-main-future" into aosp-main-future 2024-05-24 21:16:16 +00:00
Treehugger Robot
58ab571b38 Merge "Add fs_config support for vendor_boot" into main 2024-05-24 19:31:07 +00:00
Treehugger Robot
078c1c95c9 Merge "Disable zucchini for all OTAs" into main 2024-05-24 19:03:06 +00:00
Kelvin Zhang
d4bdbdced6 Disable zucchini for all OTAs
zucchini failure in OTA is observed. To unblock, disable
zucchini first. After the investigation are done and determined
zucchini is safe to enable, we will turn it back on.

Test: th
Bug: 342523982
Change-Id: I79c245356a356389328c788b3b7977b224e1df6a
2024-05-24 11:02:54 -07:00
Xin Li
b04e9cc36f Merge Android 24Q2 Release (ab/11526283) to aosp-main-future
Bug: 337098550
Merged-In: I713a528d437e3446d32461add648e3b52b036d7a
Change-Id: I7fdd415a218d1425f7fc37095d02c674ddfae6eb
2024-05-24 08:30:06 -07:00
Ashok Mutyala
8a3e361ea4 Add fs_config support for vendor_boot
Test:
1) add META/vendor_boot_filesystem_config.txt to    merge_config_other_item_list
2)Building vendor_boot image from target_files

Change-Id: Ia983d1119e30c46a6730566c567f13e25a65b0ff
2024-05-24 14:09:28 +00:00
Cole Faust
9a6e468646 Update go.mod and go.work for go 1.22
Go 1.22 is more strict about GOPROXY=off, so we need to update the
go.work file to point at local copies of dependencies.

Bug: 330574836
Test: Presubmits
Change-Id: I37dbc821f138fe8977636316ebe3e7986ccdfa0e
2024-05-23 16:28:15 -07:00
Dennis Shen
a0624828b2 aconfig: remove read api lib's dependency on libbase and liblog
Bug: b/321077378
Test: atest -c
Change-Id: I0bc7780de2123021e1cc9f7a29ca3f7dabebcd40
2024-05-23 12:30:31 +00:00
Dennis Shen
7b09e95c89 Merge "aconfig: update storage read api" into main 2024-05-22 20:52:40 +00:00
Dennis Shen
70208daaaa aconfig: update storage read api
Bug: b/321077378
Test atest -c

Change-Id: I53fe6c34466f32d5283d0bdbf4736c8ecd20ef99
2024-05-22 19:25:35 +00:00
Dennis Shen
5590478580 aconfig: update storage read api
Update storage read api to not find storage file location from a pb
file, instead directly read from /metadata copy. Previously for
package.map and flag.map, we are reading from the respective RO
partition. Now we are reading from /metadata/maps dir. This has a few
advantages:

1, early flag availability, since /metadata can be mounted much earlier
than mainline modules, so it would make mainline flags availabile even
before mainline modules are mounted.

2, we no longer need to read from a pb file to find where package.map
and flag.map are. Thus the read api can be further simplified and
downsized. With this change, we are able to shrink the cc flag read api
lib size from 171k to 120k.

Bug: b/321077378
Test atest -c

Change-Id: Ic9086fe4c49c139a4d1c66a8d472023a88c9dd17
2024-05-22 19:25:17 +00:00
Treehugger Robot
802de330d3 Merge "add csv output to format_benchmarks" into main 2024-05-22 16:49:27 +00:00
Mårten Kongstad
aa41dac8d8 check-flagged-apis: make interfaces inherit from java/lang/Object
When parsing API signature files, check-flagged-apis relies on
ClassItem.superClass to get the parent class of a class or interface.
That method always returns null for interfaces.

When generating api-versions.xml, metalava marks interface classes as
inheriting from java/lang/Object:

  <class name="android/os/Parcelable" since="1">
    <extends name="java/lang/Object"/>
    [...]
  </class>

This confuses check-flagged-apis when comparing data parsed from both
sources, as the symbol signatures will be identical, but the superclass
entries differ. Work around this by explicitly marking all interfaces
as inheriting from java/lang/Object when parsing API signature files.

Bug: 334870672
Test: atest --host check-flagged-apis-test
Change-Id: Icbb8f7d4c3d4232a083289a778b347e33a0856ab
2024-05-22 15:13:54 +02:00
Joe Onorato
b9ff8e4205 add csv output to format_benchmarks
Test: format_benchmarks --csv
Bug: 316189534
Change-Id: I9a19861ed1ca6249c6e6ddbed0fcf9574f871d93
2024-05-20 14:23:00 -07:00
Joe Onorato
7963591826 Merge "The lunch benchmarks don't have targets, so don't fail." into main 2024-05-20 15:07:04 +00:00
Joe Onorato
159cc8c594 The lunch benchmarks don't have targets, so don't fail.
Bug: 316189534
Test: format_benchmarks
Change-Id: I5b37a99624801a9c8d5f43ded788c8f0721b45f8
2024-05-18 07:58:24 -07:00
Daniel Zheng
7a61f499be Merge changes Ibbed6cf9,I31b36b42 into main
* changes:
  ota_from_target_files: allow cow version override
  Add build configs for wearable tunables
2024-05-16 19:34:11 +00:00
Daniel Zheng
60922a45ef ota_from_target_files: allow cow version override
With our version compatibility check, overriding our cow version no
longer works. Updating this check to only apply if a command line
vabc_cow_version is not specified.

NOTE: the ota may not successfully apply, depending on device if we
override the cow version

Test: th
Change-Id: Ibbed6cf94cc2e91597d0c249dc8ade314b8341a2
2024-05-16 10:22:03 -07:00