_INFO("after g_bus_get_sync");
+ if (!connection) {
+ if (error) {
+ _ERR("Unable to connect to gdbus: %s", error->message);
+ g_clear_error(&error);
+ }
+ return NULL;
+ }
+
+ g_clear_error(&error);
/* Create the object */
_acc_mgr =
"/org/tizen/account/manager",
NULL,
&error);
+
+ if (!_acc_mgr) {
+ if (error) {
+ _ERR("Unable account_manager_proxy_new_sync: %s", error->message);
+ g_clear_error(&error);
+ }
+ if(connection)
+ g_object_unref(connection);
+ return NULL;
+ }
+
+ g_clear_error(&error);
_INFO("_account_manager_get_instance end");
return _acc_mgr;
}
_INFO("3. Before account_manager_call_account_add_sync");
bool is_success = account_manager_call_account_add_sync(acc_mgr, account_serialized, &db_id, NULL, &error);
ACCOUNT_CATCH_ERROR((is_success != false), {}, _account_get_error_code(is_success, error), "Failed to get dbus.");
+ g_clear_error(&error);
*account_db_id = db_id;
account_data->id = db_id;
return ACCOUNT_ERROR_NONE;
CATCH:
+ g_clear_error(&error);
//Failed to get dbus.
_ERR("account_manager_call_account_add_sync()=[%d]", error_code);
if (!is_success)
{
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);
return error_code;
}
+ g_clear_error(&error);
_INFO("3. Before account_manager_call_account_delete_from_db_by_id_sync");
is_success = account_manager_call_account_delete_from_db_by_id_sync(acc_mgr, account_db_id, NULL, &error);
{
error_code = _account_get_error_code(is_success, error);
_ERR("account_manager_call_account_delete_from_db_by_id_sync failed [%d]", error_code);
+ g_clear_error(&error);
return error_code;
}
+ g_clear_error(&error);
_INFO("4. Before account_delete_from_db_by_id end");
return ACCOUNT_ERROR_NONE;
bool is_success = account_manager_call_account_query_account_by_user_name_sync(acc_mgr, user_name, &account_list_variant, NULL, &error);
error_code = _account_get_error_code(is_success, error);
+ g_clear_error(&error);
if (error_code != ACCOUNT_ERROR_NONE)
{
_ERR("account_query_account_by_user_name error=[%d]", error_code);
return error_code;
}
- _INFO("before unmarshal_account_list");
GSList* account_list = unmarshal_account_list(account_list_variant);
- _INFO("after unmarshal_account_list");
+ g_variant_unref(account_list_variant);
+
if (account_list == NULL)
{
return ACCOUNT_ERROR_NO_DATA;
if (!is_success)
{
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_free(account_list);
return error_code;
}
+ g_clear_error(&error);
_account_gslist_free(account_list);
return ACCOUNT_ERROR_NONE;
if (!is_success)
{
error_code = _account_get_error_code(is_success, error);
+ g_clear_error(&error);
_ERR("account_manager_call_account_delete_from_db_by_package_name_sync failed [%d]", error_code);
return error_code;
}
+ g_clear_error(&error);
return ACCOUNT_ERROR_NONE;
}
ACCOUNT_API int account_delete_from_db_by_package_name(const char *package_name)
{
- _INFO("account_delete_from_db_by_package_name start");
+ _INFO("account_delete_from_db_by_package_name starting with permission");
return _account_delete_from_db_by_package_name(package_name, true);
}
if (!is_success)
{
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);
return error_code;
}
+ 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);
if (!is_success)
{
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;
}
+ g_clear_error(&error);
_INFO("4. account_update_to_db_by_id end");
return ACCOUNT_ERROR_NONE;
if (!is_success)
{
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);
return error_code;
}
+ g_clear_error(&error);
_INFO("before marshal() : account_id[%d], user_name=%s", account_id, ((account_s*)account)->user_name);
GVariant* account_serialized = marshal_account((account_s*) account);
if (!is_success)
{
error_code = _account_get_error_code(is_success, error);
+ g_clear_error(&error);
_ERR("account_manager_call_account_update_to_db_by_id_ex_sync failed [%d]", error_code);
return error_code;
}
+ g_clear_error(&error);
return ACCOUNT_ERROR_NONE;
}
if (!is_success)
{
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);
return error_code;
}
+ g_clear_error(&error);
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, NULL, &error);
if (!is_success)
{
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;
}
+ g_clear_error(&error);
return ACCOUNT_ERROR_NONE;
}
bool is_success = account_manager_call_account_query_all_sync(acc_mgr, &account_list_variant, NULL, &error);
int error_code = _account_get_error_code(is_success, error);
+ g_clear_error(&error);
+
if (error_code != ACCOUNT_ERROR_NONE)
{
return error_code;
}
- _INFO("before unmarshal_account_list");
GSList* account_list = unmarshal_account_list(account_list_variant);
- _INFO("after unmarshal_account_list");
+ g_variant_unref(account_list_variant);
+
GSList* iter;
for (iter = account_list; iter != NULL; iter = g_slist_next(iter))
}
_INFO("After one iteration callback");
}
- _INFO("account_foreach_account_from_db end");
-
_account_gslist_free(account_list);
+
+ _INFO("account_foreach_account_from_db end");
return ACCOUNT_ERROR_NONE;
}
bool is_success = account_manager_call_account_query_account_by_account_id_sync(acc_mgr, account_db_id, &account_variant, NULL, &error);
int error_code = _account_get_error_code(is_success, error);
+ g_clear_error(&error);
if (error_code != ACCOUNT_ERROR_NONE)
{
return error_code;
bool is_success = account_manager_call_account_query_account_by_user_name_sync(acc_mgr, user_name, &account_list_variant, NULL, &error);
int error_code = _account_get_error_code(is_success, error);
+ g_clear_error(&error);
if (error_code != ACCOUNT_ERROR_NONE)
{
return error_code;
}
- _INFO("before unmarshal_account_list");
GSList* account_list = unmarshal_account_list(account_list_variant);
- _INFO("after unmarshal_account_list");
+ g_variant_unref(account_list_variant);
+
if (account_list == NULL)
{
return ACCOUNT_ERROR_NO_DATA;
bool is_success = account_manager_call_account_query_account_by_package_name_sync(acc_mgr, package_name, &account_list_variant, NULL, &error);
int error_code = _account_get_error_code(is_success, error);
+ g_clear_error(&error);
if (error_code != ACCOUNT_ERROR_NONE)
{
return error_code;
}
- _INFO("before unmarshal_account_list");
GSList* account_list = unmarshal_account_list(account_list_variant);
- _INFO("after unmarshal_account_list");
+ g_variant_unref(account_list_variant);
+
if (account_list == NULL)
{
return ACCOUNT_ERROR_NO_DATA;
bool is_success = account_manager_call_account_query_account_by_capability_sync(acc_mgr, capability_type, capability_value, &account_list_variant, NULL, &error);
int error_code = _account_get_error_code(is_success, error);
+ g_clear_error(&error);
if (error_code != ACCOUNT_ERROR_NONE)
{
return error_code;
}
- _INFO("before unmarshal_account_list");
GSList* account_list = unmarshal_account_list(account_list_variant);
- _INFO("after unmarshal_account_list");
+ g_variant_unref(account_list_variant);
if (account_list == NULL)
{
return ACCOUNT_ERROR_NO_DATA;
bool is_success = account_manager_call_account_query_account_by_capability_type_sync(acc_mgr, capability_type, &account_list_variant, NULL, &error);
int error_code = _account_get_error_code(is_success, error);
+ g_clear_error(&error);
if (error_code != ACCOUNT_ERROR_NONE)
{
return error_code;
}
- _INFO("before unmarshal_account_list");
GSList* account_list = unmarshal_account_list(account_list_variant);
- _INFO("after unmarshal_account_list");
+ g_variant_unref(account_list_variant);
+
if (account_list == NULL)
{
return ACCOUNT_ERROR_NO_DATA;
bool is_success = account_manager_call_account_query_capability_by_account_id_sync(acc_mgr, account_id, &capability_list_variant, NULL, &error);
int error_code = _account_get_error_code(is_success, error);
+ g_clear_error(&error);
if (error_code != ACCOUNT_ERROR_NONE)
{
return error_code;
int temp_count = -1;
bool is_success = account_manager_call_account_get_total_count_from_db_sync(acc_mgr, include_hidden, &temp_count, NULL, &error);
int error_code = _account_get_error_code(is_success, error);
+ g_clear_error(&error);
if (error_code != ACCOUNT_ERROR_NONE)
{
return error_code;
ACCOUNT_API int account_update_sync_status_by_id(int account_db_id, const account_sync_state_e sync_status)
{
_INFO("account_update_sync_status_by_id starting");
+ int error_code = ACCOUNT_ERROR_NONE;
ACCOUNT_RETURN_VAL((account_db_id > 0), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("ACCOUNT INDEX IS LESS THAN 0"));
if ( ((int)sync_status < 0) || (sync_status > ACCOUNT_SYNC_STATUS_RUNNING)) {
bool is_success = account_manager_call_account_update_sync_status_by_id_sync(acc_mgr, account_db_id, sync_status, NULL, &error);
- return _account_get_error_code(is_success, error);
+ error_code = _account_get_error_code(is_success, error);
+ g_clear_error(&error);
+
+ return error_code;
}
static int _account_type_free_label_items(label_s *data)
if (!is_success)
{
-// error_code = error->code;
error_code = _account_get_error_code(is_success, error);
+ g_clear_error(&error);
_ERR("Account IPC call returned error[%d]", error_code);
return error_code;
}
+ g_clear_error(&error);
GSList* provider_feature_list = variant_to_provider_feature_list(feature_list_variant);
if (provider_feature_list == NULL)
if (!is_success)
{
ret = _account_get_error_code(is_success, error);
-// ret = error->code;
+ g_clear_error(&error);
_ERR("Account IPC call returned error[%d]", ret);
set_last_result(ret);
return false;
}
+ g_clear_error(&error);
set_last_result(ACCOUNT_ERROR_NONE);
_INFO("account_type_query_supported_feature end");
bool is_success = account_manager_call_account_type_add_sync(acc_mgr, account_type_serialized, &db_id, NULL, &error);
int ret = _account_get_error_code(is_success, error);
+ g_clear_error(&error);
+
if (ret != ACCOUNT_ERROR_NONE)
{
return ret;
ACCOUNT_INTERNAL_API int account_type_update_to_db_by_app_id(const account_type_h account_type, const char* app_id)
{
_INFO("account_type_update_to_db_by_app_id starting");
+ int error_code = ACCOUNT_ERROR_NONE;
ACCOUNT_RETURN_VAL((account_type != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("DATA IS NULL"));
ACCOUNT_RETURN_VAL((app_id != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("APP ID IS NULL"));
bool is_success = account_manager_call_account_type_update_to_db_by_app_id_sync(acc_mgr, account_type_variant, app_id, NULL, &error);
- return _account_get_error_code(is_success, error);
+ error_code = _account_get_error_code(is_success, error);
+ g_clear_error(&error);
+
+ return error_code;
}
ACCOUNT_INTERNAL_API int account_type_delete_by_app_id(const char* app_id)
{
_INFO("account_type_delete_by_app_id starting");
+ int error_code = ACCOUNT_ERROR_NONE;
ACCOUNT_RETURN_VAL((app_id != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("APP ID IS NULL"));
bool is_success = account_manager_call_account_type_delete_by_app_id_sync(acc_mgr, app_id, NULL, &error);
- return _account_get_error_code(is_success, error);
+ error_code = _account_get_error_code(is_success, error);
+ g_clear_error(&error);
+
+ return error_code;
}
ACCOUNT_API int account_type_query_label_by_app_id(account_label_cb callback, const char* app_id, void *user_data )
bool is_success = account_manager_call_account_type_query_label_by_app_id_sync(acc_mgr, app_id, &label_list_variant, NULL, &error);
int ret = _account_get_error_code(is_success, error);
+ g_clear_error(&error);
+
if (ret != ACCOUNT_ERROR_NONE)
{
return ret;
bool is_success = account_manager_call_account_type_query_by_app_id_sync(acc_mgr, app_id, &account_type_variant, NULL, &error);
int ret = _account_get_error_code(is_success, error);
+ g_clear_error(&error);
+
if (ret != ACCOUNT_ERROR_NONE)
{
return ret;
_INFO("after account_type_query_all_sync()");
int ret = _account_get_error_code(is_success, error);
+ g_clear_error(&error);
+
if (ret != ACCOUNT_ERROR_NONE)
{
return ret;
}
- _INFO("before unmarshal_account_type_list");
GSList* account_type_list = unmarshal_account_type_list(account_type_list_variant);
- _INFO("after unmarshal_account_type_list");
+ g_variant_unref(account_type_list_variant);
+
if (account_type_list == NULL)
{
return ACCOUNT_ERROR_NO_DATA;
_INFO("after account_type_query_label_by_locale_sync() : is_success=%d", is_success);
int ret = _account_get_error_code(is_success, error);
+ g_clear_error(&error);
+
if (ret != ACCOUNT_ERROR_NONE)
{
return ret;
bool is_success = account_manager_call_account_type_query_by_provider_feature_sync(acc_mgr, key, &account_type_list_variant, NULL, &error);
int ret = _account_get_error_code(is_success, error);
+ g_clear_error(&error);
+
if (ret != ACCOUNT_ERROR_NONE)
{
return ret;
_INFO("before unmarshal_account_type_list");
GSList* account_type_list = unmarshal_account_type_list(account_type_list_variant);
- _INFO("after unmarshal_account_type_list");
+ g_variant_unref(account_type_list_variant);
+
if (account_type_list == NULL)
{
return ACCOUNT_ERROR_NO_DATA;
ACCOUNT_API int account_type_query_app_id_exist(const char* app_id)
{
_INFO("account_type_query_app_id_exist starting");
+ int error_code = ACCOUNT_ERROR_NONE;
ACCOUNT_RETURN_VAL((app_id != 0), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("APP ID IS NULL"));
bool is_success = account_manager_call_account_type_query_app_id_exist_sync(acc_mgr, app_id, NULL, &error);
- return _account_get_error_code(is_success, error);
+ error_code = _account_get_error_code(is_success, error);
+ g_clear_error(&error);
+
+ return error_code;
}