Camera: Clean up warnings and set -Werror
- Also fix error logging template inconsistency
- Also add a few error handling cases into camera2 NDK
to deal with previously-ignored error codes
Bug: 27149500
Change-Id: I8f1f4c72252dd48d652f24b595b642199f20c327
diff --git a/services/camera/libcameraservice/api2/CameraDeviceClient.cpp b/services/camera/libcameraservice/api2/CameraDeviceClient.cpp
index 6f9bc7c..307b412 100644
--- a/services/camera/libcameraservice/api2/CameraDeviceClient.cpp
+++ b/services/camera/libcameraservice/api2/CameraDeviceClient.cpp
@@ -30,16 +30,13 @@
// Convenience methods for constructing binder::Status objects for error returns
-#define STRINGIZE_IMPL(x) #x
-#define STRINGIZE(x) STRINGIZE_IMPL(x)
-
#define STATUS_ERROR(errorCode, errorString) \
binder::Status::fromServiceSpecificError(errorCode, \
- String8(STRINGIZE(__FUNCTION__) ":" STRINGIZE(__LINE__) ":" # errorString))
+ String8::format("%s:%d: %s", __FUNCTION__, __LINE__, errorString))
#define STATUS_ERROR_FMT(errorCode, errorString, ...) \
binder::Status::fromServiceSpecificError(errorCode, \
- String8::format(STRINGIZE(__FUNCTION__) ":" STRINGIZE(__LINE__) ":" # errorString, \
+ String8::format("%s:%d: " errorString, __FUNCTION__, __LINE__, \
__VA_ARGS__))
namespace android {