Implement Parcelling functions for InputWindowInfo

In preparation for parcelling across the SurfaceControl interface.
As a dependency we move the parcelling of InputChannels from
frameworks/base JNI code in to InputChannel.h.

Bug: 80101428
Bug: 113136004
Bug: 111440400
Test: None
Change-Id: Ib27f03282e9872274b834bb00737fd351e7a1b30
diff --git a/include/input/InputTransport.h b/include/input/InputTransport.h
index 5fd86b4..4782c9b 100644
--- a/include/input/InputTransport.h
+++ b/include/input/InputTransport.h
@@ -37,6 +37,7 @@
 #include <utils/BitSet.h>
 
 namespace android {
+class Parcel;
 
 /*
  * Intermediate representation used to send input events and related signals.
@@ -143,6 +144,7 @@
     virtual ~InputChannel();
 
 public:
+    InputChannel() = default;
     InputChannel(const std::string& name, int fd);
 
     /* Creates a pair of input channels.
@@ -183,9 +185,14 @@
     /* Returns a new object that has a duplicate of this channel's fd. */
     sp<InputChannel> dup() const;
 
+    status_t write(Parcel& out) const;
+    status_t read(const Parcel& from);
+
 private:
+    void setFd(int fd);
+
     std::string mName;
-    int mFd;
+    int mFd = -1;
 };
 
 /*