Add new command dispatcher(current NULL) and modify return value for dispatcher
[platform/core/multimedia/mmsvc-camera.git] / muse / src / muse_camera_dispatcher.c
index 37c6c0b..9aeb869 100644 (file)
@@ -1386,7 +1386,7 @@ int camera_dispatcher_create(muse_module_h module)
                ret = CAMERA_ERROR_PERMISSION_DENIED;
                LOGE("security check failed 0x%x", ret);
                muse_camera_msg_return(api, class, ret, module);
-               return MUSE_CAMERA_ERROR_NONE;
+               return MUSE_CAMERA_ERROR_INVALID;
        }
 
        /* init handle */
@@ -1395,7 +1395,7 @@ int camera_dispatcher_create(muse_module_h module)
                ret = CAMERA_ERROR_OUT_OF_MEMORY;
                LOGE("handle alloc failed 0x%x", ret);
                muse_camera_msg_return(api, class, ret, module);
-               return MUSE_CAMERA_ERROR_NONE;
+               return MUSE_CAMERA_ERROR_INVALID;
        }
 
        memset(muse_camera, 0x0, sizeof(muse_camera_handle_s));
@@ -1410,7 +1410,7 @@ int camera_dispatcher_create(muse_module_h module)
                ret = CAMERA_ERROR_INVALID_OPERATION;
                muse_camera_msg_return(api, class, ret, module);
 
-               return MUSE_CAMERA_ERROR_NONE;
+               return MUSE_CAMERA_ERROR_INVALID;
        }
 
        ret = legacy_camera_create((camera_device_e)device_type, &muse_camera->camera_handle);
@@ -1419,7 +1419,7 @@ int camera_dispatcher_create(muse_module_h module)
                muse_camera = NULL;
                muse_camera_msg_return(api, class, ret, module);
 
-               return MUSE_CAMERA_ERROR_NONE;
+               return MUSE_CAMERA_ERROR_INVALID;
        }
 
        g_mutex_init(&muse_camera->task_lock);
@@ -1492,7 +1492,7 @@ _CREATE_ERROR:
        muse_camera = NULL;
        muse_camera_msg_return(api, class, ret, module);
 
-       return MUSE_CAMERA_ERROR_NONE;
+       return MUSE_CAMERA_ERROR_INVALID;
 }
 
 
@@ -1536,7 +1536,10 @@ int camera_dispatcher_destroy(muse_module_h module)
 
        muse_camera_msg_return(api, class, ret, module);
 
-       return MUSE_CAMERA_ERROR_NONE;
+       if (ret == CAMERA_ERROR_NONE)
+               return MUSE_CAMERA_ERROR_NONE;
+       else
+               return MUSE_CAMERA_ERROR_INVALID;
 }
 
 int camera_dispatcher_start_preview(muse_module_h module)
@@ -5209,5 +5212,6 @@ int (*cmd_dispatcher[MUSE_MODULE_COMMAND_MAX])(muse_module_h module) = {
        camera_cmd_dispatcher_shutdown, /* MUSE_MODULE_COMMAND_SHUTDOWN */
        NULL, /* MUSE_MODULE_COMMAND_DEBUG_INFO_DUMP */
        NULL, /* MUSE_MODULE_COMMAND_CREATE_SERVER_ACK */
-       NULL  /* MUSE_MODULE_COMMAND_RESOURCE_NOT_AVAILABLE */
+       NULL, /* MUSE_MODULE_COMMAND_RESOURCE_NOT_AVAILABLE */
+       NULL  /* MUSE_MODULE_COMMAND_EXTERNAL_STORAGE_STATE_CHANGED */
 };