camera2: Don't log vendor tag errors when camera HAL too old

Change-Id: Iac3d23284230c95c85ee404abbf9b22df1ae721c
diff --git a/camera/ICameraService.cpp b/camera/ICameraService.cpp
index ef6c0f4..b86651f 100644
--- a/camera/ICameraService.cpp
+++ b/camera/ICameraService.cpp
@@ -303,10 +303,10 @@
             reply->writeInt32(result);
 
             // out-variables are after exception and return value
-            reply->writeInt32(1); // means the parcelable is included
             if (d == NULL) {
                 reply->writeInt32(0);
             } else {
+                reply->writeInt32(1); // means the parcelable is included
                 d->writeToParcel(reply);
             }
             return NO_ERROR;
@@ -320,7 +320,7 @@
             int32_t clientUid = data.readInt32();
             sp<ICamera> camera;
             status_t status = connect(cameraClient, cameraId,
-                    clientName, clientUid, /*out*/ camera);
+                    clientName, clientUid, /*out*/camera);
             reply->writeNoException();
             reply->writeInt32(status);
             if (camera != NULL) {
@@ -340,7 +340,7 @@
             int32_t clientUid = data.readInt32();
             sp<IProCameraUser> camera;
             status_t status = connectPro(cameraClient, cameraId,
-                    clientName, clientUid, /*out*/ camera);
+                    clientName, clientUid, /*out*/camera);
             reply->writeNoException();
             reply->writeInt32(status);
             if (camera != NULL) {
@@ -360,7 +360,7 @@
             int32_t clientUid = data.readInt32();
             sp<ICameraDeviceUser> camera;
             status_t status = connectDevice(cameraClient, cameraId,
-                    clientName, clientUid, /*out*/ camera);
+                    clientName, clientUid, /*out*/camera);
             reply->writeNoException();
             reply->writeInt32(status);
             if (camera != NULL) {
diff --git a/camera/VendorTagDescriptor.cpp b/camera/VendorTagDescriptor.cpp
index 89b0ea8..a0a6a51 100644
--- a/camera/VendorTagDescriptor.cpp
+++ b/camera/VendorTagDescriptor.cpp
@@ -236,7 +236,7 @@
     return res;
 }
 
-status_t VendorTagDescriptor::setAsGlobalVendorTagDescriptor(sp<VendorTagDescriptor>& desc) {
+status_t VendorTagDescriptor::setAsGlobalVendorTagDescriptor(const sp<VendorTagDescriptor>& desc) {
     status_t res = OK;
     Mutex::Autolock al(sLock);
     sGlobalVendorTagDescriptor = desc;
diff --git a/include/camera/ICameraService.h b/include/camera/ICameraService.h
index 6ccbf67..6e48f22 100644
--- a/include/camera/ICameraService.h
+++ b/include/camera/ICameraService.h
@@ -60,12 +60,16 @@
 
     virtual int32_t  getNumberOfCameras() = 0;
     virtual status_t getCameraInfo(int cameraId,
-                                          struct CameraInfo* cameraInfo) = 0;
+            /*out*/
+            struct CameraInfo* cameraInfo) = 0;
 
     virtual status_t getCameraCharacteristics(int cameraId,
-                                              CameraMetadata* cameraInfo) = 0;
+            /*out*/
+            CameraMetadata* cameraInfo) = 0;
 
-    virtual status_t getCameraVendorTagDescriptor(sp<VendorTagDescriptor>& desc) = 0;
+    virtual status_t getCameraVendorTagDescriptor(
+            /*out*/
+            sp<VendorTagDescriptor>& desc) = 0;
 
     // Returns 'OK' if operation succeeded
     // - Errors: ALREADY_EXISTS if the listener was already added
diff --git a/include/camera/VendorTagDescriptor.h b/include/camera/VendorTagDescriptor.h
index 0fefe1a..ea21d31 100644
--- a/include/camera/VendorTagDescriptor.h
+++ b/include/camera/VendorTagDescriptor.h
@@ -63,7 +63,9 @@
          *
          * Returns OK on success, or a negative error code.
          */
-        status_t writeToParcel(/*out*/Parcel* parcel) const;
+        status_t writeToParcel(
+                /*out*/
+                Parcel* parcel) const;
 
         // Static methods:
 
@@ -93,7 +95,7 @@
          *
          * Returns OK on success, or a negative error code.
          */
-        static status_t setAsGlobalVendorTagDescriptor(sp<VendorTagDescriptor>& desc);
+        static status_t setAsGlobalVendorTagDescriptor(const sp<VendorTagDescriptor>& desc);
 
         /**
          * Clears the global vendor tag descriptor used by this process.
diff --git a/services/camera/libcameraservice/CameraService.cpp b/services/camera/libcameraservice/CameraService.cpp
index 6be5e0f..6fb5a84 100644
--- a/services/camera/libcameraservice/CameraService.cpp
+++ b/services/camera/libcameraservice/CameraService.cpp
@@ -287,7 +287,7 @@
 
     if (mModule->common.module_api_version < CAMERA_MODULE_API_VERSION_2_2) {
         // TODO: Remove this check once HAL1 shim is in place.
-        ALOGE("%s: Only HAL module version V2.2 or higher supports vendor tags", __FUNCTION__);
+        ALOGW("%s: Only HAL module version V2.2 or higher supports vendor tags", __FUNCTION__);
         return -EOPNOTSUPP;
     }