Commit graph

461 commits

Author SHA1 Message Date
Ted Bauer
e8e66b8aa8 Read from new storage in Rust R/W flags
Bug: 346991641
Test: m
Change-Id: I23b7f7e8a1b43bbd5f49012c95a130d91098f92a
Ignore-AOSP-First: internal storage migration, this code will be deleted
2024-06-14 17:20:27 +00:00
Treehugger Robot
895768cced Merge "aconfig: update java read api for performance" into main am: 910ad04d2f am: edbd06d8a4
Original change: https://android-review.googlesource.com/c/platform/build/+/3112419

Change-Id: I0d26fec2dc3e854baed38c26ff49bdddbbcd4f5a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-06-04 23:34:36 +00:00
Dennis Shen
a8e28dfe87 aconfig: update java read api for performance
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
2024-06-04 17:24:53 +00:00
Dennis Shen
6ef1489b44 Merge "aconfig: create first implementation of aconfig storage java read api" into main am: ca6602821b am: 845de05ab4
Original change: https://android-review.googlesource.com/c/platform/build/+/3106837

Change-Id: I2f1c01b7a62c06eb8047cdee9dfbdcbc98301a51
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-30 22:44:19 +00:00
Dennis Shen
e5dd91bca7 aconfig: create first implementation of aconfig storage java read api
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
2024-05-30 00:32:42 +00:00
Dennis Shen
8746ef2b53 Merge "aconfig: remove read api lib's dependency on libbase and liblog" into main am: 25889d80af am: 612e50eb4b
Original change: https://android-review.googlesource.com/c/platform/build/+/3097838

Change-Id: I35012cd45e68798389863e5d7ced5e5ec64ff66f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-23 16:13:14 +00:00
Dennis Shen
a0624828b2 aconfig: remove read api lib's dependency on libbase and liblog
Bug: b/321077378
Test: atest -c
Change-Id: I0bc7780de2123021e1cc9f7a29ca3f7dabebcd40
2024-05-23 12:30:31 +00:00
Dennis Shen
a94943dbb7 Merge "aconfig: update storage read api" into main am: 7b09e95c89 am: 298335d9c9
Original change: https://android-review.googlesource.com/c/platform/build/+/3096736

Change-Id: I8d873543a0b7ea7699098dc01e064f746f820ec5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-22 21:43:03 +00:00
Dennis Shen
1ce0dc9a78 Merge "aconfig: update storage read api" into main am: 96c8bec5a4 am: 619582971c
Original change: https://android-review.googlesource.com/c/platform/build/+/3092646

Change-Id: I97206d418675b04b03fa09806301464358b987a4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-22 21:42:58 +00:00
Dennis Shen
7b09e95c89 Merge "aconfig: update storage read api" into main 2024-05-22 20:52:40 +00:00
Dennis Shen
70208daaaa aconfig: update storage read api
Bug: b/321077378
Test atest -c

Change-Id: I53fe6c34466f32d5283d0bdbf4736c8ecd20ef99
2024-05-22 19:25:35 +00:00
Dennis Shen
5590478580 aconfig: update storage read api
Update storage read api to not find storage file location from a pb
file, instead directly read from /metadata copy. Previously for
package.map and flag.map, we are reading from the respective RO
partition. Now we are reading from /metadata/maps dir. This has a few
advantages:

1, early flag availability, since /metadata can be mounted much earlier
than mainline modules, so it would make mainline flags availabile even
before mainline modules are mounted.

2, we no longer need to read from a pb file to find where package.map
and flag.map are. Thus the read api can be further simplified and
downsized. With this change, we are able to shrink the cc flag read api
lib size from 171k to 120k.

Bug: b/321077378
Test atest -c

Change-Id: Ic9086fe4c49c139a4d1c66a8d472023a88c9dd17
2024-05-22 19:25:17 +00:00
Ted Bauer
59198ca2d2 Merge "Add filter by container to aflags" into main am: f52e8788a2 am: 09fbb10fc4
Original change: https://android-review.googlesource.com/c/platform/build/+/3087903

Change-Id: Ief4f1bd2e94e07496400d3f0b7f7b60ed242b732
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-15 18:11:25 +00:00
Ted Bauer
aeb96092af Add filter by container to aflags
Test: m -j120 && acloud create --local-image && adb shell aflags list --c system
Test: cargo t
Bug: 340840507
Change-Id: I5db7f204673accdbd3c4ad62e88b213028a8d5ab
2024-05-15 10:06:25 -04:00
Treehugger Robot
c6cf9ac793 Merge "Add a nano proto version of aconfig protos" into main am: 4a2c1b5ca3 am: fd1ca8b6ff
Original change: https://android-review.googlesource.com/c/platform/build/+/3087843

Change-Id: Ic336fdb1a79fd10e38124fe860c6a77babbe8173
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-15 07:54:02 +00:00
Mark Punzalan
5529e36e88 Add a nano proto version of aconfig protos
Framework already has nano protos, and reusing them won't
introduce extra dependencies for the apps
This is setting up the resources flagging in the framework

Bug: 297373084
Test: Built with related changes
Change-Id: I518bd56f56c42e0adef0002e95f8948e0904fb43
2024-05-15 06:18:23 +00:00
Treehugger Robot
8674bb045b Merge "Fix bug in device path proto reading" into main am: b63973dfc2 am: 21978761b8
Original change: https://android-review.googlesource.com/c/platform/build/+/3085527

Change-Id: Ia8fd6c199b1394c41bf1cc76aaf8864fe6366318
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-14 21:52:21 +00:00
Ted Bauer
1f9d55d2ab Fix bug in device path proto reading
aconfig_device_paths uses `include_str!` to include a text file
containing comma-separated strings with each partition aconfig file.
The lib does not handle the escaped newlines and quotation marks.
Adds proper handling.

Test: cargo t  && m -j120 && acloud create --local-image && adb shell aflags list
Bug: 340514768
Change-Id: I75214bf02dd962d8291f1654ade8cbce1cda9fde
2024-05-14 15:49:14 -04:00
Dennis Shen
96dee8805b Merge "aconfig: simply proto" into main am: db0c8d7986 am: 91e478d07b
Original change: https://android-review.googlesource.com/c/platform/build/+/3081125

Change-Id: Ic9a84b5e3cd0e62b11a0e544cef6f9b3babc5c42
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-13 15:58:36 +00:00
Dennis Shen
db0c8d7986 Merge "aconfig: simply proto" into main 2024-05-13 15:26:26 +00:00
Dennis Shen
a2fb60b822 aconfig: simply proto
Bug: b/339514174, b/312444587
Test: atest -c
Change-Id: I5511efd04af9f57b22e4c89bd2db65496aaf4398
2024-05-11 15:51:14 +00:00
Treehugger Robot
942eb2034e Merge "Replace impl ToString with impl Display" into main am: 8211cb24a5 am: d9f34e441d
Original change: https://android-review.googlesource.com/c/platform/build/+/3081923

Change-Id: I204c7156ef2eed664c414ac0a827feff17663c2f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-10 19:20:32 +00:00
Treehugger Robot
8211cb24a5 Merge "Replace impl ToString with impl Display" into main 2024-05-10 18:32:41 +00:00
Chris Wailes
e6bb2e951d Replace impl ToString with impl Display
If the Display interface is implemented the compiler will automatically
derive an implementation of ToString.

Test: m aflags
Bug: 333887339
Change-Id: I861a3065edbef0da1684a6ea28cc374acd0d774a
2024-05-09 15:14:22 -07:00
Dennis Shen
ff38350139 Merge "aconfig: add list_flag api cxx interlop" into main am: 9d21525b85 am: 341557f56c
Original change: https://android-review.googlesource.com/c/platform/build/+/3079587

Change-Id: If731976287515a794e6867dd0823c35d884a72fe
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-09 21:52:22 +00:00
Dennis Shen
9d21525b85 Merge "aconfig: add list_flag api cxx interlop" into main 2024-05-09 21:13:17 +00:00
Dennis Shen
e1949a6563 aconfig: add list_flag api cxx interlop
Bug: 312444587
Test: atest -c
Change-Id: I3e3bc511c370fbcdfa6dcf7942377dd9b544c647
2024-05-09 17:37:36 +00:00
Treehugger Robot
91c40ed17d Merge "Add a Java lib to read on-device proto paths" into main am: c0c2e5f278 am: 39937913e1
Original change: https://android-review.googlesource.com/c/platform/build/+/3077343

Change-Id: I53fc186f8a27071ebce6eafeb38f1660dcb67446
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-09 15:52:28 +00:00
Treehugger Robot
c0c2e5f278 Merge "Add a Java lib to read on-device proto paths" into main 2024-05-09 15:05:28 +00:00
Ted Bauer
3cf7c0a2c0 Add a Java lib to read on-device proto paths
Bug: 337911453
Test: m aconfig_on_device_protos_java
Change-Id: Iac8d671acee070ed041927028ec80c7aa371bd61

Change-Id: I19e0e52d8de71207c9858305e6248b6251a20989
2024-05-08 16:05:00 -04:00
Dennis Shen
7ef182e7a3 Merge "aconfig: make MutableMappedStorageFiles inherit MappedStoargeFiles" into main am: 015de62d7a am: 3807c32bff
Original change: https://android-review.googlesource.com/c/platform/build/+/3077003

Change-Id: Ic6a19eea0269b2e38d2678321a310d4d36599b40
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-08 19:40:34 +00:00
Dennis Shen
d772eb3edc aconfig: make MutableMappedStorageFiles inherit MappedStoargeFiles
Bug: b/321077378
Test: atest -c
Change-Id: Ib052df74bf79b5bc2a0f8c793701e3ff18f4aa30
2024-05-07 15:28:09 +00:00
Dennis Shen
49e6cbeff4 Merge "aconfig: update storage file mapping api" into main am: 260663ddfc am: d557389eb1
Original change: https://android-review.googlesource.com/c/platform/build/+/3075404

Change-Id: I7e768b8e31ff2f68f606aadc83d25529156b4509
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-07 14:21:05 +00:00
Dennis Shen
a49f1ba5c5 aconfig: update storage file mapping api
Return a pointer of MappedStorageFile/MutableMappedStorageFile instead
of an object of MappedStorageFile/MutableMappedStorageFile. Now added
destructor for MappedStorageFile/MutableMappedStorageFile to unmap the
in memory file to free up memory.

Bug: b/321077378
Test: atest -c
Change-Id: Iaa02696feb07ff383f0c7e46b645d82e57c38254
2024-05-06 17:25:59 +00:00
Ted Bauer
881c93aca6 Merge "Update dependencies for new aconfig flag storage" into main am: daa3c71739 am: 3011ec66ed
Original change: https://android-review.googlesource.com/c/platform/build/+/3068041

Change-Id: If9255711db8691fcc7e0bd71f7c0efde012aabee
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-01 16:10:07 +00:00
Ted Bauer
daa3c71739 Merge "Update dependencies for new aconfig flag storage" into main 2024-05-01 15:37:20 +00:00
Ted Bauer
4560e3ae8f Update dependencies for new aconfig flag storage
Bug: 328444881
Test: m
Change-Id: I3685a74e9e93a6ecb89a054e243b48b67f470d55
2024-04-30 23:57:51 +00:00
Dennis Shen
93b2796372 Merge "aconfig: add a new aconfig storage file flag listing api" into main am: c0102331c8 am: a8d8b351da
Original change: https://android-review.googlesource.com/c/platform/build/+/3065243

Change-Id: I6069f7dc83ea8f7d8f26ec89601134f83b31fbc0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-04-30 23:45:16 +00:00
Dennis Shen
c0102331c8 Merge "aconfig: add a new aconfig storage file flag listing api" into main 2024-04-30 23:06:18 +00:00
Dennis Shen
45c94c6421 aconfig: add a new aconfig storage file flag listing api
added a new function called list_flag_with_info to list all the flags
given all four storage files (package.map, flag.map, flag.val, flag.info).
also exported this api thru cxx interface so aconfigd can use it.

Bug: b/312444587
Test: atest -c
Change-Id: Ibbfe657b980d40e25e5e28962b930338192e2d98
2024-04-30 17:52:44 +00:00
Ted Bauer
4b639bed45 Merge "Add cc_defaults containing libs needed for static linking" into main am: ced25ac630 am: b80523c4ec
Original change: https://android-review.googlesource.com/c/platform/build/+/3065623

Change-Id: I492c009bfe9249bdae7b8e8737753670a4d06f1c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-04-30 01:53:45 +00:00
Ted Bauer
d724dd04e2 Add cc_defaults containing libs needed for static linking
Bug: 328444881
Test: m
Change-Id: I35cbce94301415381b3ad38d7e5c697f9c010856
2024-04-29 23:41:52 +00:00
Treehugger Robot
68759c9c7f Merge "Drive instrumentation with build flag" into main am: faeac4d7f7 am: c679eeb1df
Original change: https://android-review.googlesource.com/c/platform/build/+/3065622

Change-Id: Ifdb37b7398aa535111a3969f4eae738676a6098d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-04-29 22:03:21 +00:00
Ted Bauer
d19d351148 Drive instrumentation with build flag
Bug: 328444881
Test: m
Change-Id: Iebb250e8a836c77b14fcc6b9536eba90f9da7a4b
2024-04-29 20:12:27 +00:00
Treehugger Robot
e7daabee94 Merge "FakeFeatureFlagsImpl optionally takes defaults via a FeatureFlags." into main am: 80c40c4d91 am: 6e52bccbe7
Original change: https://android-review.googlesource.com/c/platform/build/+/3062045

Change-Id: I58b62c69636c337d661ccc09921daa7fb0ad85d6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-04-29 17:28:53 +00:00
Ted Bauer
efe3c3c134 Merge "Read from new storage in C++ aconfig codegen" into main am: d475818504 am: c02b7c9519
Original change: https://android-review.googlesource.com/c/platform/build/+/3058822

Change-Id: I2efd6c9bcb84439bc9a7acd91c26f9cd29027466
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-04-29 17:28:30 +00:00
Treehugger Robot
80c40c4d91 Merge "FakeFeatureFlagsImpl optionally takes defaults via a FeatureFlags." into main 2024-04-29 16:53:28 +00:00
Ted Bauer
d475818504 Merge "Read from new storage in C++ aconfig codegen" into main 2024-04-29 16:47:45 +00:00
Jeff DeCew
23fbd1e2f6 FakeFeatureFlagsImpl optionally takes defaults via a FeatureFlags.
Bug: 337449122
Flag: test_only
Test: presubmit
Change-Id: I45e2a523b36a6b14627c89ee7deffda711a32f5e
2024-04-27 18:08:45 +00:00
Treehugger Robot
28b224fc9a Merge "Restrict aconfig version script to linux" into main am: 3e2f5a0df8 am: a4fe929837
Original change: https://android-review.googlesource.com/c/platform/build/+/3064402

Change-Id: I57b05eb2952f003678e731248e23abc634c6ae85
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-04-27 00:02:34 +00:00