diff options
Diffstat (limited to 'runtime/oat/oat.h')
-rw-r--r-- | runtime/oat/oat.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/runtime/oat/oat.h b/runtime/oat/oat.h index 0061c90da9..2069b569e3 100644 --- a/runtime/oat/oat.h +++ b/runtime/oat/oat.h @@ -164,7 +164,14 @@ class EXPORT PACKED(4) OatHeader { uint32_t GetKeyValueStoreSize() const; const uint8_t* GetKeyValueStore() const; - const char* GetStoreValueByKey(const char* key) const; + const char* GetStoreValueByKeyUnsafe(const char* key) const; + + const char* GetStoreValueByKey(const char* key) const { + // Do not get apex versions from the oat header directly. Use `OatFile::GetApexVersions` + // instead. + DCHECK_NE(std::string_view(key), kApexVersionsKey); + return GetStoreValueByKeyUnsafe(key); + } // Returns the next key-value pair, at the given offset. On success, updates `offset`. // The expected use case is to start the iteration with an offset initialized to zero and |