From 60788050236ff77f84675e12efe9dba098e49870 Mon Sep 17 00:00:00 2001 From: Michael Lentine Date: Mon, 18 May 2015 13:04:01 -0700 Subject: 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 --- include/utils/BlobCache.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include') 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 -- cgit v1.1