static int camera_cancel_auto_focus(struct camera_device *device)
{
    int ret = 0;

    ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
            (uintptr_t)(((wrapper_camera_device_t*)device)->vendor));

    if (!device)
        return -EINVAL;

    if (camera_preview_enabled(device))
        ret = VENDOR_CALL(device, cancel_auto_focus);

    return ret;
}
static char *camera_fixup_setparams(int id, const char *settings, struct camera_device *device)
{
    android::CameraParameters params;
    params.unflatten(android::String8(settings));

    bool videoMode = false;

#if !LOG_NDEBUG
    ALOGV("%s: original parameters:", __FUNCTION__);
    params.dump();
#endif

    if (params.get(android::CameraParameters::KEY_RECORDING_HINT)) {
        videoMode = !strcmp(params.get(android::CameraParameters::KEY_RECORDING_HINT), "true");
    }

    if (params.get("manual-focus-position") && params.get("focus-mode") && !strcmp(params.get("focus-mode"), "manual")) {
        params.set("maf_key", params.get("manual-focus-position"));
        params.set("focus-mode", "infinity");
    }

/*
    if(!videoMode && id==1) {
	params.set("snapshot-picture-flip", "flip-v");
    }
*/

    if(videoMode) {
        params.set("video-flip", "off");
        params.set("video-exposure-to-1080p", "0");
        params.set("snapshot_mirror", "off");
    } else {
        params.set("ois_key", "1"); // not sure it is used by camera hal, but nubia camera set this property
//        params.set("slow_shutter", "-1");
//        params.set("slow_shutter_addition", "0");
    }

    if(needsVideoFix) {
        if(camera_preview_enabled(device)) {
            if(videoMode) {
                ALOGV("%s: trying to fix video recording...", __FUNCTION__);
                params.set(android::CameraParameters::KEY_RECORDING_HINT, "false");

                android::String8 strParams = params.flatten();
                if (fixed_set_params[id])
                    free(fixed_set_params[id]);
                fixed_set_params[id] = strdup(strParams.string());
                char *ret = fixed_set_params[id];
                VENDOR_CALL(device, set_parameters, fixed_set_params[id]);

                params.set(android::CameraParameters::KEY_RECORDING_HINT, "true");

                needsVideoFix = false;
            } else {
                needsVideoFix = false;
            }
        }
    }

#if !LOG_NDEBUG
    ALOGV("%s: fixed parameters:", __FUNCTION__);
    params.dump();
#endif

    android::String8 strParams = params.flatten();
    if (fixed_set_params[id])
	free(fixed_set_params[id]);
    fixed_set_params[id] = strdup(strParams.string());
    char *ret = fixed_set_params[id];

    return ret;
}