AAPT2: Remove usage of u16string
For legacy reasons, we kept around the use of UTF-16 internally
in AAPT2. We don't need this and this CL removes all instances of
std::u16string and StringPiece16. The only places still needed
are when interacting with the ResTable APIs that only operate in
UTF16.
Change-Id: I492475b84bb9014fa13bf992cff447ee7a5fe588
diff --git a/tools/aapt2/proto/ProtoHelpers.cpp b/tools/aapt2/proto/ProtoHelpers.cpp
index 99981c5..2aa8aa5 100644
--- a/tools/aapt2/proto/ProtoHelpers.cpp
+++ b/tools/aapt2/proto/ProtoHelpers.cpp
@@ -33,7 +33,7 @@
}
void serializeSourceToPb(const Source& source, StringPool* srcPool, pb::Source* outPbSource) {
- StringPool::Ref ref = srcPool->makeRef(util::utf8ToUtf16(source.path));
+ StringPool::Ref ref = srcPool->makeRef(source.path);
outPbSource->set_path_idx(static_cast<uint32_t>(ref.getIndex()));
if (source.line) {
outPbSource->set_line_no(static_cast<uint32_t>(source.line.value()));
@@ -43,7 +43,7 @@
void deserializeSourceFromPb(const pb::Source& pbSource, const android::ResStringPool& srcPool,
Source* outSource) {
if (pbSource.has_path_idx()) {
- outSource->path = util::getString8(srcPool, pbSource.path_idx()).toString();
+ outSource->path = util::getString(srcPool, pbSource.path_idx());
}
if (pbSource.has_line_no()) {