Switch from ScopedFd to unique_fd.
ScopedFd is being deprecated.
Bug: 35856819
Test: Still builds on nyc-iot-dev, now builds on master too.
Change-Id: Ibf131cbac218d581beee17e70f83042289382f17
diff --git a/modules/camera/3_4/Android.mk b/modules/camera/3_4/Android.mk
index fbb9a4b..d4201ba 100644
--- a/modules/camera/3_4/Android.mk
+++ b/modules/camera/3_4/Android.mk
@@ -27,7 +27,6 @@
libcutils \
libhardware \
liblog \
- libnativehelper \
libsync \
libutils \
diff --git a/modules/camera/3_4/v4l2_wrapper.cpp b/modules/camera/3_4/v4l2_wrapper.cpp
index 64115fb..3fafffd 100644
--- a/modules/camera/3_4/v4l2_wrapper.cpp
+++ b/modules/camera/3_4/v4l2_wrapper.cpp
@@ -19,6 +19,7 @@
#include <algorithm>
#include <array>
#include <limits>
+#include <mutex>
#include <vector>
#include <fcntl.h>
@@ -26,9 +27,7 @@
#include <sys/stat.h>
#include <sys/types.h>
-#include <mutex>
-
-#include <nativehelper/ScopedFd.h>
+#include <android-base/unique_fd.h>
#include "common.h"
#include "stream_format.h"
@@ -107,7 +106,7 @@
return;
}
- device_fd_.reset(); // Includes close().
+ device_fd_.reset(-1); // Includes close().
format_.reset();
buffers_.clear();
// Closing the device releases all queued buffers back to the user.
diff --git a/modules/camera/3_4/v4l2_wrapper.h b/modules/camera/3_4/v4l2_wrapper.h
index eb41239..c3ad272 100644
--- a/modules/camera/3_4/v4l2_wrapper.h
+++ b/modules/camera/3_4/v4l2_wrapper.h
@@ -24,7 +24,7 @@
#include <string>
#include <vector>
-#include <nativehelper/ScopedFd.h>
+#include <android-base/unique_fd.h>
#include "common.h"
#include "stream_format.h"
@@ -102,7 +102,7 @@
// The camera device path. For example, /dev/video0.
const std::string device_path_;
// The opened device fd.
- ScopedFd device_fd_;
+ android::base::unique_fd device_fd_;
// The underlying gralloc module.
std::unique_ptr<V4L2Gralloc> gralloc_;
// Whether or not the device supports the extended control query.