From 18220909f0e913e476d235fb4a7f1fb9eb1876c2 Mon Sep 17 00:00:00 2001 From: Jeff Sharkey Date: Thu, 5 Nov 2020 08:36:20 -0700 Subject: Double speed of Parcel.writeString(). updating docs Bug: 172562452 Change-Id: I57754eac7af235a0a1bce9642d4923856bb04b78 Merged-In: I57754eac7af235a0a1bce9642d4923856bb04b78 --- libs/binder/Parcel.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libs/binder/Parcel.cpp b/libs/binder/Parcel.cpp index 40dd09b180..27cf97c945 100644 --- a/libs/binder/Parcel.cpp +++ b/libs/binder/Parcel.cpp @@ -1068,6 +1068,7 @@ status_t Parcel::writeString8(const char* str, size_t len) { if (str == nullptr) return writeInt32(-1); + // NOTE: Keep this logic in sync with android_os_Parcel.cpp status_t err = writeInt32(len); if (err == NO_ERROR) { uint8_t* data = (uint8_t*)writeInplace(len+sizeof(char)); @@ -1108,6 +1109,7 @@ status_t Parcel::writeString16(const char16_t* str, size_t len) { if (str == nullptr) return writeInt32(-1); + // NOTE: Keep this logic in sync with android_os_Parcel.cpp status_t err = writeInt32(len); if (err == NO_ERROR) { len *= sizeof(char16_t); -- cgit v1.2.3-59-g8ed1b