From: Krishna Kant Jaju Date: Thu, 16 May 2024 06:07:03 +0000 (+0530) Subject: Update the parameter description and add sample code X-Git-Tag: accepted/tizen/unified/20240718.010242^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7732f05cc7f9ac866e2d1f113f784e19dfb490a3;p=platform%2Fcore%2Fapi%2Flibaccount-service.git Update the parameter description and add sample code Change-Id: Idc52845323b8659964de941516356c46bed569e1 Signed-off-by: Krishna Kant Jaju --- diff --git a/include/account.h b/include/account.h index 6efd248..8b64fbb 100644 --- a/include/account.h +++ b/include/account.h @@ -1808,6 +1808,8 @@ int account_type_foreach_account_type_from_db(account_type_cb callback, void *us * @brief Retrieves the label information with the given application ID and locale. * * @since_tizen 2.3 + * @remarks The @a label should be released using free(). + * * @privlevel public * @privilege %http://tizen.org/privilege/account.read * @param[in] app_id The application ID @@ -1828,6 +1830,44 @@ int account_type_foreach_account_type_from_db(account_type_cb callback, void *us * * @pre This function requires an open connection to an account service by account_connect() on tizen 2.3 .\n * But the account_connect() is not required to use this function since tizen 2.4. + * + * @par Example + * @code +#include +... +account_h account; + +ret = account_connect(); +if(ret != ACCOUNT_ERROR_NONE) { + SECURE_LOGD("(%d)-[Account] ret = %d, account=%p\n", __LINE__, ret, account); +} + +ret = account_create(&account); +if(ret != ACCOUNT_ERROR_NONE) { + SECURE_LOGD("(%d)-[Account] ret = %d, account=%p\n", __LINE__, ret, account); +} +... +char *app_id = "org.tizen.example"; +char *locale = "en_US.utf8"; +char *label = NULL; + +ret = account_type_query_label_by_locale(app_id, locale, &label); +if (ret!= ACCOUNT_ERROR_NONE) { + SECURE_LOGD("(%d)-[Account] ret = %d, account=%p\n", __LINE__, ret, account); +} +... + +if (label) { + free(label); + label = NULL; +} +... +ret = account_disconnect(); +if(ret != ACCOUNT_ERROR_NONE) { + SECURE_LOGD("(%d)-[Account] ret = %d, account=%p\n", __LINE__, ret, account); +} +... + * @endcode */ int account_type_query_label_by_locale(const char *app_id, const char *locale, char **label); diff --git a/packaging/libaccount-service.spec b/packaging/libaccount-service.spec index 35fa2b1..1ced4d3 100644 --- a/packaging/libaccount-service.spec +++ b/packaging/libaccount-service.spec @@ -1,6 +1,6 @@ Name: libaccount-service Summary: Account DB library -Version: 0.4.24 +Version: 0.4.25 Release: 1 Group: Social & Content/API License: Apache-2.0