diff options
author | Michael Lentine <mlentine@google.com> | 2015-05-18 13:04:01 -0700 |
---|---|---|
committer | Michael Lentine <mlentine@google.com> | 2015-05-18 13:14:32 -0700 |
commit | 60788050236ff77f84675e12efe9dba098e49870 (patch) | |
tree | d4f1df78f418119dede449b90871a3e76eb8bc44 /include | |
parent | 6de7a06afb3f70abe1517fc55efd1a11110e5197 (diff) | |
download | system_core-60788050236ff77f84675e12efe9dba098e49870.zip system_core-60788050236ff77f84675e12efe9dba098e49870.tar.gz system_core-60788050236ff77f84675e12efe9dba098e49870.tar.bz2 |
Adding a build id check to blob cache.
Add a build id field to the header structure in blob cache. Add build
id support with reading and writing the cache. When the cache gets
written it writes the build id at the end of the header. When read it
checks to see if there is a match between the current version and the
version in the cache. If not, it invalidates the cache which would
typically only occur during an ota update. Also remove blob cache
from the host build.
bug: 18262905
Change-Id: I753b1de1986703a4c1c8691b9d2bb533b2546143
Diffstat (limited to 'include')
-rw-r--r-- | include/utils/BlobCache.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/utils/BlobCache.h b/include/utils/BlobCache.h index 7d621e4..65dca9f 100644 --- a/include/utils/BlobCache.h +++ b/include/utils/BlobCache.h @@ -185,6 +185,12 @@ private: // mNumEntries is number of cache entries following the header in the // data. size_t mNumEntries; + + // mBuildId is the build id of the device when the cache was created. + // When an update to the build happens (via an OTA or other update) this + // is used to invalidate the cache. + int mBuildIdLength; + char mBuildId[]; }; // An EntryHeader is the header for a serialized cache entry. No need to |