summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Steven Moreland <smoreland@google.com> 2020-11-04 23:40:49 +0000
committer Steven Moreland <smoreland@google.com> 2020-11-04 23:40:49 +0000
commit46f79a21dca27e6cc6e12d39c3258959b689f20c (patch)
treea5c8cffb039501ab77547cc43f4f157898a24295
parent084e1948aeea969ff33d3c44ed80f31a3212c3c9 (diff)
libgui: no use readString16Inplace
This uses readString16Inplace, which we may try to remove, in order to make it possible libbinder can use utf-8 internally (and save space). Bug: 172502290 Test: boot Change-Id: I99761ebdcaa051363eabd9d577ca41b6d4d66880
-rw-r--r--libs/gui/view/Surface.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/libs/gui/view/Surface.cpp b/libs/gui/view/Surface.cpp
index d64dfd55be..d98ffc6618 100644
--- a/libs/gui/view/Surface.cpp
+++ b/libs/gui/view/Surface.cpp
@@ -72,13 +72,9 @@ status_t Surface::readFromParcel(const Parcel* parcel, bool nameAlreadyRead) {
}
String16 Surface::readMaybeEmptyString16(const Parcel* parcel) {
- size_t len;
- const char16_t* str = parcel->readString16Inplace(&len);
- if (str != nullptr) {
- return String16(str, len);
- } else {
- return String16();
- }
+ std::optional<String16> str;
+ parcel->readString16(&str);
+ return str.value_or(String16());
}
} // namespace view