summaryrefslogtreecommitdiff
path: root/tools/aapt2/Debug.cpp
diff options
context:
space:
mode:
authorRyan Mitchell <rtmitchell@google.com>2020-12-14 20:42:03 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2020-12-14 20:42:03 +0000
commit314863c132479b108f0ce61a5a753123cd3a15ca (patch)
tree8c2c62e7f5964b3ed503f1f2c753d0850ac70dec /tools/aapt2/Debug.cpp
parent2991744d472491889d9ba465c8f96c1022af5df0 (diff)
parenta45506e6f6619f59ce1ae94b20ad377b86966be0 (diff)
Merge changes from topic "inc-hard-am"
* changes: Revert^2 "Cache resolved theme values" Set resource id correctly when resolve fails Revert^2 "libandroidfw hardening for IncFs" idmap2: remove call to obsolete 'idmap2 verify' from valgrind.sh idmap2: remove the 'scan' command
Diffstat (limited to 'tools/aapt2/Debug.cpp')
-rw-r--r--tools/aapt2/Debug.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/aapt2/Debug.cpp b/tools/aapt2/Debug.cpp
index 439f231193df..82da24959521 100644
--- a/tools/aapt2/Debug.cpp
+++ b/tools/aapt2/Debug.cpp
@@ -436,9 +436,9 @@ void Debug::DumpResStringPool(const android::ResStringPool* pool, text::Printer*
for (size_t i=0; i<N; i++) {
size_t len;
if (pool->isUTF8()) {
- uniqueStrings.add(pool->string8At(i, &len));
+ uniqueStrings.add(UnpackOptionalString(pool->string8At(i), &len));
} else {
- uniqueStrings.add(pool->stringAt(i, &len));
+ uniqueStrings.add(UnpackOptionalString(pool->stringAt(i), &len));
}
}
@@ -450,8 +450,8 @@ void Debug::DumpResStringPool(const android::ResStringPool* pool, text::Printer*
const size_t NS = pool->size();
for (size_t s=0; s<NS; s++) {
- String8 str = pool->string8ObjectAt(s);
- printer->Print(StringPrintf("String #%zd : %s\n", s, str.string()));
+ auto str = pool->string8ObjectAt(s);
+ printer->Print(StringPrintf("String #%zd : %s\n", s, str.has_value() ? str->string() : ""));
}
}