aconfig: package.map file serialization
For each container, there will be three storage files: package.map, flag.map and flags.val. This change adds package.map creation. package.map is a hash table in file that maps a package name to its package id and package value offset. This file will be used by flag storage client lib to locate the fixed offset of a flag in flag value file. package.map provides the file byte offset to the start of all flag values for this package. Together with flag value offset within its package which will be provided by flag.map, we can locate a flag's value in the value file. The top level struct for this file is called "PackageTable". The struct consists of three parts: (1) table header which includes the file version and other metadata such as number of packages and etc. (2) table buckets which is an array of u32, each bucket stores the package.map file offset to the package table node. (3) package table node array. each node stores package name, package id, package value offset and offset to the next package table node. The table uses fixed format serialization. All u32 are encoded using little endian format as that is the Android format. All strings are UTF8 encoded. This is to ensure cross platform compatibility. Bug: b/312243587 Test: atest aconfig.test Change-Id: I1041405db42862573ec320c0e557948732c28eb8
Loading
Please register or sign in to comment