_INFO("3. Before account_manager_call_account_add_sync");
bool is_success = account_manager_call_account_add_sync(acc_mgr, account_serialized, (int)getuid(), &db_id, NULL, &error);
- g_variant_unref(account_serialized);
ACCOUNT_CATCH_ERROR((is_success != false), {}, _account_get_error_code(is_success, error), "Failed to get dbus.");
g_clear_error(&error);
_INFO("3. Before account_manager_call_account_update_to_db_by_id_sync");
GVariant *account_serialized = marshal_account((account_s *)account);
is_success = account_manager_call_account_update_to_db_by_id_sync(acc_mgr, account_serialized, account_id, (int)getuid(), NULL, &error);
- g_variant_unref(account_serialized);
if (!is_success) {
error_code = _account_get_error_code(is_success, error);
_INFO("before call update() : account_id[%d]", account_id);
is_success = account_manager_call_account_update_to_db_by_id_ex_sync(acc_mgr, account_serialized, account_id, (int)getuid(), NULL, &error);
- g_variant_unref(account_serialized);
_INFO("after call update() : is_success=%d", is_success);
if (!is_success) {
GVariant *account_serialized = marshal_account(account_data);
is_success = account_manager_call_account_update_to_db_by_user_name_sync(acc_mgr, account_serialized, user_name, package_name, (int)getuid(), NULL, &error);
- g_variant_unref(account_serialized);
if (!is_success) {
error_code = _account_get_error_code(is_success, error);
int db_id = -1;
GVariant *account_type_serialized = marshal_account_type((account_type_s *)account_type);
bool is_success = account_manager_call_account_type_add_sync(acc_mgr, account_type_serialized, (int)getuid(), &db_id, NULL, &error);
- g_variant_unref(account_type_serialized);
int ret = _account_get_error_code(is_success, error);
g_clear_error(&error);
}
bool is_success = account_manager_call_account_type_update_to_db_by_app_id_sync(acc_mgr, account_type_variant, app_id, (int)getuid(), NULL, &error);
- g_variant_unref(account_type_variant);
error_code = _account_get_error_code(is_success, error);
g_clear_error(&error);
return ret;
account_type_s *received_account_type = umarshal_account_type(account_type_variant);
+ g_variant_unref(account_type_variant);
ACCOUNT_RETURN_VAL((received_account_type != NULL), {}, ACCOUNT_ERROR_DB_FAILED, ("INVALID DATA RECEIVED FROM SVC"));
in_data->id = received_account_type->id;