Fix clang-tidy warnings in camera.
* Add explicit keyword to conversion constructors.
Bug: 28341362
* Use const reference type for read-only parameters.
Bug: 30407689
* Use const reference type to avoid unnecessary copy.
Bug: 30413862
Test: build with WITH_TIDY=1
Change-Id: I71d3008da843ba5f1df1a73a320fb2af6ceffa16
diff --git a/camera/VendorTagDescriptor.cpp b/camera/VendorTagDescriptor.cpp
index 02ece14..756962f 100644
--- a/camera/VendorTagDescriptor.cpp
+++ b/camera/VendorTagDescriptor.cpp
@@ -284,7 +284,7 @@
return &mSections;
}
-status_t VendorTagDescriptor::lookupTag(String8 name, String8 section, /*out*/uint32_t* tag) const {
+status_t VendorTagDescriptor::lookupTag(const String8& name, const String8& section, /*out*/uint32_t* tag) const {
ssize_t index = mReverseMapping.indexOfKey(section);
if (index < 0) {
ALOGE("%s: Section '%s' does not exist.", __FUNCTION__, section.string());
diff --git a/include/camera/VendorTagDescriptor.h b/include/camera/VendorTagDescriptor.h
index 60e2d2d..bfc8c96 100644
--- a/include/camera/VendorTagDescriptor.h
+++ b/include/camera/VendorTagDescriptor.h
@@ -91,7 +91,7 @@
*
* Returns OK on success, or a negative error code.
*/
- status_t lookupTag(String8 name, String8 section, /*out*/uint32_t* tag) const;
+ status_t lookupTag(const String8& name, const String8& section, /*out*/uint32_t* tag) const;
/**
* Dump the currently configured vendor tags to a file descriptor.
diff --git a/services/camera/libcameraservice/CameraFlashlight.cpp b/services/camera/libcameraservice/CameraFlashlight.cpp
index ad08a68..6314ba5 100644
--- a/services/camera/libcameraservice/CameraFlashlight.cpp
+++ b/services/camera/libcameraservice/CameraFlashlight.cpp
@@ -812,7 +812,7 @@
}
status_t CameraHardwareInterfaceFlashControl::initializePreviewWindow(
- sp<CameraHardwareInterface> device, int32_t width, int32_t height) {
+ const sp<CameraHardwareInterface>& device, int32_t width, int32_t height) {
status_t res;
BufferQueue::createBufferQueue(&mProducer, &mConsumer);
diff --git a/services/camera/libcameraservice/CameraFlashlight.h b/services/camera/libcameraservice/CameraFlashlight.h
index 5cde372..59fc87d 100644
--- a/services/camera/libcameraservice/CameraFlashlight.h
+++ b/services/camera/libcameraservice/CameraFlashlight.h
@@ -193,7 +193,7 @@
status_t disconnectCameraDevice();
// initialize the preview window
- status_t initializePreviewWindow(sp<CameraHardwareInterface> device,
+ status_t initializePreviewWindow(const sp<CameraHardwareInterface>& device,
int32_t width, int32_t height);
// start preview and enable torch
diff --git a/services/camera/libcameraservice/CameraService.cpp b/services/camera/libcameraservice/CameraService.cpp
index 54424ed..14e92ad 100644
--- a/services/camera/libcameraservice/CameraService.cpp
+++ b/services/camera/libcameraservice/CameraService.cpp
@@ -2366,7 +2366,7 @@
void CameraService::ClientEventListener::onClientAdded(
const resource_policy::ClientDescriptor<String8,
sp<CameraService::BasicClient>>& descriptor) {
- auto basicClient = descriptor.getValue();
+ const auto& basicClient = descriptor.getValue();
if (basicClient.get() != nullptr) {
BatteryNotifier& notifier(BatteryNotifier::getInstance());
notifier.noteStartCamera(descriptor.getKey(),
@@ -2377,7 +2377,7 @@
void CameraService::ClientEventListener::onClientRemoved(
const resource_policy::ClientDescriptor<String8,
sp<CameraService::BasicClient>>& descriptor) {
- auto basicClient = descriptor.getValue();
+ const auto& basicClient = descriptor.getValue();
if (basicClient.get() != nullptr) {
BatteryNotifier& notifier(BatteryNotifier::getInstance());
notifier.noteStopCamera(descriptor.getKey(),
diff --git a/services/camera/libcameraservice/CameraService.h b/services/camera/libcameraservice/CameraService.h
index 4332ce3..b35f35c 100644
--- a/services/camera/libcameraservice/CameraService.h
+++ b/services/camera/libcameraservice/CameraService.h
@@ -265,7 +265,7 @@
class OpsCallback : public BnAppOpsCallback {
public:
- OpsCallback(wp<BasicClient> client);
+ explicit OpsCallback(wp<BasicClient> client);
virtual void opChanged(int32_t op, const String16& packageName);
private:
diff --git a/services/camera/libcameraservice/api1/Camera2Client.cpp b/services/camera/libcameraservice/api1/Camera2Client.cpp
index 005dd69..bcd62d6 100644
--- a/services/camera/libcameraservice/api1/Camera2Client.cpp
+++ b/services/camera/libcameraservice/api1/Camera2Client.cpp
@@ -526,7 +526,7 @@
}
status_t Camera2Client::setPreviewWindowL(const sp<IBinder>& binder,
- sp<Surface> window) {
+ const sp<Surface>& window) {
ATRACE_CALL();
status_t res;
@@ -1903,12 +1903,12 @@
}
status_t Camera2Client::registerFrameListener(int32_t minId, int32_t maxId,
- wp<camera2::FrameProcessor::FilteredListener> listener, bool sendPartials) {
+ const wp<camera2::FrameProcessor::FilteredListener>& listener, bool sendPartials) {
return mFrameProcessor->registerListener(minId, maxId, listener, sendPartials);
}
status_t Camera2Client::removeFrameListener(int32_t minId, int32_t maxId,
- wp<camera2::FrameProcessor::FilteredListener> listener) {
+ const wp<camera2::FrameProcessor::FilteredListener>& listener) {
return mFrameProcessor->removeListener(minId, maxId, listener);
}
diff --git a/services/camera/libcameraservice/api1/Camera2Client.h b/services/camera/libcameraservice/api1/Camera2Client.h
index 3cb9e4f..e2129f5 100644
--- a/services/camera/libcameraservice/api1/Camera2Client.h
+++ b/services/camera/libcameraservice/api1/Camera2Client.h
@@ -126,10 +126,10 @@
int getZslStreamId() const;
status_t registerFrameListener(int32_t minId, int32_t maxId,
- wp<camera2::FrameProcessor::FilteredListener> listener,
+ const wp<camera2::FrameProcessor::FilteredListener>& listener,
bool sendPartials = true);
status_t removeFrameListener(int32_t minId, int32_t maxId,
- wp<camera2::FrameProcessor::FilteredListener> listener);
+ const wp<camera2::FrameProcessor::FilteredListener>& listener);
status_t stopStream();
@@ -160,7 +160,7 @@
typedef camera2::Parameters Parameters;
status_t setPreviewWindowL(const sp<IBinder>& binder,
- sp<Surface> window);
+ const sp<Surface>& window);
status_t startPreviewL(Parameters ¶ms, bool restart);
void stopPreviewL();
status_t startRecordingL(Parameters ¶ms, bool restart);
diff --git a/services/camera/libcameraservice/api1/client2/CallbackProcessor.cpp b/services/camera/libcameraservice/api1/client2/CallbackProcessor.cpp
index b4b269a..3f4017f 100644
--- a/services/camera/libcameraservice/api1/client2/CallbackProcessor.cpp
+++ b/services/camera/libcameraservice/api1/client2/CallbackProcessor.cpp
@@ -55,7 +55,7 @@
}
status_t CallbackProcessor::setCallbackWindow(
- sp<Surface> callbackWindow) {
+ const sp<Surface>& callbackWindow) {
ATRACE_CALL();
status_t res;
diff --git a/services/camera/libcameraservice/api1/client2/CallbackProcessor.h b/services/camera/libcameraservice/api1/client2/CallbackProcessor.h
index a22442f..5231688 100644
--- a/services/camera/libcameraservice/api1/client2/CallbackProcessor.h
+++ b/services/camera/libcameraservice/api1/client2/CallbackProcessor.h
@@ -41,13 +41,13 @@
class CallbackProcessor:
public Thread, public CpuConsumer::FrameAvailableListener {
public:
- CallbackProcessor(sp<Camera2Client> client);
+ explicit CallbackProcessor(sp<Camera2Client> client);
~CallbackProcessor();
void onFrameAvailable(const BufferItem& item);
// Set to NULL to disable the direct-to-app callback window
- status_t setCallbackWindow(sp<Surface> callbackWindow);
+ status_t setCallbackWindow(const sp<Surface>& callbackWindow);
status_t updateStream(const Parameters ¶ms);
status_t deleteStream();
int getStreamId() const;
diff --git a/services/camera/libcameraservice/api1/client2/Camera2Heap.h b/services/camera/libcameraservice/api1/client2/Camera2Heap.h
index 9c72d76..fe3afcb 100644
--- a/services/camera/libcameraservice/api1/client2/Camera2Heap.h
+++ b/services/camera/libcameraservice/api1/client2/Camera2Heap.h
@@ -26,7 +26,7 @@
// Utility class for managing a set of IMemory blocks
class Camera2Heap : public RefBase {
public:
- Camera2Heap(size_t buf_size, uint_t num_buffers = 1,
+ explicit Camera2Heap(size_t buf_size, uint_t num_buffers = 1,
const char *name = NULL) :
mBufSize(buf_size),
mNumBufs(num_buffers) {
diff --git a/services/camera/libcameraservice/api1/client2/CaptureSequencer.cpp b/services/camera/libcameraservice/api1/client2/CaptureSequencer.cpp
index 05adb29..b65f1c7 100644
--- a/services/camera/libcameraservice/api1/client2/CaptureSequencer.cpp
+++ b/services/camera/libcameraservice/api1/client2/CaptureSequencer.cpp
@@ -59,7 +59,7 @@
ALOGV("%s: Exit", __FUNCTION__);
}
-void CaptureSequencer::setZslProcessor(wp<ZslProcessor> processor) {
+void CaptureSequencer::setZslProcessor(const wp<ZslProcessor>& processor) {
Mutex::Autolock l(mInputMutex);
mZslProcessor = processor;
}
@@ -132,7 +132,7 @@
}
void CaptureSequencer::onCaptureAvailable(nsecs_t timestamp,
- sp<MemoryBase> captureBuffer, bool captureError) {
+ const sp<MemoryBase>& captureBuffer, bool captureError) {
ATRACE_CALL();
ALOGV("%s", __FUNCTION__);
Mutex::Autolock l(mInputMutex);
@@ -709,7 +709,7 @@
}
/*static*/ void CaptureSequencer::shutterNotifyLocked(const Parameters ¶ms,
- sp<Camera2Client> client, int msgType) {
+ const sp<Camera2Client>& client, int msgType) {
ATRACE_CALL();
if (params.state == Parameters::STILL_CAPTURE
diff --git a/services/camera/libcameraservice/api1/client2/CaptureSequencer.h b/services/camera/libcameraservice/api1/client2/CaptureSequencer.h
index a7c61d2..f2e3750 100644
--- a/services/camera/libcameraservice/api1/client2/CaptureSequencer.h
+++ b/services/camera/libcameraservice/api1/client2/CaptureSequencer.h
@@ -44,11 +44,11 @@
virtual public Thread,
virtual public FrameProcessor::FilteredListener {
public:
- CaptureSequencer(wp<Camera2Client> client);
+ explicit CaptureSequencer(wp<Camera2Client> client);
~CaptureSequencer();
// Get reference to the ZslProcessor, which holds the ZSL buffers and frames
- void setZslProcessor(wp<ZslProcessor> processor);
+ void setZslProcessor(const wp<ZslProcessor>& processor);
// Begin still image capture
status_t startCapture(int msgType);
@@ -69,7 +69,7 @@
virtual void onResultAvailable(const CaptureResult &result);
// Notifications from the JPEG processor
- void onCaptureAvailable(nsecs_t timestamp, sp<MemoryBase> captureBuffer, bool captureError);
+ void onCaptureAvailable(nsecs_t timestamp, const sp<MemoryBase>& captureBuffer, bool captureError);
void dump(int fd, const Vector<String16>& args);
@@ -172,7 +172,7 @@
// Emit Shutter/Raw callback to java, and maybe play a shutter sound
static void shutterNotifyLocked(const Parameters ¶ms,
- sp<Camera2Client> client, int msgType);
+ const sp<Camera2Client>& client, int msgType);
};
}; // namespace camera2
diff --git a/services/camera/libcameraservice/api1/client2/FrameProcessor.cpp b/services/camera/libcameraservice/api1/client2/FrameProcessor.cpp
index 4d12015..394eb4c 100644
--- a/services/camera/libcameraservice/api1/client2/FrameProcessor.cpp
+++ b/services/camera/libcameraservice/api1/client2/FrameProcessor.cpp
@@ -389,7 +389,7 @@
}
-void FrameProcessor::callbackFaceDetection(sp<Camera2Client> client,
+void FrameProcessor::callbackFaceDetection(const sp<Camera2Client>& client,
const camera_frame_metadata &metadata) {
camera_frame_metadata *metadata_ptr =
diff --git a/services/camera/libcameraservice/api1/client2/FrameProcessor.h b/services/camera/libcameraservice/api1/client2/FrameProcessor.h
index a5b81a7..62a4e91 100644
--- a/services/camera/libcameraservice/api1/client2/FrameProcessor.h
+++ b/services/camera/libcameraservice/api1/client2/FrameProcessor.h
@@ -107,7 +107,7 @@
int32_t mLast3AFrameNumber;
// Emit FaceDetection event to java if faces changed
- void callbackFaceDetection(sp<Camera2Client> client,
+ void callbackFaceDetection(const sp<Camera2Client>& client,
const camera_frame_metadata &metadata);
};
diff --git a/services/camera/libcameraservice/api1/client2/JpegCompressor.cpp b/services/camera/libcameraservice/api1/client2/JpegCompressor.cpp
index 9ecab71..01951a0 100644
--- a/services/camera/libcameraservice/api1/client2/JpegCompressor.cpp
+++ b/services/camera/libcameraservice/api1/client2/JpegCompressor.cpp
@@ -36,7 +36,7 @@
Mutex::Autolock lock(mMutex);
}
-status_t JpegCompressor::start(Vector<CpuConsumer::LockedBuffer*> buffers,
+status_t JpegCompressor::start(const Vector<CpuConsumer::LockedBuffer*>& buffers,
nsecs_t captureTime) {
ALOGV("%s", __FUNCTION__);
Mutex::Autolock busyLock(mBusyMutex);
diff --git a/services/camera/libcameraservice/api1/client2/JpegCompressor.h b/services/camera/libcameraservice/api1/client2/JpegCompressor.h
index df5da54..589a2fd 100644
--- a/services/camera/libcameraservice/api1/client2/JpegCompressor.h
+++ b/services/camera/libcameraservice/api1/client2/JpegCompressor.h
@@ -48,7 +48,7 @@
// Start compressing COMPRESSED format buffers; JpegCompressor takes
// ownership of the Buffers vector.
- status_t start(Vector<CpuConsumer::LockedBuffer*> buffers,
+ status_t start(const Vector<CpuConsumer::LockedBuffer*>& buffers,
nsecs_t captureTime);
status_t cancel();
diff --git a/services/camera/libcameraservice/api1/client2/Parameters.h b/services/camera/libcameraservice/api1/client2/Parameters.h
index f4bb34c..798aab5 100644
--- a/services/camera/libcameraservice/api1/client2/Parameters.h
+++ b/services/camera/libcameraservice/api1/client2/Parameters.h
@@ -412,7 +412,7 @@
template<typename S, typename P>
class BaseLock {
public:
- BaseLock(S &p):
+ explicit BaseLock(S &p):
mParameters(p.mParameters),
mSharedParameters(p) {
mSharedParameters.mLock.lock();
diff --git a/services/camera/libcameraservice/api1/client2/StreamingProcessor.cpp b/services/camera/libcameraservice/api1/client2/StreamingProcessor.cpp
index de42fb2..e334410 100644
--- a/services/camera/libcameraservice/api1/client2/StreamingProcessor.cpp
+++ b/services/camera/libcameraservice/api1/client2/StreamingProcessor.cpp
@@ -58,7 +58,7 @@
deleteRecordingStream();
}
-status_t StreamingProcessor::setPreviewWindow(sp<Surface> window) {
+status_t StreamingProcessor::setPreviewWindow(const sp<Surface>& window) {
ATRACE_CALL();
status_t res;
diff --git a/services/camera/libcameraservice/api1/client2/StreamingProcessor.h b/services/camera/libcameraservice/api1/client2/StreamingProcessor.h
index 57e6389..ce4a343 100644
--- a/services/camera/libcameraservice/api1/client2/StreamingProcessor.h
+++ b/services/camera/libcameraservice/api1/client2/StreamingProcessor.h
@@ -39,10 +39,10 @@
*/
class StreamingProcessor : public virtual VirtualLightRefBase {
public:
- StreamingProcessor(sp<Camera2Client> client);
+ explicit StreamingProcessor(sp<Camera2Client> client);
~StreamingProcessor();
- status_t setPreviewWindow(sp<Surface> window);
+ status_t setPreviewWindow(const sp<Surface>& window);
status_t setRecordingWindow(sp<Surface> window);
bool haveValidPreviewWindow() const;
diff --git a/services/camera/libcameraservice/common/Camera2ClientBase.h b/services/camera/libcameraservice/common/Camera2ClientBase.h
index 4f60034..dbbf638 100644
--- a/services/camera/libcameraservice/common/Camera2ClientBase.h
+++ b/services/camera/libcameraservice/common/Camera2ClientBase.h
@@ -93,13 +93,13 @@
public:
class Lock {
public:
- Lock(SharedCameraCallbacks &client);
+ explicit Lock(SharedCameraCallbacks &client);
~Lock();
sp<TCamCallbacks> &mRemoteCallback;
private:
SharedCameraCallbacks &mSharedClient;
};
- SharedCameraCallbacks(const sp<TCamCallbacks>& client);
+ explicit SharedCameraCallbacks(const sp<TCamCallbacks>& client);
SharedCameraCallbacks& operator=(const sp<TCamCallbacks>& client);
void clear();
private:
diff --git a/services/camera/libcameraservice/common/CameraModule.h b/services/camera/libcameraservice/common/CameraModule.h
index 1a1c274..d131a26 100644
--- a/services/camera/libcameraservice/common/CameraModule.h
+++ b/services/camera/libcameraservice/common/CameraModule.h
@@ -32,7 +32,7 @@
*/
class CameraModule {
public:
- CameraModule(camera_module_t *module);
+ explicit CameraModule(camera_module_t *module);
virtual ~CameraModule();
// Must be called after construction
diff --git a/services/camera/libcameraservice/common/FrameProcessorBase.cpp b/services/camera/libcameraservice/common/FrameProcessorBase.cpp
index 29eb78f..2ef3057 100644
--- a/services/camera/libcameraservice/common/FrameProcessorBase.cpp
+++ b/services/camera/libcameraservice/common/FrameProcessorBase.cpp
@@ -47,7 +47,7 @@
}
status_t FrameProcessorBase::registerListener(int32_t minId,
- int32_t maxId, wp<FilteredListener> listener, bool sendPartials) {
+ int32_t maxId, const wp<FilteredListener>& listener, bool sendPartials) {
Mutex::Autolock l(mInputMutex);
List<RangeListener>::iterator item = mRangeListeners.begin();
while (item != mRangeListeners.end()) {
@@ -70,7 +70,7 @@
status_t FrameProcessorBase::removeListener(int32_t minId,
int32_t maxId,
- wp<FilteredListener> listener) {
+ const wp<FilteredListener>& listener) {
Mutex::Autolock l(mInputMutex);
List<RangeListener>::iterator item = mRangeListeners.begin();
while (item != mRangeListeners.end()) {
diff --git a/services/camera/libcameraservice/common/FrameProcessorBase.h b/services/camera/libcameraservice/common/FrameProcessorBase.h
index a618d84..00763a4 100644
--- a/services/camera/libcameraservice/common/FrameProcessorBase.h
+++ b/services/camera/libcameraservice/common/FrameProcessorBase.h
@@ -36,7 +36,7 @@
*/
class FrameProcessorBase: public Thread {
public:
- FrameProcessorBase(wp<CameraDeviceBase> device);
+ explicit FrameProcessorBase(wp<CameraDeviceBase> device);
virtual ~FrameProcessorBase();
struct FilteredListener: virtual public RefBase {
@@ -48,10 +48,10 @@
// the same range of IDs has no effect.
// sendPartials controls whether partial results will be sent.
status_t registerListener(int32_t minId, int32_t maxId,
- wp<FilteredListener> listener,
+ const wp<FilteredListener>& listener,
bool sendPartials = true);
status_t removeListener(int32_t minId, int32_t maxId,
- wp<FilteredListener> listener);
+ const wp<FilteredListener>& listener);
void dump(int fd, const Vector<String16>& args);
protected:
diff --git a/services/camera/libcameraservice/device1/CameraHardwareInterface.h b/services/camera/libcameraservice/device1/CameraHardwareInterface.h
index 0b883ba..952bae1 100644
--- a/services/camera/libcameraservice/device1/CameraHardwareInterface.h
+++ b/services/camera/libcameraservice/device1/CameraHardwareInterface.h
@@ -73,7 +73,7 @@
class CameraHardwareInterface : public virtual RefBase {
public:
- CameraHardwareInterface(const char *name):
+ explicit CameraHardwareInterface(const char *name):
mDevice(nullptr),
mName(name),
mPreviewScalingMode(NOT_SET),
@@ -543,9 +543,9 @@
commonInitialization();
}
- CameraHeapMemory(size_t buf_size, uint_t num_buffers = 1) :
- mBufSize(buf_size),
- mNumBufs(num_buffers)
+ explicit CameraHeapMemory(size_t buf_size, uint_t num_buffers = 1) :
+ mBufSize(buf_size),
+ mNumBufs(num_buffers)
{
mHeap = new MemoryHeapBase(buf_size * num_buffers);
commonInitialization();
diff --git a/services/camera/libcameraservice/device3/Camera3Device.cpp b/services/camera/libcameraservice/device3/Camera3Device.cpp
index 3b95e62..9036879 100644
--- a/services/camera/libcameraservice/device3/Camera3Device.cpp
+++ b/services/camera/libcameraservice/device3/Camera3Device.cpp
@@ -2886,7 +2886,7 @@
return OK;
}
-bool Camera3Device::RequestThread::isRepeatingRequestLocked(const sp<CaptureRequest> requestIn) {
+bool Camera3Device::RequestThread::isRepeatingRequestLocked(const sp<CaptureRequest>& requestIn) {
if (mRepeatingRequests.empty()) {
return false;
}
@@ -3007,7 +3007,7 @@
* AE_PRECAPTURE_TRIGGER_CANCEL to AE_PRECAPTURE_TRIGGER_IDLE but doesn't add AE_LOCK_ON to the
* request.
*/
-void Camera3Device::RequestThread::handleAePrecaptureCancelRequest(sp<CaptureRequest> request) {
+void Camera3Device::RequestThread::handleAePrecaptureCancelRequest(const sp<CaptureRequest>& request) {
request->mAeTriggerCancelOverride.applyAeLock = false;
request->mAeTriggerCancelOverride.applyAePrecaptureTrigger = false;
diff --git a/services/camera/libcameraservice/device3/Camera3Device.h b/services/camera/libcameraservice/device3/Camera3Device.h
index 17893a9..33429a6 100644
--- a/services/camera/libcameraservice/device3/Camera3Device.h
+++ b/services/camera/libcameraservice/device3/Camera3Device.h
@@ -65,7 +65,7 @@
private camera3_callback_ops {
public:
- Camera3Device(int id);
+ explicit Camera3Device(int id);
virtual ~Camera3Device();
@@ -220,7 +220,7 @@
struct Size {
uint32_t width;
uint32_t height;
- Size(uint32_t w = 0, uint32_t h = 0) : width(w), height(h){}
+ explicit Size(uint32_t w = 0, uint32_t h = 0) : width(w), height(h){}
};
// Map from format to size.
Vector<Size> mSupportedOpaqueInputSizes;
@@ -589,10 +589,10 @@
void setErrorState(const char *fmt, ...);
// If the input request is in mRepeatingRequests. Must be called with mRequestLock hold
- bool isRepeatingRequestLocked(const sp<CaptureRequest>);
+ bool isRepeatingRequestLocked(const sp<CaptureRequest>&);
// Handle AE precapture trigger cancel for devices <= CAMERA_DEVICE_API_VERSION_3_2.
- void handleAePrecaptureCancelRequest(sp<CaptureRequest> request);
+ void handleAePrecaptureCancelRequest(const sp<CaptureRequest>& request);
// Clear repeating requests. Must be called with mRequestLock held.
status_t clearRepeatingRequestsLocked(/*out*/ int64_t *lastFrameNumber = NULL);
diff --git a/services/camera/libcameraservice/device3/Camera3DummyStream.h b/services/camera/libcameraservice/device3/Camera3DummyStream.h
index 639619e..18e8a23 100644
--- a/services/camera/libcameraservice/device3/Camera3DummyStream.h
+++ b/services/camera/libcameraservice/device3/Camera3DummyStream.h
@@ -42,7 +42,7 @@
* Set up a dummy stream; doesn't actually connect to anything, and uses
* a default dummy format and size.
*/
- Camera3DummyStream(int id);
+ explicit Camera3DummyStream(int id);
virtual ~Camera3DummyStream();
diff --git a/services/camera/libcameraservice/device3/StatusTracker.h b/services/camera/libcameraservice/device3/StatusTracker.h
index 49cecb3..3a1d85c 100644
--- a/services/camera/libcameraservice/device3/StatusTracker.h
+++ b/services/camera/libcameraservice/device3/StatusTracker.h
@@ -45,7 +45,7 @@
*/
class StatusTracker: public Thread {
public:
- StatusTracker(wp<Camera3Device> parent);
+ explicit StatusTracker(wp<Camera3Device> parent);
~StatusTracker();
// An always-invalid component ID
diff --git a/services/camera/libcameraservice/utils/AutoConditionLock.h b/services/camera/libcameraservice/utils/AutoConditionLock.h
index b7f167b..cdbb01b 100644
--- a/services/camera/libcameraservice/utils/AutoConditionLock.h
+++ b/services/camera/libcameraservice/utils/AutoConditionLock.h
@@ -37,7 +37,7 @@
/**
* Construct the ConditionManger with the given Mutex.
*/
- WaitableMutexWrapper(Mutex* mutex);
+ explicit WaitableMutexWrapper(Mutex* mutex);
virtual ~WaitableMutexWrapper();
private:
@@ -88,7 +88,7 @@
static std::unique_ptr<AutoConditionLock> waitAndAcquire(
const std::shared_ptr<WaitableMutexWrapper>& manager);
private:
- AutoConditionLock(const std::shared_ptr<WaitableMutexWrapper>& manager);
+ explicit AutoConditionLock(const std::shared_ptr<WaitableMutexWrapper>& manager);
std::shared_ptr<WaitableMutexWrapper> mManager;
Mutex::Autolock mAutoLock;
diff --git a/services/camera/libcameraservice/utils/ClientManager.h b/services/camera/libcameraservice/utils/ClientManager.h
index 7ae58d5..830c50b 100644
--- a/services/camera/libcameraservice/utils/ClientManager.h
+++ b/services/camera/libcameraservice/utils/ClientManager.h
@@ -216,7 +216,7 @@
static constexpr int32_t DEFAULT_MAX_COST = 100;
ClientManager();
- ClientManager(int32_t totalCost);
+ explicit ClientManager(int32_t totalCost);
/**
* Add a given ClientDescriptor to the managed list. ClientDescriptors for clients that