Commit graph

9140 commits

Author SHA1 Message Date
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
Ted Bauer
6d4db66026 aflags: add new storage mode
Add a mode that lets the user use the new aconfig storage.

Bug: 324436145
Test: adb shell aflags list --use-new-storage
Change-Id: I97d7a229a64c6ef1aea844281298ce5449b02570
2024-03-29 16:57:42 +00:00
Ted Bauer
9b7185ca9c Merge "aconfig: make APIs apex available" into main 2024-03-28 23:33:32 +00:00
Dennis Shen
76163aaa38 aconfig_storage_file: add flag_info definition
Flag info file is another memory mapped file to store the file
information such as if current flag has been staged or not, is it sticky
and etc. This file will be created by aconfig storage daemon during
container initialization.

Bug: b/321077378
Test: atest aconfig_storage_file.test
Change-Id: I8f70e04c74b5770f89dbe981d9f03c787ea5eeed
2024-03-28 17:22:01 +00:00
Ted Bauer
e30efac744 aconfig: make APIs apex available
We need the aconfig APIs to be available on every mainline module, so
set the min_sdk_version as low as possible.

Bug: 328444881
Test: m
Change-Id: I02e569d510a30f4809d4a82f7630326b0b30f263
2024-03-28 13:46:18 +00:00
Treehugger Robot
efb09e77d3 Merge "Revert^2 "Migrate buildinfo.sh script into Soong"" into main 2024-03-28 02:59:51 +00:00
Charisee
58708f5d7b Update needed for Rust v1.77.0
error: this `let...else` may be rewritten with the `?` operator
   --> build/make/tools/aconfig/aconfig/src/commands.rs:320:5
    |
320 | /     let Some(package) = parsed_flags.first().map(|pf| pf.package()) else {
321 | |         return None;
322 | |     };
    | |______^ help: replace it with: `let package = parsed_flags.first().map(|pf| pf.package())?;`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ques
tion_mark
    = note: `-D clippy::question-mark` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::question_mark)]`

error: this `let...else` may be rewritten with the `?` operator
   --> build/make/tools/aconfig/aconfig/src/commands.rs:330:5
    |
330 | /     let Some(container) = parsed_flags.parsed_flag.first().map(|pf| pf.container()) else {
331 | |         return None;
332 | |     };
    | |______^ help: replace it with: `let container = parsed_flags.parsed_flag.first().map(|pf| pf.cont
ainer())?;`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ques
tion_mark

error: aborting due to 2 previous errors


Bug: 330185853
Test: ./test_compiler.py --prebuilt-path dist/rust-dev.tar.xz  --target aosp_cf_x86_64_phone --image
Change-Id: I00e22fc75137e8bd6fe28a8c20f8a1c3bbe711fd
2024-03-27 19:53:24 +00:00
Inseob Kim
06d22319d2 Revert^2 "Migrate buildinfo.sh script into Soong"
This reverts commit 54101665ee.

Reason for revert: Fixed build breakage

Bug: 322090587
Change-Id: I065a187bf5863cbb381b4f3308aae7b7200ffa6d
Test: compare build.prop before and after
Test: build multiple times and see build.prop isn't rebuilt
2024-03-27 05:19:56 +00:00
Gina Ko
813b17dd5c Merge "Revert "Migrate buildinfo.sh script into Soong"" into main 2024-03-26 22:46:48 +00:00
Gina Ko
54101665ee Revert "Migrate buildinfo.sh script into Soong"
Revert submission 3004875-buildinfo_prop_soong

Reason for revert: DroidMonitor-triggered revert due to breakage b/331462869

Reverted changes: /q/submissionid:3004875-buildinfo_prop_soong

Bug: 331462869
Change-Id: I02b125f10aaba538998dfe3a503ed2021405e8ae
2024-03-26 22:45:44 +00:00
Treehugger Robot
e1df94c841 Merge "releasetools: Resolve symlinks in IsEntryOtaPackage()" into main 2024-03-26 16:55:57 +00:00
Inseob Kim
1e13e587f5 Merge "Migrate buildinfo.sh script into Soong" into main 2024-03-26 08:06:06 +00:00
Treehugger Robot
decb8f4d1b Merge "Add apk_name information in error message" into main 2024-03-25 22:30:31 +00:00
Spandan Das
198dcf91ca Add apk_name information in error message
Logging the apk_name will improve debugging process if
`GetMinSdkVersion` returns an exception.

Test: None
Change-Id: I3ddf602d92701dcaaa4821fe42a76a870a721a11
2024-03-25 21:24:33 +00:00
LuK1337
fc51de4553
releasetools: Resolve symlinks in IsEntryOtaPackage()
Test: Sign target files package where
      SYSTEM/product/media/bootanimation-dark.zip is a symlink to
      bootanimation.zip.
Change-Id: I4648c3c39c094cb090cbe337c566c3e9ad894691
2024-03-24 21:18:17 +01:00
Daniel Zheng
4a80c5403d fallback to v2 on s build
In the case that a vendor is on s build (which doesn't have snapuserd),
and is takinga  v3 -> v3 upgrade, we want to fallback to v2 vabc ota.

Test: th
Change-Id: Iba259b139b9b423ac77d82e14a113cf35fbfea64
2024-03-22 12:02:54 -07:00
Dennis Shen
12d3417708 Merge "aconfig: update aconfig_storage_read_api" into main 2024-03-22 12:49:04 +00:00
Daniel Zheng
02393ee106 Revert "allow command line override"
This reverts commit f3d476ed40.

Reason for revert: b/330767621

Change-Id: Ia0b8ec3f177ae74c03d7cb4e568e44149b125617
2024-03-21 21:08:22 +00:00
Daniel Zheng
f3d476ed40 allow command line override
Allow override for vabc_cow version if specified from the command line.
If OPTIONS.vabc_cow_version is already defined, then we don't want to
modify this value since it was defined by --vabc_compression_param=

Test: th
Change-Id: I57b8129faf5caf9de1dc8ad96e7570214a9f3313
2024-03-21 10:47:51 -07:00
Inseob Kim
6a35810856 Migrate buildinfo.sh script into Soong
To build system.img in Soong, we need all artifacts including
build.prop. This fully migrates buildinfo.prop file into Soong as a
first step to build build.prop on Soong.

Bug: 322090587
Test: compare build.prop before and after
Test: build multiple times and see build.prop isn't rebuilt
Change-Id: I0d5aab21a825cfe22f97a6834209f9df196625d9
2024-03-21 17:18:59 +09:00
Dennis Shen
bb13bbb086 aconfig: update aconfig_storage_read_api
Previously we are ensuring that the public rust api to get mapped file
is safe as we are ensuring that the file being mapped has a permission
of 444. However, a file permission of 444 is not possible due to build
system needs to make file 644 while creating img files. Thus need to make the rust api to get mapped file unsafe.

In reality, this should have no impact. Because, even though the storage
files have a file permission of 644, they are on a RO partition like
system. So the files are not writable anyway. This is true for all the
containers (platform partitions and mainline modules) we know so far.

Bug: b/321077378
Test: atest aconfig_storage_read_api.test; atest
aconfig_storage_read_api.test.rust; atest
aconfig_storage_read_api.test.cpp

Change-Id: I643fe191e697a524e2303a32750f04c268f408fd
2024-03-21 01:44:02 +00:00
Kelvin Zhang
0669b8eac2 Fix typo
Test: th
Bug: 329678555
Change-Id: I952c19f93484dad9e273afe1cd45a043a36a34ee
2024-03-20 13:58:15 -07:00
Treehugger Robot
64134135c7 Merge "aconfig: update pb file location" into main 2024-03-20 17:46:35 +00:00
Dennis Shen
5e909adbc8 aconfig: update pb file location
We have moved the storage records metadata pb file to the boot dir.

Bug: b/321077378
Test: atest aconfig_storage_read_api.test
Change-Id: Ic5bd89052e311ec5b1993ba1779d49be8451caa2
2024-03-20 16:38:09 +00:00
Michael Merg
d8880abbdf Write ide_qeury results to stdout
All other output will be written to stderr.

Change-Id: Iefbd8292bb136e4723d5c168e4508ae183585c7c
2024-03-20 11:06:17 +00:00
Daniel Zheng
0b7a685573 create_brick_ota: fix nonetype bug
If devkeys are present, we don't need to specify a serialno. In this
case we should conditionally add serial no to our metadata

Test: create_brick_ota
Change-Id: I9c93aa0f9ec5752693a9ddde5b76be4c12d6fc3b
2024-03-19 12:29:13 -07:00
Kadir Çetinkaya
f6e76b6566 Merge "Make sure ninja keeps going after errors" into main 2024-03-18 07:36:16 +00:00
Treehugger Robot
6c63da3ce7 Merge "aconfig: c++ read api to return an android::base::Result and cargo fmt" into main 2024-03-15 14:16:27 +00:00
Kadir Çetinkaya
874e12be43 Make sure ninja keeps going after errors
Language services builds are usually executed in a non-building state of the codebase as the user is actively editing the code.

This change ensures we can build as many dependencies as possible for language services by ninja.

Note that this doesn't change the error-limit for soong itself, i.e. we can still fail-early if we encounter errors while generating ninja files.

Change-Id: I594e2ae4591d2e75db082486f28f705833ceb4a8
2024-03-15 07:27:30 +00:00
Tomasz Wasilczyk
4045ae7871 Remove SignApk output limitation of 2GiB
Bug: 302112430
Test: build/soong/soong_ui.bash --make-mode TARGET_PRODUCT=aosp_x86_64 TARGET_RELEASE=trunk_staging CLANG_COVERAGE=true NATIVE_COVERAGE_PATHS="art external/aac external/boringssl external/conscrypt external/cpu_features external/dlmalloc external/fdlibm external/libaom external/libavc external/libcxx external/libfuse external/libgav1 external/libgsm external/libhevc external/libmpeg2 external/libopus external/libtextclassifier external/libvpx external/libxaac external/oj-libjdwp external/sonivox external/speex external/tremolo external/vixl frameworks/av frameworks/base/media libcore libnativehelper packages/modules/Bluetooth packages/modules/Connectivity packages/modules/DnsResolver packages/modules/ExtServices packages/modules/NetworkStack packages/modules/NeuralNetworks packages/modules/SdkExtensions packages/modules/StatsD packages/providers/MediaProvider system/core/base system/core/libcutils system/core/libstats system/media/audio_utils system/netd/resolv" com.android.art.testing
      apksigner verify --in $OUT/../generic_x86_64/system/apex/com.android.art.testing.apex --print-certs -v --min-sdk-version 23
Change-Id: Id31eae0f221dd7ef333bd12aeef591463e1c931a
2024-03-14 14:57:04 -07:00
Dennis Shen
435fe14146 aconfig: c++ read api to return an android::base::Result and cargo fmt
Bug: b/312444587
Test: atest aconfig_storage_read_api.test.rust; atest
aconfig_storage_write_api.test.cpp

Change-Id: I6beb6e8d43b6f5418476101a929374e97832e27f
2024-03-14 19:25:07 +00:00
Dennis Shen
aa0287641e Merge "aconfig_storage: create aconfig storage c++ flag value write api" into main 2024-03-14 19:21:38 +00:00
Treehugger Robot
4e5aa5d0f5 Merge "Remove fs_get_stats." into main 2024-03-14 17:13:26 +00:00
Dennis Shen
1fdb6cc456 aconfig_storage: create aconfig storage c++ flag value write api
Bug: b/312444587
Test: atest aconfig_storage_write_api.test.cpp
Change-Id: Ib08575b7e6ca23141ebbf739bf604a66da472dc2
2024-03-14 16:06:03 +00:00
Elliott Hughes
b904c27e12 Remove fs_get_stats.
This was only used by the tarball-building support that was removed
in 2019.

Test: treehugger
Change-Id: I719364699d426d21010c3ab913d12f15128f2538
2024-03-14 15:32:24 +00:00
Dennis Shen
7c30411d3d Merge changes from topic "read_api" into main
* changes:
  aconfig: update aconfig_storage_read_api c++ lib
  aconfig: update aconfig_storage_read_api
2024-03-14 14:43:12 +00:00
Treehugger Robot
be19783c7a Merge "Replace some ByteBuffers with DataSource" into main 2024-03-13 23:57:51 +00:00
Tomasz Wasilczyk
4b114c29ec Replace some ByteBuffers with DataSource
This avoids ByteArray 2GiB limit in a few places, but requires more
changes to SignApk to fully support large archives.

Bug: 302112430
Test: build/soong/soong_ui.bash --make-mode TARGET_PRODUCT=aosp_x86_64 TARGET_RELEASE=trunk_staging CLANG_COVERAGE=true NATIVE_COVERAGE_PATHS="art external/aac external/boringssl external/conscrypt external/cpu_features external/dlmalloc external/fdlibm external/libaom external/libavc external/libcxx external/libfuse external/libgav1 external/libgsm external/libhevc external/libmpeg2 external/libopus external/libtextclassifier external/libvpx external/libxaac external/oj-libjdwp external/sonivox external/speex external/tremolo external/vixl frameworks/av frameworks/base/media libcore libnativehelper packages/modules/Bluetooth packages/modules/Connectivity packages/modules/DnsResolver packages/modules/ExtServices packages/modules/NetworkStack packages/modules/NeuralNetworks packages/modules/SdkExtensions packages/modules/StatsD packages/providers/MediaProvider system/core/base system/core/libcutils system/core/libstats system/media/audio_utils system/netd/resolv" com.android.art.testing
Change-Id: Ie7fc0bbce9ef43b6331143703ac5568cf1b2186a
2024-03-13 21:43:13 +00:00
Dennis Shen
808bf915a8 aconfig: update aconfig_storage_read_api c++ lib
Now the read api lib no longer owns the memory mapped file. The rust lib
aconfig_storage_read_api api to get memory mapped file just returns an
Mmap rust struct. However cxx does not support Mmap data type, so we
cannot export the api to get memory mapped file from rust to c++. This
means we have to implement c++ apis to get memory mapped files.

This change is basically implementing c++ api to get memory mapped files,
mirroring the rust implementation. In addition, the integration test is
also updated to lock down the new c++ api implementation.

Bug: b/321077378
Test: atest aconfig_storage_read_api.test.cpp
Change-Id: I5e93a220cdd05cc0e5b0eb441284ac3e9dc34da7
2024-03-13 20:29:13 +00:00
Dennis Shen
71f9303dc0 aconfig: update aconfig_storage_read_api
Right now, aconfig_storage_read_api rust lib would own mapped files. So
individual flag lib does not need to. The original intent is that all
these flag lib can dynamically link against this lib. So say we have
different variants of flag lib for one flag package, there is just one
unique memory mapped file. In addition, the exposed rust apis hides the
memory mapped files. So when exporting these apis to c++/java, we don't
have to implement memory mapping in c++/java flag read api lib.

However, this design has its own downside. The biggest being that these
memory mapped files are stored in a mutable static hash map. For rust,
it must be protected by a mutex lock. The real effect on the lock is
mostly minimal as it immediately unlocks when the clone of memory
mapping is returned. But still we could get more performance out of it
in exchange of having more c++/java side implementation of mapping
files. (Note, apis that interpret mapped files are still exported by
Rust, so no c++/java implementation needed).

In this change, aconfig_storage_read_api give away its ownership of
memory mapped file in its api to get memory mapped file. The memory
mapped file is supposed to be owned by generated flag lib. By doing so,
no more mutex lock is needed. Also, since each flag lib has one flag
package, which maps to a single owning container. The flag lib can have
the memory mapped files as non mutable static variables. So no mutex
lock penalty on flag lib side.

Bug: b/321077378
Test: atest aconfig_storage_read_api.test; atest
aconfig_storage_read_api.test.rust

Change-Id: I29060bae90db6f7d296252ed73f7e312143f4b7e
2024-03-13 18:10:19 +00:00
Treehugger Robot
c7704f1650 Merge "aflags: show staged values for each flag." into main 2024-03-13 17:01:14 +00:00
Ted Bauer
46d758bd49 aflags: show staged values for each flag.
Lines now have a new column, and look like this:

com.android.example.flag1 enabled -            server read-write system
com.android.example.flag2 enabled (->disabled) server read-write system

The dash represents no change on boot, the (->value) represents a change
to value on the next boot.

Test: adb shell device_config put staged multitasking*com.android.wm.shell.enable_taskbar_navbar_unification true && adb shell aflags list | grep navbar_unification
Bug: 324436145
Change-Id: I022460bc69fcb2ccd9c6db8f060fcbd0337d1ea6
2024-03-13 14:46:31 +00:00