Code clean for libcameraservice
Cleaning compile warnings "variable 'XX' set but not used":
1. Remove the variables which are obviously not used;
2. Add "[[maybe_unused]]" to variable declaration of the ones
which are potentially used.
For the unused function parameters which were cast by "(void)":
We have changed them to the C++17 attribute "[[maybe_unused]]".
This seems not that necessary but it avoids redundant code lines.
Test: mmm frameworks/av/services/camera/libcameraservice,
presubmit check.
Change-Id: Ia68b78c01f8254d76be81b1ce98d2a5c3d7eea46
Signed-off-by: Jing Mike <jingyangliu@eswincomputing.com>
diff --git a/services/camera/libcameraservice/tests/CameraProviderManagerTest.cpp b/services/camera/libcameraservice/tests/CameraProviderManagerTest.cpp
index 2f55def..1a6b2e0 100644
--- a/services/camera/libcameraservice/tests/CameraProviderManagerTest.cpp
+++ b/services/camera/libcameraservice/tests/CameraProviderManagerTest.cpp
@@ -185,9 +185,8 @@
using getCameraDeviceInterface_V1_x_cb = std::function<void(Status status,
const sp<device::V1_0::ICameraDevice>& device)>;
virtual hardware::Return<void> getCameraDeviceInterface_V1_x(
- const hardware::hidl_string& cameraDeviceName,
+ [[maybe_unused]] const hardware::hidl_string& cameraDeviceName,
getCameraDeviceInterface_V1_x_cb _hidl_cb) override {
- (void) cameraDeviceName;
_hidl_cb(Status::OK, nullptr); //TODO: impl. of ver. 1.0 device interface
// otherwise enumeration will fail.
return hardware::Void();
@@ -261,9 +260,8 @@
virtual ~TestInteractionProxy() {}
virtual bool registerForNotifications(
- const std::string &serviceName,
+ [[maybe_unused]] const std::string &serviceName,
const sp<hidl::manager::V1_0::IServiceNotification> ¬ification) override {
- (void) serviceName;
mManagerNotificationInterface = notification;
return true;
}