Merge "libgui: no use readString16Inplace" am: b1d6aaa8a5 am: eabc791b14 am: 16524d223a

Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/1487916

Change-Id: I2aac865dbb611f7728c04f52caab1f8dfab9bc7f
diff --git a/libs/gui/view/Surface.cpp b/libs/gui/view/Surface.cpp
index d64dfd5..d98ffc6 100644
--- a/libs/gui/view/Surface.cpp
+++ b/libs/gui/view/Surface.cpp
@@ -72,13 +72,9 @@
 }
 
 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