summaryrefslogtreecommitdiff
path: root/libs/gui/view/Surface.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libs/gui/view/Surface.cpp')
-rw-r--r--libs/gui/view/Surface.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/libs/gui/view/Surface.cpp b/libs/gui/view/Surface.cpp
index 1bfe4624f1..d64dfd55be 100644
--- a/libs/gui/view/Surface.cpp
+++ b/libs/gui/view/Surface.cpp
@@ -45,9 +45,7 @@ status_t Surface::writeToParcel(Parcel* parcel, bool nameAlreadyWritten) const {
if (res != OK) return res;
}
- res = IGraphicBufferProducer::exportToParcel(graphicBufferProducer, parcel);
- if (res != OK) return res;
- return parcel->writeStrongBinder(surfaceControlHandle);
+ return IGraphicBufferProducer::exportToParcel(graphicBufferProducer, parcel);
}
status_t Surface::readFromParcel(const Parcel* parcel) {
@@ -70,14 +68,17 @@ status_t Surface::readFromParcel(const Parcel* parcel, bool nameAlreadyRead) {
}
graphicBufferProducer = IGraphicBufferProducer::createFromParcel(parcel);
- surfaceControlHandle = parcel->readStrongBinder();
return OK;
}
String16 Surface::readMaybeEmptyString16(const Parcel* parcel) {
- std::optional<String16> str;
- parcel->readString16(&str);
- return str.value_or(String16());
+ size_t len;
+ const char16_t* str = parcel->readString16Inplace(&len);
+ if (str != nullptr) {
+ return String16(str, len);
+ } else {
+ return String16();
+ }
}
} // namespace view