Use interfaceDescriptor instead of interfaceChain

wherever suits. Sementically, interfaceDescriptor
returns the first element of interfaceChain; use
interfaceDescriptor when the rest of the elements
aren't used.

Bug: 34136228

Test: hidl_test
Change-Id: Ie3332c168a792ab018d9b762f9bf6c15ddcbf998
diff --git a/Interface.cpp b/Interface.cpp
index b4a1b67..57f3ca4 100644
--- a/Interface.cpp
+++ b/Interface.cpp
@@ -669,17 +669,13 @@
         << " o) ";
 
     out.block([&] {
-        out << "std::string os;\nbool ok = false;\n";
-        // TODO b/34136228 use interfaceDescriptor instead
-        out << "auto ret = o->interfaceChain([&os, &ok] (const auto &chain) ";
+        out << "std::string os;\n";
+        out << "auto ret = o->interfaceDescriptor([&os] (const auto &name) ";
         out.block([&] {
-            out.sIf("chain.size() >= 1", [&] {
-                out << "os += chain[0].c_str();\n"
-                    << "ok = true;\n";
-            }).endl();
+            out << "os += name.c_str();\n";
         });
         out << ");\n";
-        out.sIf("!ret.isOk() || !ok", [&] {
+        out.sIf("!ret.isOk()", [&] {
             out << "os += \"[class or subclass of \";\n"
                 << "os += " << fullName() << "::descriptor;\n"
                 << "os += \"]\";\n";