OSDN Git Service

Camera: make fence import agnostic to hidl transport
authorYin-Chia Yeh <yinchiayeh@google.com>
Tue, 10 Jan 2017 21:15:38 +0000 (13:15 -0800)
committerYin-Chia Yeh <yinchiayeh@google.com>
Wed, 18 Jan 2017 00:51:03 +0000 (16:51 -0800)
This will introduce one more FD dup/close in passthrough mode, but
we have no other choice as camera server will not know whether
it is running in passthrough or binderized mode.

Test: running Camera2 API CTS
Bug: 30985004
Change-Id: I407d54a51c51fc09477dfb6236ab1b53bb1e0a21

camera/device/3.2/default/CameraDeviceSession.cpp

index 5f7b950..26b7b73 100644 (file)
@@ -94,15 +94,7 @@ public:
         if (handle == nullptr || handle->numFds == 0) {
             fd = -1;
         } else if (handle->numFds == 1) {
-//TODO(b/34110242): make this hidl transport agnostic
-#ifdef BINDERIZED
             fd = dup(handle->data[0]);
-            // TODO(b/34169301)
-            // Camera service expect FD be closed by HAL process (in passthrough mode)
-            // close(handle->data[0]);
-#else
-            fd = handle->data[0];
-#endif
             if (fd < 0) {
                 ALOGE("failed to dup fence fd %d", handle->data[0]);
                 return false;
@@ -118,13 +110,9 @@ public:
 
     void closeFence(int fd)
     {
-#ifdef BINDERIZED
         if (fd >= 0) {
             close(fd);
         }
-#else
-        (void) fd;
-#endif
     }
 
 private: