diff options
author | Ryan Mitchell <rtmitchell@google.com> | 2020-04-10 15:50:15 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2020-04-10 15:50:15 +0000 |
commit | 6cb79cdfb777e817c29e574aed1f2711996b578c (patch) | |
tree | dafc87dd27736942c9d4e2a0128f98d391a2225e /libs/androidfw/ApkAssets.cpp | |
parent | ce4cd092d9c0cd815e2e097a381b819081ce96e9 (diff) | |
parent | 5900a1d3c5ba4941c16927abce25541956ff448a (diff) |
Merge changes from topic "invalidate_idmap" into rvc-dev
* changes:
Fix InstallOverlayTests fail to install overlay
Test that upgrading target apk invalidates idmap
Invalidate idmap when target updates
Diffstat (limited to 'libs/androidfw/ApkAssets.cpp')
-rw-r--r-- | libs/androidfw/ApkAssets.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libs/androidfw/ApkAssets.cpp b/libs/androidfw/ApkAssets.cpp index 918e7af12d31..05f4d6b63a4c 100644 --- a/libs/androidfw/ApkAssets.cpp +++ b/libs/androidfw/ApkAssets.cpp @@ -385,7 +385,7 @@ std::unique_ptr<const ApkAssets> ApkAssets::LoadOverlay(const std::string& idmap const StringPiece idmap_data( reinterpret_cast<const char*>(idmap_asset->getBuffer(true /*wordAligned*/)), static_cast<size_t>(idmap_asset->getLength())); - std::unique_ptr<const LoadedIdmap> loaded_idmap = LoadedIdmap::Load(idmap_data); + std::unique_ptr<const LoadedIdmap> loaded_idmap = LoadedIdmap::Load(idmap_path, idmap_data); if (loaded_idmap == nullptr) { LOG(ERROR) << "failed to load IDMAP " << idmap_path; return {}; @@ -538,8 +538,9 @@ bool ApkAssets::IsUpToDate() const { // Loaders are invalidated by the app, not the system, so assume they are up to date. return true; } + return (!loaded_idmap_ || loaded_idmap_->IsUpToDate()) && + last_mod_time_ == getFileModDate(path_.c_str()); - return last_mod_time_ == getFileModDate(path_.c_str()); } } // namespace android |