liblp: Expand the metadata header for future use.
A few times we have wanted to stash small bits of information in the super header, but we haven't had any bits to do so. This patch addresses future needs in two ways: 1. A "flags" field has been added for miscellanious bits that do not need a version bump. 2. The header struct has been padded to 256 bytes to allow for future expansion without complicating the struct-parsing code. This is the first time we've materially changed the format, so this patch needs some extra explanation. In all the places we rely on sizeof(LpMetadataHeader), we now need to use the |header_size| field instead. To make newer versions of liblp compatible with older headers, we read the minimum required header size and fill in the extra bytes as needed. To make the validation and reading logic more clear, it is now combined into a single function, ReadMetdataHeader. MetadataBuilder will still emit 1.0-compatible headers, to avoid changing the on-disk format of existing devices. The new header will only be emitted as-needed. Bug: 134949511 Test: liblp_test gtest retrofit DAP device boots launch DAP device boots Change-Id: I6221123768ff0057a73967ecb2ff9b006c17af88
Loading
Please register or sign in to comment