libgui: Make BitTube Parcelable and use unique_fd
This change completes the Parcelable interface for BitTube (it was
semi-Parcelable before as it implemented writeToParcel, but this adds
the complementary readFromParcel).
It also changes the send and receive file descriptors from ints to
android::base::unique_fds, which simplifies some of their lifecycle
management.
Finally, it changes the default constructor to leave the class
uninitialized, adding a BitTube(BitTube::DefaultSize) constructor to
replace that functionality (and paving the way for the ability to
default-construct a BitTube prior to readFromParcel'ing into it).
Test: m -j + manual testing
Change-Id: Ib0cba4c7c443b449a9a1837f07f7334395d4f10d
diff --git a/services/surfaceflinger/EventThread.cpp b/services/surfaceflinger/EventThread.cpp
index 7e0506b..2d3515e 100644
--- a/services/surfaceflinger/EventThread.cpp
+++ b/services/surfaceflinger/EventThread.cpp
@@ -389,7 +389,7 @@
EventThread::Connection::Connection(
const sp<EventThread>& eventThread)
- : count(-1), mEventThread(eventThread), mChannel(new gui::BitTube())
+ : count(-1), mEventThread(eventThread), mChannel(new gui::BitTube(gui::BitTube::DefaultSize))
{
}