This change adds annotation in the generated code. If the flag is read
only, annotations @com.android.aconfig.annotations.AssumeTrueForR8 or
@com.android.aconfig.annotations.AssumeFalseForR8 will be added in to
the corresponding methods in the interface FeatureFlags, and class
Flags.
Test: atest aconfig aconfig.test.java
Bug: 295328116
Change-Id: Ic1b62a86f0945a5e72ae2c4987cce77fe3f172e9
Update parsed_flag::verify_fields to verify that the invariant "if a
parsed flag is_fixed_read_only, its permission must be READ_ONLY".
Note: commands.rs will ensure that no value files are used to create an
invalid parsed flag when flag declarations and values are parsed, but
the invariant check should still be added for completeness sake, and to
make sure no invalid hand-crafted test data exists.
Also fix invalid test data found by adding this invariant.
Bug: 298935897
Test: atest aconfig.test
Change-Id: I8cea5c4d28c458525b7034d78ecb34dd09272771
The integration tests introduced in 906405f5c9 depend on libraries
auto-generated by running aconfig. This works fine for the Android build
system, but breaks `cargo t`.
Disable the tests when using `cargo t` for local development. Cargo can
be used for rapid local development, including running unit tests;
integration tests should be run using atest.
Bug: 298904077
Test: cargo t
Test: atest aconfig.test_mode.test.rust aconfig.prod_mode.test.rust
Change-Id: Ifcd374fa6efdc121cbfd4c4ac4fb43cf9cacc192
test_ZipWrite_large_file need to write a 4GB file to zipfile for
testing. Instead of writing sequence of 0s to the test file, use seek().
Test: th
Bug: 298138109
Change-Id: I886bfa0c3f21664e529ba7de9688909518148f61
Boot partition only OTA must be marked as "partial". This is required
for update_engine to correctly copy non-updated partitions to the target
slot.
Test: th
Bug: 293313353
Change-Id: Ic89d03f214e12fa43f686d37854d6fed1d78a6a3
apexd_host is invoked in check_target_files_vintf.py
to prepare the apex directory before invoking checkvintf. ota_from_target_files uses check_target_files_vintf.py via (python_library) releasetools_check_target_files_vintf.
Since soong doesn't inherit "required:" property from library to binary, adding the dependency manually to ota_from_target_files.
Bug: n/a
Test: $ m ota_from_target_files # should build apexd_host
Change-Id: Ie7e6c3acf376c23960f242294f5a9bf99fec26aa
This change will generate full fakefeatureflagsimpl in prod mode.
FakeFeatureFlagsImp will be the same in test mode and the prod mode.
FeatureFlagsImpl will be all unimplemented in test mode. setFlag,
resetAll are added into the interface FeatureFlags.
The reason to make this change is for project using injection pattern,
the project doesn't have to use test mode to test the flag guarded code.
The project can directly use the FakeFeatureFlagsImpl for testing.
Bug: 294838180
Test: atest AconfigJavaHostTest --host AND atest aconfig.test.java
Change-Id: Ib6d40fd3a9ef872e01594fd4f8d6c4cb10bb173a
brillo_update_payload is thin bash wrapper for delta_generator, and
OTA tools are wrappers around brillo_update_payload. This is
inconveinent, as adding a new flag requires changing 3 places. Since
brillo_update_payload is really thin, skip it and invoke delta_generator
directly.
Test: th
Bug: 293313353
Change-Id: I2fd5af95c571ea45aea62f9eec475f0f4e864953
Bazel previously had a bug where the source directory of the entrypoint
python script would be added to the path. They added PYTHONSAFEPATH
to the enviornment to fix it, which was introduced in python 3.11.
Now that python is being updated to 3.11, the fix is in, which breaks
some scripts that don't properly specify import folders.
Add the import folders where required.
Bug: 278602456
Test: ./build/bazel/ci/bp2build.sh
Change-Id: I5b87f83247dfdfcb8bdb4f962466cbf522cc29c6
Allow apps to specify the target page size for aligning their
uncompressed shared libraries.
This allows apps that want to support larger page sizes to do
so by specifiying the -P <pagesize_kb> flag.
However, apps built for 4k-only devices are unaffected as they
can continue to use -p flag for 4kB page alignment of uncompressed
shared libraries.
Bug: 276963821
Test: atest -c zipalign_tests
Change-Id: I890db067b8f898045f73e86788662f94a48af772
Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
Add a new field in the declaration to indicate whether
the permission can be overridden.
When the field “is_fixed_read_only” is set to true,
the flag permission will be set as fixed “READ_ONLY”,
and the permission should not be changed by Gantry.
Bug: 292521627
Test: atest aconfig.test
Change-Id: Ic9bcd7823bccb8b947cf05568c7ced3763490a23
During build, we will need to generate an OTA for boot partition using a
16K boot image. Typically, OTA is generated from target_files.zip . To
avoid relying on target_files.zip as a dependency for 16K OTA, add a
tool to generate OTA directly from a raw image.
Test: th, ota_from_raw_img --partition_name boot --output ota.zip $OUT/boot_16k.img
Bug: 293313353
Change-Id: I2076332faf2a8dc573450597efd481e285a49545
zipalign_test is passing (int)4096 instead of required bool
for the pageAlignSharedLibs parameter. Update the test to use
the correct type.
Bug: 276963821
Test: atest -c zipalign_tests
Change-Id: I4150dbd411e5a40427281645aa03262f7b0c9e3a
Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
super image generation is failing for non-ab target as it is not able to find update_engine_config.txt while calling MergeUpdateEngineConfig.
META/update_engine_config.txt exists when AB_OTA_UPDATER is true.
Avoid calling MergeUpdateEngineConfig for non-ab target.
Bug: 290811619
Change-Id: Ie88b31adce15df87f73031e1f5bff0d825601e0c
Add FlagMacrosTests in presubmit to ensure that test filtering rule
always work as expected.
Bug: 292707070
Test: atest --test-mapping
Change-Id: I7a08b7e41e95063fb3c188da784f56e0973d4fae
The aconfig-generated code in the framework is added with srcjars. To
get those srcjars, we still need a java_aconfig_library. This class is
there to allow that to compile, even though those compiled .jar files
are not actually used.
Bug: 293195086
Test: m
Change-Id: I34c21925fbc5912a34fea3e7796d5e0c77c9a4af
Update sys prop name from persist.device_config.<namespace>.<flag> to persist.aconfig_flags.aconfig_flags.<namespace>.<flag>
Bug: b/295379636
Change-Id: I78f00daa574dc016902dce4b9b4ec961f973693c
If a T launch device later changes to LZ4(which is supported since U),
we will fallback to older compression algorithms, because if the full
OTA is applied on an T build, the update_engine on device won't support
lz4.
Bug: 295989519
Test: generate full OTA for T launched devices, make sure lz4 is not
used
Change-Id: I82fdf788e47e2a6daeaa4479bfecf317d8ebb5d5
Using test mode in aconfig allows us to override the flag for unit
testing
Test: atest aconfig.test_mode.test.rust
Change-Id: I890fb20fd8cf83e6033defc7093430e3a77e4de4
Aconfig set flag default permission as READ_WRITE regardless of the
release configuration. This change enables the caller of create-cache to
set the default permission for all flags, if the flag doesn't have a
value.
Test: atest aconfig.test
Bug: 294417368
Change-Id: I1ba19e1ba793cd2ae59923b136b9b50a92315ece
Some boards need to supply a custom super image script, and this
is supported via the BOARD_CUSTOM_BUILD_SUPER_IMAGE variable.
However, this variable is not used by img_from_target_files.py.
Change img_from_target_files.py to call the supplied script.
Bug: None
Change-Id: I6bca937534f58459d3419139ee7a37a10138ab8f
Add methods setFlag and resetAll in FeatureFlags in test mode. For the
injection usecase, user will use the interface FeatureFlags in the code
to control the flags.
Add tests for test mode.
Bug: 280833463
Test: Atest AconfigJavaHostTest --host
Change-Id: Ib59ba35a9011a6400af42fc9c283d37193577997
Before FeatureFlagsImpl will be used as a fake for testing. This change
adds new class FakeFeatureFlagsImpl. The FeatureFlagsImpl will keep the
same as production. FakeFeatureFlagsImpl can be used as fake for
testing.
FakeFeatureFlagsImpl, and FeatureFlagsImpl will be generated in both
test and prod mode. In test mode FeatureFlagsImpl will just be a stub,
and in prod mode FakeFeatureFlagsImpl will just be a stub.
Bug: 280833463
Test: atest aconfig.test
Change-Id: I11c1e716a9ea00d55600e5e9d5fb6442420762e6
Adding option to ota_from_target_files to configure compression level.
This option can be configured via the --vabc_compression_param flag.
e.g. --vabc_compression_param=gz,9 specifies gz compression algorithm
using level 9 compression
Test: ota_from_target_files
Change-Id: Ifc851faccbb3fba466d45c9695aaab322a362081
system_dlkm partition is related to GKI, so it should be
in the same category as boot image.
Test: merge_target_files \
--path otatools \
--framework-target-files framework-target_files.zip \
--vendor-target-files vendor-target_files.zip \
--output-target-files merged-target_files.zip
Bug: 294482075
Change-Id: Ie8f60d72f44d31e1bc3b556735b92ed0a2fda662