diff options
Diffstat (limited to 'libs')
| -rw-r--r-- | libs/androidfw/ResourceTypes.cpp | 7 | ||||
| -rw-r--r-- | libs/androidfw/include/androidfw/ResourceTypes.h | 1 | ||||
| -rw-r--r-- | libs/hwui/TessellationCache.cpp | 4 |
3 files changed, 7 insertions, 5 deletions
diff --git a/libs/androidfw/ResourceTypes.cpp b/libs/androidfw/ResourceTypes.cpp index 0782269d7de1..7a0ef2b770ce 100644 --- a/libs/androidfw/ResourceTypes.cpp +++ b/libs/androidfw/ResourceTypes.cpp @@ -59,7 +59,6 @@ namespace android { #endif #define IDMAP_MAGIC 0x504D4449 -#define IDMAP_CURRENT_VERSION 0x00000001 #define APP_PACKAGE_ID 0x7f #define SYS_PACKAGE_ID 0x01 @@ -246,11 +245,11 @@ static bool assertIdmapHeader(const void* idmap, size_t size) { } const uint32_t version = htodl(*(reinterpret_cast<const uint32_t*>(idmap) + 1)); - if (version != IDMAP_CURRENT_VERSION) { + if (version != ResTable::IDMAP_CURRENT_VERSION) { // We are strict about versions because files with this format are // auto-generated and don't need backwards compatibility. ALOGW("idmap: version mismatch in header (is 0x%08x, expected 0x%08x)", - version, IDMAP_CURRENT_VERSION); + version, ResTable::IDMAP_CURRENT_VERSION); return false; } return true; @@ -6855,7 +6854,7 @@ status_t ResTable::createIdmap(const ResTable& overlay, uint32_t* data = (uint32_t*)*outData; *data++ = htodl(IDMAP_MAGIC); - *data++ = htodl(IDMAP_CURRENT_VERSION); + *data++ = htodl(ResTable::IDMAP_CURRENT_VERSION); *data++ = htodl(targetCrc); *data++ = htodl(overlayCrc); const char* paths[] = { targetPath, overlayPath }; diff --git a/libs/androidfw/include/androidfw/ResourceTypes.h b/libs/androidfw/include/androidfw/ResourceTypes.h index 7a6e37d41b7c..66c66c251d9b 100644 --- a/libs/androidfw/include/androidfw/ResourceTypes.h +++ b/libs/androidfw/include/androidfw/ResourceTypes.h @@ -1933,6 +1933,7 @@ public: void** outData, size_t* outSize) const; static const size_t IDMAP_HEADER_SIZE_BYTES = 4 * sizeof(uint32_t) + 2 * 256; + static const uint32_t IDMAP_CURRENT_VERSION = 0x00000001; // Retrieve idmap meta-data. // diff --git a/libs/hwui/TessellationCache.cpp b/libs/hwui/TessellationCache.cpp index 01582ce8f007..63bf7bc443e0 100644 --- a/libs/hwui/TessellationCache.cpp +++ b/libs/hwui/TessellationCache.cpp @@ -400,7 +400,9 @@ TessellationCache::Buffer* TessellationCache::getOrCreateBuffer( mProcessor = new TessellationProcessor(Caches::getInstance()); } mProcessor->add(task); - mCache.put(entry, buffer); + bool inserted = mCache.put(entry, buffer); + // Note to the static analyzer that this insert should always succeed. + LOG_ALWAYS_FATAL_IF(!inserted, "buffers shouldn't spontaneously appear in the cache"); } return buffer; } |