From 42ebcb80b50834a1ce4755cd4ca86918c96ca3c6 Mon Sep 17 00:00:00 2001 From: MÃ¥rten Kongstad Date: Tue, 28 Mar 2017 15:30:21 +0200 Subject: idmap: include idmap version in check for stale file Teach is_idmap_stale_fd to include the idmap version in the list of criteria used to determine if an idmap file is already up to date. Change-Id: I3e4e2aa502fe76a034c3977bdb055a1df7e665be --- cmds/idmap/create.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'cmds/idmap/create.cpp') diff --git a/cmds/idmap/create.cpp b/cmds/idmap/create.cpp index 524db14f7aab..f415f8f5dd75 100644 --- a/cmds/idmap/create.cpp +++ b/cmds/idmap/create.cpp @@ -104,13 +104,17 @@ fail: } } - uint32_t cached_target_crc, cached_overlay_crc; + uint32_t version, cached_target_crc, cached_overlay_crc; String8 cached_target_path, cached_overlay_path; - if (!ResTable::getIdmapInfo(buf, N, NULL, &cached_target_crc, &cached_overlay_crc, + if (!ResTable::getIdmapInfo(buf, N, &version, &cached_target_crc, &cached_overlay_crc, &cached_target_path, &cached_overlay_path)) { return true; } + if (version != ResTable::IDMAP_CURRENT_VERSION) { + return true; + } + if (cached_target_path != target_apk_path) { return true; } -- cgit v1.2.3-59-g8ed1b