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/IDisplayEventConnection.h b/include/gui/IDisplayEventConnection.h
index 21b53fe..0779448 100644
--- a/include/gui/IDisplayEventConnection.h
+++ b/include/gui/IDisplayEventConnection.h
@@ -34,9 +34,11 @@
DECLARE_META_INTERFACE(DisplayEventConnection)
/*
- * getDataChannel() returns a BitTube where to receive the events from
+ * stealReceiveChannel() returns a BitTube to receive events from. Only the receive file
+ * descriptor of outChannel will be initialized, and this effectively "steals" the receive
+ * channel from the remote end (such that the remote end can only use its send channel).
*/
- virtual status_t getDataChannel(sp<gui::BitTube>* outChannel) const = 0;
+ virtual status_t stealReceiveChannel(gui::BitTube* outChannel) = 0;
/*
* setVsyncRate() sets the vsync event delivery rate. A value of 1 returns every vsync event.