BufferQueue: Remove Bn version of create*

It turns out that there's no reason to have both I* and Bn* versions
of the createBufferQueue method, so I removed the Bn* version.

Change-Id: I66aeb09e10458ae540ddf1f38d2d0154ea8f315b
diff --git a/libs/gui/BufferQueue.cpp b/libs/gui/BufferQueue.cpp
index c306f9d..782afcc 100644
--- a/libs/gui/BufferQueue.cpp
+++ b/libs/gui/BufferQueue.cpp
@@ -43,19 +43,6 @@
     }
 }
 
-void BufferQueue::createBufferQueue(sp<BnGraphicBufferProducer>* outProducer,
-        sp<BnGraphicBufferConsumer>* outConsumer,
-        const sp<IGraphicBufferAlloc>& allocator) {
-    LOG_ALWAYS_FATAL_IF(outProducer == NULL,
-            "BufferQueue: outProducer must not be NULL");
-    LOG_ALWAYS_FATAL_IF(outConsumer == NULL,
-            "BufferQueue: outConsumer must not be NULL");
-
-    sp<BufferQueueCore> core(new BufferQueueCore(allocator));
-    *outProducer = new BufferQueueProducer(core);
-    *outConsumer = new BufferQueueConsumer(core);
-}
-
 void BufferQueue::createBufferQueue(sp<IGraphicBufferProducer>* outProducer,
         sp<IGraphicBufferConsumer>* outConsumer,
         const sp<IGraphicBufferAlloc>& allocator) {
@@ -65,8 +52,19 @@
             "BufferQueue: outConsumer must not be NULL");
 
     sp<BufferQueueCore> core(new BufferQueueCore(allocator));
-    *outProducer = new BufferQueueProducer(core);
-    *outConsumer = new BufferQueueConsumer(core);
+    LOG_ALWAYS_FATAL_IF(core == NULL,
+            "BufferQueue: failed to create BufferQueueCore");
+
+    sp<IGraphicBufferProducer> producer(new BufferQueueProducer(core));
+    LOG_ALWAYS_FATAL_IF(producer == NULL,
+            "BufferQueue: failed to create BufferQueueProducer");
+
+    sp<IGraphicBufferConsumer> consumer(new BufferQueueConsumer(core));
+    LOG_ALWAYS_FATAL_IF(consumer == NULL,
+            "BufferQueue: failed to create BufferQueueConsumer");
+
+    *outProducer = producer;
+    *outConsumer = consumer;
 }
 
 BufferQueue::BufferQueue(const sp<IGraphicBufferAlloc>& allocator) :
diff --git a/libs/gui/tests/BufferQueue_test.cpp b/libs/gui/tests/BufferQueue_test.cpp
index 7943476..e02c780 100644
--- a/libs/gui/tests/BufferQueue_test.cpp
+++ b/libs/gui/tests/BufferQueue_test.cpp
@@ -81,12 +81,12 @@
 
     if (forkPid == 0) {
         // Child process
-        sp<BnGraphicBufferProducer> producer;
-        sp<BnGraphicBufferConsumer> consumer;
+        sp<IGraphicBufferProducer> producer;
+        sp<IGraphicBufferConsumer> consumer;
         BufferQueue::createBufferQueue(&producer, &consumer);
         sp<IServiceManager> serviceManager = defaultServiceManager();
-        serviceManager->addService(PRODUCER_NAME, producer.get());
-        serviceManager->addService(CONSUMER_NAME, consumer.get());
+        serviceManager->addService(PRODUCER_NAME, producer->asBinder());
+        serviceManager->addService(CONSUMER_NAME, consumer->asBinder());
         ProcessState::self()->startThreadPool();
         IPCThreadState::self()->joinThreadPool();
         LOG_ALWAYS_FATAL("Shouldn't be here");