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
This change implements storage files in java to remove the dependencies
on JNI.
Bug: 352078117
Test: atest aconfig_storage_file.test.java
Change-Id: I34438576d09d0aa31eabc60f472e71cebf1552a0
This reverts commit fca73bcad3.
Reason for revert: Droidmonitor triggered revert due to build breakage in b/350978649. Will be verifying through ABTD before submission.
Change-Id: I65de159518597289f1e0e3902080f35970842afc
This may not matter in practice due to string inlining and interning,
but might avoid any accidental name drift/bugs in the future.
Bug: 280833463
Test: atest aconfig.test
Change-Id: I53b5b3effb577493ba708800928553c04b2fdc54
This is no longer necessary as static linkage in Rust has been fixed.
Bug: 254469782
Test: m aconfig_storage_write_api.test.cpp
Change-Id: I6b8b36882aa521eb0412fb7da03a5eec94df81d4
Marking the member as final for non-test scenarios allows for
optimizations that may otherwise be unavailable, and avoids ambiguity
about mutability.
Bug: 280833463
Test: atest aconfig.test
Change-Id: Ia58a04c9a57ee06d68f4dd022ace5365c65f4cf5