Add BufferHub backend for android::view::Surface

This CL allows BufferHubProducer to be used as alternative backend of
parcelable Surface.

When sent over binder, BufferHubProducer serializes itself differently
from Binder-based IGBP objects. Instead of writing to a Parcel object as
strong binder object, BufferHubProducer asks libbufferhubqueue to
generate a BufferHubQueueParcelable object (which packs all the FDs
representing the BufferHub channel).

When received from a binder interface, BufferHubProducer object can be
reconstructed from the BufferHubQueueParcelable object. The newly
constructed object has all the FDs (i.e. UDS channels) directly
connected to bufferhubd. Thus, on going buffer transport operations can
happen directly between the receiving process and bufferhubd. This
elimates one extra binder hop.

Bug: 37517761
Bug: 70046255
Test: libgui_test, buffer_transport_benchmark,
      buffer_hub_queue_producer-test, dvr_api-test,
      SurfaceParcelable_test
Change-Id: I78bd879f36d3196f3d74c76c79d27467740792f7
diff --git a/libs/gui/view/Surface.cpp b/libs/gui/view/Surface.cpp
index 5ed3d3b..d64dfd5 100644
--- a/libs/gui/view/Surface.cpp
+++ b/libs/gui/view/Surface.cpp
@@ -45,10 +45,7 @@
         if (res != OK) return res;
     }
 
-    res = parcel->writeStrongBinder(
-            IGraphicBufferProducer::asBinder(graphicBufferProducer));
-
-    return res;
+    return IGraphicBufferProducer::exportToParcel(graphicBufferProducer, parcel);
 }
 
 status_t Surface::readFromParcel(const Parcel* parcel) {
@@ -70,16 +67,7 @@
         }
     }
 
-    sp<IBinder> binder;
-
-    res = parcel->readNullableStrongBinder(&binder);
-    if (res != OK) {
-        ALOGE("%s: Can't read strong binder", __FUNCTION__);
-        return res;
-    }
-
-    graphicBufferProducer = interface_cast<IGraphicBufferProducer>(binder);
-
+    graphicBufferProducer = IGraphicBufferProducer::createFromParcel(parcel);
     return OK;
 }