Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5614cbe6 authored by Igor Murashkin's avatar Igor Murashkin
Browse files

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

Change-Id: Id7fe9464d7599a566cea976cddc62ad101cf4a10
parent a1e4bf9b
Loading
Loading
Loading
Loading
+2 −7
Original line number Diff line number Diff line
@@ -81,13 +81,8 @@ public final class CameraManager {
        mCameraService = CameraBinderDecorator.newInstance(cameraServiceRaw);

        try {
            int err = CameraMetadataNative.nativeSetupGlobalVendorTagDescriptor();
            if (err == CameraBinderDecorator.EOPNOTSUPP) {
                Log.w(TAG, "HAL version doesn't vendor tags.");
            } else {
                CameraBinderDecorator.throwOnError(CameraMetadataNative.
                        nativeSetupGlobalVendorTagDescriptor());
            }
            CameraBinderDecorator.throwOnError(
                    CameraMetadataNative.nativeSetupGlobalVendorTagDescriptor());
        } catch(CameraRuntimeException e) {
            throw new IllegalStateException("Failed to setup camera vendor tags",
                    e.asChecked());
+8 −3
Original line number Diff line number Diff line
@@ -579,9 +579,14 @@ static jint CameraMetadata_setupGlobalVendorTagDescriptor(JNIEnv *env, jobject t
    sp<VendorTagDescriptor> desc;
    err = cameraService->getCameraVendorTagDescriptor(/*out*/desc);

    if (err != OK) {
        ALOGE("%s: Failed to setup vendor tag descriptors, received error %s (%d)", __FUNCTION__,
                strerror(-err), err);
    if (err == -EOPNOTSUPP) {
        ALOGW("%s: Camera HAL too old; does not support vendor tags", __FUNCTION__);
        VendorTagDescriptor::clearGlobalVendorTagDescriptor();

        return OK;
    } else if (err != OK) {
        ALOGE("%s: Failed to setup vendor tag descriptors, received error %s (%d)",
                __FUNCTION__, strerror(-err), err);
        return err;
    }