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
static_rlibs has been folded into the normal static_libs and
whole_static_libs properties.
Bug: 254469782
Bug: 349129702
Test: m
Change-Id: I89d260f78947c3e0fe65148177c7f98d0d0c504d
When a dependency takes multiple rust_ffi_static dependencies in its
static_libs, their symbols collide. Switch to static_rlibs, which
resolves the collisions. See b/349129702 for context.
Bug: 349129702
Test: m
Change-Id: I6cd2fe92629c7d44e22d113795b340e06175f008
The change was applied in the file in memory. Without explicitly calling
msync, there is no guarantee that the changes are written back to disk.
Thus the flag value may not be changed.
Bug: b/348693143
Test: atest aconfig_storage_write_api.test.cpp
aconfig_storage_write_api.test.rust
Change-Id: I8b1e0cbbb90bcb3c2e5bbf418a6a1a9cd047c81b
In some build targets/combinations aconfig_flags.pb
may not be generated.
For example in GSI only system/aconfig_flags.pb exists
and system-only updates won't have vendor/aconfig_flags.pb.
Test: m, aflags
Change-Id: I136345a8748bc6d80bd98e673f90e0a2ab380ab1
Add a defaults target that all targets linking to aconfig codegen with
the new storage API dependencies will need. The target takes the new
storage APIs conditionally behind a flag, so we can disable it easily.
In this topic, we add it to a single target to see that it builds and
adds the dependency. In follow-on CLs we can add it to the rest of the
targets.
Test: m audiopolicy_tests
Bug: 347701310
Change-Id: I67643205b283301f72c5466401060212b637388f
Merged-In: I67643205b283301f72c5466401060212b637388f
aflags scans the apex/ dir, which requires root access to read.
Currently the command fails with "Error: Permission denied", which
doesn't tell the user how to fix the problem. This CL adds a more
descriptive error message.
Test: adb unroot && adb shell aflags list
Bug: 347692127
Change-Id: I98a7a1ba10ef52ec47035816fa66119ea84f281d
With this update, cold flag read (first flag in a namespace) is now 6x
faster compared to device config.
Bug: b/321077378
Test: atest -c
Change-Id: I52ffd897fdd487b2a44d07be50f2975f0ef5b9b3
1, See AconfigStorageReadAPI.java to see java APIs to map storage files
and read flag values. It is using fast native annotation, in theory it
should be faster than regular JNI without much of the overhead.
2, The java api calls into Rust wrapper in srcs/lib.rs, note that
MappedByteBuffer is not copied during JNI. In the rust side
implementation we get the underlying raw pointer and buffer size and
reconstruct a rust slice. However, at current implmentation, the string
input such as package name and flag name are most likely copied. They
are converted from JStirng to JavaStr first without copy, then the
into() call to convert it to Rust string. We could potentially optimize
it to without copy.
3, Add an android_test target to lock down the API behaviors.
Bug: b/321077378
Test: atest -c
Change-Id: I8915fe70e8eb341be563c70f85e19e644e8aa6be