Commit graph

9181 commits

Author SHA1 Message Date
Dennis Shen
7d642b10df Merge "aconfig: add write api cpp test to presubmit" into main 2024-04-12 18:26:55 +00:00
Dennis Shen
e8fa42f45a aconfig: add write api cpp test to presubmit
Bug: b/321077378
Test atest -c

Change-Id: Ib04280f25eb6c4de6ff1523579e6ac96a868ff1d
2024-04-12 16:57:28 +00:00
Dennis Shen
f17dbcd8b7 aconfig: update flag info query api
Currently flag info query api is called get_boolean_flag_attribute, in
this change, we switched it over to a flag value type generic
implementation get_flag_attribute. So in the future we want to add more flag value types, this api can stay the same.

Bug: b/312444587
Test: atest -c
Change-Id: I2b272f3fa3cb1d0edc8b77a44bf37752ffe95925
2024-04-12 16:28:10 +00:00
Nariyasu Heseri
5ffefcc642 Ensure insertion order of Python dict
Add keys to the dict `partitions` in serial to have a deterministic
insertion order.
This guarantees the generated vbmeta.img is always the same on the same
input, fixing image consistency issues.

Reference:
https://android-review.googlesource.com/c/platform/build/+/2585397

Bug: 332550989
Test: Generate vbmeta several times, confirm identical result.
Change-Id: I39da5844045f497fdc89e6477a7e32ddacb70764
2024-04-12 07:57:37 +00:00
Dennis Shen
d74941b42d aconfig: create flag info file write c api
Bug: b/312444587
Test: atest -c
Change-Id: I310e1ed727ced454bec2016afe48f7a29561fac3
2024-04-11 20:23:22 +00:00
Dennis Shen
4647c0e1f0 aconfig: create flag info file write rust api
Bug: b/312444587
Test: atest aconfig_storage_write_api.test; atest
aconfig_storage_write_api.test.rust

Change-Id: Icbedc78ae78b2c7590539f008521c507c2b3df5b
2024-04-11 20:23:00 +00:00
Dennis Shen
d22eee50fa Merge changes from topic "index_instead_of_offset" into main
* changes:
  aconfig: update storage write api
  aconfig: update storage read api
  aconfig: update storage file creation to allow storage files to store flag index instead of byte offset
  aconfig: update storage file to store flag index instead of file byte offset
2024-04-10 18:53:43 +00:00
Daniel Zheng
e836a3a2e4 Merge "zstd negative compression support" into main 2024-04-10 17:56:45 +00:00
Daniel Zheng
d919100382 zstd negative compression support
supporting negative compression levels in ota_from_target_files in the
format of zstd,-$compression_level

Test: ota_from_target_files
Change-Id: If2ca592829f10e7a0226cb41680cb47223d17c71
2024-04-10 10:54:51 -07:00
Dennis Shen
0efe47967b aconfig: update storage write api
Now we are storing flag index instead of flag byte offset in storage
files, need to update storage write api accordingly.

Bug: b/321077378
Test: atest -c
Change-Id: I67e55287a242df0af1925ede886f8c087d343c1f
2024-04-10 16:40:06 +00:00
Dennis Shen
b18227e8d8 aconfig: update storage read api
With the update to store flag index instead of flag byte offset in
storage file. We need to update flag read api accordingly.

Bug: b/321077378
Test: atest -c
Change-Id: Iccbf939fc5b7fe0ce0f2c33f7e3aa403c268120a
2024-04-10 16:39:21 +00:00
Dennis Shen
a8ba164422 aconfig: update storage file creation to allow storage files to store
flag index instead of byte offset

Bug: b/321077378
Test: atest -c
Change-Id: I2fbfa09ac880c172fd8e47866d9ec1449718e0b6
2024-04-10 16:37:23 +00:00
Dennis Shen
702408ecbb aconfig: update storage file to store flag index instead of file byte offset
Previously, in package.map, we store the byte offset of the first flag
in a flag package in a flag value file. In flag.map, we store the within
package flag byte offset. Once we know the total offset, we can locate
the flag in the flag value file. However, this offset may not work for
flag info file. Currently we only have boolean flags. Each boolean flag
value and info takes up 1 byte in flag value and flag info file. So the
byte offsets are the same. But in the future, when we add a new flag
value type, or add more contents to flag info file. Then the byte offset
for flag value file and flag info file may not be same.

Instead, we should store index rather than offset. The package map
should store the index of the first flag in this package. The flag map
stores the within package index. Then flag value read api and flag info
read api can then infer the byte offset independently.

Bug: b/321077378
Test: atest -c
Change-Id: Iad89776d5369715ba2d8faaea18261ac3271f13b
2024-04-10 16:36:46 +00:00
Dennis Shen
9fa78d373c aconfig: return stored flag type enum as a part of flag offset info
Bug: b/321077378
Test: atest -c
Change-Id: I25bad6b226de570eedfef4b450e09be2ac75c5eb
2024-04-10 15:14:14 +00:00
Dennis Shen
ccfb4c284f Merge changes from topic "flag_info_read_api" into main
* changes:
  aconfig: add flag info read c api
  aconfig: add flag info read rust api
2024-04-10 14:33:36 +00:00
Dennis Shen
cf7f5375be Merge "aconfig: add flag info field to proto" into main 2024-04-09 13:26:57 +00:00
Treehugger Robot
cfec7d0f7b Merge changes I1a5615e9,I01a673e7 into main
* changes:
  Remove dependency on non-AB modules
  Make build_image output consistent for partitions w/o build.prop
2024-04-08 19:57:56 +00:00
Kelvin Zhang
7a17cfd81a Remove dependency on non-AB modules
imgdiff is scheduled for removal.

Test: th
Bug: 324360816
Change-Id: I1a5615e9f5f776c16269ac8780187f97edba16f2
2024-04-08 11:08:14 -07:00
Dennis Shen
58ada6f972 aconfig: add flag info read c api
Bug: b/321077378
Test: atest aconfig_storage_read_api.test.cpp
Change-Id: If6c258429b8d8ccc872cac9f72cb533cf454ecbd
2024-04-07 20:36:25 +00:00
Dennis Shen
2ac7a4c2bd aconfig: add flag info read rust api
Bug: b/321077378
Test: atest aconfig_storage_read_api.test; atest
aconfig_storage_read_api.test.rust

Change-Id: I382ac0145c5d91827952b3ddb01cabefd1539854
2024-04-07 20:34:28 +00:00
Dennis Shen
eff5363e2d aconfig: add flag info field to proto
Bug: b/321077378
Test: m
Change-Id: I1b974f83ea49e8d4b19b3392cb7feab3d4b3fcdc
2024-04-05 16:40:43 +00:00
Dennis Shen
acfb82cf73 Merge "aconfig: move create flag info file api to aconfig_storage_write_api" into main 2024-04-05 13:59:45 +00:00
Dennis Shen
455dc608f3 aconfig: move create flag info file api to aconfig_storage_write_api
rust_ffi_static right now will export excessive symbols, this lead to a
duplication of symbols when aconfig links against both
libaconfig_storage_file_cc and libaconfig_storage_read_api_cc. This is
because aconfig_storage_read_api crate depends on aconfig_storage_file
crate. To solve this problem, move create flag info file api to
aconfig_storage_write_api crate which is parallel to
aconfig_storage_read_api crate.

Bug: b/321077378
Test: atest aconfig_storage_file.test; atest
aconfig_storage_read_api.test; atest aconfig_storage_write_api.test

Change-Id: Ibbb50193a2da82d52ccbb4087c8e3fb9f320805f
2024-04-04 21:39:04 +00:00
Zhi Dou
bc71cd03b9 aconfig: remove @com.android.aconfig.annotations.AconfigFlagAccessor from the
exported mode

The exported mode library will be dropped into google3, and there isn't
the library for this annotation.

Test: atest aconfig.test
Bug: n/a
Change-Id: I318d1c0faf232b22f42587b8ea2f976173c8554a
2024-04-04 20:21:50 +00:00
Dennis Shen
83066f6dc0 Merge "aconfig: add create_flag_info cc api" into main 2024-04-04 18:26:12 +00:00
Zhi Dou
93937ac342 Merge "aconfig: prototype AconfigFlagAccessor" into main 2024-04-03 19:17:15 +00:00
Dennis Shen
cf3042db77 Merge "aconfig: add api to create flag info file based on package map and flag map file" into main 2024-04-03 18:31:08 +00:00
Dennis Shen
2922ca9019 aconfig: add create_flag_info cc api
Bug: b/321077378
Test: atest aconfig_storage_file.test
Change-Id: I1d48311cade178f0b047a5b4d4f81c6dac4362c8
2024-04-03 18:09:39 +00:00
Treehugger Robot
6b1292065f Merge "aflags: add aflags.test to presubmit runs" into main 2024-04-03 15:45:35 +00:00
Mårten Kongstad
bf1b2ba6b2 Finalization: update OWNERS
Add new folks working on finalization, remove folks no longer working on
it.

Also, sort the entires alphabetically.

Bug: 323940469
Test: N/A
Change-Id: Ib8f6c3f485a06e3d1269e4142317174ae7ac276b
2024-04-03 17:20:42 +02:00
Ted Bauer
fb358d6a89 aflags: add aflags.test to presubmit runs
Bug: 326062088
Test: m # Also, confirm aflags.test runs in this CL
Change-Id: Ie7a1a7625163503e43d5b67d0e50554cd2a9e4cd
2024-04-03 14:02:51 +00:00
Zhi Dou
ddfd2f4889 aconfig: prototype AconfigFlagAccessor
Bug: n/a
Test: atest aconfig.test
Ignore-AOSP-First: need to submit with annotation change. will cherry pick to aosp.
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:c65c7c7f577f4140ff5632ce87a26dc98a75b8dc)
Merged-In: I62ea458c05fb61973705346c4313535f9b2291be
Change-Id: I62ea458c05fb61973705346c4313535f9b2291be
2024-04-03 13:31:57 +00:00
Dennis Shen
bb9912e551 aconfig: add api to create flag info file based on package map and flag
map file

Bug: b/321077378
Test: atest aconfig_storage_file.test
Change-Id: I957e231bc11db856a8c6753771eaafea2f168352
2024-04-02 21:39:51 +00:00
Dennis Shen
7d12daf9b4 aconfig: add flag type information to list flag api
Bug: b/321077378
Test: atest aconfig_storage_file.test
Change-Id: I1880e9aa441c423c3225a0ef86c6edde096d7ba3
2024-04-02 17:51:21 +00:00
Dennis Shen
9c7a000d6f Merge "aconfig: enable tests in presubmits" into main 2024-04-02 17:51:09 +00:00
Dennis Shen
d740c50331 Merge "aconfig: test updates" into main 2024-04-02 17:51:00 +00:00
Wei Li
20e7d0fe3d Merge "Add some comments to the field "third_party.identifier.type" in METADATA files." into main 2024-04-02 16:57:39 +00:00
Kelvin Zhang
4dc089971b Make build_image output consistent for partitions w/o build.prop
Bug: 331405669
Change-Id: I01a673e7c842a5042d85f079e29c680c4d7b589c
2024-04-02 09:05:08 -07:00
Dennis Shen
467d22f2a8 aconfig: enable tests in presubmits
Bug: b/321077378
Test: atest each test
Change-Id: Id8a47605c5642a9459d16c8414adc8590fd4c46d
2024-04-02 13:47:42 +00:00
Dennis Shen
3e4c33c1bc aconfig: test updates
Previously, three seperate crates create their own test baseline which
are nearly identical. This is inconvinent when updating the baselines.
All three locations needs to be touched. This cl merges functions to
create test storage file base struct into aconfig_storage_file crate

Bug: b/321077378
Test: atest aconfig.test
Change-Id: Ic97437f856763347a11de8b449592292014bcce3
2024-04-02 13:01:26 +00:00
Wei Li
dd020a1762 Add some comments to the field "third_party.identifier.type" in METADATA files.
Bug: 332409257
Test: CIs
Change-Id: I7db2e12e0f780003f94544177812cc3fabe2968c
2024-04-01 17:19:40 -07:00
Dennis Shen
cd381f5d64 Merge "aconfig: use an enum to represetn flag type" into main 2024-04-01 20:15:03 +00:00
Daniel Zheng
7187b548e6 Merge "Full ota v3 compatibilty check" into main 2024-04-01 19:08:30 +00:00
Daniel Zheng
2826b1a2d3 Full ota v3 compatibilty check
Check that device is shipped supporting v3 in order to enable it.
Otherwise fallback.

Bug: 331202590
Test: th
Change-Id: I218fbaa6a044420af39be70b055da5ffbfced158
2024-04-01 12:08:01 -07:00
Dennis Shen
93d11b7bc4 aconfig: use an enum to represetn flag type
Flag type is encoded as a u16 in flag table file. Previously we are
assinging value of 1 for flag type to indicate that they are all boolean
flags. In this change, we formalize the flag type designation with an
enum.

ReadWriteBoolean -> 0
ReadOnlyBoolean -> 1
FixedReadOnlyBoolean -> 2

Bug: b/321077378
Test: atest aconfg.test; atest aconfig_storage_file.test
Change-Id: I114818435b44f1e82a611f0509787993a5a8e70e
2024-04-01 18:30:06 +00:00
Dennis Shen
88899887c0 Merge "aconfig: syntax update, as_bytes to into_bytes to be more appropriate" into main 2024-04-01 17:33:46 +00:00
Lucas Henneman
83162dfcec Merge "TEST_MAPPING: fix TODO syntax" into main 2024-04-01 17:07:17 +00:00
Dennis Shen
87fc7cecd2 aconfig: syntax update, as_bytes to into_bytes to be more appropriate
Bug: b/321077378
Test: atest aconfig_storage_file.test; atest aconfig.test
Change-Id: I124387db54cd322bcce557a27c27e1b6a8c0f465
2024-04-01 15:19:13 +00:00
Dennis Shen
abf5ea2f46 Merge "aconfig_storage_file: add flag_info definition" into main 2024-04-01 14:20:34 +00:00
Lucas Henneman
6e7137c556 TEST_MAPPING: fix TODO syntax
These two TODO tags were improperly formatted, which means automation
will not alert anyone if the ticket is closed.

Bug: 327420679
Test: git diff
Change-Id: I99c8215fe3e24cdf3fa7be517291964cc5eb1ecf
Signed-off-by: Lucas Henneman <henneman@google.com>
2024-04-01 13:21:30 +00:00