GError *error = NULL;
if ((NULL != connection) || (sac_interface_proxy)) {
- FUNC_STOP();
- return -1;
+ FUNC_STOP(); /* LCOV_EXCL_LINE */
+ return -1; /* LCOV_EXCL_LINE */
}
connection = g_bus_get_sync(G_BUS_TYPE_SESSION, NULL, &error);
if (NULL == connection) {
- g_error_free(error);
+ g_error_free(error); /* LCOV_EXCL_LINE */
- FUNC_STOP();
- return -1;
+ FUNC_STOP(); /* LCOV_EXCL_LINE */
+ return -1; /* LCOV_EXCL_LINE */
} else {
sac_interface_proxy = g_dbus_proxy_new_sync(connection,
G_DBUS_PROXY_FLAGS_NONE,
&error);
if (NULL == sac_interface_proxy) {
- g_error_free(error);
+ g_error_free(error); /* LCOV_EXCL_LINE */
- g_object_unref(connection);
- connection = NULL;
+ g_object_unref(connection); /* LCOV_EXCL_LINE */
+ connection = NULL; /* LCOV_EXCL_LINE */
- FUNC_STOP();
- return -1;
+ FUNC_STOP(); /* LCOV_EXCL_LINE */
+ return -1; /* LCOV_EXCL_LINE */
}
}
NULL);
if (0 == watcher_id) {
- g_object_unref(sac_interface_proxy);
- sac_interface_proxy = NULL;
+ g_object_unref(sac_interface_proxy); /* LCOV_EXCL_LINE */
+ sac_interface_proxy = NULL; /* LCOV_EXCL_LINE */
- g_object_unref(connection);
- connection = NULL;
+ g_object_unref(connection); /* LCOV_EXCL_LINE */
+ connection = NULL; /* LCOV_EXCL_LINE */
- FUNC_STOP();
- return -1;
+ FUNC_STOP(); /* LCOV_EXCL_LINE */
+ return -1; /* LCOV_EXCL_LINE */
}
int res = g_signal_connect(sac_interface_proxy,
NULL);
if (0 == res) {
- g_object_unref(sac_interface_proxy);
- sac_interface_proxy = NULL;
+ g_object_unref(sac_interface_proxy); /* LCOV_EXCL_LINE */
+ sac_interface_proxy = NULL; /* LCOV_EXCL_LINE */
- g_object_unref(connection);
- connection = NULL;
+ g_object_unref(connection); /* LCOV_EXCL_LINE */
+ connection = NULL; /* LCOV_EXCL_LINE */
- g_bus_unwatch_name(watcher_id);
- watcher_id = 0;
+ g_bus_unwatch_name(watcher_id); /* LCOV_EXCL_LINE */
+ watcher_id = 0; /* LCOV_EXCL_LINE */
- FUNC_STOP();
- return -1;
+ FUNC_STOP(); /* LCOV_EXCL_LINE */
+ return -1; /* LCOV_EXCL_LINE */
}
FUNC_END();
}
FUNC_END();
}
-//LCOV_EXCL_START
+/* LCOV_EXCL_START */
static void on_name_vanished(GDBusConnection *connection,
const gchar *name,
gpointer user_data)
}
FUNC_END();
}
-//LCOV_EXCL_STOP
static void _service_signal_emitter(void *data)
{
g_thread_unref(g_thread_self());
FUNC_END();
}
+/* LCOV_EXCL_STOP */
static void on_signal(GDBusProxy *proxy,
gchar *sender_name,
if (NULL != dbusClientThread) {
/* D-Bus client thread is already running */
- FUNC_STOP();
- return -1;
+ FUNC_STOP(); /* LCOV_EXCL_LINE */
+ return -1; /* LCOV_EXCL_LINE */
}
dbus_service_adaptor_client_thread_data_s *thread_data =
(dbus_service_adaptor_client_thread_data_s *) calloc(1, sizeof(dbus_service_adaptor_client_thread_data_s));
if (NULL == thread_data) {
- FUNC_STOP();
- return -1;
+ FUNC_STOP(); /* LCOV_EXCL_LINE */
+ return -1; /* LCOV_EXCL_LINE */
}
g_mutex_init(&thread_data->connection_mutex);
while (!thread_data->connection_cond_signaled) {
if (!g_cond_wait_until(&thread_data->connection_cond, &thread_data->connection_mutex, timeout)) {
/* timeout */
- g_mutex_unlock(&thread_data->connection_mutex);
+ g_mutex_unlock(&thread_data->connection_mutex); /* LCOV_EXCL_LINE */
- FUNC_STOP();
- return -1;
+ FUNC_STOP(); /* LCOV_EXCL_LINE */
+ return -1; /* LCOV_EXCL_LINE */
}
}
g_mutex_unlock(&thread_data->connection_mutex);
}
if (NULL != dbusClientMainLoop) {
- g_main_loop_unref(dbusClientMainLoop);
- dbusClientMainLoop = NULL;
+ g_main_loop_unref(dbusClientMainLoop); /* LCOV_EXCL_LINE */
+ dbusClientMainLoop = NULL; /* LCOV_EXCL_LINE */
}
if (NULL != dbusClientMainContext) {
- g_main_context_pop_thread_default(dbusClientMainContext);
- g_main_context_unref(dbusClientMainContext);
- dbusClientMainContext = NULL;
+ g_main_context_pop_thread_default(dbusClientMainContext); /* LCOV_EXCL_LINE */
+ g_main_context_unref(dbusClientMainContext); /* LCOV_EXCL_LINE */
+ dbusClientMainContext = NULL; /* LCOV_EXCL_LINE */
}
_queue_clear_task();
FUNC_END();
}
-/**
- * Adds string into variant builder
- * @param builder Builder
- * @param data String to be added
- */
-/*
-void __safe_g_variant_builder_add_string(GVariantBuilder *builder,
- const char *data)
-{
- if (NULL == data) {
- g_variant_builder_add(builder, "s", "");
- } else {
- g_variant_builder_add(builder, "s", data);
- }
-}
-
-void __safe_g_variant_builder_add_array_string(GVariantBuilder *builder,
- const char *data)
-{
- if (NULL == data) {
- g_variant_builder_add(builder, "(s)", "");
- } else {
- g_variant_builder_add(builder, "(s)", data);
- }
-}
-*/
-
char *ipc_g_variant_dup_string(GVariant *string)
{
char *ret = g_variant_dup_string(string, NULL);
&g_error);
if (NULL == call_result) {
- error->code = SERVICE_ADAPTOR_ERROR_IPC_UNSTABLE;
- ret = SERVICE_ADAPTOR_ERROR_IPC_UNSTABLE;
+ error->code = SERVICE_ADAPTOR_ERROR_IPC_UNSTABLE; /* LCOV_EXCL_LINE */
+ ret = SERVICE_ADAPTOR_ERROR_IPC_UNSTABLE; /* LCOV_EXCL_LINE */
- if (NULL != g_error) {
- error->msg = __SAFE_STRDUP(g_error->message);
- g_error_free(g_error);
+ if (NULL != g_error) { /* LCOV_EXCL_LINE */
+ error->msg = __SAFE_STRDUP(g_error->message); /* LCOV_EXCL_LINE */
+ g_error_free(g_error); /* LCOV_EXCL_LINE */
}
} else {
if (FALSE == g_variant_is_of_type(call_result, G_VARIANT_TYPE("(ts)"))) {
- error->code = SERVICE_ADAPTOR_ERROR_IPC_UNSTABLE;
- error->msg = strdup("D-Bus return type error");
- ret = SERVICE_ADAPTOR_ERROR_IPC_UNSTABLE;
+ error->code = SERVICE_ADAPTOR_ERROR_IPC_UNSTABLE; /* LCOV_EXCL_LINE */
+ error->msg = strdup("D-Bus return type error"); /* LCOV_EXCL_LINE */
+ ret = SERVICE_ADAPTOR_ERROR_IPC_UNSTABLE; /* LCOV_EXCL_LINE */
} else {
GVariant *call_result_struct[2];
call_result_struct[0] = g_variant_get_child_value(call_result, 0);
uint64_t remote_call_result = g_variant_get_uint64(call_result_struct[0]);
if (SERVICE_ADAPTOR_ERROR_NONE != remote_call_result) {
- error->code = remote_call_result;
- error->msg = ipc_g_variant_dup_string(call_result_struct[1]);
- ret = SERVICE_ADAPTOR_ERROR_PLUGIN_FAILED;
+ error->code = remote_call_result; /* LCOV_EXCL_LINE */
+ error->msg = ipc_g_variant_dup_string(call_result_struct[1]); /* LCOV_EXCL_LINE */
+ ret = SERVICE_ADAPTOR_ERROR_PLUGIN_FAILED; /* LCOV_EXCL_LINE */
}
g_variant_unref(call_result_struct[0]);
&g_error);
if (NULL == call_result) {
- error->code = SERVICE_ADAPTOR_ERROR_IPC_UNSTABLE;
- ret = SERVICE_ADAPTOR_ERROR_IPC_UNSTABLE;
+ error->code = SERVICE_ADAPTOR_ERROR_IPC_UNSTABLE; /* LCOV_EXCL_LINE */
+ ret = SERVICE_ADAPTOR_ERROR_IPC_UNSTABLE; /* LCOV_EXCL_LINE */
- if (NULL != g_error) {
- error->msg = __SAFE_STRDUP(g_error->message);
- g_error_free(g_error);
+ if (NULL != g_error) { /* LCOV_EXCL_LINE */
+ error->msg = __SAFE_STRDUP(g_error->message); /* LCOV_EXCL_LINE */
+ g_error_free(g_error); /* LCOV_EXCL_LINE */
}
} else {
if (FALSE == g_variant_is_of_type(call_result, G_VARIANT_TYPE(MAKE_RETURN_TYPE(plugin_list_type)))) {
- error->code = SERVICE_ADAPTOR_ERROR_IPC_UNSTABLE;
- error->msg = strdup("D-Bus return type error");
- ret = SERVICE_ADAPTOR_ERROR_IPC_UNSTABLE;
+ error->code = SERVICE_ADAPTOR_ERROR_IPC_UNSTABLE; /* LCOV_EXCL_LINE */
+ error->msg = strdup("D-Bus return type error"); /* LCOV_EXCL_LINE */
+ ret = SERVICE_ADAPTOR_ERROR_IPC_UNSTABLE; /* LCOV_EXCL_LINE */
} else {
GVariant *call_result_struct[3];
call_result_struct[0] = g_variant_get_child_value(call_result, 0);
uint64_t remote_call_result = g_variant_get_uint64(call_result_struct[1]);
if (SERVICE_ADAPTOR_ERROR_NONE != remote_call_result) {
- error->code = remote_call_result;
- error->msg = ipc_g_variant_dup_string(call_result_struct[2]);
- ret = SERVICE_ADAPTOR_ERROR_PLUGIN_FAILED;
+ error->code = remote_call_result; /* LCOV_EXCL_LINE */
+ error->msg = ipc_g_variant_dup_string(call_result_struct[2]); /* LCOV_EXCL_LINE */
+ ret = SERVICE_ADAPTOR_ERROR_PLUGIN_FAILED; /* LCOV_EXCL_LINE */
} else {
gsize list_count = g_variant_n_children(call_result_struct[0]);
}
*plugin_list = plugins;
} else {
- *plugins_len = (unsigned int) 0;
- ret = SERVICE_ADAPTOR_ERROR_UNKNOWN;
+ *plugins_len = (unsigned int) 0; /* LCOV_EXCL_LINE */
+ ret = SERVICE_ADAPTOR_ERROR_UNKNOWN; /* LCOV_EXCL_LINE */
}
}
g_variant_builder_unref(builder_in);
if (NULL == call_result) {
- error->code = SERVICE_ADAPTOR_ERROR_IPC_UNSTABLE;
- ret = SERVICE_ADAPTOR_ERROR_IPC_UNSTABLE;
+ error->code = SERVICE_ADAPTOR_ERROR_IPC_UNSTABLE; /* LCOV_EXCL_LINE */
+ ret = SERVICE_ADAPTOR_ERROR_IPC_UNSTABLE; /* LCOV_EXCL_LINE */
- if (NULL != g_error) {
- error->msg = __SAFE_STRDUP(g_error->message);
- g_error_free(g_error);
+ if (NULL != g_error) { /* LCOV_EXCL_LINE */
+ error->msg = __SAFE_STRDUP(g_error->message); /* LCOV_EXCL_LINE */
+ g_error_free(g_error); /* LCOV_EXCL_LINE */
}
} else {
if (FALSE == g_variant_is_of_type(call_result, G_VARIANT_TYPE("(ts)"))) {
- error->code = SERVICE_ADAPTOR_ERROR_IPC_UNSTABLE;
- error->msg = strdup("D-Bus return type error");
- ret = SERVICE_ADAPTOR_ERROR_IPC_UNSTABLE;
+ error->code = SERVICE_ADAPTOR_ERROR_IPC_UNSTABLE; /* LCOV_EXCL_LINE */
+ error->msg = strdup("D-Bus return type error"); /* LCOV_EXCL_LINE */
+ ret = SERVICE_ADAPTOR_ERROR_IPC_UNSTABLE; /* LCOV_EXCL_LINE */
} else {
GVariant *call_result_struct[2];
call_result_struct[0] = g_variant_get_child_value(call_result, 0);
uint64_t remote_call_result = g_variant_get_uint64(call_result_struct[0]);
if (SERVICE_ADAPTOR_ERROR_NONE != remote_call_result) {
- error->code = remote_call_result;
- error->msg = ipc_g_variant_dup_string(call_result_struct[1]);
- ret = SERVICE_ADAPTOR_ERROR_IPC_UNSTABLE;
+ error->code = remote_call_result; /* LCOV_EXCL_LINE */
+ error->msg = ipc_g_variant_dup_string(call_result_struct[1]); /* LCOV_EXCL_LINE */
+ ret = SERVICE_ADAPTOR_ERROR_IPC_UNSTABLE; /* LCOV_EXCL_LINE */
}
g_variant_unref(call_result_struct[0]);
return ret;
}
-//LCOV_EXCL_START
+/* LCOV_EXCL_START */
static void *_on_dbus_disappeared_cb(void *data)
{
FUNC_START();
FUNC_END();
return NULL;
}
-//LCOV_EXCL_STOP
+/* LCOV_EXCL_STOP */
int ret = _dbus_client_service_adaptor_init();
if (0 != ret) {
- _dbus_client_service_adaptor_deinit();
- return ret;
+ _dbus_client_service_adaptor_deinit(); /* LCOV_EXCL_LINE */
+ return ret; /* LCOV_EXCL_LINE */
}
return 0;
int idx1 = 0, idx2 = 0, idx3 = 0;
_file_info = service_storage_create_file_info();
if (NULL == _file_info) {
- *file_info = NULL;
+ *file_info = NULL; /* LCOV_EXCL_LINE */
- for (size_t j = 0; j < service_adaptor_file_info_s_type_length; j++) {
- g_variant_unref(res_info_struct[j]);
+ for (size_t j = 0; j < service_adaptor_file_info_s_type_length; j++) { /* LCOV_EXCL_LINE */
+ g_variant_unref(res_info_struct[j]); /* LCOV_EXCL_LINE */
}
- return;
+ return; /* LCOV_EXCL_LINE */
}
_file_info->plugin_name = ipc_g_variant_dup_string(res_info_struct[idx1++]);
idx++;
*file_info_list_len = g_variant_get_uint32(res_info_struct[idx++]);
} else {
- *file_info_list_len = 0U;
+ *file_info_list_len = 0U; /* LCOV_EXCL_LINE */
}
for (size_t j = 0; j < service_adaptor_get_file_list_res_s_type_length; j++) {
service_adaptor_task_h task = _queue_get_task(file_uid);
if (NULL == task) {
- sac_warning("Callback task get failed");
- return;
+ sac_warning("Callback task get failed"); /* LCOV_EXCL_LINE */
+ return; /* LCOV_EXCL_LINE */
} else if (NULL == task->handle) {
- sac_warning("Callback task->handle get failed");
- return;
+ sac_warning("Callback task->handle get failed"); /* LCOV_EXCL_LINE */
+ return; /* LCOV_EXCL_LINE */
} else {
service_storage_task_h storage_task = (service_storage_task_h) task->handle;
if (NULL != storage_task->progress_callback) {
- sac_debug("Call progress callback[%lld] (%llu/%llu byte)", file_uid, progress_size, total_size);
- storage_task->progress_callback(progress_size, total_size, storage_task->progress_user_data);
+ sac_debug("Call progress callback[%lld] (%llu/%llu byte)", file_uid, progress_size, total_size); /* LCOV_EXCL_LINE */
+ storage_task->progress_callback(progress_size, total_size, storage_task->progress_user_data); /* LCOV_EXCL_LINE */
}
}
} else if (0 == g_strcmp0(signal_name, DBUS_STORAGE_FILE_TRANSFER_STATE_CHANGED_SIGNAL)) {
_state = SERVICE_STORAGE_TASK_CANCELED;
break;
case SERVICE_ADAPTOR_FILE_TRANSFER_STATE_FAILED:
- _state = SERVICE_STORAGE_TASK_FAILED;
- break;
+ _state = SERVICE_STORAGE_TASK_FAILED; /* LCOV_EXCL_LINE */
+ break; /* LCOV_EXCL_LINE */
default:
- return;
+ return; /* LCOV_EXCL_LINE */
}
GVariant *call_result[2];
service_adaptor_task_h task = _queue_get_task(file_uid);
if (NULL == task) {
- sac_warning("Callback task get failed");
- return;
+ sac_warning("Callback task get failed"); /* LCOV_EXCL_LINE */
+ return; /* LCOV_EXCL_LINE */
} else if (NULL == task->handle) {
- sac_warning("Callback task->handle get failed");
- return;
+ sac_warning("Callback task->handle get failed"); /* LCOV_EXCL_LINE */
+ return; /* LCOV_EXCL_LINE */
} else {
service_storage_task_h storage_task = (service_storage_task_h) task->handle;
if (NULL != storage_task->state_callback) {
- sac_debug("Call state callback[%lld] (%d state)", file_uid, _state);
- storage_task->state_callback(_state, storage_task->state_user_data);
+ sac_debug("Call state callback[%lld] (%d state)", file_uid, _state); /* LCOV_EXCL_LINE */
+ storage_task->state_callback(_state, storage_task->state_user_data); /* LCOV_EXCL_LINE */
}
}
}
ipc_check_proxy(sac_interface_proxy);
if ((NULL == service_name) || (NULL == privilege_name)) {
- error->code = SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER;
- error->msg = strdup("Invalid Param");
- return SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER;
+ error->code = SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER; /* LCOV_EXCL_LINE */
+ error->msg = strdup("Invalid Param"); /* LCOV_EXCL_LINE */
+ return SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER; /* LCOV_EXCL_LINE */
}
GVariant *request = g_variant_new("(" private_service_adaptor_privilege_check_req_s_type ")", __safe_add_string(service_name), __safe_add_string(privilege_name));
service_adaptor_task_h task = (service_adaptor_task_h) g_malloc0(sizeof(service_adaptor_task_s));
if (NULL == task) {
- // LCOV_EXCL_START
+ /* LCOV_EXCL_START */
FUNC_STOP();
return -1;
- // LCOV_EXCL_STOP
+ /* LCOV_EXCL_STOP */
}
task->id = _id;
g_service_adaptor_task_queue = NULL;
}
-/** @brief Adds Task in Queue
- * @return int
- * @remarks :
- */
- /*
-int _signal_queue_add_task(int64_t _id,
- uint32_t _callback,
- void *_handle,
- void *user_data)
-{
- FUNC_START();
-
- service_adaptor_task_h task = (service_adaptor_task_h) g_malloc0(sizeof(service_adaptor_task_s));
-
- if (NULL == task) {
- FUNC_STOP();
- return -1;
- }
-
- task->id = _id;
- task->callback = _callback;
- task->handle = _handle;
- task->user_data = user_data;
-
- g_service_adaptor_signal_queue = g_list_append(g_service_adaptor_signal_queue, task);
-
- FUNC_END();
- return 0;
-}
-*/
-
+/* LCOV_EXCL_START */
/** @brief Adds Task in Queue
* @return service_adaptor_task_h
* @remarks :
FUNC_END();
return target;
}
-
-/** @brief Adds Task in Queue
- * @return int
- * @remarks :
- */
- /*
-int _signal_queue_del_task(service_adaptor_task_h _task)
-{
- FUNC_START();
- service_adaptor_task_h target = NULL;
-
- for (GList *list = g_list_first(g_service_adaptor_signal_queue); list != NULL; list = g_list_next(list)) {
- service_adaptor_task_h data = (service_adaptor_task_h) list->data;
-
- if ((NULL != data) && (_task == data)) {
- target = data;
- break;
- }
- }
-
- if (NULL != target) {
- g_service_adaptor_signal_queue = g_list_remove(g_service_adaptor_signal_queue, target);
- g_free(target);
- target = NULL;
- }
-
- FUNC_END();
- return 0;
-}
-*/
+/* LCOV_EXCL_STOP */
/** @brief Clears Task in Queue
* @return void
{
FUNC_START();
if (NULL != g_service_adaptor_signal_queue) {
- g_list_free(g_service_adaptor_signal_queue);
+ g_list_free(g_service_adaptor_signal_queue); /* LCOV_EXCL_LINE */
}
g_service_adaptor_signal_queue = NULL;
FUNC_END();
}
-/*
-int service_adaptor_check_handle_validate(service_adaptor_h handle)
-{
- if ((NULL == handle) || (NULL == g_service_adaptor)) {
- sac_error("The handle is invalid <user(%p) adaptor(%p)>", handle, g_service_adaptor);
- return -1;
- } else if (handle != g_service_adaptor) {
- sac_error("The handle is invalid <user(%p) adaptor(%p)>", handle, g_service_adaptor);
- return -2;
- } else {
- return 0;
- }
-}
-*/
-
void _service_adaptor_set_last_result(int code, const char *message)
{
FUNC_START();
} else if (0 >= strlen(last_error_message)) {
ret = SERVICE_ADAPTOR_ERROR_NO_DATA;
} else {
- *message = strdup(last_error_message);
- ret = SERVICE_ADAPTOR_ERROR_NONE;
+ *message = strdup(last_error_message); /* LCOV_EXCL_LINE */
+ ret = SERVICE_ADAPTOR_ERROR_NONE; /* LCOV_EXCL_LINE */
}
FUNC_END();
}
if (0 < connections_counter) {
- g_mutex_unlock(&connections_counter_mutex);
-
- return SERVICE_ADAPTOR_ERROR_NOT_SUPPORTED;
+ g_mutex_unlock(&connections_counter_mutex); /* LCOV_EXCL_LINE */
+ return SERVICE_ADAPTOR_ERROR_NOT_SUPPORTED; /* LCOV_EXCL_LINE */
}
service = (service_adaptor_h) calloc(1, sizeof(service_adaptor_s));
if (NULL == service) {
- service_adaptor_set_last_result(SERVICE_ADAPTOR_ERROR_UNKNOWN, "Memory allocation failed");
- g_mutex_unlock(&connections_counter_mutex);
- return SERVICE_ADAPTOR_ERROR_UNKNOWN;
+ service_adaptor_set_last_result(SERVICE_ADAPTOR_ERROR_UNKNOWN, "Memory allocation failed"); /* LCOV_EXCL_LINE */
+ g_mutex_unlock(&connections_counter_mutex); /* LCOV_EXCL_LINE */
+ return SERVICE_ADAPTOR_ERROR_UNKNOWN; /* LCOV_EXCL_LINE */
}
-/*
- int trd = 0;
- char fingerprint[50] = {0, };
- snprintf(fingerprint, 50, "%s/%d", SERVICE_ADAPTOR_START_KEY_PATH, getpid());
- sac_debug("Trigger open : %s", fingerprint);
- trd = open(fingerprint, O_WRONLY|O_CREAT, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH);
- if (0 > trd) {
- sac_error("Trigger open failed (%d)", trd);
- free(service);
- g_mutex_unlock(&connections_counter_mutex);
- return SERVICE_ADAPTOR_ERROR_INVALID_STATE;
- }
-*/
+
int dbus_ret = _dbus_client_layer_init();
if (0 == dbus_ret) {
ret = _dbus_connect_service_adaptor(&error);
if (SERVICE_ADAPTOR_ERROR_NONE != ret) {
- service_adaptor_set_last_result(error.code, error.msg);
- free(service);
-/*
- close(trd);
- remove(fingerprint);
-*/
- g_mutex_unlock(&connections_counter_mutex);
- free(error.msg);
- return ret;
+ service_adaptor_set_last_result(error.code, error.msg); /* LCOV_EXCL_LINE */
+ free(service); /* LCOV_EXCL_LINE */
+ g_mutex_unlock(&connections_counter_mutex); /* LCOV_EXCL_LINE */
+ free(error.msg); /* LCOV_EXCL_LINE */
+ return ret; /* LCOV_EXCL_LINE */
}
service->on_signal = NULL;
-/* service->plugins = NULL; */
-/* service->plugin_count = 0; */
-
*handle = service;
g_service_adaptor = service;
-/*
- close(trd);
- remove(fingerprint);
-*/
+
g_mutex_unlock(&connections_counter_mutex);
sac_api_end(ret);
g_mutex_lock(&connections_counter_mutex);
if (0 >= connections_counter) {
- connections_counter = 0;
- g_service_adaptor = NULL;
- g_mutex_unlock(&connections_counter_mutex);
+ connections_counter = 0; /* LCOV_EXCL_LINE */
+ g_service_adaptor = NULL; /* LCOV_EXCL_LINE */
+ g_mutex_unlock(&connections_counter_mutex); /* LCOV_EXCL_LINE */
- ret = SERVICE_ADAPTOR_ERROR_UNKNOWN;
- return ret;
+ ret = SERVICE_ADAPTOR_ERROR_UNKNOWN; /* LCOV_EXCL_LINE */
+ return ret; /* LCOV_EXCL_LINE */
}
if (NULL != handle) {
ret = _dbus_get_plugin_list(&plugin_uris, &plugins_len, &error);
if (SERVICE_ADAPTOR_ERROR_NONE != ret) {
- service_adaptor_set_last_result(error.code, error.msg);
- free(error.msg);
+ service_adaptor_set_last_result(error.code, error.msg); /* LCOV_EXCL_LINE */
+ free(error.msg); /* LCOV_EXCL_LINE */
} else if ((NULL != plugin_uris) && (0 < plugins_len)) {
int i;
bool is_continue = true;
*plugin = _plugin;
} else {
- free(_plugin);
- free(_plugin_uri);
- sac_error("Critical : Memory allocation failed.");
- ret = SERVICE_ADAPTOR_ERROR_UNKNOWN;
+ free(_plugin); /* LCOV_EXCL_LINE */
+ free(_plugin_uri); /* LCOV_EXCL_LINE */
+ sac_error("Critical : Memory allocation failed."); /* LCOV_EXCL_LINE */
+ ret = SERVICE_ADAPTOR_ERROR_UNKNOWN; /* LCOV_EXCL_LINE */
}
}
} else {
*value = strdup((char *) property);
}
-/*
- GHashTableIter iter;
- gpointer iter_key;
- gpointer iter_value;
- g_hash_table_iter_init(&iter, (GHashTable *)(handle->optional_property));
- while (g_hash_table_iter_next(&iter, &iter_key, &iter_value)) {
- if (NULL != iter_key) {
- if (0 == strcmp((char *)iter_key, key)) {
- ret = SERVICE_ADAPTOR_ERROR_NONE;
- *value = strdup((char *)iter_value);
- break;
- }
- }
- }
-*/
-
sac_api_end(ret);
return ret;
}
app_ret = app_get_id(&tizen_app_id);
if (app_ret || (NULL == tizen_app_id)) {
- char executable_path[1000];
- int executable_path_len = 0;
- executable_path_len = readlink("/proc/self/exe", executable_path, 1000);
- tizen_app_id = strndup(executable_path, executable_path_len);
- type = strdup("etc");
- handle->app_type = CLIENT_APP_TYPE_ETC;
+ char executable_path[1000]; /* LCOV_EXCL_LINE */
+ int executable_path_len = 0; /* LCOV_EXCL_LINE */
+ executable_path_len = readlink("/proc/self/exe", executable_path, 1000); /* LCOV_EXCL_LINE */
+ tizen_app_id = strndup(executable_path, executable_path_len); /* LCOV_EXCL_LINE */
+ type = strdup("etc"); /* LCOV_EXCL_LINE */
+ handle->app_type = CLIENT_APP_TYPE_ETC; /* LCOV_EXCL_LINE */
} else {
type = strdup("app");
handle->app_type = CLIENT_APP_TYPE_APPLICATION;
}
if (NULL == tizen_app_id) {
- free(type);
- return SERVICE_ADAPTOR_ERROR_UNKNOWN;
+ free(type); /* LCOV_EXCL_LINE */
+ return SERVICE_ADAPTOR_ERROR_UNKNOWN; /* LCOV_EXCL_LINE */
}
service_handle_name = g_strconcat(tizen_app_id, "?type=", type, "&plugin=", handle->plugin_uri, NULL);
free(type);
if (NULL == service_handle_name) {
- sac_error("handle name get failed");
- service_adaptor_set_last_result(SERVICE_ADAPTOR_ERROR_UNKNOWN, "handle name get failed");
- return SERVICE_ADAPTOR_ERROR_UNKNOWN;
+ sac_error("handle name get failed"); /* LCOV_EXCL_LINE */
+ service_adaptor_set_last_result(SERVICE_ADAPTOR_ERROR_UNKNOWN, "handle name get failed"); /* LCOV_EXCL_LINE */
+ return SERVICE_ADAPTOR_ERROR_UNKNOWN; /* LCOV_EXCL_LINE */
}
/* TODO replace to real cookie */
snprintf(security_cookie, SECURITY_SERVER_COOKIE_BUFFER_SIZE, "%020d", (int)getpid());
-/*
- int sec_ret = security_server_request_cookie(security_cookie, SECURITY_SERVER_COOKIE_BUFFER_SIZE);
- sac_debug_func("security_cookie : %s (%d)", security_cookie, sec_ret);
-
- if (('\0' == security_cookie[0]) || sec_ret) {
- sac_error("cookie get failed");
- service_adaptor_set_last_result(SERVICE_ADAPTOR_ERROR_UNKNOWN, "security cookie get failed");
- free(service_handle_name);
- return SERVICE_ADAPTOR_ERROR_UNKNOWN;
- }
-*/
handle->service_handle_name = service_handle_name;
sac_info("handle name :%s", handle->service_handle_name);
ret = _dbus_start_service(handle, service_flag, security_cookie, &error);
if (SERVICE_ADAPTOR_ERROR_NONE != ret) {
- service_adaptor_set_last_result(error.code, error.msg);
- free(error.msg);
+ service_adaptor_set_last_result(error.code, error.msg); /* LCOV_EXCL_LINE */
+ free(error.msg); /* LCOV_EXCL_LINE */
}
sac_api_end(ret);
_cloud_meta = (service_storage_cloud_meta_s *) calloc(1, sizeof(service_storage_cloud_meta_s));
if ((NULL == _file_info) || (NULL == _media_meta) || (NULL == _cloud_meta)) {
- free(_file_info);
- free(_media_meta);
- free(_cloud_meta);
+ free(_file_info); /* LCOV_EXCL_LINE */
+ free(_media_meta); /* LCOV_EXCL_LINE */
+ free(_cloud_meta); /* LCOV_EXCL_LINE */
- FUNC_STOP();
- return NULL;
+ FUNC_STOP(); /* LCOV_EXCL_LINE */
+ return NULL; /* LCOV_EXCL_LINE */
}
_media_meta->mime_type = NULL;
{
FUNC_START();
if (NULL == file_info) {
- FUNC_STOP();
- return 1;
+ FUNC_STOP(); /* LCOV_EXCL_LINE */
+ return 1; /* LCOV_EXCL_LINE */
}
if (NULL == *file_info) {
- FUNC_STOP();
- return 0;
+ FUNC_STOP(); /* LCOV_EXCL_LINE */
+ return 0; /* LCOV_EXCL_LINE */
}
service_storage_file_h _file_info = *file_info;
int privilege_ret = 0;
privilege_ret = _dbus_get_privilege_check_result(plugin->service_handle_name, TIZEN_PRIVILEGE_NAME_INTERNET, NULL, &error);
if (SERVICE_ADAPTOR_ERROR_NONE != privilege_ret) {
- sac_error("Privilege check error (ret : %d)", privilege_ret);
- return SERVICE_ADAPTOR_ERROR_PERMISSION_DENIED;
+ sac_error("Privilege check error (ret : %d)", privilege_ret); /* LCOV_EXCL_LINE */
+ return SERVICE_ADAPTOR_ERROR_PERMISSION_DENIED; /* LCOV_EXCL_LINE */
}
}
service_storage_task_h _task = (service_storage_task_h) calloc(1, sizeof(service_storage_task_t));
if (NULL == _task) {
- ret = SERVICE_ADAPTOR_ERROR_UNKNOWN;
- service_adaptor_set_last_result(ret, "Memory allocation failed");
- return ret;
+ ret = SERVICE_ADAPTOR_ERROR_UNKNOWN; /* LCOV_EXCL_LINE */
+ service_adaptor_set_last_result(ret, "Memory allocation failed"); /* LCOV_EXCL_LINE */
+ return ret; /* LCOV_EXCL_LINE */
}
long long int task_id = 0;
ret = _dbus_open_upload_file(plugin->service_handle_name, file_path, upload_path, &task_id, &error);
if (SERVICE_ADAPTOR_ERROR_NONE != ret) {
- service_adaptor_set_last_result(error.code, error.msg);
- free(error.msg);
- free(_task);
+ service_adaptor_set_last_result(error.code, error.msg); /* LCOV_EXCL_LINE */
+ free(error.msg); /* LCOV_EXCL_LINE */
+ free(_task); /* LCOV_EXCL_LINE */
} else {
_task->service_handle_name = strdup(plugin->service_handle_name);
_task->task_id = task_id;
int privilege_ret = 0;
privilege_ret = _dbus_get_privilege_check_result(plugin->service_handle_name, TIZEN_PRIVILEGE_NAME_INTERNET, NULL, &error);
if (SERVICE_ADAPTOR_ERROR_NONE != privilege_ret) {
- sac_error("Privilege check error (ret : %d)", privilege_ret);
- return SERVICE_ADAPTOR_ERROR_PERMISSION_DENIED;
+ sac_error("Privilege check error (ret : %d)", privilege_ret); /* LCOV_EXCL_LINE */
+ return SERVICE_ADAPTOR_ERROR_PERMISSION_DENIED; /* LCOV_EXCL_LINE */
}
}
service_storage_task_h _task = (service_storage_task_h) calloc(1, sizeof(service_storage_task_t));
if (NULL == _task) {
- ret = SERVICE_ADAPTOR_ERROR_UNKNOWN;
- service_adaptor_set_last_result(ret, "Memory allocation failed");
- return ret;
+ ret = SERVICE_ADAPTOR_ERROR_UNKNOWN; /* LCOV_EXCL_LINE */
+ service_adaptor_set_last_result(ret, "Memory allocation failed"); /* LCOV_EXCL_LINE */
+ return ret; /* LCOV_EXCL_LINE */
}
long long int task_id = 0;
ret = _dbus_open_download_file(plugin->service_handle_name, storage_path, download_path, &task_id, &error);
if (SERVICE_ADAPTOR_ERROR_NONE != ret) {
- service_adaptor_set_last_result(error.code, error.msg);
- free(error.msg);
- free(_task);
+ service_adaptor_set_last_result(error.code, error.msg); /* LCOV_EXCL_LINE */
+ free(error.msg); /* LCOV_EXCL_LINE */
+ free(_task); /* LCOV_EXCL_LINE */
} else {
_task->service_handle_name = strdup(plugin->service_handle_name);
_task->task_id = task_id;
int privilege_ret = 0;
privilege_ret = _dbus_get_privilege_check_result(plugin->service_handle_name, TIZEN_PRIVILEGE_NAME_INTERNET, NULL, &error);
if (SERVICE_ADAPTOR_ERROR_NONE != privilege_ret) {
- sac_error("Privilege check error (ret : %d)", privilege_ret);
- return SERVICE_ADAPTOR_ERROR_PERMISSION_DENIED;
+ sac_error("Privilege check error (ret : %d)", privilege_ret); /* LCOV_EXCL_LINE */
+ return SERVICE_ADAPTOR_ERROR_PERMISSION_DENIED; /* LCOV_EXCL_LINE */
}
}
service_storage_task_h _task = (service_storage_task_h) calloc(1, sizeof(service_storage_task_t));
int *t_size = (int *)calloc(1, sizeof(int));
if ((NULL == _task) || (NULL == t_size)) {
- ret = SERVICE_ADAPTOR_ERROR_UNKNOWN;
- service_adaptor_set_last_result(ret, "Memory allocation failed");
- free(_task);
- free(t_size);
- return ret;
+ ret = SERVICE_ADAPTOR_ERROR_UNKNOWN; /* LCOV_EXCL_LINE */
+ service_adaptor_set_last_result(ret, "Memory allocation failed"); /* LCOV_EXCL_LINE */
+ free(_task); /* LCOV_EXCL_LINE */
+ free(t_size); /* LCOV_EXCL_LINE */
+ return ret; /* LCOV_EXCL_LINE */
}
long long int task_id = 0;
ret = _dbus_open_download_thumbnail(plugin->service_handle_name, storage_path, download_path, thumbnail_size, &task_id, &error);
if (SERVICE_ADAPTOR_ERROR_NONE != ret) {
- service_adaptor_set_last_result(error.code, error.msg);
- free(error.msg);
- free(_task);
- free(t_size);
+ service_adaptor_set_last_result(error.code, error.msg); /* LCOV_EXCL_LINE */
+ free(error.msg); /* LCOV_EXCL_LINE */
+ free(_task); /* LCOV_EXCL_LINE */
+ free(t_size); /* LCOV_EXCL_LINE */
} else {
_task->service_handle_name = strdup(plugin->service_handle_name);
_task->task_id = task_id;
ret = _dbus_close_file_task(task->service_handle_name, task->task_id, &error);
if (SERVICE_ADAPTOR_ERROR_NONE != ret) {
- service_adaptor_set_last_result(error.code, error.msg);
- free(error.msg);
+ service_adaptor_set_last_result(error.code, error.msg); /* LCOV_EXCL_LINE */
+ free(error.msg); /* LCOV_EXCL_LINE */
}
service_adaptor_task_h callback_task = NULL;
break;
default:
- sac_info("Invalid async task");
- ret = SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER;
- error.code = SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER;
- error.msg = strdup("Invalid async task operation");
- break;
+ sac_info("Invalid async task"); /* LCOV_EXCL_LINE */
+ ret = SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER; /* LCOV_EXCL_LINE */
+ error.code = SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER; /* LCOV_EXCL_LINE */
+ error.msg = strdup("Invalid async task operation"); /* LCOV_EXCL_LINE */
+ break; /* LCOV_EXCL_LINE */
}
if (SERVICE_ADAPTOR_ERROR_NONE != ret) {
- service_adaptor_set_last_result(error.code, error.msg);
- free(error.msg);
+ service_adaptor_set_last_result(error.code, error.msg); /* LCOV_EXCL_LINE */
+ free(error.msg); /* LCOV_EXCL_LINE */
}
sac_api_end(ret);
break;
default:
- sac_info("Invalid async task");
- ret = SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER;
- error.code = SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER;
- error.msg = strdup("Invalid async task operation");
- break;
+ sac_info("Invalid async task"); /* LCOV_EXCL_LINE */
+ ret = SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER; /* LCOV_EXCL_LINE */
+ error.code = SERVICE_ADAPTOR_ERROR_INVALID_PARAMETER; /* LCOV_EXCL_LINE */
+ error.msg = strdup("Invalid async task operation"); /* LCOV_EXCL_LINE */
+ break; /* LCOV_EXCL_LINE */
}
if (SERVICE_ADAPTOR_ERROR_NONE != ret) {
- service_adaptor_set_last_result(error.code, error.msg);
- free(error.msg);
+ service_adaptor_set_last_result(error.code, error.msg); /* LCOV_EXCL_LINE */
+ free(error.msg); /* LCOV_EXCL_LINE */
}
sac_api_end(ret);
ret = _dbus_get_file_list(_params->plugin->service_handle_name, _params->path, &files, &files_len, NULL, &error);
if (SERVICE_ADAPTOR_ERROR_NONE != ret) {
- service_adaptor_set_last_result(error.code, error.msg);
- free(error.msg);
- if ((NULL != files) && (0 < files_len)) {
- int i;
- for (i = 0; i < files_len; i++) {
- service_storage_unref_file_info(&files[i]);
- }
- free(files);
- files = NULL;
+ service_adaptor_set_last_result(error.code, error.msg); /* LCOV_EXCL_LINE */
+ free(error.msg); /* LCOV_EXCL_LINE */
+ if ((NULL != files) && (0 < files_len)) { /* LCOV_EXCL_LINE */
+ int i; /* LCOV_EXCL_LINE */
+ for (i = 0; i < files_len; i++) { /* LCOV_EXCL_LINE */
+ service_storage_unref_file_info(&files[i]); /* LCOV_EXCL_LINE */
+ } /* LCOV_EXCL_LINE */
+ free(files); /* LCOV_EXCL_LINE */
+ files = NULL; /* LCOV_EXCL_LINE */
}
} else {
if (0 < files_len) {
file_list = (service_storage_file_list_h) calloc(1, sizeof(struct _service_storage_file_list_s));
if (NULL == file_list) {
- sac_error("Critical : Memory allocation failed");
+ sac_error("Critical : Memory allocation failed"); /* LCOV_EXCL_LINE */
ret = SERVICE_ADAPTOR_ERROR_UNKNOWN;
} else {
file_list->list = files;
error.msg = NULL;
privilege_ret = _dbus_get_privilege_check_result(plugin->service_handle_name, TIZEN_PRIVILEGE_NAME_INTERNET, NULL, &error);
if (SERVICE_ADAPTOR_ERROR_NONE != privilege_ret) {
- sac_error("Privilege check error (ret : %d)", privilege_ret);
- return SERVICE_ADAPTOR_ERROR_PERMISSION_DENIED;
+ sac_error("Privilege check error (ret : %d)", privilege_ret); /* LCOV_EXCL_LINE */
+ return SERVICE_ADAPTOR_ERROR_PERMISSION_DENIED; /* LCOV_EXCL_LINE */
}
}
params = (struct __async_wrapper_context *) calloc(1, sizeof(struct __async_wrapper_context));
if (NULL == params) {
- sac_warning("Memory allocation failed");
- ret = SERVICE_ADAPTOR_ERROR_UNKNOWN;
+ sac_warning("Memory allocation failed"); /* LCOV_EXCL_LINE */
+ ret = SERVICE_ADAPTOR_ERROR_UNKNOWN; /* LCOV_EXCL_LINE */
} else {
params->plugin = plugin;
params->path = strdup(dir_path);
thread_ret = pthread_create(&get_list_thread, NULL, _get_file_list_runnable, (void *)params);
if (thread_ret) {
- sac_warning("Thread create failed");
- ret = SERVICE_ADAPTOR_ERROR_UNKNOWN;
- free(params->path);
- free(params);
+ sac_warning("Thread create failed"); /* LCOV_EXCL_LINE */
+ ret = SERVICE_ADAPTOR_ERROR_UNKNOWN; /* LCOV_EXCL_LINE */
+ free(params->path); /* LCOV_EXCL_LINE */
+ free(params); /* LCOV_EXCL_LINE */
}
}
service_storage_file_list_h _list = NULL;
_list = (service_storage_file_list_h) calloc(1, sizeof(struct _service_storage_file_list_s));
if (NULL == _list) {
- FUNC_STOP();
- return SERVICE_ADAPTOR_ERROR_UNKNOWN;
+ FUNC_STOP(); /* LCOV_EXCL_LINE */
+ return SERVICE_ADAPTOR_ERROR_UNKNOWN; /* LCOV_EXCL_LINE */
}
_list->length = src_list->length;
_list->list = (service_storage_file_h *) calloc(_list->length, sizeof(struct _service_storage_file_s *));
if (NULL == _list->list) {
- free(_list);
- FUNC_STOP();
- return SERVICE_ADAPTOR_ERROR_UNKNOWN;
+ free(_list); /* LCOV_EXCL_LINE */
+ FUNC_STOP(); /* LCOV_EXCL_LINE */
+ return SERVICE_ADAPTOR_ERROR_UNKNOWN; /* LCOV_EXCL_LINE */
}
int i = 0;
service_storage_file_h new_file = service_storage_create_file_info();
if (NULL == new_file) {
- FUNC_STOP();
- return SERVICE_ADAPTOR_ERROR_UNKNOWN;
+ FUNC_STOP(); /* LCOV_EXCL_LINE */
+ return SERVICE_ADAPTOR_ERROR_UNKNOWN; /* LCOV_EXCL_LINE */
}
if (NULL != src->media_meta) {
ret = _dbus_remove_file(_params->plugin->service_handle_name, _params->path, NULL, &error);
if (SERVICE_ADAPTOR_ERROR_NONE != ret) {
- service_adaptor_set_last_result(error.code, error.msg);
- free(error.msg);
+ service_adaptor_set_last_result(error.code, error.msg); /* LCOV_EXCL_LINE */
+ free(error.msg); /* LCOV_EXCL_LINE */
}
((service_storage_result_cb)_params->callback)(ret, _params->user_data);
error.msg = NULL;
privilege_ret = _dbus_get_privilege_check_result(plugin->service_handle_name, TIZEN_PRIVILEGE_NAME_INTERNET, NULL, &error);
if (SERVICE_ADAPTOR_ERROR_NONE != privilege_ret) {
- sac_error("Privilege check error (ret : %d)", privilege_ret);
- return SERVICE_ADAPTOR_ERROR_PERMISSION_DENIED;
+ sac_error("Privilege check error (ret : %d)", privilege_ret); /* LCOV_EXCL_LINE */
+ return SERVICE_ADAPTOR_ERROR_PERMISSION_DENIED; /* LCOV_EXCL_LINE */
}
}
params = (struct __async_wrapper_context *) calloc(1, sizeof(struct __async_wrapper_context));
if (NULL == params) {
- sac_warning("Memory allocation failed");
- ret = SERVICE_ADAPTOR_ERROR_UNKNOWN;
+ sac_warning("Memory allocation failed"); /* LCOV_EXCL_LINE */
+ ret = SERVICE_ADAPTOR_ERROR_UNKNOWN; /* LCOV_EXCL_LINE */
} else {
params->plugin = plugin;
params->path = strdup(remove_path);
thread_ret = pthread_create(&remove_thread, NULL, _remove_runnable, (void *)params);
if (thread_ret) {
- sac_warning("Thread create failed");
- ret = SERVICE_ADAPTOR_ERROR_UNKNOWN;
- free(params->path);
- free(params);
+ sac_warning("Thread create failed"); /* LCOV_EXCL_LINE */
+ ret = SERVICE_ADAPTOR_ERROR_UNKNOWN; /* LCOV_EXCL_LINE */
+ free(params->path); /* LCOV_EXCL_LINE */
+ free(params); /* LCOV_EXCL_LINE */
}
}
#include <bundle.h>
-// LCOV_EXCL_START
+/* LCOV_EXCL_START */
/** @brief NULL-pointer safe string duplication function
* This function will not crash if source string pointer is NULL. It is user's
* responsibility to free the result pointer.
return SERVICE_ADAPTOR_ERROR_PLUGIN_FAILED;
}
}
-// LCOV_EXCL_STOP
+/* LCOV_EXCL_STOP */
int _ipc_get_simple_result(GVariant *call_result, GError *g_error, service_adaptor_error_s *error)
{
int ret = SERVICE_ADAPTOR_ERROR_NONE;
if (NULL == call_result) {
+ /* LCOV_EXCL_START */
error->code = SERVICE_ADAPTOR_ERROR_IPC_UNSTABLE;
ret = SERVICE_ADAPTOR_ERROR_IPC_UNSTABLE;
if (NULL != g_error) {
- // LCOV_EXCL_START
sac_error("G_IO_ERROR DEBUG (%d)", (int)(g_error->code));
if (g_error->code == G_IO_ERROR_TIMED_OUT) {
ret = SERVICE_ADAPTOR_ERROR_TIMED_OUT;
}
error->msg = __SAFE_STRDUP(g_error->message);
g_error_free(g_error);
- // LCOV_EXCL_STOP
}
+ /* LCOV_EXCL_STOP */
} else {
if (FALSE == g_variant_is_of_type(call_result, G_VARIANT_TYPE("(ts)"))) {
- // LCOV_EXCL_START
+ /* LCOV_EXCL_START */
error->code = SERVICE_ADAPTOR_ERROR_IPC_UNSTABLE;
error->msg = strdup("D-Bus return type error");
ret = SERVICE_ADAPTOR_ERROR_IPC_UNSTABLE;
- // LCOV_EXCL_STOP
+ /* LCOV_EXCL_STOP */
} else {
GVariant *call_result_struct[2];
call_result_struct[0] = g_variant_get_child_value(call_result, 0);
uint64_t remote_call_result = g_variant_get_uint64(call_result_struct[0]);
if (SERVICE_ADAPTOR_ERROR_NONE != remote_call_result) {
- // LCOV_EXCL_START
+ /* LCOV_EXCL_START */
error->code = remote_call_result;
error->msg = ipc_g_variant_dup_string(call_result_struct[1]);
ret = _get_result_code(remote_call_result);
- // LCOV_EXCL_STOP
+ /* LCOV_EXCL_STOP */
}
g_variant_unref(call_result_struct[0]);
g_variant_unref(call_result_struct[1]);
/* if calling completion callback, it need to wait called message api in dbus-message-adaptor */
-// LCOV_EXCL_START
+/* LCOV_EXCL_START */
void _get_service_name_by_message_context(message_adaptor_plugin_context_h context,
char **service_name)
{
return ret;
}
-//LCOV_EXCL_STOP
+/* LCOV_EXCL_STOP */
message_adaptor_h service_adaptor_create_message()
{
/***********************************************************
* Push adaptor callback
***********************************************************/
-//LCOV_EXCL_START
+/* LCOV_EXCL_START */
void service_adaptor_push_adaptor_on_notification_received(push_adaptor_notification_data_h notification,
void *user_data)
{
snprintf(ret_msg, 2048, "push plugin connect failed [%d]", (int)__LINE__);
return SERVICE_ADAPTOR_INTERNAL_ERROR_CREATE;
}
-/*
- // Set server info
- int ret = 0;
- push_adaptor_error_code_h error = NULL;
- ret = push_adaptor_set_server_info(plugin, push_context, service->server_info, NULL, &error, NULL);
- if (SERVICE_ADAPTOR_ERROR_NONE != ret) {
- service_adaptor_warning("Could not set push plugin server information: %d", ret);
- if (NULL != error) {
- service_adaptor_warning("[%lld] %s", error->code, error->msg);
- }
- push_adaptor_destroy_error_code(&error);
- }
-*/
push_adaptor_error_code_h error = NULL;
SERVICE_ADAPTOR_API_TIME_CHECK_PAUSE();
SERVICE_ADAPTOR_PLUGIN_API_TIME_CHECK_START(SA_TIME_CHECK_FLAG_PUSH);
service_adaptor_info("Reconnected push plugin");
return SERVICE_ADAPTOR_INTERNAL_ERROR_NONE;
}
-//LCOV_EXCL_STOP
+/* LCOV_EXCL_STOP */
push_adaptor_h service_adaptor_create_push()
{
push_adaptor_h push_adaptor = push_adaptor_create(PUSH_PLUGIN_PATH);
- if ((void *) NULL == push_adaptor) { //LCOV_EXCL_LINE
- service_adaptor_error("Could not create push adaptor"); //LCOV_EXCL_LINE
- return NULL;
+ if ((void *) NULL == push_adaptor) { /* LCOV_EXCL_LINE */
+ service_adaptor_error("Could not create push adaptor"); /* LCOV_EXCL_LINE */
+ return NULL; /* LCOV_EXCL_LINE */
}
service_adaptor_debug("Push adaptor created");
return push_adaptor;
}
+/* LCOV_EXCL_START */
void service_adaptor_destroy_push(push_adaptor_h push_handle)
{
if ((void *) NULL == push_handle) {
_unload_all_push_service_file();
#endif
}
-
+/* LCOV_EXCL_STOP */
push_adaptor_listener_h service_adaptor_register_push_listener(push_adaptor_h push_adaptor)
{
if ((void *) NULL == push_adaptor) {
- service_adaptor_error("Could not create push adaptor"); //LCOV_EXCL_LINE
- return NULL; //LCOV_EXCL_LINE
+ service_adaptor_error("Could not create push adaptor"); /* LCOV_EXCL_LINE */
+ return NULL; /* LCOV_EXCL_LINE */
}
push_adaptor_listener_h push_listener =
(push_adaptor_listener_h) malloc(sizeof(push_adaptor_listener_t));
if ((void *) NULL == push_listener) {
- service_adaptor_error("Could not create push listener"); //LCOV_EXCL_LINE
- return NULL; //LCOV_EXCL_LINE
+ service_adaptor_error("Could not create push listener"); /* LCOV_EXCL_LINE */
+ return NULL; /* LCOV_EXCL_LINE */
}
push_listener->_on_notification_received = service_adaptor_push_adaptor_on_notification_received;
return push_listener;
}
-//LCOV_EXCL_START
+/* LCOV_EXCL_START */
service_adaptor_internal_error_code_e service_adaptor_push_register(const char *service_file, char **error_msg)
{
service_adaptor_debug("<Start> %s", __FUNCTION__);
}
service_adaptor_debug("<End> %s", __FUNCTION__);
}
-//LCOV_EXCL_STOP
+/* LCOV_EXCL_STOP */
service_adaptor_internal_error_code_e service_adaptor_ref_enabled_push_services(push_activate_h **services, int *services_len)
{
return g_service_adaptor;
}
-//LCOV_EXCL_START
+/* LCOV_EXCL_START */
void debug_service_context(GList *service_list)
{
#ifdef SERVICE_ADAPTOR_DEBUG_CONTEXT
service_adaptor_error("============================================================");
service_adaptor_error("============================================================");
}
-//LCOV_EXCL_STOP
+/* LCOV_EXCL_STOP */
static void glog_handler_init()
{
(int)g_log_set_handler("GLib", G_LOG_LEVEL_CRITICAL, __glog_handler_cb, NULL));
}
-//LCOV_EXCL_START
+/* LCOV_EXCL_START */
service_adaptor_service_context_h service_adaptor_get_service_context(service_adaptor_h service_adaptor,
const char *service_name)
{
FUNC_END();
return SERVICE_ADAPTOR_INTERNAL_ERROR_NONE;
}
-//LCOV_EXCL_STOP
+/* LCOV_EXCL_STOP */
service_adaptor_internal_error_code_e service_adaptor_start(service_adaptor_h service_adaptor)
{
return SERVICE_ADAPTOR_INTERNAL_ERROR_START;
}
+/* LCOV_EXCL_START */
FUNC_STEP();
int ret = auth_adaptor_stop(service_adaptor->auth_handle);
ret += contact_adaptor_stop(service_adaptor->contact_handle);
FUNC_END();
return SERVICE_ADAPTOR_INTERNAL_ERROR_NONE;
+/* LCOV_EXCL_STOP */
}
/**************************************************************************
auth_adaptor_h auth_handle = service_adaptor_create_auth();
if (NULL == auth_handle) {
- //LCOV_EXCL_START
+ /* LCOV_EXCL_START */
service_adaptor_error("Could not create auth adaptor");
return NULL;
- //LCOV_EXCL_STOP
+ /* LCOV_EXCL_STOP */
}
contact_adaptor_h contact_handle = service_adaptor_create_contact();
if (NULL == contact_handle) {
- //LCOV_EXCL_START
+ /* LCOV_EXCL_START */
service_adaptor_error("Could not create contact adaptor");
auth_adaptor_destroy(auth_handle);
return NULL;
- //LCOV_EXCL_STOP
+ /* LCOV_EXCL_STOP */
}
message_adaptor_h message_handle = service_adaptor_create_message();
if (NULL == message_handle) {
- //LCOV_EXCL_START
+ /* LCOV_EXCL_START */
service_adaptor_error("Could not create message adaptor");
auth_adaptor_destroy(auth_handle);
contact_adaptor_destroy(contact_handle);
return NULL;
- //LCOV_EXCL_STOP
+ /* LCOV_EXCL_STOP */
}
shop_adaptor_h shop_handle = service_adaptor_create_shop();
if (NULL == shop_handle) {
- //LCOV_EXCL_START
+ /* LCOV_EXCL_START */
service_adaptor_error("Could not create shop adaptor");
auth_adaptor_destroy(auth_handle);
contact_adaptor_destroy(contact_handle);
message_adaptor_destroy(message_handle);
return NULL;
- //LCOV_EXCL_STOP
+ /* LCOV_EXCL_STOP */
}
storage_adaptor_h storage_handle = service_adaptor_create_storage();
if (NULL == storage_handle) {
- //LCOV_EXCL_START
+ /* LCOV_EXCL_START */
service_adaptor_error("Could not create storage adaptor");
auth_adaptor_destroy(auth_handle);
contact_adaptor_destroy(contact_handle);
message_adaptor_destroy(message_handle);
shop_adaptor_destroy(shop_handle);
return NULL;
- //LCOV_EXCL_STOP
+ /* LCOV_EXCL_STOP */
}
push_adaptor_h push_handle = service_adaptor_create_push();
if (NULL == push_handle) {
- //LCOV_EXCL_START
+ /* LCOV_EXCL_START */
service_adaptor_error("Could not create push adaptor");
auth_adaptor_destroy(auth_handle);
contact_adaptor_destroy(contact_handle);
shop_adaptor_destroy(shop_handle);
storage_adaptor_destroy(storage_handle);
return NULL;
- //LCOV_EXCL_STOP
+ /* LCOV_EXCL_STOP */
}
/* register listener of adaptor */
auth_adaptor_listener_h auth_listener = service_adaptor_register_auth_listener(auth_handle);
if (NULL == auth_listener) {
- //LCOV_EXCL_START
+ /* LCOV_EXCL_START */
service_adaptor_error("Could not create auth listener");
auth_adaptor_destroy(auth_handle);
contact_adaptor_destroy(contact_handle);
storage_adaptor_destroy(storage_handle);
push_adaptor_destroy(push_handle);
return NULL;
- //LCOV_EXCL_STOP
+ /* LCOV_EXCL_STOP */
}
contact_adaptor_listener_h contact_listener = service_adaptor_register_contact_listener(contact_handle);
if (NULL == contact_listener) {
- //LCOV_EXCL_START
+ /* LCOV_EXCL_START */
service_adaptor_error("Could not create contact listener");
auth_adaptor_unregister_listener(auth_handle, auth_listener);
storage_adaptor_destroy(storage_handle);
push_adaptor_destroy(push_handle);
return NULL;
- //LCOV_EXCL_STOP
+ /* LCOV_EXCL_STOP */
}
message_adaptor_listener_h message_listener = service_adaptor_register_message_listener(message_handle);
if (NULL == message_listener) {
- //LCOV_EXCL_START
+ /* LCOV_EXCL_START */
service_adaptor_error("Could not create message listener");
auth_adaptor_unregister_listener(auth_handle, auth_listener);
contact_adaptor_unregister_listener(contact_handle, contact_listener);
storage_adaptor_destroy(storage_handle);
push_adaptor_destroy(push_handle);
return NULL;
- //LCOV_EXCL_STOP
+ /* LCOV_EXCL_STOP */
}
shop_adaptor_listener_h shop_listener = service_adaptor_register_shop_listener(shop_handle);
if (NULL == shop_listener) {
- //LCOV_EXCL_START
+ /* LCOV_EXCL_START */
service_adaptor_error("Could not create shop listener");
auth_adaptor_unregister_listener(auth_handle, auth_listener);
contact_adaptor_unregister_listener(contact_handle, contact_listener);
storage_adaptor_destroy(storage_handle);
push_adaptor_destroy(push_handle);
return NULL;
- //LCOV_EXCL_STOP
+ /* LCOV_EXCL_STOP */
}
storage_adaptor_listener_h storage_listener = service_adaptor_register_storage_listener(storage_handle);
if (NULL == storage_listener) {
- //LCOV_EXCL_START
+ /* LCOV_EXCL_START */
service_adaptor_error("Could not create storage listener");
auth_adaptor_unregister_listener(auth_handle, auth_listener);
contact_adaptor_unregister_listener(contact_handle, contact_listener);
storage_adaptor_destroy(storage_handle);
push_adaptor_destroy(push_handle);
return NULL;
- //LCOV_EXCL_STOP
+ /* LCOV_EXCL_STOP */
}
push_adaptor_listener_h push_listener = service_adaptor_register_push_listener(push_handle);
if (NULL == push_listener) {
- //LCOV_EXCL_START
+ /* LCOV_EXCL_START */
service_adaptor_error("Could not create push listener");
auth_adaptor_unregister_listener(auth_handle, auth_listener);
contact_adaptor_unregister_listener(contact_handle, contact_listener);
storage_adaptor_destroy(storage_handle);
push_adaptor_destroy(push_handle);
return NULL;
- //LCOV_EXCL_STOP
+ /* LCOV_EXCL_STOP */
}
/* create Service Adaptor */
service_adaptor_h service_adaptor = (service_adaptor_h) g_malloc0(sizeof(service_adaptor_s));
if (NULL == service_adaptor) {
- //LCOV_EXCL_START
+ /* LCOV_EXCL_START */
service_adaptor_error("Could not create service adaptor");
auth_adaptor_unregister_listener(auth_handle, auth_listener);
contact_adaptor_unregister_listener(contact_handle, contact_listener);
storage_adaptor_destroy(storage_handle);
push_adaptor_destroy(push_handle);
return NULL;
- //LCOV_EXCL_STOP
+ /* LCOV_EXCL_STOP */
}
FUNC_STEP();
service_adaptor_debug_func("### Preload service len : %d", svc_len);
if (SERVICE_ADAPTOR_INTERNAL_ERROR_NONE == ret) {
+ /* LCOV_EXCL_START */
for (int i = 0; i < svc_len; i++) {
service_adaptor_context_info_s new_context_info;
__init_context_info_s(new_context_info);
service_adaptor_debug_func("### Preload service : ret(%d) service_name(%s)", ret, service_name);
}
free(services);
+ /* LCOV_EXCL_STOP */
}
FUNC_END();
service_adaptor_debug("Service Adaptor: Deinitialized");
}
-//LCOV_EXCL_START
+/* LCOV_EXCL_START */
/**
* @brief main signal function
*
FUNC_END();
return ret;
}
-//LCOV_EXCL_STOP
+/* LCOV_EXCL_STOP */
/**
* @brief main function
#endif
-//LCOV_EXCL_START
+/* LCOV_EXCL_START */
void SERVICE_ADAPTOR_API_TIME_CHECK_START()
{
#ifdef SERVICE_ADAPTOR_DEBUG_TIME_CHECK
service_adaptor_debug_func("[TIMECHECK]================================================");
#endif
}
-//LCOV_EXCL_STOP
+/* LCOV_EXCL_STOP */