Suport RpcData as a parcelable type.

Change-Id: I5721fe5b33f52edfb06f4c9cd4f8c97d234e9fc7
diff --git a/tools/aidl/Type.cpp b/tools/aidl/Type.cpp
index 9415bc8..8161ef3 100755
--- a/tools/aidl/Type.cpp
+++ b/tools/aidl/Type.cpp
@@ -903,6 +903,14 @@
 {
 }
 
+ParcelableType::ParcelableType(const string& package, const string& name,
+                            bool builtIn, bool canWriteToRpcData,
+                            const string& declFile, int declLine)
+    :Type(package, name, builtIn ? BUILT_IN : PARCELABLE, true, canWriteToRpcData, true,
+            declFile, declLine)
+{
+}
+
 string
 ParcelableType::CreatorName() const
 {
@@ -1258,7 +1266,7 @@
 // ================================================================
 
 RpcDataType::RpcDataType()
-    :Type("com.android.athome.rpc", "RpcData", Type::BUILT_IN, false, true, true)
+    :ParcelableType("com.android.athome.rpc", "RpcData", true, true)
 {
 }
 
diff --git a/tools/aidl/Type.h b/tools/aidl/Type.h
index 536dc17..a144448 100755
--- a/tools/aidl/Type.h
+++ b/tools/aidl/Type.h
@@ -355,6 +355,9 @@
 public:
                     ParcelableType(const string& package, const string& name,
                             bool builtIn, const string& declFile, int declLine);
+                    ParcelableType(const string& package, const string& name,
+                            bool builtIn, bool canWriteToRpcData,
+                            const string& declFile = "", int declLine = -1);
 
     virtual string  CreatorName() const;
 
@@ -434,6 +437,22 @@
     vector<Type*> m_args;
 };
 
+class RpcDataType : public ParcelableType
+{
+public:
+                    RpcDataType();
+
+    virtual void    WriteToRpcData(StatementBlock* addTo, Expression* k, Variable* v,
+                                    Variable* data, int flags);
+    virtual void    CreateFromRpcData(StatementBlock* addTo, Expression* k, Variable* v,
+                                    Variable* data, Variable** cl);
+};
+
+class ClassLoaderType : public Type
+{
+public:
+                    ClassLoaderType();
+};
 
 class GenericListType : public GenericType
 {
@@ -460,23 +479,6 @@
     string m_creator;
 };
 
-class RpcDataType : public Type
-{
-public:
-                    RpcDataType();
-
-    virtual void    WriteToRpcData(StatementBlock* addTo, Expression* k, Variable* v,
-                                    Variable* data, int flags);
-    virtual void    CreateFromRpcData(StatementBlock* addTo, Expression* k, Variable* v,
-                                    Variable* data, Variable** cl);
-};
-
-class ClassLoaderType : public Type
-{
-public:
-                    ClassLoaderType();
-};
-
 class Namespace
 {
 public: