libgui: Remove RefBase from BitTube

Removes RefBase from BitTube, since because it is not a Binder object,
it doesn't need to be reference-counted in this way.

In the process, we rename IDisplayEventConnection::getDataChannel to
IDEC::stealReceiveChannel to make it clearer that this is a non-const
operation on the remote end that removes its access to the receive
channel.

This also adds a couple of methods for moving the receive file
descriptor out of one BitTube and into another, since this is the
essence of the IDisplayEventConnection::stealReceiveChannel method,
and now with C++11 move semantics, we can do this without needing to
return an sp<> from EventThread's implementation of stealReceiveChannel.

Test: m -j + manual testing
Change-Id: Ibaaca2a14fb6155052fe5434c14bc3e671b43743
diff --git a/include/gui/DisplayEventReceiver.h b/include/gui/DisplayEventReceiver.h
index 6d1ab5d..9557b4f 100644
--- a/include/gui/DisplayEventReceiver.h
+++ b/include/gui/DisplayEventReceiver.h
@@ -111,15 +111,13 @@
      * should be destroyed and getEvents() shouldn't be called again.
      */
     ssize_t getEvents(Event* events, size_t count);
-    static ssize_t getEvents(const sp<gui::BitTube>& dataChannel,
-            Event* events, size_t count);
+    static ssize_t getEvents(gui::BitTube* dataChannel, Event* events, size_t count);
 
     /*
      * sendEvents write events to the queue and returns how many events were
      * written.
      */
-    static ssize_t sendEvents(const sp<gui::BitTube>& dataChannel,
-            Event const* events, size_t count);
+    static ssize_t sendEvents(gui::BitTube* dataChannel, Event const* events, size_t count);
 
     /*
      * setVsyncRate() sets the Event::VSync delivery rate. A value of
@@ -137,7 +135,7 @@
 
 private:
     sp<IDisplayEventConnection> mEventConnection;
-    sp<gui::BitTube> mDataChannel;
+    std::unique_ptr<gui::BitTube> mDataChannel;
 };
 
 // ----------------------------------------------------------------------------