Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit f25d2e3b authored by Marybeth Fair's avatar Marybeth Fair
Browse files

Add ability to read both v1/v2 package map.

Note we're not actually updating the struct or anything to be v2 /
contain the fingerprint. All we're doing is adding methods to read v2
files.

This will ensure that any file, v1 or v2, can be read. I think we should
think a bit differently about where the version is set; ideally, it
would come from the build arg (from aconfig/src/main) and we'd use that
value within the system for all writes. For reads, we'd use whatever
version it's written as. For updates, similarly, we should maintain the
version  we have (though separately we can update files).

I also added "build flagging" to version increment. The reason I use quotes is because I added the ability to set the write version
via an optional arg to the create-storage CLI.
If the arg is not set, the default value is the existing version (1).
Since I haven't added the build flag or updated Soong to set the
version, it will always be unset, so this is equivalent to flagging by writing if (false) and
changing it to if (flagEnabled()) later. The reasons I would like to
start with this change are:
1) It lays the infra to be able to have different versions without actually
   changing the versions of anything.
2) If somehow anyone has the v2 file, at least now we can read it
   without crashing. This
   part of the change is not guarded by a flag because the check is the
   version code of the file that's on the device - so, moving forward,
   the updated reads will only be invoked if we've written the newer
   format, which is build flag guarded. If anyone has other ideas of how
   to approach this to ensure we cover any v2 files which may be in
   place, please let me know!

Test: atest, manual in-progress
Change-Id: Ib17ba44339c1d0d457c9cdd73047c891ab712774
parent cc0bb805
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment