I was updating the format of PackageTableHeader to add an additional
field (and due to that change incremented the file version). This broke
several tests under aconfig_storage_read_api and
aconfig_storage_write_api that were operating on files written in the
old schema. I tried to re-generate them using aconfig create-storage as
explained in aosp/2933375, but was having some trouble. Figure if we can
just update the files directly it will be easier to make updates in the
future anyway. This isn't bypassing logic that's tested - IIUC the tests
cover reading the file correctly (writing is covered in separate tests).
Usage:
$ aconfig-storage print --file=path/to/flag.map --type=flag_map
--format=json > flag_map.json
$ vim flag_map.json // Manually make updates
$ aconfig-storage write-bytes --input-file=flag_map.json
--output-file=path/to/flag.map --type=flag_map
Change-Id: I212bf0b97483740b30130eb121acb895d350da84
Test: manual (adding debug-only tooling) + cargo t
Bug: 316357686
Framework currently hardcodes the paths to flags protos, with
this change it will be able to reuse the globally defined ones
and also gets access to all APEX flags
Bug: 301491148
Test: build + boot
Flag: EXEMPT build change
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:1e85e40c3ead83585ac3d7c71a712d35cd420a36)
Merged-In: I91dae72c32c47888697914265c90918389aa4c25
Change-Id: I91dae72c32c47888697914265c90918389aa4c25
Avoid log spam by skipping log statements for matching validated flag
entries in the Java codegen. Also change any mismatched logs from
info to warning.
Change-Id: Icb8bba38d8594438757d76957c4c0188f6c2758a
Test: atest aconfig.test
Flag: EXEMPT bugfix
Uses SipHasher implementation added to the project. Ideally the output
would remain consistent between builds (though the worst case of an
updated algorithm would be a string lookup for cross-container reads
only).
Sort the flags first so everything is always added to the hasher in the
same order - note this code is only run at build time, not runtime.
Next step is to write this fingerprint into the package.map file and
introduce a flag to guard this change.
Bug: 316357686
Test: atest aconfig.test
Change-Id: Ie5f34541d982dfa120ffb05fc0790603689d47c0
Now that we have Rust 1.80 LazyLock is available in the standard library
so we no longer need to use external crates such as lazy_static.
Bug: 364211748
Test: atest aconfig.test
Test: atest aconfig.prod_mode.test.rust
Test: atest aconfig.test_mode.test.rust
Test: atest aconfig.force_read_only_mode.test.rust
Change-Id: If2862eaf20065c118daa9fc51e9fb403b99dada3
This commit changes java reader to directly read the flag value from the
map file instead of load the entire file.
Change-Id: Icee42d99506894da1e3e32a31c6554895719de7b
Test: atest aconfig_storage_read_api.test.java aconfig_storage_file.test.java
Bug: 352078117
This change implements SipHasher in rust and java to make sure same
bytes array will be hashed into the same u64.
The implementation is needed, thus when rust, and java code read the
same flag file, they can find the same entry based on the same key.
Test: atest aconfig_storage_file.test.java aconfig_storage_file.test.cpp
Bug: 352078117
Change-Id: I2ce470039213a09a1df7637e60f4649b053fb2ea
This change removes the local copy of the flag file in PackageTable, and
FlagValueList.
PackageTable copied the entire flag file into memory, and the
FlagValueList copied the entire flag value list into memory. In this
change FlagValueList directly access the flag value list in the memory.
PackageTable will iterate the file, and find the target package node.
Change-Id: Id766c28b71a54290b266cc5f3f404f5c82590da2
Test: atest aconfig_storage_file.test.java aconfig_storage_read_api.test.java
Bug: 352078117
"fake_device_config" and "strict_mode_stub" provide stubs and do not
contain any implementation details. Specifying the property
"is_stubs_module" to these modules allow inter-container dependency on
these modules.
Test: m nothing
Bug: 354029496
Change-Id: Ia65ad36ca02c0594fc753935f9cc7c0af6caa20d
The restrict mode doesn't allow to have disk read from main thread. Some
apps enabled this check. The code in the dependencies of the
fileinputstream. This chagne switch to filechannel.
Test: presubmit
Bug: 356614910
Change-Id: Icf2175fe75ed1bfad4a048ead680b08e57d6c2ca
Close file stream, since the in the restrict mode the runtime will check
whether all the resource is closed when it is out of scope.
Test: ABTD ImsStackJavaTests
Bug: 349874828
Change-Id: Ib297622bae730bf99e4d5d1b3adeff3fee805a93
This change changes the logic to read the flag value from new storage.
Before it check the existence of a file. Not it will directly check the
flag value from DeviceConfig.
Test: m and presubmit
Bug: 349874828
Change-Id: I4a360564a3b48564057eede9bd893899136b3221
This change adds code in java code to read from new storage. However the
generated code won't geneerate code contains code for new storage, since
the build system won't pass `allow-instrumentation` to java codegen.
Test: atest aconfig.test.java
Bug: 349874828
Change-Id: I70983fa97de6633f467d968109d134d46f895a89
This reverts commit 70b9ac0ddd.
Reason for revert: Droidmonitor created revert due to build breakages in b/352582602.
Change-Id: I8a8e38ccf3e715e9b4746ac333aed0cc13d11969