diff options
author | Ryan Mitchell <rtmitchell@google.com> | 2021-01-10 18:01:49 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2021-01-10 18:01:49 +0000 |
commit | 3d91609e47d43f8796b1f4989cdfe5081ba23e4b (patch) | |
tree | b72d7954a37d61e244aba7c43600e9e2c8bd2579 /cmds/idmap2/libidmap2/BinaryStreamVisitor.cpp | |
parent | d5d79830ad7506b36bfc2cbf823b3bb05d415653 (diff) | |
parent | fb4d09cadd27a3fb1a2e268417f0f511aa92e344 (diff) |
Merge changes I09965e58,I02316d0b,Ic240cdb8
* changes:
Read manifest values using resource id in idmap2
Accept --overlay-name flag in idmap2
Remove idmap path 256 length limit
Diffstat (limited to 'cmds/idmap2/libidmap2/BinaryStreamVisitor.cpp')
-rw-r--r-- | cmds/idmap2/libidmap2/BinaryStreamVisitor.cpp | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/cmds/idmap2/libidmap2/BinaryStreamVisitor.cpp b/cmds/idmap2/libidmap2/BinaryStreamVisitor.cpp index 726f6c5c2c99..c16310792d12 100644 --- a/cmds/idmap2/libidmap2/BinaryStreamVisitor.cpp +++ b/cmds/idmap2/libidmap2/BinaryStreamVisitor.cpp @@ -38,13 +38,6 @@ void BinaryStreamVisitor::Write32(uint32_t value) { stream_.write(reinterpret_cast<char*>(&x), sizeof(uint32_t)); } -void BinaryStreamVisitor::WriteString256(const StringPiece& value) { - char buf[kIdmapStringLength]; - memset(buf, 0, sizeof(buf)); - memcpy(buf, value.data(), std::min(value.size(), sizeof(buf))); - stream_.write(buf, sizeof(buf)); -} - void BinaryStreamVisitor::WriteString(const StringPiece& value) { // pad with null to nearest word boundary; size_t padding_size = CalculatePadding(value.size()); @@ -64,8 +57,9 @@ void BinaryStreamVisitor::visit(const IdmapHeader& header) { Write32(header.GetOverlayCrc()); Write32(header.GetFulfilledPolicies()); Write32(static_cast<uint8_t>(header.GetEnforceOverlayable())); - WriteString256(header.GetTargetPath()); - WriteString256(header.GetOverlayPath()); + WriteString(header.GetTargetPath()); + WriteString(header.GetOverlayPath()); + WriteString(header.GetOverlayName()); WriteString(header.GetDebugInfo()); } |