#include "account_internal.h"
#include "account_private_client.h"
-#define ACCOUNT_FEATURE "http://tizen.org/feature/account"
-
-#define CHECK_ACCOUNT_SUPPORTED(feature_name) \
-do { \
- bool is_supported = false; \
- if (!system_info_get_platform_bool(feature_name, &is_supported)) { \
- if (is_supported == false) { \
- LOGE("[%s] feature is disabled", feature_name); \
- return ACCOUNT_ERROR_NOT_SUPPORTED; \
- } \
- } else { \
- LOGE("Error - Feature getting from System Info"); \
- } \
-} while (0)
-
#define ACCOUNT_DB_OPEN_READONLY 0
#define ACCOUNT_DB_OPEN_READWRITE 1
ACCOUNT_API int account_insert_to_db(account_h account, int *account_db_id)
{
- CHECK_ACCOUNT_SUPPORTED(ACCOUNT_FEATURE);
-
_INFO("1. account_insert_to_db start");
ACCOUNT_RETURN_VAL((account != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("ACCOUNT HANDLE IS NULL"));
ACCOUNT_API int account_delete_from_db_by_id(int account_db_id)
{
- CHECK_ACCOUNT_SUPPORTED(ACCOUNT_FEATURE);
-
_INFO("1. account_delete_from_db_by_id starting [%d]", account_db_id);
int error_code = ACCOUNT_ERROR_NONE;
ACCOUNT_API int account_delete_from_db_by_user_name(char *user_name, char *package_name)
{
- CHECK_ACCOUNT_SUPPORTED(ACCOUNT_FEATURE);
-
int error_code = ACCOUNT_ERROR_NONE;
_INFO("account_delete_from_db_by_user_name start");
int _account_delete_from_db_by_package_name(const char *package_name, bool permission)
{
- CHECK_ACCOUNT_SUPPORTED(ACCOUNT_FEATURE);
-
_INFO("_account_delete_from_db_by_package_name starting permission opions = %d", permission);
int error_code = ACCOUNT_ERROR_NONE;
ACCOUNT_API int account_delete_from_db_by_package_name(const char *package_name)
{
- CHECK_ACCOUNT_SUPPORTED(ACCOUNT_FEATURE);
-
_INFO("account_delete_from_db_by_package_name starting with permission");
return _account_delete_from_db_by_package_name(package_name, true);
}
ACCOUNT_API int account_update_to_db_by_id(account_h account, int account_id)
{
- CHECK_ACCOUNT_SUPPORTED(ACCOUNT_FEATURE);
-
_INFO("1. account_update_to_db_by_id start");
int error_code = ACCOUNT_ERROR_NONE;
ACCOUNT_API int account_update_to_db_by_id_ex(account_h account, int account_id)
{
- CHECK_ACCOUNT_SUPPORTED(ACCOUNT_FEATURE);
-
int ret = -1;
ret = account_update_to_db_by_id(account, account_id);
ACCOUNT_INTERNAL_API int account_update_to_db_by_id_without_permission(account_h account, int account_id)
{
- CHECK_ACCOUNT_SUPPORTED(ACCOUNT_FEATURE);
-
_INFO("account_update_to_db_by_id_without_permission start");
int error_code = ACCOUNT_ERROR_NONE;
ACCOUNT_API int account_update_to_db_by_user_name(account_h account, const char *user_name, const char *package_name)
{
- CHECK_ACCOUNT_SUPPORTED(ACCOUNT_FEATURE);
-
_INFO("account_update_to_db_by_user_name starting");
int error_code = ACCOUNT_ERROR_NONE;
ACCOUNT_API int account_create(account_h *account)
{
- CHECK_ACCOUNT_SUPPORTED(ACCOUNT_FEATURE);
-
_INFO("account_create start");
if (!account) {
ACCOUNT_SLOGE("(%s)-(%d) account is NULL.\n", __FUNCTION__, __LINE__);
ACCOUNT_API int account_destroy(account_h account)
{
- CHECK_ACCOUNT_SUPPORTED(ACCOUNT_FEATURE);
-
_INFO("account_destroy start");
account_s *data = (account_s *)account;
ACCOUNT_API int account_set_user_name(account_h account, const char *user_name)
{
- CHECK_ACCOUNT_SUPPORTED(ACCOUNT_FEATURE);
-
if (!account) {
ACCOUNT_SLOGE("(%s)-(%d) account handle is NULL.\n", __FUNCTION__, __LINE__);
return ACCOUNT_ERROR_INVALID_PARAMETER;
ACCOUNT_API int account_set_display_name(account_h account, const char *display_name)
{
- CHECK_ACCOUNT_SUPPORTED(ACCOUNT_FEATURE);
-
if (!account) {
ACCOUNT_SLOGE("(%s)-(%d) account handle is NULL.\n", __FUNCTION__, __LINE__);
return ACCOUNT_ERROR_INVALID_PARAMETER;
ACCOUNT_API int account_set_email_address(account_h account, const char *email_address)
{
- CHECK_ACCOUNT_SUPPORTED(ACCOUNT_FEATURE);
-
if (!account) {
ACCOUNT_SLOGE("(%s)-(%d) account handle is NULL.\n", __FUNCTION__, __LINE__);
return ACCOUNT_ERROR_INVALID_PARAMETER;
ACCOUNT_API int account_set_icon_path(account_h account, const char *icon_path)
{
- CHECK_ACCOUNT_SUPPORTED(ACCOUNT_FEATURE);
-
if (!account) {
ACCOUNT_SLOGE("(%s)-(%d) account handle is NULL.\n", __FUNCTION__, __LINE__);
return ACCOUNT_ERROR_INVALID_PARAMETER;
ACCOUNT_API int account_set_source(account_h account, const char *source)
{
- CHECK_ACCOUNT_SUPPORTED(ACCOUNT_FEATURE);
-
if (!account) {
ACCOUNT_SLOGE("(%s)-(%d) account handle is NULL.\n", __FUNCTION__, __LINE__);
return ACCOUNT_ERROR_INVALID_PARAMETER;
ACCOUNT_API int account_set_package_name(account_h account, const char *package_name)
{
- CHECK_ACCOUNT_SUPPORTED(ACCOUNT_FEATURE);
-
if (!account) {
ACCOUNT_SLOGE("(%s)-(%d) account handle is NULL.\n", __FUNCTION__, __LINE__);
return ACCOUNT_ERROR_INVALID_PARAMETER;
ACCOUNT_API int account_set_domain_name(account_h account, const char *domain_name)
{
- CHECK_ACCOUNT_SUPPORTED(ACCOUNT_FEATURE);
-
if (!account) {
ACCOUNT_SLOGE("(%s)-(%d) account handle is NULL.\n", __FUNCTION__, __LINE__);
return ACCOUNT_ERROR_INVALID_PARAMETER;
ACCOUNT_API int account_set_access_token(account_h account, const char *access_token)
{
- CHECK_ACCOUNT_SUPPORTED(ACCOUNT_FEATURE);
-
if (!account) {
ACCOUNT_SLOGE("(%s)-(%d) account handle is NULL.\n", __FUNCTION__, __LINE__);
return ACCOUNT_ERROR_INVALID_PARAMETER;
ACCOUNT_API int account_set_user_text(account_h account, int idx, const char *user_txt)
{
- CHECK_ACCOUNT_SUPPORTED(ACCOUNT_FEATURE);
-
if (!account) {
ACCOUNT_SLOGE("(%s)-(%d) account handle is NULL.\n", __FUNCTION__, __LINE__);
return ACCOUNT_ERROR_INVALID_PARAMETER;
ACCOUNT_API int account_set_custom(account_h account, const char *key, const char *value)
{
- CHECK_ACCOUNT_SUPPORTED(ACCOUNT_FEATURE);
-
if (!account) {
ACCOUNT_SLOGE("(%s)-(%d) account handle is NULL.\n", __FUNCTION__, __LINE__);
return ACCOUNT_ERROR_INVALID_PARAMETER;
ACCOUNT_API int account_set_auth_type(account_h account, const account_auth_type_e auth_type)
{
- CHECK_ACCOUNT_SUPPORTED(ACCOUNT_FEATURE);
-
ACCOUNT_RETURN_VAL((account != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("(%s)-(%d) account handle is NULL.\n", __FUNCTION__, __LINE__));
if (((int)auth_type < 0) || (auth_type > ACCOUNT_AUTH_TYPE_CLIENT_LOGIN))
ACCOUNT_API int account_set_secret(account_h account, const account_secrecy_state_e secret)
{
- CHECK_ACCOUNT_SUPPORTED(ACCOUNT_FEATURE);
-
ACCOUNT_RETURN_VAL((account != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("(%s)-(%d) account handle is NULL.\n", __FUNCTION__, __LINE__));
if (((int)secret < 0) || (secret > ACCOUNT_SECRECY_VISIBLE))
ACCOUNT_API int account_set_sync_support(account_h account, const account_sync_state_e sync_support)
{
- CHECK_ACCOUNT_SUPPORTED(ACCOUNT_FEATURE);
-
ACCOUNT_RETURN_VAL((account != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("(%s)-(%d) account handle is NULL.\n", __FUNCTION__, __LINE__));
if (((int)sync_support < 0) || (sync_support > ACCOUNT_SUPPORTS_SYNC))
ACCOUNT_API int account_set_user_int(account_h account, int idx, const int user_int)
{
- CHECK_ACCOUNT_SUPPORTED(ACCOUNT_FEATURE);
-
if (!account)
return ACCOUNT_ERROR_INVALID_PARAMETER;
ACCOUNT_API int account_set_capability(account_h account, const char *capability_type, account_capability_state_e capability_value)
{
- CHECK_ACCOUNT_SUPPORTED(ACCOUNT_FEATURE);
-
ACCOUNT_RETURN_VAL((account != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("account handle is null"));
ACCOUNT_RETURN_VAL((capability_type != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("capability_type is null"));
ACCOUNT_RETURN_VAL((strlen(capability_type) > 0), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("capability_type is Empty"));
ACCOUNT_API int account_get_user_name(account_h account, char **user_name)
{
- CHECK_ACCOUNT_SUPPORTED(ACCOUNT_FEATURE);
-
if (!account)
return ACCOUNT_ERROR_INVALID_PARAMETER;
ACCOUNT_API int account_get_display_name(account_h account, char **display_name)
{
- CHECK_ACCOUNT_SUPPORTED(ACCOUNT_FEATURE);
-
if (!account)
return ACCOUNT_ERROR_INVALID_PARAMETER;
ACCOUNT_API int account_get_email_address(account_h account, char **email_address)
{
- CHECK_ACCOUNT_SUPPORTED(ACCOUNT_FEATURE);
-
if (!account)
return ACCOUNT_ERROR_INVALID_PARAMETER;
ACCOUNT_API int account_get_icon_path(account_h account, char **icon_path)
{
- CHECK_ACCOUNT_SUPPORTED(ACCOUNT_FEATURE);
-
if (!account)
return ACCOUNT_ERROR_INVALID_PARAMETER;
ACCOUNT_API int account_get_source(account_h account, char **source)
{
- CHECK_ACCOUNT_SUPPORTED(ACCOUNT_FEATURE);
-
if (!account)
return ACCOUNT_ERROR_INVALID_PARAMETER;
ACCOUNT_API int account_get_package_name(account_h account, char **package_name)
{
- CHECK_ACCOUNT_SUPPORTED(ACCOUNT_FEATURE);
-
if (!account)
return ACCOUNT_ERROR_INVALID_PARAMETER;
ACCOUNT_API int account_get_domain_name(account_h account, char **domain_name)
{
- CHECK_ACCOUNT_SUPPORTED(ACCOUNT_FEATURE);
-
if (!account)
return ACCOUNT_ERROR_INVALID_PARAMETER;
ACCOUNT_API int account_get_access_token(account_h account, char **access_token)
{
- CHECK_ACCOUNT_SUPPORTED(ACCOUNT_FEATURE);
-
if (!account)
return ACCOUNT_ERROR_INVALID_PARAMETER;
ACCOUNT_API int account_get_user_text(account_h account, int user_text_index, char **text)
{
- CHECK_ACCOUNT_SUPPORTED(ACCOUNT_FEATURE);
-
if (!account)
return ACCOUNT_ERROR_INVALID_PARAMETER;
ACCOUNT_API int account_get_auth_type(account_h account, account_auth_type_e *auth_type)
{
- CHECK_ACCOUNT_SUPPORTED(ACCOUNT_FEATURE);
-
if (!account)
return ACCOUNT_ERROR_INVALID_PARAMETER;
ACCOUNT_API int account_get_secret(account_h account, account_secrecy_state_e *secret)
{
- CHECK_ACCOUNT_SUPPORTED(ACCOUNT_FEATURE);
-
if (!account)
return ACCOUNT_ERROR_INVALID_PARAMETER;
ACCOUNT_API int account_get_sync_support(account_h account, account_sync_state_e *sync_support)
{
- CHECK_ACCOUNT_SUPPORTED(ACCOUNT_FEATURE);
-
if (!account)
return ACCOUNT_ERROR_INVALID_PARAMETER;
ACCOUNT_API int account_get_account_id(account_h account, int *account_id)
{
- CHECK_ACCOUNT_SUPPORTED(ACCOUNT_FEATURE);
-
if (!account)
return ACCOUNT_ERROR_INVALID_PARAMETER;
ACCOUNT_API int account_get_user_int(account_h account, int user_int_index, int *integer)
{
- CHECK_ACCOUNT_SUPPORTED(ACCOUNT_FEATURE);
-
if (!account)
return ACCOUNT_ERROR_INVALID_PARAMETER;
ACCOUNT_API int account_get_capability(account_h account, const char *capability_type, account_capability_state_e *capability_value)
{
- CHECK_ACCOUNT_SUPPORTED(ACCOUNT_FEATURE);
-
ACCOUNT_RETURN_VAL((account != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("ACCOUNT HANDLE IS NULL"));
ACCOUNT_RETURN_VAL((capability_type != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("capability_type is NULL"));
ACCOUNT_RETURN_VAL((capability_value != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("capability_value is NULL"));
ACCOUNT_API int account_get_capability_all(account_h account, capability_cb callback, void *user_data)
{
- CHECK_ACCOUNT_SUPPORTED(ACCOUNT_FEATURE);
-
ACCOUNT_RETURN_VAL((account != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("ACCOUNT HANDLE IS NULL"));
ACCOUNT_RETURN_VAL((callback != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("NO CALLBACK FUNCTION"));
ACCOUNT_API int account_get_custom(account_h account, const char *key, char **value)
{
- CHECK_ACCOUNT_SUPPORTED(ACCOUNT_FEATURE);
-
ACCOUNT_RETURN_VAL((account != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("ACCOUNT HANDLE IS NULL"));
ACCOUNT_RETURN_VAL((key != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("NO KEY TO REQUEST"));
ACCOUNT_RETURN_VAL((value != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("VALUE POINTER IS NULL"));
ACCOUNT_API int account_get_custom_all(account_h account, account_custom_cb callback, void *user_data)
{
- CHECK_ACCOUNT_SUPPORTED(ACCOUNT_FEATURE);
-
ACCOUNT_RETURN_VAL((account != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("ACCOUNT HANDLE IS NULL"));
ACCOUNT_RETURN_VAL((callback != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("NO CALLBACK FUNCTION"));
ACCOUNT_API int account_foreach_account_from_db(account_cb callback, void *user_data)
{
- CHECK_ACCOUNT_SUPPORTED(ACCOUNT_FEATURE);
-
_INFO("account_foreach_account_from_db start");
ACCOUNT_RETURN_VAL((callback != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("ACCOUNT Callback IS NULL"));
ACCOUNT_API int account_query_account_by_account_id(int account_db_id, account_h *account)
{
- CHECK_ACCOUNT_SUPPORTED(ACCOUNT_FEATURE);
-
_INFO("account_query_account_by_account_id start [%d]", account_db_id);
ACCOUNT_RETURN_VAL((account_db_id > 0), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("ACCOUNT INDEX IS LESS THAN 0"));
ACCOUNT_API int account_query_account_by_user_name(account_cb callback, const char *user_name, void *user_data)
{
- CHECK_ACCOUNT_SUPPORTED(ACCOUNT_FEATURE);
-
_INFO("account_query_account_by_user_name starting");
ACCOUNT_RETURN_VAL((user_name != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("USER NAME IS NULL"));
ACCOUNT_API int account_query_account_by_package_name(account_cb callback, const char *package_name, void *user_data)
{
- CHECK_ACCOUNT_SUPPORTED(ACCOUNT_FEATURE);
-
_INFO("account_query_account_by_package_name starting");
ACCOUNT_RETURN_VAL((package_name != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("PACKAGE NAME IS NULL"));
ACCOUNT_API int account_query_account_by_capability(account_cb callback, const char *capability_type, account_capability_state_e capability_value, void *user_data)
{
- CHECK_ACCOUNT_SUPPORTED(ACCOUNT_FEATURE);
-
_INFO("account_query_account_by_capability starting");
ACCOUNT_RETURN_VAL((capability_type != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("capability_type IS NULL"));
ACCOUNT_API int account_query_account_by_capability_type(account_cb callback, const char *capability_type, void *user_data)
{
- CHECK_ACCOUNT_SUPPORTED(ACCOUNT_FEATURE);
-
_INFO("account_query_account_by_capability_type starting");
ACCOUNT_RETURN_VAL((capability_type != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("capability_type IS NULL"));
ACCOUNT_API int account_query_capability_by_account_id(capability_cb callback, int account_id, void *user_data)
{
- CHECK_ACCOUNT_SUPPORTED(ACCOUNT_FEATURE);
-
_INFO("account_query_capability_by_account_id starting");
ACCOUNT_RETURN_VAL((account_id > 0), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("ACCOUNT INDEX IS LESS THAN 0"));
static int _account_get_total_count(int *count, bool include_hidden)
{
- CHECK_ACCOUNT_SUPPORTED(ACCOUNT_FEATURE);
-
_INFO("account_get_total_count_from_db starting");
if (!count) {
ACCOUNT_API int account_get_total_count_from_db(int *count)
{
- CHECK_ACCOUNT_SUPPORTED(ACCOUNT_FEATURE);
-
_INFO("account_get_total_count_from_db starting");
return _account_get_total_count(count, true);
ACCOUNT_INTERNAL_API int account_get_total_count_from_db_ex(int *count)
{
- CHECK_ACCOUNT_SUPPORTED(ACCOUNT_FEATURE);
-
_INFO("account_get_total_count_from_db_ex starting");
return _account_get_total_count(count, false);
ACCOUNT_API int account_update_sync_status_by_id(int account_db_id, const account_sync_state_e sync_status)
{
- CHECK_ACCOUNT_SUPPORTED(ACCOUNT_FEATURE);
-
_INFO("account_update_sync_status_by_id starting");
int error_code = ACCOUNT_ERROR_NONE;
ACCOUNT_API int account_type_create(account_type_h *account_type)
{
- CHECK_ACCOUNT_SUPPORTED(ACCOUNT_FEATURE);
-
if (!account_type) {
ACCOUNT_SLOGE("(%s)-(%d) account type handle is NULL.\n", __FUNCTION__, __LINE__);
return ACCOUNT_ERROR_INVALID_PARAMETER;
ACCOUNT_API int account_type_destroy(account_type_h account_type)
{
- CHECK_ACCOUNT_SUPPORTED(ACCOUNT_FEATURE);
-
_INFO("account_type_destroy");
account_type_s *data = (account_type_s *)account_type;
ACCOUNT_INTERNAL_API int account_type_set_app_id(account_type_h account_type, const char *app_id)
{
- CHECK_ACCOUNT_SUPPORTED(ACCOUNT_FEATURE);
-
if (!account_type) {
ACCOUNT_SLOGE("(%s)-(%d) account_type handle is NULL.\n", __FUNCTION__, __LINE__);
return ACCOUNT_ERROR_INVALID_PARAMETER;
ACCOUNT_INTERNAL_API int account_type_set_service_provider_id(account_type_h account_type, const char *service_provider_id)
{
- CHECK_ACCOUNT_SUPPORTED(ACCOUNT_FEATURE);
-
if (!account_type)
return ACCOUNT_ERROR_INVALID_PARAMETER;
ACCOUNT_INTERNAL_API int account_type_set_icon_path(account_type_h account_type, const char *icon_path)
{
- CHECK_ACCOUNT_SUPPORTED(ACCOUNT_FEATURE);
-
if (!account_type)
return ACCOUNT_ERROR_INVALID_PARAMETER;
ACCOUNT_INTERNAL_API int account_type_set_small_icon_path(account_type_h account_type, const char *small_icon_path)
{
- CHECK_ACCOUNT_SUPPORTED(ACCOUNT_FEATURE);
-
if (!account_type)
return ACCOUNT_ERROR_INVALID_PARAMETER;
ACCOUNT_INTERNAL_API int account_type_set_multiple_account_support(account_type_h account_type, bool multiple_account_support)
{
- CHECK_ACCOUNT_SUPPORTED(ACCOUNT_FEATURE);
-
ACCOUNT_RETURN_VAL((account_type != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("(%s)-(%d) account handle is NULL.\n", __FUNCTION__, __LINE__));
account_type_s *data = (account_type_s *)account_type;
ACCOUNT_INTERNAL_API int account_type_set_label(account_type_h account_type, const char *label, const char *locale)
{
- CHECK_ACCOUNT_SUPPORTED(ACCOUNT_FEATURE);
-
if (!account_type) {
ACCOUNT_SLOGE("(%s)-(%d) account_type handle is NULL.\n", __FUNCTION__, __LINE__);
return ACCOUNT_ERROR_INVALID_PARAMETER;
ACCOUNT_INTERNAL_API int account_type_set_provider_feature(account_type_h account_type, const char *provider_feature)
{
- CHECK_ACCOUNT_SUPPORTED(ACCOUNT_FEATURE);
-
ACCOUNT_RETURN_VAL((account_type != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("account type handle is null"));
ACCOUNT_RETURN_VAL((provider_feature != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("provider_feature is null"));
ACCOUNT_RETURN_VAL((strlen(provider_feature) > 0), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("provider_feature is Empty"));
ACCOUNT_API int account_type_query_provider_feature_by_app_id(provider_feature_cb callback, const char *app_id, void *user_data)
{
- CHECK_ACCOUNT_SUPPORTED(ACCOUNT_FEATURE);
-
_INFO("account_type_query_provider_feature_by_app_id start");
ACCOUNT_RETURN_VAL((app_id != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("APP ID IS NULL"));
ACCOUNT_API bool account_type_query_supported_feature(const char *app_id, const char *capability)
{
- CHECK_ACCOUNT_SUPPORTED(ACCOUNT_FEATURE);
-
_INFO("account_type_query_supported_feature start");
if (app_id == NULL || capability == NULL) {
ACCOUNT_API int account_type_get_app_id(account_type_h account_type, char **app_id)
{
- CHECK_ACCOUNT_SUPPORTED(ACCOUNT_FEATURE);
-
if (!account_type)
return ACCOUNT_ERROR_INVALID_PARAMETER;
ACCOUNT_API int account_type_get_service_provider_id(account_type_h account_type, char **service_provider_id)
{
- CHECK_ACCOUNT_SUPPORTED(ACCOUNT_FEATURE);
-
if (!account_type)
return ACCOUNT_ERROR_INVALID_PARAMETER;
ACCOUNT_API int account_type_get_icon_path(account_type_h account_type, char **icon_path)
{
- CHECK_ACCOUNT_SUPPORTED(ACCOUNT_FEATURE);
-
if (!account_type)
return ACCOUNT_ERROR_INVALID_PARAMETER;
ACCOUNT_API int account_type_get_small_icon_path(account_type_h account_type, char **small_icon_path)
{
- CHECK_ACCOUNT_SUPPORTED(ACCOUNT_FEATURE);
-
if (!account_type)
return ACCOUNT_ERROR_INVALID_PARAMETER;
ACCOUNT_API int account_type_get_multiple_account_support(account_type_h account_type, int *multiple_account_support)
{
- CHECK_ACCOUNT_SUPPORTED(ACCOUNT_FEATURE);
-
if (!account_type)
return ACCOUNT_ERROR_INVALID_PARAMETER;
ACCOUNT_API int account_type_get_provider_feature_all(account_type_h account_type, provider_feature_cb callback, void *user_data)
{
- CHECK_ACCOUNT_SUPPORTED(ACCOUNT_FEATURE);
-
ACCOUNT_RETURN_VAL((account_type != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("ACCOUNT HANDLE IS NULL"));
ACCOUNT_RETURN_VAL((callback != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("NO CALLBACK FUNCTION"));
ACCOUNT_API int account_type_get_label_by_locale(account_type_h account_type, const char *locale, char **label)
{
- CHECK_ACCOUNT_SUPPORTED(ACCOUNT_FEATURE);
-
ACCOUNT_RETURN_VAL((account_type != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("ACCOUNT HANDLE IS NULL"));
ACCOUNT_RETURN_VAL((label != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("INVALID PARAMETER"));
ACCOUNT_API int account_type_get_label(account_type_h account_type, account_label_cb callback, void *user_data)
{
- CHECK_ACCOUNT_SUPPORTED(ACCOUNT_FEATURE);
-
ACCOUNT_RETURN_VAL((account_type != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("ACCOUNT HANDLE IS NULL"));
ACCOUNT_RETURN_VAL((callback != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("NO CALLBACK FUNCTION"));
ACCOUNT_INTERNAL_API int account_type_insert_to_db(account_type_h account_type, int *account_type_id)
{
- CHECK_ACCOUNT_SUPPORTED(ACCOUNT_FEATURE);
-
_INFO("account_type_insert_to_db starting");
ACCOUNT_RETURN_VAL((account_type != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("ACCOUNT TYPE HANDLE IS NULL"));
ACCOUNT_INTERNAL_API int account_type_update_to_db_by_app_id(const account_type_h account_type, const char *app_id)
{
- CHECK_ACCOUNT_SUPPORTED(ACCOUNT_FEATURE);
-
_INFO("account_type_update_to_db_by_app_id starting");
int error_code = ACCOUNT_ERROR_NONE;
ACCOUNT_INTERNAL_API int account_type_delete_by_app_id(const char *app_id)
{
- CHECK_ACCOUNT_SUPPORTED(ACCOUNT_FEATURE);
-
_INFO("account_type_delete_by_app_id starting");
int error_code = ACCOUNT_ERROR_NONE;
ACCOUNT_API int account_type_query_label_by_app_id(account_label_cb callback, const char *app_id, void *user_data)
{
- CHECK_ACCOUNT_SUPPORTED(ACCOUNT_FEATURE);
-
_INFO("account_type_query_label_by_app_id starting");
ACCOUNT_RETURN_VAL((callback != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("ACCOUNT Callback IS NULL"));
ACCOUNT_API int account_type_query_by_app_id(const char *app_id, account_type_h *account_type)
{
- CHECK_ACCOUNT_SUPPORTED(ACCOUNT_FEATURE);
-
_INFO("account_type_query_by_app_id starting");
ACCOUNT_RETURN_VAL((app_id != 0), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("APP ID IS NULL"));
ACCOUNT_API int account_type_foreach_account_type_from_db(account_type_cb callback, void *user_data)
{
- CHECK_ACCOUNT_SUPPORTED(ACCOUNT_FEATURE);
-
_INFO("account_type_foreach_account_type_from_db starting");
ACCOUNT_RETURN_VAL((callback != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("ACCOUNT Callback IS NULL"));
ACCOUNT_API int account_type_query_label_by_locale(const char *app_id, const char *locale, char **label)
{
- CHECK_ACCOUNT_SUPPORTED(ACCOUNT_FEATURE);
-
_INFO("account_type_query_label_by_locale starting");
ACCOUNT_RETURN_VAL((app_id != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("NO APP ID"));
ACCOUNT_API int account_type_query_by_provider_feature(account_type_cb callback, const char *key, void *user_data)
{
- CHECK_ACCOUNT_SUPPORTED(ACCOUNT_FEATURE);
-
_INFO("account_type_query_by_provider_feature starting");
ACCOUNT_RETURN_VAL((key != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("capability_type IS NULL"));
ACCOUNT_API int account_type_query_app_id_exist(const char *app_id)
{
- CHECK_ACCOUNT_SUPPORTED(ACCOUNT_FEATURE);
-
_INFO("account_type_query_app_id_exist starting");
int error_code = ACCOUNT_ERROR_NONE;
ACCOUNT_API int account_subscribe_create(account_subscribe_h *account_subscribe)
{
- CHECK_ACCOUNT_SUPPORTED(ACCOUNT_FEATURE);
-
if (!account_subscribe) {
ACCOUNT_SLOGE("account is NULL.\n", __FUNCTION__, __LINE__);
return ACCOUNT_ERROR_INVALID_PARAMETER;
ACCOUNT_API int account_subscribe_notification(account_subscribe_h account_subscribe, account_event_cb callback, void *user_data)
{
- CHECK_ACCOUNT_SUPPORTED(ACCOUNT_FEATURE);
-
ACCOUNT_RETURN_VAL((account_subscribe != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("(%s)-(%d) account subscribe handle is NULL.\n", __FUNCTION__, __LINE__));
account_subscribe_s *tmp = (account_subscribe_s *)account_subscribe;
ACCOUNT_API int account_unsubscribe_notification(account_subscribe_h account_subscribe)
{
- CHECK_ACCOUNT_SUPPORTED(ACCOUNT_FEATURE);
-
ACCOUNT_RETURN_VAL((account_subscribe != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("(%s)-(%d) account subscribe handle is NULL.\n", __FUNCTION__, __LINE__));
account_subscribe_s *tmp = (account_subscribe_s *)account_subscribe;
ACCOUNT_API int account_unsubscribe_notification_ex(account_subscribe_h account_subscribe)
{
- CHECK_ACCOUNT_SUPPORTED(ACCOUNT_FEATURE);
-
ACCOUNT_RETURN_VAL((account_subscribe != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("(%s)-(%d) account subscribe handle is NULL.\n", __FUNCTION__, __LINE__));
account_subscribe_s *tmp = (account_subscribe_s *)account_subscribe;
ACCOUNT_API int account_subscribe_notification_ex(account_subscribe_h account_subscribe, account_event_cb callback, void *user_data)
{
- CHECK_ACCOUNT_SUPPORTED(ACCOUNT_FEATURE);
-
ACCOUNT_RETURN_VAL((account_subscribe != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("(%s)-(%d) account subscribe handle is NULL.\n", __FUNCTION__, __LINE__));
account_subscribe_s *tmp = (account_subscribe_s *)account_subscribe;