Commit graph

9456 commits

Author SHA1 Message Date
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
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
Joe Onorato
5c9f86dcd8 Merge changes from topic "joeo_envsetup" into main
* changes:
  Clean cruft out of envsetup.sh.
  Provide a function in envsetup.sh to get the host arch directly
2024-05-15 18:40:12 +00:00
Ted Bauer
aeb96092af Add filter by container to aflags
Test: m -j120 && acloud create --local-image && adb shell aflags list --c system
Test: cargo t
Bug: 340840507
Change-Id: I5db7f204673accdbd3c4ad62e88b213028a8d5ab
2024-05-15 10:06:25 -04:00
Mark Punzalan
5529e36e88 Add a nano proto version of aconfig protos
Framework already has nano protos, and reusing them won't
introduce extra dependencies for the apps
This is setting up the resources flagging in the framework

Bug: 297373084
Test: Built with related changes
Change-Id: I518bd56f56c42e0adef0002e95f8948e0904fb43
2024-05-15 06:18:23 +00:00
Joe Onorato
2312475f66 Clean cruft out of envsetup.sh.
aninja and overrideflags moved to build/soong/bin

Bug: 340648588
Test: manual
Change-Id: I1d426b628f15674e142df4152661d3f4b9b56320
2024-05-14 15:12:53 -07:00
Ted Bauer
1f9d55d2ab Fix bug in device path proto reading
aconfig_device_paths uses `include_str!` to include a text file
containing comma-separated strings with each partition aconfig file.
The lib does not handle the escaped newlines and quotation marks.
Adds proper handling.

Test: cargo t  && m -j120 && acloud create --local-image && adb shell aflags list
Bug: 340514768
Change-Id: I75214bf02dd962d8291f1654ade8cbce1cda9fde
2024-05-14 15:49:14 -04:00
Dennis Shen
db0c8d7986 Merge "aconfig: simply proto" into main 2024-05-13 15:26:26 +00:00
Treehugger Robot
7c71d88e0b Merge "check-flagged-apis: handle nested flags" into main 2024-05-13 07:32:16 +00:00
Dennis Shen
a2fb60b822 aconfig: simply proto
Bug: b/339514174, b/312444587
Test: atest -c
Change-Id: I5511efd04af9f57b22e4c89bd2db65496aaf4398
2024-05-11 15:51:14 +00:00
Treehugger Robot
8211cb24a5 Merge "Replace impl ToString with impl Display" into main 2024-05-10 18:32:41 +00:00
Chris Wailes
e6bb2e951d Replace impl ToString with impl Display
If the Display interface is implemented the compiler will automatically
derive an implementation of ToString.

Test: m aflags
Bug: 333887339
Change-Id: I861a3065edbef0da1684a6ea28cc374acd0d774a
2024-05-09 15:14:22 -07:00
Dennis Shen
9d21525b85 Merge "aconfig: add list_flag api cxx interlop" into main 2024-05-09 21:13:17 +00:00
Dennis Shen
e1949a6563 aconfig: add list_flag api cxx interlop
Bug: 312444587
Test: atest -c
Change-Id: I3e3bc511c370fbcdfa6dcf7942377dd9b544c647
2024-05-09 17:37:36 +00:00
Treehugger Robot
67c90ed1e9 Merge "Reland "Fix retrofit OTA generation failures"" into main 2024-05-09 16:54:09 +00:00
Treehugger Robot
c0c2e5f278 Merge "Add a Java lib to read on-device proto paths" into main 2024-05-09 15:05:28 +00:00
Kelvin Zhang
13f0b68a8f Reland "Fix retrofit OTA generation failures"
This reverts commit 681597df18.

retrofit OTA generation relies on files in OTA/* , include these
files when copying target_files dir to tmp location.

Test: th
Bug: 337043530
Fixes: 337043530

Change-Id: Id9bb1cddcf992556923a17fd3f9b5e41eac7ca96
2024-05-08 18:14:41 -07:00
Kelvin Zhang
e41c75cb83 Merge "Revert "Fix retrofit OTA generation failures"" into main 2024-05-08 20:37:41 +00:00
Kelvin Zhang
681597df18 Revert "Fix retrofit OTA generation failures"
This reverts commit 7af14aa7da.

Reason for revert: b/339483257

Change-Id: I86cf6c0baed8697ace888135b3d66b4785d22aa5
2024-05-08 20:10:22 +00:00
Ted Bauer
3cf7c0a2c0 Add a Java lib to read on-device proto paths
Bug: 337911453
Test: m aconfig_on_device_protos_java
Change-Id: Iac8d671acee070ed041927028ec80c7aa371bd61

Change-Id: I19e0e52d8de71207c9858305e6248b6251a20989
2024-05-08 16:05:00 -04:00
Dennis Shen
015de62d7a Merge "aconfig: make MutableMappedStorageFiles inherit MappedStoargeFiles" into main 2024-05-08 18:55:00 +00:00
Treehugger Robot
9a78be4d42 Merge "Fix retrofit OTA generation failures" into main 2024-05-08 17:35:43 +00:00
Kelvin Zhang
7af14aa7da Fix retrofit OTA generation failures
retrofit OTA generation relies on files in OTA/* , include these
files when copying target_files dir to tmp location.

Test: th
Bug: 337043530
Fixes: 337043530
Change-Id: I8fd7729bc1b2d2797f7e76f594b06fd9675fa104
2024-05-08 09:28:40 -07:00
Mårten Kongstad
0d44e721ed check-flagged-apis: handle nested flags
Consider

  @FlaggedApi(FLAG_OUTER) Clazz {
      @FlaggedApi(FLAG_INNER) method();
  }

If FLAG_OUTER is disabled, any class members are ignored. Teach
check-flagged-apis to recognize this and stop reporting false positives.

Bug: 339183637
Test: atest --host check-flagged-apis-test
Change-Id: Ie6799e952dc33874c1239231f841d7dfd947c7ce
2024-05-08 13:30:58 +02:00
Dennis Shen
d772eb3edc aconfig: make MutableMappedStorageFiles inherit MappedStoargeFiles
Bug: b/321077378
Test: atest -c
Change-Id: Ib052df74bf79b5bc2a0f8c793701e3ff18f4aa30
2024-05-07 15:28:09 +00:00
Treehugger Robot
64dac049a6 Merge "check-flagged-apis: consider superclasses when looking up symbol" into main 2024-05-07 14:18:20 +00:00
Dennis Shen
260663ddfc Merge "aconfig: update storage file mapping api" into main 2024-05-07 14:10:47 +00:00
Mårten Kongstad
5413a1e55d Merge "check-flagged-apis: record super class when parsing classes" into main 2024-05-07 13:52:21 +00:00
Treehugger Robot
4925954a79 Merge changes Ia6dfcfa8,I8d93c230,I4db7ff47,I003535c7,I8c0619fa into main
* changes:
  check-flagged-apis: consider interfaces when looking up symbol
  check-flagged-apis: skip self-referential interfaces
  check-flagged-apis: record interfaces when parsing classes
  check-flagged-apis: add more details to Symbol class
  check-flagged-apis: api-versions.xml: correctly parse nested class ctor
2024-05-07 13:42:25 +00:00
Mårten Kongstad
e812039036 check-flagged-apis: consider superclasses when looking up symbol
If a symbol can't be found in a class, (recursively) check the class'
superclass before reporting the symbol as missing.

Bug: 334870672
Test: atest --host check-flagged-apis-test
Change-Id: I8ef1fbfcc51e0c5ba00959536c087213d688fe39
2024-05-07 13:28:54 +02:00
Mårten Kongstad
c3f05a6d92 check-flagged-apis: record super class when parsing classes
Extend ClassSymbol with a nullable reference to the class' superclass.

Bug: 334870672
Test: atest --host check-flagged-apis-test
Change-Id: Ia2741a4d7fb5de908a03ef640f5fcd38d0ce0e28
2024-05-07 13:28:53 +02:00
Mårten Kongstad
d2c707613e check-flagged-apis: consider interfaces when looking up symbol
When searching for potential errors, if a symbol can't be found in the
api-verions.xml data, check if it is present in any of the class'
interfaces.

A follow-up CL will add similar logic to handle super classes.

Bug: 334870672
Test: atest --host check-flagged-apis-test
Change-Id: Ia6dfcfa8495b89465db60f6a4eb77d304112046b
2024-05-07 13:28:53 +02:00