NDK Backend: send/receive interfaces

E.x.: "IEmpty RepeatInterface(IEmpty value);"

Interfaces have read/write methods. If an interface is local, its
implementation is retrieved. Otherwise, a proxy for it is constructed.

Bug: 112664205
Test: atest android.binder.cts
Change-Id: Id3496500321b0110915c29100d778ba95af558d2
diff --git a/aidl_to_ndk.h b/aidl_to_ndk.h
index d024b4c..cfbab17 100644
--- a/aidl_to_ndk.h
+++ b/aidl_to_ndk.h
@@ -16,6 +16,7 @@
 #pragma once
 
 #include "aidl_language.h"
+#include "aidl_to_cpp_common.h"
 
 namespace android {
 namespace aidl {
@@ -27,13 +28,19 @@
   OUT_ARGUMENT,  // Pointer to raw type
 };
 
+// Returns ::aidl::some_package::some_sub_package::foo::IFoo/BpFoo/BnFoo
+std::string NdkFullClassName(const AidlDefinedType& type, cpp::ClassNames name);
+
 // Returns the corresponding Ndk type name for an AIDL type spec including
 // array modifiers.
-std::string NdkNameOf(const AidlTypeSpecifier& aidl, StorageMode mode);
+std::string NdkNameOf(const AidlTypenames& types, const AidlTypeSpecifier& aidl, StorageMode mode);
 
 struct CodeGeneratorContext {
   CodeWriter& writer;
+
+  const AidlTypenames& types;
   const AidlTypeSpecifier& type;
+
   const string parcel;
   const string var;
 };
@@ -42,13 +49,14 @@
 void ReadFromParcelFor(const CodeGeneratorContext& c);
 
 // -> 'type name, type name, type name' for a method
-std::string NdkArgListOf(const AidlMethod& method);
+std::string NdkArgListOf(const AidlTypenames& types, const AidlMethod& method);
 
 // -> 'name, name, name' for a method where out arguments are '&name'
 std::string NdkCallListFor(const AidlMethod& method);
 
 // -> 'status (class::)name(type name, ...)' for a method
-std::string NdkMethodDecl(const AidlMethod& method, const std::string& clazz = "");
+std::string NdkMethodDecl(const AidlTypenames& types, const AidlMethod& method,
+                          const std::string& clazz = "");
 
 }  // namespace ndk
 }  // namespace aidl