Pointer support and embedded types in HIDL.

* Pointers work per transaction. Don't work
  across transactions.
* ref<T> in HIDL translates to T const* in C++.
* No Java support.
* Embedded types like ref<vec<vec<int32_t>>>
  or vec<ref<T>> is supported. Pointers to
  pointers like ref<ref<ref<T>>> is supported.
* Array of pointers and pointer to array supported.
* Pointer inside a union is NOT supported.

Test: `mma`
Test: `make hidl_test && adb sync && adb shell hidl_test`
      Note that this only works with a kernel patch.

Bug: 31300815
Bug: 31349114

Change-Id: I15b74ca74a801009cc8bdc7132bd53d0185dbcbf
diff --git a/ArrayType.h b/ArrayType.h
index 440a66c..4514c2d 100644
--- a/ArrayType.h
+++ b/ArrayType.h
@@ -72,7 +72,30 @@
             const std::string &parentName,
             const std::string &offsetText) const override;
 
+    void emitResolveReferences(
+            Formatter &out,
+            const std::string &name,
+            bool nameIsPointer,
+            const std::string &parcelObj,
+            bool parcelObjIsPointer,
+            bool isReader,
+            ErrorMode mode) const override;
+
+    void emitResolveReferencesEmbedded(
+            Formatter &out,
+            size_t depth,
+            const std::string &name,
+            const std::string &sanitizedName,
+            bool nameIsPointer,
+            const std::string &parcelObj,
+            bool parcelObjIsPointer,
+            bool isReader,
+            ErrorMode mode,
+            const std::string &parentName,
+            const std::string &offsetText) const override;
+
     bool needsEmbeddedReadWrite() const override;
+    bool needsResolveReferences() const override;
     bool resultNeedsDeref() const override;
 
     void emitJavaReaderWriter(
@@ -104,6 +127,8 @@
     std::vector<size_t> mSizes;
     std::vector<std::string> mSizeComments;
 
+    size_t dimension() const;
+
     DISALLOW_COPY_AND_ASSIGN(ArrayType);
 };