ret = app_get_id(&app_id);
if (ret != APP_ERROR_NONE) {
- LOGE("Failed to get app_id : %d", ret);
+ LOGE("Failed to get app_id : %d", ret); //LCOV_EXCL_LINE
ret = STICKER_ERROR_OPERATION_FAILED;
goto cleanup;
}
ret = package_info_create(app_id, &package_info);
if (ret != PACKAGE_MANAGER_ERROR_NONE || package_info == NULL) {
- LOGE("failed to create package_info. ret: %d", ret);
+ LOGE("failed to create package_info. ret: %d", ret); //LCOV_EXCL_LINE
ret = STICKER_ERROR_OPERATION_FAILED;
goto cleanup;
}
ret = package_info_get_root_path(package_info, &app_path);
if (ret != PACKAGE_MANAGER_ERROR_NONE || app_path == NULL) {
- LOGE("failed to create package_info. ret: %d", ret);
+ LOGE("failed to create package_info. ret: %d", ret); //LCOV_EXCL_LINE
ret = STICKER_ERROR_OPERATION_FAILED;
goto cleanup;
}
int path_len = strlen(app_path) + strlen(relative_path) + 2;
file_path = (char *)calloc(path_len, sizeof(char));
if (!file_path) {
- LOGE("failed to alloc memory");
+ LOGE("failed to alloc memory"); //LCOV_EXCL_LINE
ret = STICKER_ERROR_OPERATION_FAILED;
goto cleanup;
}
if(relative_path[0] == '/')
snprintf(file_path, path_len, "%s%s",app_path, relative_path);
else
- snprintf(file_path, path_len, "%s%s%s",app_path, "/", relative_path);
+ snprintf(file_path, path_len, "%s%s%s",app_path, "/", relative_path); //LCOV_EXCL_LINE
if (access(file_path, F_OK) != 0) {
LOGE("%s does not exist", file_path);
char *app_id = NULL;
int ret = app_get_id(&app_id);
if (ret != APP_ERROR_NONE) {
+ //LCOV_EXCL_START
LOGE("Failed to get app_id : %d", ret);
free(data_struct);
ret = STICKER_ERROR_OPERATION_FAILED;
goto cleanup;
+ //LCOV_EXCL_STOP
}
data_struct->app_id = strdup(app_id);
GDBusConnection *conn = NULL;
conn = g_bus_get_sync(G_BUS_TYPE_SYSTEM, NULL, &error);
if (conn == NULL) {
+ //LCOV_EXCL_START
if (error != NULL) {
LOGE("g_bus_get_sync error message = %s", error->message);
g_error_free(error);
}
+ //LCOV_EXCL_STOP
return STICKER_CLIENT_ERROR_IO_ERROR;
}
*gdbus_connection = conn;
LOGD("watch_id : %d", watch_id);
if (watch_id == 0) {
- LOGE("Failed to get identifier");
+ LOGE("Failed to get identifier"); //LCOV_EXCL_LINE
return STICKER_CLIENT_ERROR_IO_ERROR;
}
NULL);
LOGD("id : %d", id);
if (id == 0) {
+ //LCOV_EXCL_START
ret = STICKER_CLIENT_ERROR_IO_ERROR;
LOGE("g_dbus_connection_signal_subscribe() failed");
+ //LCOV_EXCL_STOP
} else {
*monitor_id = id;
}
cmd);
if (!message) {
+ //LCOV_EXCL_START
LOGE("Failed to create a new gdbus message");
if (body)
g_variant_unref(body);
+ //LCOV_EXCL_STOP
return NULL;
}
&err);
if (!*reply) {
+ //LCOV_EXCL_START
ret = STICKER_CLIENT_ERROR_SERVICE_NOT_READY;
if (err != NULL) {
LOGE("Error occurred when sending message(%s) : %s", cmd, err->message);
ret = STICKER_CLIENT_ERROR_PERMISSION_DENIED;
g_error_free(err);
}
+ //LCOV_EXCL_STOP
return ret;
}
if (g_dbus_message_to_gerror(*reply, &err)) {
+ //LCOV_EXCL_START
LOGE("error message = %s, code = %d", err->message, err->code);
if (err->code == G_DBUS_ERROR_ACCESS_DENIED)
ret = STICKER_CLIENT_ERROR_PERMISSION_DENIED;
else
ret = err->code;
g_error_free(err);
+ //LCOV_EXCL_STOP
return ret;
}
g_object_unref(msg);
if (err != NULL) {
+ //LCOV_EXCL_START
ret = STICKER_CLIENT_ERROR_SERVICE_NOT_READY;
LOGE("Error occurred when sending message(%s) : %s", cmd, err->message);
g_error_free(err);
return ret;
+ //LCOV_EXCL_STOP
}
return ret;
ret = _dbus_init(gdbus_connection);
if (ret != STICKER_CLIENT_ERROR_NONE) {
+ //LCOV_EXCL_START
LOGE("_dbus_init() failed : %d", ret);
return ret;
+ //LCOV_EXCL_STOP
}
ret = _dbus_signal_init(*gdbus_connection, monitor_id, lib, data);
if (ret != STICKER_CLIENT_ERROR_NONE) {
+ //LCOV_EXCL_START
LOGE("_dbus_signal_init() failed : %d", ret);
return ret;
+ //LCOV_EXCL_STOP
}
ret = _monitor_register(*gdbus_connection, server_watcher_id, lib);
if (ret != STICKER_CLIENT_ERROR_NONE) {
+ //LCOV_EXCL_START
LOGE("_monitor_register() failed : %d", ret);
return ret;
+ //LCOV_EXCL_STOP
}
if (*server_monitor_id == 0) {
server_watcher_id,
NULL);
if (*server_monitor_id == 0) {
+ //LCOV_EXCL_START
g_dbus_connection_signal_unsubscribe(*gdbus_connection, *monitor_id);
*monitor_id = 0;
LOGE("Failed to get identifier");
return STICKER_CLIENT_ERROR_IO_ERROR;
+ //LCOV_EXCL_STOP
}
}
{
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;
}
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;
}
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;
}
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;
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)
ret = sticker_dbus_init(&provider_struct->gdbus_connection, &provider_struct->server_watcher_id,
&provider_struct->monitor_id, &provider_struct->server_monitor_id, STICKER_CLIENT_LIB_PROVIDER, (void *)provider_struct);
if (ret != STICKER_ERROR_NONE) {
+ //LCOV_EXCL_START
LOGE("Failed to initialize dbus : %d", ret);
free(provider_struct);
return STICKER_ERROR_OPERATION_FAILED;
+ //LCOV_EXCL_STOP
}
*provider_handle = provider_struct;
ret = sticker_dbus_shutdown(provider_handle->gdbus_connection, &provider_handle->server_watcher_id,
&provider_handle->server_monitor_id, &provider_handle->monitor_id, STICKER_CLIENT_LIB_PROVIDER);
if (ret != STICKER_ERROR_NONE) {
+ //LCOV_EXCL_START
LOGE("Failed to finalize dbus : %d", ret);
free(provider_handle);
return STICKER_ERROR_OPERATION_FAILED;
+ //LCOV_EXCL_STOP
}
if (provider_handle->gdbus_connection)
ret = app_get_id(&app_id);
if (ret != APP_ERROR_NONE) {
- LOGE("Failed to get app_id : %d", ret);
+ LOGE("Failed to get app_id : %d", ret); //LCOV_EXCL_LINE
ret = STICKER_ERROR_OPERATION_FAILED;
goto cleanup;
}
if (access(json_path, F_OK) != 0) {
ret = package_info_create(app_id, &package_info);
if (ret != PACKAGE_MANAGER_ERROR_NONE || package_info == NULL) {
- LOGE("failed to create package_info. ret: %d", ret);
+ LOGE("failed to create package_info. ret: %d", ret); //LCOV_EXCL_LINE
ret = STICKER_ERROR_OPERATION_FAILED;
goto cleanup;
}
ret = package_info_get_root_path(package_info, &app_path);
if (ret != PACKAGE_MANAGER_ERROR_NONE || app_path == NULL) {
- LOGE("failed to create package_info. ret: %d", ret);
+ LOGE("failed to create package_info. ret: %d", ret); //LCOV_EXCL_LINE
ret = STICKER_ERROR_OPERATION_FAILED;
goto cleanup;
}
int path_len = strlen(app_path) + strlen(json_path) + 2;
file_path = (char *)calloc(path_len, sizeof(char));
if (!file_path) {
- LOGE("failed to alloc memory");
+ LOGE("failed to alloc memory"); //LCOV_EXCL_LINE
ret = STICKER_ERROR_OPERATION_FAILED;
goto cleanup;
}
ret = sticker_dbus_update_sticker_info(provider_handle->gdbus_connection, data_handle);
if (ret != STICKER_ERROR_NONE) {
+ //LCOV_EXCL_START
LOGE("Failed to update sticker information : %d", ret);
if (ret == STICKER_CLIENT_ERROR_FILE_EXISTS)
return STICKER_ERROR_FILE_EXISTS;
return STICKER_ERROR_NO_SUCH_FILE;
else
return STICKER_ERROR_OPERATION_FAILED;
+ //LCOV_EXCL_STOP
}
return STICKER_ERROR_NONE;
ret = app_get_id(&app_id);
if (ret != APP_ERROR_NONE) {
- LOGE("Failed to get app_id : %d", ret);
+ LOGE("Failed to get app_id : %d", ret); //LCOV_EXCL_LINE
ret = STICKER_ERROR_OPERATION_FAILED;
goto cleanup;
}
ret = app_get_id(&app_id);
if (ret != APP_ERROR_NONE) {
- LOGE("Failed to get app_id : %d", ret);
+ LOGE("Failed to get app_id : %d", ret); //LCOV_EXCL_LINE
ret = STICKER_ERROR_OPERATION_FAILED;
goto cleanup;
}