Remove toString + operator== from server libraries.
This is Phase III of a three phase plan to remove toString + operator==
from sources since the VNDK is currently not in place.
Phase I: functions in client and source libraries
Phase II: rebuild prebuilts with the functions in the clients
across all targets and vendors.
Phase III: remove functions from the source libraries
Test: manually inspecting binaries and sources, hidl_test
Test: 2016 pixel device boots and works
Test: 2017 pixel device boots and works
Test: 'some other device' boots and works
Test: boot bat
Test: boot owl
Bug: 65200821
Merged-In: Ib71614e43e7db9f83cbd42847e846324fd12fbde
Change-Id: Ib71614e43e7db9f83cbd42847e846324fd12fbde
diff --git a/Interface.cpp b/Interface.cpp
index 5f9a924..ed87b5d 100644
--- a/Interface.cpp
+++ b/Interface.cpp
@@ -849,12 +849,6 @@
void Interface::emitPackageTypeDeclarations(Formatter& out) const {
Scope::emitPackageTypeDeclarations(out);
- // TODO(b/65200821): remove these ifndefs
- out << "#ifdef REALLY_IS_HIDL_INTERNAL_LIB" << gCurrentCompileName << "\n";
- out << "std::string toString("
- << getCppArgumentType()
- << ");\n";
- out << "#else\n";
out << "static inline std::string toString(" << getCppArgumentType() << " o) ";
out.block([&] {
@@ -864,25 +858,12 @@
<< "os += o->isRemote() ? \"@remote\" : \"@local\";\n"
<< "return os;\n";
}).endl().endl();
- out << "#endif // REALLY_IS_HIDL_INTERNAL_LIB\n";
}
void Interface::emitTypeDefinitions(Formatter& out, const std::string& prefix) const {
std::string space = prefix.empty() ? "" : (prefix + "::");
+
Scope::emitTypeDefinitions(out, space + localName());
-
- // TODO(b/65200821): remove toString from .cpp once all prebuilts are rebuilt
- out << "std::string toString("
- << getCppArgumentType()
- << " o) ";
-
- out.block([&] {
- out << "std::string os = \"[class or subclass of \";\n"
- << "os += " << fullName() << "::descriptor;\n"
- << "os += \"]\";\n"
- << "os += o->isRemote() ? \"@remote\" : \"@local\";\n"
- << "return os;\n";
- }).endl().endl();
}
void Interface::emitJavaReaderWriter(