Use TypeNamespace instances in aidl.cpp

Refactor much of the logic around types into an instance of
TypeNamespace.  This class defines an interface to type reasoning
logic that aidl.cpp can use to register binder and parcelable types
it loads during parsing.  Code generation can use a language specific
subclass of the type namespace to reason about types more specifically.

For now, leave NAMES and the global type constants intact.  We'll
refactor those in a separate change if necessary.

Bug: 24303749
Test: Compiles, unittests pass

Change-Id: Ie56a89159c956c587a1ff3e45d38d1850b04a9f2
diff --git a/generate_java.h b/generate_java.h
index 12d9f57..b67a88c 100644
--- a/generate_java.h
+++ b/generate_java.h
@@ -12,11 +12,13 @@
 using std::string;
 using std::vector;
 
+class JavaTypeNamespace;
+
 int generate_java(const string& filename, const string& originalSrc,
-                interface_type* iface);
+                  interface_type* iface, JavaTypeNamespace* types);
 
 android::aidl::Class* generate_binder_interface_class(
-    const interface_type* iface);
+    const interface_type* iface, JavaTypeNamespace* types);
 
 string gather_comments(extra_text_type* extra);
 string append(const char* a, const char* b);