view::Surface: Add toString()
This is used for the generation of AIDL files, I'm not sure why it
hasn't broken before.
For now, it just returns the set name of the view Surface.
Bug: 340933754
Flag: EXEMPT only builds in later test, is otherwise unused
functionality, required to build
Test: new test in libgui_test
Change-Id: I86ea29a8ea7dc8270fc471a0cfd04eb38e015045
diff --git a/libs/gui/view/Surface.cpp b/libs/gui/view/Surface.cpp
index 7c15e7c..84c2a6a 100644
--- a/libs/gui/view/Surface.cpp
+++ b/libs/gui/view/Surface.cpp
@@ -121,5 +121,11 @@
return str.value_or(String16());
}
+std::string Surface::toString() const {
+ std::stringstream out;
+ out << name;
+ return out.str();
+}
+
} // namespace view
} // namespace android