aconfig: update storage file to store flag index instead of file byte offset
Previously, in package.map, we store the byte offset of the first flag in a flag package in a flag value file. In flag.map, we store the within package flag byte offset. Once we know the total offset, we can locate the flag in the flag value file. However, this offset may not work for flag info file. Currently we only have boolean flags. Each boolean flag value and info takes up 1 byte in flag value and flag info file. So the byte offsets are the same. But in the future, when we add a new flag value type, or add more contents to flag info file. Then the byte offset for flag value file and flag info file may not be same. Instead, we should store index rather than offset. The package map should store the index of the first flag in this package. The flag map stores the within package index. Then flag value read api and flag info read api can then infer the byte offset independently. Bug: b/321077378 Test: atest -c Change-Id: Iad89776d5369715ba2d8faaea18261ac3271f13b
Loading
Please register or sign in to comment