diff options
author | Adam Lesinski <adamlesinski@google.com> | 2015-07-27 16:53:14 -0700 |
---|---|---|
committer | Adam Lesinski <adamlesinski@google.com> | 2015-07-27 17:04:43 -0700 |
commit | 5b0f1be0a23011416697efaa7e9c050e466c44f5 (patch) | |
tree | 118c1a6aaa6b061299a48f6f62dc245be69b1463 /libs | |
parent | 71bfb27013f983bc4a54f1924af61c07732f994e (diff) | |
download | frameworks_base-5b0f1be0a23011416697efaa7e9c050e466c44f5.zip frameworks_base-5b0f1be0a23011416697efaa7e9c050e466c44f5.tar.gz frameworks_base-5b0f1be0a23011416697efaa7e9c050e466c44f5.tar.bz2 |
AAPT: Fix printing of resource configurations
Print out proper, copied configuration. We add fields to ResTable_config
and if we don't copy and fill in defaults when reading old configurations,
we end up with garbage values. This can potentially cause a crash as well.
Bug:22773426
Change-Id: I64f5ebe73ee72453bcdad3a19e48f8e7ad58e9c2
Diffstat (limited to 'libs')
-rw-r--r-- | libs/androidfw/ResourceTypes.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/libs/androidfw/ResourceTypes.cpp b/libs/androidfw/ResourceTypes.cpp index a95db9f..62aabb1 100644 --- a/libs/androidfw/ResourceTypes.cpp +++ b/libs/androidfw/ResourceTypes.cpp @@ -6758,7 +6758,13 @@ void ResTable::print(bool inclValues) const printf(" NON-INTEGER ResTable_type ADDRESS: %p\n", type); continue; } - String8 configStr = type->config.toString(); + + // Always copy the config, as fields get added and we need to + // set the defaults. + ResTable_config thisConfig; + thisConfig.copyFromDtoH(type->config); + + String8 configStr = thisConfig.toString(); printf(" config %s:\n", configStr.size() > 0 ? configStr.string() : "(default)"); size_t entryCount = dtohl(type->entryCount); |