Get rid of duplicated #include code.

This is in preparation to add a new target for IServiceManagerDupe and
is also general cleanup.

Test: hidl_test
Bug: 32313592
Change-Id: I9427a042e1ef0b5432e227522b616a8a948f2acf
diff --git a/generateCppImpl.cpp b/generateCppImpl.cpp
index 570635f..25310f5 100644
--- a/generateCppImpl.cpp
+++ b/generateCppImpl.cpp
@@ -109,15 +109,7 @@
     out << "#ifndef " << guard << "\n";
     out << "#define " << guard << "\n\n";
 
-    std::vector<std::string> packageComponents;
-    getPackageAndVersionComponents(
-            &packageComponents, false /* cpp_compatible */);
-
-    out << "#include <";
-    for (const auto &component : packageComponents) {
-        out << component << "/";
-    }
-    out << "I" << baseName << ".h>\n";
+    generateCppPackageInclude(out, mPackage, "I" + baseName);
 
     out << "#include <hidl/Status.h>\n\n";
     out << "#include <hidl/MQDescriptor.h>\n";