idmap: use more robust data structures
The problem of creating idmap data consists of three steps:
1. create the mapping overlay resid -> target resid
2. fix the padding between the target resids
3. write the mapping as a binary stream
Because we iterate over the resources in the overlay package, there are
no guarantees on the order in which target resources are processed. This
means we can't fix the padding until after step 1. On the other hand,
after step 2 the mapping should be immutable.
Introduce new data structures that help enforce immutability and
ownership of data, as outlined above.
Bug: 80150169
Test: make libandroidfw_tests
Test: atest OverlayHostTests OverlayDeviceTests
Change-Id: I45689e8003c96d251a63a758f77609972ae963df
1 file changed