aconfig: add storage file type into storage file serialization

1, add storage file type into storage files serialization
2, update aconfig_storage_read_api integration tests to not rely on
soong to produce read only storage files. Instead, have the test process
create temp read only storage file copies.

Bug: b/312444587
Test: atest aconfig.test; atest.aconfig_storage_file.test
Change-Id: I1607fb000b48e8acffc966b16a5136578911ab3e
This commit is contained in:
Dennis Shen
2024-03-11 16:00:42 +00:00
parent 672af9523b
commit e9b9573def
27 changed files with 375 additions and 234 deletions

View File

@@ -51,15 +51,16 @@ pub fn update_boolean_flag_value(
#[cfg(test)]
mod tests {
use super::*;
use aconfig_storage_file::FlagValueList;
use aconfig_storage_file::{FlagValueList, StorageFileType};
pub fn create_test_flag_value_list() -> FlagValueList {
let header = FlagValueHeader {
version: FILE_VERSION,
container: String::from("system"),
file_size: 34,
file_type: StorageFileType::FlagVal as u8,
file_size: 35,
num_flags: 8,
boolean_value_offset: 26,
boolean_value_offset: 27,
};
let booleans: Vec<bool> = vec![false; 8];
FlagValueList { header, booleans }