_INFO("_account_manager_get_instance");
pthread_mutex_lock(&_account_proxy_instance_mutex);
if (_acc_mgr != NULL) {
+ /* LCOV_EXCL_START */
_INFO("instance already created.");
_account_manager_increase_count();
pthread_mutex_unlock(&_account_proxy_instance_mutex);
return _acc_mgr;
+ /* LCOV_EXCL_STOP */
}
#if !GLIB_CHECK_VERSION(2, 35, 0)
_INFO("after g_bus_get_sync");
if (!_connection) {
+ /* LCOV_EXCL_START */
if (error) {
_ERR("Unable to connect to gdbus: %s", error->message);
g_clear_error(&error);
}
pthread_mutex_unlock(&_account_proxy_instance_mutex);
return NULL;
+ /* LCOV_EXCL_STOP */
}
g_clear_error(&error);
&error);
if (!_acc_mgr) {
+ /* LCOV_EXCL_START */
if (error) {
_ERR("Unable account_manager_proxy_new_sync: %s", error->message);
g_clear_error(&error);
}
pthread_mutex_unlock(&_account_proxy_instance_mutex);
return NULL;
+ /* LCOV_EXCL_STOP */
}
g_clear_error(&error);
return ACCOUNT_ERROR_NONE;
CATCH:
+ /* LCOV_EXCL_START */
g_clear_error(&error);
_ERR("account_manager_call_account_add_sync()=[%d]", error_code);
return error_code;
+ /* LCOV_EXCL_STOP */
}
ACCOUNT_API int account_delete_from_db_by_id(int account_db_id)
AccountManager *acc_mgr = _account_manager_get_instance();
if (acc_mgr == NULL) {
+ /* LCOV_EXCL_START */
_ERR("g_bus_get_sync failed");
return ACCOUNT_ERROR_PERMISSION_DENIED;
+ /* LCOV_EXCL_STOP */
}
_INFO("2. Before account_manager_call_account_query_account_by_account_id_sync");
bool is_success = account_manager_call_account_query_account_by_account_id_sync(acc_mgr, account_db_id, (int)getuid(), false, &account_serialized_old, NULL, &error);
if (!is_success) {
+ /* LCOV_EXCL_START */
error_code = _account_get_error_code(is_success, error);
g_clear_error(&error);
_ERR("account_manager_call_account_query_account_by_account_id_sync failed [%d]", error_code);
_account_manager_release_instance();
return error_code;
+ /* LCOV_EXCL_STOP */
}
g_clear_error(&error);
AccountManager *acc_mgr = _account_manager_get_instance();
if (acc_mgr == NULL) {
+ /* LCOV_EXCL_START */
_ERR("g_bus_get_sync failed");
return ACCOUNT_ERROR_PERMISSION_DENIED;
+ /* LCOV_EXCL_STOP */
}
GVariant *account_list_variant = NULL;
g_variant_unref(account_list_variant);
if (account_list == NULL) {
+ /* LCOV_EXCL_START */
_account_manager_release_instance();
return ACCOUNT_ERROR_NO_DATA;
+ /* LCOV_EXCL_STOP */
}
is_success = account_manager_call_account_delete_from_db_by_user_name_sync(acc_mgr, user_name, package_name, (int)getuid(), NULL, &error);
_account_manager_release_instance();
if (!is_success) {
+ /* LCOV_EXCL_START */
error_code = _account_get_error_code(is_success, error);
g_clear_error(&error);
_ERR("account_manager_call_account_delete_from_db_by_user_name_sync failed [%d]", error_code);
_account_gslist_account_free(account_list);
return error_code;
+ /* LCOV_EXCL_STOP */
}
g_clear_error(&error);
AccountManager *acc_mgr = _account_manager_get_instance();
if (acc_mgr == NULL) {
+ /* LCOV_EXCL_START */
_ERR("g_bus_get_sync failed");
return ACCOUNT_ERROR_PERMISSION_DENIED;
+ /* LCOV_EXCL_STOP */
}
/*
//First get account list of user_name, used for gSSO DB deletion
AccountManager *acc_mgr = _account_manager_get_instance();
if (acc_mgr == NULL) {
+ /* LCOV_EXCL_START */
_ERR("g_bus_get_sync failed");
return ACCOUNT_ERROR_PERMISSION_DENIED;
+ /* LCOV_EXCL_STOP */
}
_INFO("2. Before account_manager_call_account_query_account_by_account_id_sync");
bool is_success = account_manager_call_account_query_account_by_account_id_sync(acc_mgr, account_id, (int)getuid(), false, &account_serialized_old, NULL, &error);
if (!is_success) {
+ /* LCOV_EXCL_START */
error_code = _account_get_error_code(is_success, error);
g_clear_error(&error);
_account_manager_release_instance();
_ERR("account_manager_call_account_query_account_by_account_id_sync failed [%d]", error_code);
return error_code;
+ /* LCOV_EXCL_STOP */
}
g_clear_error(&error);
_account_manager_release_instance();
if (!is_success) {
+ /* LCOV_EXCL_START */
error_code = _account_get_error_code(is_success, error);
g_clear_error(&error);
_ERR("account_manager_call_account_update_to_db_by_id_sync failed [%d]", error_code);
return error_code;
+ /* LCOV_EXCL_STOP */
}
g_clear_error(&error);
AccountManager *acc_mgr = _account_manager_get_instance();
if (acc_mgr == NULL) {
+ /* LCOV_EXCL_START */
_ERR("g_bus_get_sync failed");
return ACCOUNT_ERROR_PERMISSION_DENIED;
+ /* LCOV_EXCL_STOP */
}
GVariant *account_serialized_old = NULL;
_account_manager_release_instance();
if (!is_success) {
+ /* LCOV_EXCL_START */
error_code = _account_get_error_code(is_success, error);
g_clear_error(&error);
_ERR("account_manager_call_account_update_to_db_by_user_name_sync failed [%d]", error_code);
return error_code;
+ /* LCOV_EXCL_STOP */
}
g_clear_error(&error);
account_s *data = (account_s *)malloc(sizeof(account_s));
if (data == NULL) {
+ /* LCOV_EXCL_START */
ACCOUNT_ERROR("Memory Allocation Failed");
return ACCOUNT_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
ACCOUNT_MEMSET(data, 0, sizeof(account_s));
_ACCOUNT_FREE(data->user_name);
data->user_name = _account_get_text(user_name);
if (data->user_name == NULL) {
+ /* LCOV_EXCL_START */
ACCOUNT_ERROR("OUT OF MEMORY\n");
return ACCOUNT_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
return ACCOUNT_ERROR_NONE;
_ACCOUNT_FREE(data->display_name);
data->display_name = _account_get_text(display_name);
if (data->display_name == NULL) {
+ /* LCOV_EXCL_START */
ACCOUNT_ERROR("OUT OF MEMORY\n");
return ACCOUNT_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
return ACCOUNT_ERROR_NONE;
_ACCOUNT_FREE(data->email_address);
data->email_address = _account_get_text(email_address);
if (data->email_address == NULL) {
+ /* LCOV_EXCL_START */
ACCOUNT_ERROR("OUT OF MEMORY\n");
return ACCOUNT_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
return ACCOUNT_ERROR_NONE;
_ACCOUNT_FREE(data->icon_path);
data->icon_path = _account_get_text(icon_path);
if (data->icon_path == NULL) {
+ /* LCOV_EXCL_START */
ACCOUNT_ERROR("OUT OF MEMORY\n");
return ACCOUNT_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
return ACCOUNT_ERROR_NONE;
_ACCOUNT_FREE(data->source);
data->source = _account_get_text(source);
if (data->source == NULL) {
+ /* LCOV_EXCL_START */
ACCOUNT_ERROR("OUT OF MEMORY\n");
return ACCOUNT_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
return ACCOUNT_ERROR_NONE;
_ACCOUNT_FREE(data->package_name);
data->package_name = _account_get_text(package_name);
if (data->package_name == NULL) {
+ /* LCOV_EXCL_START */
ACCOUNT_ERROR("OUT OF MEMORY\n");
return ACCOUNT_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
return ACCOUNT_ERROR_NONE;
_ACCOUNT_FREE(data->domain_name);
data->domain_name = _account_get_text(domain_name);
if (data->domain_name == NULL) {
+ /* LCOV_EXCL_START */
ACCOUNT_ERROR("OUT OF MEMORY\n");
return ACCOUNT_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
return ACCOUNT_ERROR_NONE;
_ACCOUNT_FREE(data->access_token);
data->access_token = _account_get_text(access_token);
if (data->access_token == NULL) {
+ /* LCOV_EXCL_START */
ACCOUNT_ERROR("OUT OF MEMORY\n");
return ACCOUNT_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
return ACCOUNT_ERROR_NONE;
_ACCOUNT_FREE(data->user_data_txt[idx]);
data->user_data_txt[idx] = _account_get_text(user_txt);
if (data->user_data_txt[idx] == NULL) {
+ /* LCOV_EXCL_START */
ACCOUNT_ERROR("OUT OF MEMORY\n");
return ACCOUNT_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
return ACCOUNT_ERROR_NONE;
char *new_value = NULL;
new_value = _account_get_text(value);
if (new_value == NULL) {
+ /* LCOV_EXCL_START */
ACCOUNT_ERROR("OUT OF MEMORY\n");
return ACCOUNT_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
_ACCOUNT_FREE(custom_data->value);
if (b_is_new) {
account_custom_s* custom_data = (account_custom_s *)malloc(sizeof(account_custom_s));
if (custom_data == NULL) {
+ /* LCOV_EXCL_START */
ACCOUNT_ERROR("Memory Allocation Failed");
return ACCOUNT_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
ACCOUNT_MEMSET(custom_data, 0, sizeof(account_custom_s));
custom_data->key = _account_get_text(key);
if (custom_data->key == NULL) {
+ /* LCOV_EXCL_START */
ACCOUNT_ERROR("OUT OF MEMORY\n");
_ACCOUNT_FREE(custom_data);
return ACCOUNT_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
custom_data->value = _account_get_text(value);
if (custom_data->value == NULL) {
+ /* LCOV_EXCL_START */
ACCOUNT_ERROR("OUT OF MEMORY\n");
_ACCOUNT_FREE(custom_data->key);
_ACCOUNT_FREE(custom_data);
return ACCOUNT_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
data->custom_list = g_slist_append(data->custom_list, (gpointer)custom_data);
if (b_is_new) {
account_capability_s *cap_data = (account_capability_s *)malloc(sizeof(account_capability_s));
if (cap_data == NULL) {
+ /* LCOV_EXCL_START */
ACCOUNT_ERROR("Memory Allocation Failed");
return ACCOUNT_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
ACCOUNT_MEMSET(cap_data, 0, sizeof(account_capability_s));
cap_data->type = _account_get_text(capability_type);
if (cap_data->type == NULL) {
+ /* LCOV_EXCL_START */
ACCOUNT_ERROR("OUT OF MEMORY\n");
_ACCOUNT_FREE(cap_data->type);
_ACCOUNT_FREE(cap_data);
return ACCOUNT_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
cap_data->value = capability_value;
(*user_name) = NULL;
*user_name = _account_get_text(data->user_name);
if (data->user_name != NULL && *user_name == NULL) {
+ /* LCOV_EXCL_START */
ACCOUNT_ERROR("OUT OF MEMORY\n");
return ACCOUNT_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
return ACCOUNT_ERROR_NONE;
*display_name = _account_get_text(data->display_name);
if (data->display_name != NULL && *display_name == NULL) {
+ /* LCOV_EXCL_START */
ACCOUNT_ERROR("OUT OF MEMORY\n");
return ACCOUNT_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
*email_address = _account_get_text(data->email_address);
if (data->email_address != NULL && *email_address == NULL) {
+ /* LCOV_EXCL_START */
ACCOUNT_ERROR("OUT OF MEMORY\n");
return ACCOUNT_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
return ACCOUNT_ERROR_NONE;
*icon_path = _account_get_text(data->icon_path);
if (data->icon_path != NULL && *icon_path == NULL) {
+ /* LCOV_EXCL_START */
ACCOUNT_ERROR("OUT OF MEMORY\n");
return ACCOUNT_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
return ACCOUNT_ERROR_NONE;
*source = _account_get_text(data->source);
if (data->source != NULL && *source == NULL) {
+ /* LCOV_EXCL_START */
ACCOUNT_ERROR("OUT OF MEMORY\n");
return ACCOUNT_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
return ACCOUNT_ERROR_NONE;
*package_name = _account_get_text(data->package_name);
if (data->package_name != NULL && *package_name == NULL) {
+ /* LCOV_EXCL_START */
ACCOUNT_ERROR("OUT OF MEMORY\n");
return ACCOUNT_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
*domain_name = _account_get_text(data->domain_name);
if (data->domain_name != NULL && *domain_name == NULL) {
+ /* LCOV_EXCL_START */
ACCOUNT_ERROR("OUT OF MEMORY\n");
return ACCOUNT_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
return ACCOUNT_ERROR_NONE;
*access_token = _account_get_text(data->access_token);
if (data->access_token != NULL && *access_token == NULL) {
+ /* LCOV_EXCL_START */
ACCOUNT_ERROR("OUT OF MEMORY\n");
return ACCOUNT_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
return ACCOUNT_ERROR_NONE;
*text = _account_get_text(data->user_data_txt[user_text_index]);
if (data->user_data_txt[user_text_index] != NULL && *text == NULL) {
+ /* LCOV_EXCL_START */
ACCOUNT_ERROR("OUT OF MEMORY\n");
return ACCOUNT_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
return ACCOUNT_ERROR_NONE;
(*value) = NULL;
*value = _account_get_text(custom_data->value);
if (custom_data->value != NULL && *value == NULL) {
+ /* LCOV_EXCL_START */
ACCOUNT_ERROR("OUT OF MEMORY\n");
return ACCOUNT_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
return ACCOUNT_ERROR_NONE;
account_type_s *data = (account_type_s *)malloc(sizeof(account_type_s));
if (data == NULL) {
+ /* LCOV_EXCL_START */
ACCOUNT_ERROR("Memory Allocation Failed");
return ACCOUNT_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
ACCOUNT_MEMSET(data, 0, sizeof(account_type_s));
_ACCOUNT_FREE(data->app_id);
data->app_id = _account_get_text(app_id);
if (data->app_id == NULL) {
+ /* LCOV_EXCL_START */
ACCOUNT_ERROR("OUT OF MEMORY\n");
return ACCOUNT_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
return ACCOUNT_ERROR_NONE;
_ACCOUNT_FREE(data->service_provider_id);
data->service_provider_id = _account_get_text(service_provider_id);
if (data->service_provider_id == NULL) {
+ /* LCOV_EXCL_START */
ACCOUNT_ERROR("OUT OF MEMORY\n");
return ACCOUNT_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
return ACCOUNT_ERROR_NONE;
_ACCOUNT_FREE(data->icon_path);
data->icon_path = _account_get_text(icon_path);
if (data->icon_path == NULL) {
+ /* LCOV_EXCL_START */
ACCOUNT_ERROR("OUT OF MEMORY\n");
return ACCOUNT_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
return ACCOUNT_ERROR_NONE;
_ACCOUNT_FREE(data->small_icon_path);
data->small_icon_path = _account_get_text(small_icon_path);
if (data->small_icon_path == NULL) {
+ /* LCOV_EXCL_START */
ACCOUNT_ERROR("OUT OF MEMORY\n");
return ACCOUNT_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
return ACCOUNT_ERROR_NONE;
account_type_s *data = (account_type_s *)account_type;
label_s *label_data = (label_s *)malloc(sizeof(label_s));
if (label_data == NULL) {
+ /* LCOV_EXCL_START */
ACCOUNT_ERROR("Memory Allocation Failed");
return ACCOUNT_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
ACCOUNT_MEMSET(label_data, 0, sizeof(label_s));
label_data->label = _account_get_text(label);
if (label_data->label == NULL) {
+ /* LCOV_EXCL_START */
ACCOUNT_ERROR("OUT OF MEMORY\n");
_ACCOUNT_FREE(label_data);
return ACCOUNT_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
label_data->locale = _account_get_text(locale);
if (label_data->locale == NULL) {
+ /* LCOV_EXCL_START */
ACCOUNT_ERROR("OUT OF MEMORY\n");
_ACCOUNT_FREE(label_data->label);
_ACCOUNT_FREE(label_data);
return ACCOUNT_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
data->label_list = g_slist_append(data->label_list, (gpointer)label_data);
if (b_is_new) {
provider_feature_s* feature_data = (provider_feature_s *)malloc(sizeof(provider_feature_s));
if (feature_data == NULL) {
+ /* LCOV_EXCL_START */
ACCOUNT_ERROR("Memory Allocation Failed");
return ACCOUNT_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
ACCOUNT_MEMSET(feature_data, 0, sizeof(provider_feature_s));
feature_data->key = _account_get_text(provider_feature);
if (feature_data->key == NULL) {
+ /* LCOV_EXCL_START */
ACCOUNT_ERROR("OUT OF MEMORY\n");
_ACCOUNT_FREE(feature_data);
return ACCOUNT_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
data->provider_feature_list = g_slist_append(data->provider_feature_list, (gpointer)feature_data);
(*app_id) = NULL;
*app_id = _account_get_text(data->app_id);
if (*app_id == NULL) {
+ /* LCOV_EXCL_START */
ACCOUNT_ERROR("OUT OF MEMORY\n");
return ACCOUNT_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
return ACCOUNT_ERROR_NONE;
(*service_provider_id) = NULL;
*service_provider_id = _account_get_text(data->service_provider_id);
if (*service_provider_id == NULL) {
+ /* LCOV_EXCL_START */
ACCOUNT_ERROR("OUT OF MEMORY\n");
return ACCOUNT_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
return ACCOUNT_ERROR_NONE;
(*icon_path) = NULL;
*icon_path = _account_get_text(data->icon_path);
if (*icon_path == NULL) {
+ /* LCOV_EXCL_START */
ACCOUNT_ERROR("OUT OF MEMORY\n");
return ACCOUNT_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
return ACCOUNT_ERROR_NONE;
(*small_icon_path) = NULL;
*small_icon_path = _account_get_text(data->small_icon_path);
if (*small_icon_path == NULL) {
+ /* LCOV_EXCL_START */
ACCOUNT_ERROR("OUT OF MEMORY\n");
return ACCOUNT_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
if (!strcmp(locale, label_data->locale)) {
*label = _account_get_text(label_data->label);
if (*label == NULL) {
+ /* LCOV_EXCL_START */
ACCOUNT_ERROR("OUT OF MEMORY\n");
return ACCOUNT_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
return ACCOUNT_ERROR_NONE;
if ((char *)(tokens[1]) != NULL) {
char *upper_token = g_ascii_strup(tokens[1], strlen(tokens[1]));
if (upper_token == NULL) {
+ /* LCOV_EXCL_START */
ACCOUNT_ERROR("Memory Allocation Failed");
g_strfreev(tokens);
return ACCOUNT_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
if (upper_token != NULL) {
g_strfreev(tokens);
*label = _account_get_text(label_data->label);
if (*label == NULL) {
+ /* LCOV_EXCL_START */
ACCOUNT_ERROR("OUT OF MEMORY\n");
return ACCOUNT_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
return ACCOUNT_ERROR_NONE;
*label = NULL;
*label = _account_get_text(label_temp);
if (*label == NULL) {
+ /* LCOV_EXCL_START */
ACCOUNT_ERROR("OUT OF MEMORY\n");
return ACCOUNT_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
_INFO("account_type_query_label_by_locale end");
account_subscribe_s *data = (account_subscribe_s *)calloc(1, sizeof(account_subscribe_s));
if (!data) {
+ /* LCOV_EXCL_START */
ACCOUNT_ERROR("OUT OF MEMORY\n");
return ACCOUNT_ERROR_OUT_OF_MEMORY;
+ /* LCOV_EXCL_STOP */
}
*account_subscribe = (account_subscribe_h)data;