Fix build error in sticker-receiver
[platform/core/uifw/capi-ui-sticker.git] / consumer / sticker_consumer.c
index 91de924..4f51fb5 100644 (file)
@@ -78,7 +78,7 @@ static int _cynara_initialize()
 {
     int ret = cynara_initialize(&p_cynara, NULL);
     if (ret != CYNARA_API_SUCCESS)
-        LOGE("Failed to cynara initialize");
+        LOGE("Failed to cynara initialize"); //LCOV_EXCL_LINE
 
     return ret;
 }
@@ -110,7 +110,7 @@ static int _check_privilege(const char *uid, const char *privilege)
         free(session);
 
     if (ret != CYNARA_API_ACCESS_ALLOWED) {
-        LOGE("Access denied. The result of cynara_check() : %d.", ret);
+        LOGE("Access denied. The result of cynara_check() : %d.", ret); //LCOV_EXCL_LINE
         return -1;
     }
 
@@ -134,7 +134,7 @@ static int _sticker_check_privilege() {
 
     snprintf(uid, 16, "%d", getuid());
     if (_check_privilege(uid, STICKER_PRIVILEGE_MEDIASTORAGE) < 0) {
-        LOGE("Permission is denied");
+        LOGE("Permission is denied"); //LCOV_EXCL_LINE
         ret = STICKER_ERROR_PERMISSION_DENIED;
     }
 
@@ -161,17 +161,21 @@ EXPORT_API int sticker_consumer_create(sticker_consumer_h *consumer_handle)
 
     ret = app_get_id(&consumer_struct->app_id);
     if (ret != APP_ERROR_NONE) {
+        //LCOV_EXCL_START
         LOGE("Failed to get app_id : %d", ret);
         free(consumer_struct);
         return STICKER_ERROR_OPERATION_FAILED;
+        //LCOV_EXCL_STOP
     }
 
     ret = sticker_dbus_init(&consumer_struct->gdbus_connection, &consumer_struct->server_watcher_id,
         &consumer_struct->monitor_id, &consumer_struct->server_monitor_id, STICKER_CLIENT_LIB_CONSUMER, (void *)consumer_struct);
     if (ret != STICKER_ERROR_NONE) {
+        //LCOV_EXCL_START
         LOGE("Failed to initialize dbus : %d", ret);
         free(consumer_struct);
         return STICKER_ERROR_OPERATION_FAILED;
+        //LCOV_EXCL_STOP
     }
 
     *consumer_handle = consumer_struct;
@@ -191,9 +195,11 @@ EXPORT_API int sticker_consumer_destroy(sticker_consumer_h consumer_handle)
     ret = sticker_dbus_shutdown(consumer_handle->gdbus_connection, &consumer_handle->server_watcher_id,
                                 &consumer_handle->server_monitor_id, &consumer_handle->monitor_id, STICKER_CLIENT_LIB_CONSUMER);
     if (ret != STICKER_ERROR_NONE) {
+        //LCOV_EXCL_START
         LOGE("Failed to finalize dbus : %d", ret);
         free(consumer_handle);
         return STICKER_ERROR_OPERATION_FAILED;
+        //LCOV_EXCL_STOP
     }
 
     if (consumer_handle->gdbus_connection)
@@ -539,7 +545,7 @@ EXPORT_API int sticker_consumer_add_recent_data(sticker_consumer_h consumer_hand
 
     int ret;
 
-    if (!consumer_handle || !data_handle || (data_handle->sticker_info_id > 0) || !data_handle->uri)
+    if (!consumer_handle || !data_handle || (data_handle->sticker_info_id <= 0) || !data_handle->uri)
         return STICKER_ERROR_INVALID_PARAMETER;
 
     ret = sticker_dbus_insert_recent_sticker_info(consumer_handle->gdbus_connection, data_handle->sticker_info_id);
@@ -599,7 +605,7 @@ cleanup:
     return ret;
 }
 
-EXPORT_API int sticker_consumer_set_event_callback(sticker_consumer_h consumer_handle, sticker_consumer_event_cb callback, void *user_data)
+EXPORT_API int sticker_consumer_set_event_cb(sticker_consumer_h consumer_handle, sticker_consumer_event_cb callback, void *user_data)
 {
     CHECK_STICKER_FEATURE();
 
@@ -612,7 +618,7 @@ EXPORT_API int sticker_consumer_set_event_callback(sticker_consumer_h consumer_h
     return STICKER_ERROR_NONE;
 }
 
-EXPORT_API int sticker_consumer_unset_event_callback(sticker_consumer_h consumer_handle)
+EXPORT_API int sticker_consumer_unset_event_cb(sticker_consumer_h consumer_handle)
 {
     CHECK_STICKER_FEATURE();