From: Jooseok Song Date: Mon, 17 Jul 2017 04:27:16 +0000 (+0900) Subject: [ACR-1028] Add not supproted error exception X-Git-Tag: submit/tizen/20170728.003408^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=59dd71c30a01c42f21207259264868adb21fe07d;p=platform%2Fcore%2Fapi%2Flibaccount-service.git [ACR-1028] Add not supproted error exception Change-Id: I894f836d2bc911948b9c7a10b791105231bf8f3d --- diff --git a/doc/account_manager_doc.h b/doc/account_manager_doc.h index 9d3540d..29217e9 100644 --- a/doc/account_manager_doc.h +++ b/doc/account_manager_doc.h @@ -33,12 +33,21 @@ * The account APIs is separated into two major sections: * 1. Registering an account provider while an application is installed. This information will be used for the Add account screen. * 2. Adding an account information when an application signs in successfully to share the account information to the Tizen system. This information will be shown in the Tizen settings account menu. - + * * The APIs of both of the sections consist of the following functionality: * - Create an account or account provider - * - Update an account or account provider(Only available for the creator) - * - Delete an account or account provider(Only available for the creator) + * - Update an account or account provider (only available for the creator) + * - Delete an account or account provider (only available for the creator) * - Read an account or account provider with some filter + * + * @section CAPI_ACCOUNT_MANAGER_MODULE_FEATURE Related Features + * This API is related with the following features:\n + * - http://tizen.org/feature/account\n + * It is recommended to use features in your application for reliability. \n + * You can check if a device supports the related features for this API by using System Information, and control your application's actions accordingly. \n + * To ensure your application is running only on devices with specific features, please define the features in your manifest file using the manifest editor in the SDK. + * More details on using features in your application can be found in the feature element description. + * */ #endif /* __ACCOUNT_MANAGER_DOC_H__ */ diff --git a/doc_prod/account_manager_doc.h b/doc_prod/account_manager_doc.h index 8b0cca8..b00a1e3 100644 --- a/doc_prod/account_manager_doc.h +++ b/doc_prod/account_manager_doc.h @@ -33,12 +33,20 @@ * The account APIs is separated into two major sections: * 1. Registering an account provider while an application is installed. This information will be used for the Add account screen. * 2. Adding an account information when an application signs in successfully to share the account information to the Tizen system. This information will be shown in the Tizen settings account menu. - + * * The APIs of both of the sections consist of the following functionality: * - Create an account or account provider - * - Update an account or account provider(Only available for the creator) - * - Delete an account or account provider(Only available for the creator) + * - Update an account or account provider (only available for the creator) + * - Delete an account or account provider (only available for the creator) * - Read an account or account provider with some filter + * + * @section CAPI_ACCOUNT_MANAGER_MODULE_FEATURE Related Features + * This API is related with the following features:\n + * - http://tizen.org/feature/account\n + * It is recommended to use features in your application for reliability. \n + * You can check if a device supports the related features for this API by using System Information, and control your application's actions accordingly. \n + * To ensure your application is running only on devices with specific features, please define the features in your manifest file using the manifest editor in the SDK. + * More details on using features in your application can be found in the feature element description. */ #endif /* __ACCOUNT_PRODUCT_H__ */ diff --git a/include/account-error.h b/include/account-error.h index 7698b5e..bc61a45 100644 --- a/include/account-error.h +++ b/include/account-error.h @@ -61,6 +61,8 @@ typedef enum { ACCOUNT_ERROR_NOT_REGISTERED_PROVIDER = TIZEN_ERROR_ACCOUNT | 0x0d, /**< Account provider is not registered */ ACCOUNT_ERROR_NOT_ALLOW_MULTIPLE = TIZEN_ERROR_ACCOUNT | 0x0e, /**< Multiple accounts are not supported */ ACCOUNT_ERROR_DATABASE_BUSY = TIZEN_ERROR_ACCOUNT | 0x10, /**< SQLite busy handler expired */ + ACCOUNT_ERROR_NOT_SUPPORTED = TIZEN_ERROR_NOT_SUPPORTED, /**< Not supported (Since 4.0) */ + ACCOUNT_ERROR_OPERATION_FAIL = TIZEN_ERROR_INVALID_OPERATION, /**< Account operation failed (Since 4.0)*/ } account_error_e; /** diff --git a/include/account.h b/include/account.h index 86f2d6f..3deea32 100644 --- a/include/account.h +++ b/include/account.h @@ -233,6 +233,7 @@ int account_disconnect(void) TIZEN_DEPRECATED_API; * @retval #ACCOUNT_ERROR_NONE Successful * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of Memory * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported * * @see account_destroy() */ @@ -249,6 +250,7 @@ int account_create(account_h *account); * otherwise a negative error value * @retval #ACCOUNT_ERROR_NONE Successful * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported * * @see account_create() */ @@ -278,6 +280,7 @@ int account_destroy(account_h account); * @retval #ACCOUNT_ERROR_PERMISSION_DENIED DB Access fail by permission * @retval #ACCOUNT_ERROR_DATABASE_BUSY SQLite handler is busy * @retval #ACCOUNT_ERROR_DB_NOT_OPENED Account database did not opened + * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported * * @pre This function requires an open connection to an account service by account_connect() on tizen 2.3 (MOBILE).\n * But the account_connect() is not required to use this function since tizen 2.4. @@ -311,6 +314,7 @@ int account_insert_to_db(account_h account, int *account_db_id); * @retval #ACCOUNT_ERROR_PERMISSION_DENIED The account owner is different from the caller or DB Access fail by permission * @retval #ACCOUNT_ERROR_DATABASE_BUSY SQLite handler is busy * @retval #ACCOUNT_ERROR_DB_NOT_OPENED Account database did not opened + * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported * * @pre This function requires an open connection to an account service by account_connect() on tizen 2.3 (MOBILE).\n * But the account_connect() is not required to use this function since tizen 2.4. @@ -345,6 +349,7 @@ int account_delete_from_db_by_id(int account_db_id); * @retval #ACCOUNT_ERROR_PERMISSION_DENIED DB Access fail by permission * @retval #ACCOUNT_ERROR_DATABASE_BUSY SQLite handler is busy * @retval #ACCOUNT_ERROR_DB_NOT_OPENED Account database did not opened + * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported * * @pre This function requires an open connection to an account service by account_connect() on tizen 2.3 (MOBILE).\n * But the account_connect() is not required to use this function since tizen 2.4. @@ -377,6 +382,7 @@ int account_delete_from_db_by_user_name(char *user_name, char *package_name); * @retval #ACCOUNT_ERROR_PERMISSION_DENIED DB Access fail by permission * @retval #ACCOUNT_ERROR_DATABASE_BUSY SQLite handler is busy * @retval #ACCOUNT_ERROR_DB_NOT_OPENED Account database did not opened + * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported * * @pre This function requires an open connection to an account service by account_connect() on tizen 2.3 (MOBILE).\n * But the account_connect() is not required to use this function since tizen 2.4. @@ -410,6 +416,7 @@ int account_delete_from_db_by_package_name(const char *package_name); * @retval #ACCOUNT_ERROR_PERMISSION_DENIED DB Access fail by permission * @retval #ACCOUNT_ERROR_DATABASE_BUSY SQLite handler is busy * @retval #ACCOUNT_ERROR_DB_NOT_OPENED Account database did not opened + * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported * * @pre This function requires an open connection to an account service by account_connect() on tizen 2.3 (MOBILE).\n * But the account_connect() is not required to use this function since tizen 2.4. @@ -445,6 +452,7 @@ int account_update_to_db_by_id(account_h account, int account_id); * @retval #ACCOUNT_ERROR_PERMISSION_DENIED DB Access fail by permission * @retval #ACCOUNT_ERROR_DATABASE_BUSY SQLite handler is busy * @retval #ACCOUNT_ERROR_DB_NOT_OPENED Account database did not opened + * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported * * @pre This function requires an open connection to an account service by account_connect() on tizen 2.3 (MOBILE).\n * But the account_connect() is not required to use this function since tizen 2.4. @@ -479,6 +487,7 @@ int account_update_to_db_by_id_ex(account_h account, int account_id); * @retval #ACCOUNT_ERROR_PERMISSION_DENIED DB Access fail by permission * @retval #ACCOUNT_ERROR_DATABASE_BUSY SQLite handler is busy * @retval #ACCOUNT_ERROR_DB_NOT_OPENED Account database did not opened + * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported * * @pre This function requires an open connection to an account service by account_connect() on tizen 2.3 (MOBILE).\n * But the account_connect() is not required to use this function since tizen 2.4. @@ -503,6 +512,7 @@ int account_update_to_db_by_user_name(account_h account, const char *user_name, * otherwise a negative error value * @retval #ACCOUNT_ERROR_NONE Successful * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported * */ int account_get_account_id(account_h account, int *account_id); @@ -521,6 +531,7 @@ int account_get_account_id(account_h account, int *account_id); * @retval #ACCOUNT_ERROR_NONE Successful * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of memory + * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported * * @see account_set_user_name() */ @@ -538,6 +549,7 @@ int account_get_user_name(account_h account, char **user_name); * otherwise a negative error value * @retval #ACCOUNT_ERROR_NONE Successful * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported * * @see account_get_user_name() */ @@ -558,6 +570,7 @@ int account_set_user_name(account_h account, const char *user_name); * @retval #ACCOUNT_ERROR_NONE Successful * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of memory + * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported * * @see account_get_display_name() */ @@ -575,6 +588,7 @@ int account_get_display_name(account_h account, char **display_name); * otherwise a negative error value * @retval #ACCOUNT_ERROR_NONE Successful * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported * * @see account_get_display_name() */ @@ -593,6 +607,7 @@ int account_set_display_name(account_h account, const char *display_name); * @retval #ACCOUNT_ERROR_NONE Successful * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter * @retval #ACCOUNT_ERROR_RECORD_NOT_FOUND There is no given capability_type in the account + * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported * * @see account_set_capability() */ @@ -610,6 +625,7 @@ int account_get_capability(account_h account, const char *capability_type, accou * otherwise a negative error value * @retval #ACCOUNT_ERROR_NONE Successful * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported * * @see account_set_capability() */ @@ -627,6 +643,7 @@ int account_get_capability_all(account_h account, capability_cb callback, void * * otherwise a negative error value * @retval #ACCOUNT_ERROR_NONE Successful * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported * * @see account_get_capability() */ @@ -647,6 +664,7 @@ int account_set_capability(account_h account, const char *capability_type, accou * @retval #ACCOUNT_ERROR_NONE Successful * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of memory + * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported * * @see account_set_icon_path() */ @@ -664,6 +682,7 @@ int account_get_icon_path(account_h account, char **icon_path); * otherwise a negative error value * @retval #ACCOUNT_ERROR_NONE Successful * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported * * @see account_get_icon_path() */ @@ -684,6 +703,7 @@ int account_set_icon_path(account_h account, const char *icon_path); * @retval #ACCOUNT_ERROR_NONE Successful * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of memory + * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported * * @see account_set_domain_name() */ @@ -701,6 +721,7 @@ int account_get_domain_name(account_h account, char **domain_name); * otherwise a negative error value * @retval #ACCOUNT_ERROR_NONE Successful * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported * * @see account_get_domain_name() */ @@ -721,6 +742,7 @@ int account_set_domain_name(account_h account, const char *domain_name); * @retval #ACCOUNT_ERROR_NONE Successful * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of memory + * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported * * @see account_set_email_address() */ @@ -738,6 +760,7 @@ int account_get_email_address(account_h account, char **email_address); * otherwise a negative error value * @retval #ACCOUNT_ERROR_NONE Successful * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported * * @see account_get_email_address() */ @@ -758,6 +781,7 @@ int account_set_email_address(account_h account, const char *email_address); * @retval #ACCOUNT_ERROR_NONE Successful * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of memory + * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported * * @see account_set_package_name() */ @@ -775,6 +799,7 @@ int account_get_package_name(account_h account, char **package_name); * otherwise a negative error value * @retval #ACCOUNT_ERROR_NONE Successful * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported * * @see account_get_email_address() */ @@ -786,6 +811,7 @@ int account_set_package_name(account_h account, const char *package_name); * * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif * @remarks You must release @a access_token using free(). + * @remarks Access token field is used for storing account secret (password / master token etc) * * @param[in] account The account handle * @param[out] access_token The access token @@ -795,8 +821,8 @@ int account_set_package_name(account_h account, const char *package_name); * @retval #ACCOUNT_ERROR_NONE Successful * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of memory + * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported * - * @remarks Access token field is used for storing account secret (password / master token etc) * Only account owner application can retrieve account password / access_token. For others this field will be null. * @see account_set_access_token() */ @@ -807,6 +833,8 @@ int account_get_access_token(account_h account, char **access_token); * @brief Sets the access token. Access token field is used to store account secrets (such as password or master token). * * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif + * @remarks Only account owner application can retrieve account password / access_token. For others this field will be null. + * * @param[in] account The account handle * @param[in] access_token The text string to set as the access token * @@ -814,7 +842,7 @@ int account_get_access_token(account_h account, char **access_token); * otherwise a negative error value * @retval #ACCOUNT_ERROR_NONE Successful * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter - * @remarks Only account owner application can retrieve account password / access_token. For others this field will be null. + * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported * @see account_get_access_token() */ int account_set_access_token(account_h account, const char *access_token); @@ -835,6 +863,7 @@ int account_set_access_token(account_h account, const char *access_token); * @retval #ACCOUNT_ERROR_NONE Successful * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of memory + * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported * * @see account_set_user_text() */ @@ -853,6 +882,7 @@ int account_get_user_text(account_h account, int user_text_index, char **user_te * otherwise a negative error value * @retval #ACCOUNT_ERROR_NONE Successful * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported * * @see account_get_user_text() */ @@ -871,6 +901,7 @@ int account_set_user_text(account_h account, int user_text_index, const char *us * otherwise a negative error value * @retval #ACCOUNT_ERROR_NONE Successful * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported * * @see account_set_user_int() */ @@ -889,6 +920,7 @@ int account_get_user_int(account_h account, int user_int_index, int *user_intege * otherwise a negative error value * @retval #ACCOUNT_ERROR_NONE Successful * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported * * @see account_get_user_int() */ @@ -906,6 +938,7 @@ int account_set_user_int(account_h account, int user_int_index, int user_integer * otherwise a negative error value * @retval #ACCOUNT_ERROR_NONE Successful * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported * * @see account_set_auth_type() */ @@ -923,6 +956,7 @@ int account_get_auth_type(account_h account, account_auth_type_e *auth_type); * otherwise a negative error value * @retval #ACCOUNT_ERROR_NONE Successful * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported * * @see account_get_auth_type() */ @@ -940,6 +974,7 @@ int account_set_auth_type(account_h account, const account_auth_type_e auth_type * otherwise a negative error value * @retval #ACCOUNT_ERROR_NONE Successful * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported * * @see account_set_secret() */ @@ -957,6 +992,7 @@ int account_get_secret(account_h account, account_secrecy_state_e *secret); * otherwise a negative error value * @retval #ACCOUNT_ERROR_NONE Successful * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported * * @see account_get_secret() */ @@ -973,6 +1009,7 @@ int account_set_secret(account_h account, const account_secrecy_state_e secret); * otherwise a negative error value * @retval #ACCOUNT_ERROR_NONE Successful * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported * * @see account_set_sync_support() */ @@ -990,6 +1027,7 @@ int account_get_sync_support(account_h account, account_sync_state_e *sync_suppo * otherwise a negative error value * @retval #ACCOUNT_ERROR_NONE Successful * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported * * @see account_get_sync_support() */ @@ -1000,7 +1038,7 @@ int account_set_sync_support(account_h account, const account_sync_state_e sync_ * @brief Gets the source. * * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif - * @remarks You must release @a user_text using free(). + * @remarks You must release @a source using free(). * * @param[in] account The account handle * @param[out] source The source @@ -1010,6 +1048,7 @@ int account_set_sync_support(account_h account, const account_sync_state_e sync_ * @retval #ACCOUNT_ERROR_NONE Successful * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of memory + * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported * * @see account_set_source() */ @@ -1027,6 +1066,7 @@ int account_get_source(account_h account, char **source); * otherwise a negative error value * @retval #ACCOUNT_ERROR_NONE Successful * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported * * @see account_get_source() */ @@ -1044,6 +1084,7 @@ int account_set_source(account_h account, const char *source); * otherwise a negative error value * @retval #ACCOUNT_ERROR_NONE Successful * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported * * @see account_get_custom() */ @@ -1053,6 +1094,8 @@ int account_set_custom(account_h account, const char *key, const char *value); * @brief Gets the user specific custom text of an account key. * * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif + * @remarks You must release @a value using free(). + * * @param[in] account The account handle * @param[in] key The key to retrieve custom text * @param[out] value The text of the given key @@ -1062,6 +1105,7 @@ int account_set_custom(account_h account, const char *key, const char *value); * @retval #ACCOUNT_ERROR_NONE Successful * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter * @retval #ACCOUNT_ERROR_RECORD_NOT_FOUND There is no given capability type in the account + * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported * * @see account_set_custom() */ @@ -1081,6 +1125,7 @@ int account_get_custom(account_h account, const char *key, char **value); * otherwise a negative error value * @retval #ACCOUNT_ERROR_NONE Successful * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported * * @see account_set_custom() */ @@ -1104,6 +1149,7 @@ int account_get_custom_all(account_h account, account_custom_cb callback, void * * @retval #ACCOUNT_ERROR_RECORD_NOT_FOUND Related record does not exist * @retval #ACCOUNT_ERROR_DATABASE_BUSY SQLite handler is busy * @retval #ACCOUNT_ERROR_DB_NOT_OPENED Account database did not opened + * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported * * @pre This function requires an open connection to an account service by account_connect() on tizen 2.3 (MOBILE).\n * But the account_connect() is not required to use this function since tizen 2.4. @@ -1118,14 +1164,15 @@ int account_foreach_account_from_db(account_cb callback, void *user_data); /** - * @brief Retrieve an account with the account ID. + * @brief Retrieves an account with the account ID. * * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif * @privlevel public * @privilege %http://tizen.org/privilege/account.read + * @remarks You must allocate @a account using account_create() and release using account_destroy(). + * * @param[in] account_db_id The account database ID to search * @param[out] account The account handle \n - * Must be allocated by account_create() and freed after using by account_destroy(). * * @return @c 0 on success, * otherwise a negative error value @@ -1136,6 +1183,7 @@ int account_foreach_account_from_db(account_cb callback, void *user_data); * @retval #ACCOUNT_ERROR_PERMISSION_DENIED DB Access fail by permission * @retval #ACCOUNT_ERROR_DATABASE_BUSY SQLite handler is busy * @retval #ACCOUNT_ERROR_DB_NOT_OPENED Account database did not opened + * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported * * @pre This function requires an open connection to an account service by account_connect() on tizen 2.3 (MOBILE).\n * But the account_connect() is not required to use this function since tizen 2.4. @@ -1165,6 +1213,7 @@ int account_query_account_by_account_id(int account_db_id, account_h *account); * @retval #ACCOUNT_ERROR_PERMISSION_DENIED DB Access fail by permission * @retval #ACCOUNT_ERROR_DATABASE_BUSY SQLite handler is busy * @retval #ACCOUNT_ERROR_DB_NOT_OPENED Account database did not opened + * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported * * @pre This function requires an open connection to an account service by account_connect() on tizen 2.3 (MOBILE).\n * But the account_connect() is not required to use this function since tizen 2.4. @@ -1197,6 +1246,7 @@ int account_query_account_by_user_name(account_cb callback, const char *user_nam * @retval #ACCOUNT_ERROR_PERMISSION_DENIED DB Access fail by permission * @retval #ACCOUNT_ERROR_DATABASE_BUSY SQLite handler is busy * @retval #ACCOUNT_ERROR_DB_NOT_OPENED Account database did not opened + * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported * * @pre This function requires an open connection to an account service by account_connect() on tizen 2.3 (MOBILE).\n * But the account_connect() is not required to use this function since tizen 2.4. @@ -1229,6 +1279,7 @@ int account_query_account_by_package_name(account_cb callback, const char *packa * @retval #ACCOUNT_ERROR_PERMISSION_DENIED DB Access fail by permission * @retval #ACCOUNT_ERROR_DATABASE_BUSY SQLite handler is busy * @retval #ACCOUNT_ERROR_DB_NOT_OPENED Account database did not opened + * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported * * @pre This function requires an open connection to an account service by account_connect() on tizen 2.3 (MOBILE).\n * But the account_connect() is not required to use this function since tizen 2.4. @@ -1260,6 +1311,7 @@ int account_query_account_by_capability(account_cb callback, const char *capabil * @retval #ACCOUNT_ERROR_PERMISSION_DENIED DB Access fail by permission * @retval #ACCOUNT_ERROR_DATABASE_BUSY SQLite handler is busy * @retval #ACCOUNT_ERROR_DB_NOT_OPENED Account database did not opened + * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported * * @pre This function requires an open connection to an account service by account_connect() on tizen 2.3 (MOBILE).\n * But the account_connect() is not required to use this function since tizen 2.4. @@ -1291,6 +1343,7 @@ int account_query_account_by_capability_type(account_cb callback, const char *ca * @retval #ACCOUNT_ERROR_PERMISSION_DENIED DB Access fail by permission * @retval #ACCOUNT_ERROR_DATABASE_BUSY SQLite handler is busy * @retval #ACCOUNT_ERROR_DB_NOT_OPENED Account database did not opened + * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported * * @pre This function requires an open connection to an account service by account_connect() on tizen 2.3 (MOBILE).\n * But the account_connect() is not required to use this function since tizen 2.4. @@ -1317,6 +1370,7 @@ int account_query_capability_by_account_id(capability_cb callback, int account_d * @retval #ACCOUNT_ERROR_PERMISSION_DENIED DB Access fail by permission * @retval #ACCOUNT_ERROR_DATABASE_BUSY SQLite handler is busy * @retval #ACCOUNT_ERROR_DB_NOT_OPENED Account database did not opened + * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported * * @pre This function requires an open connection to an account service by account_connect() on tizen 2.3 (MOBILE).\n * But the account_connect() is not required to use this function since tizen 2.4. @@ -1344,6 +1398,7 @@ int account_get_total_count_from_db(int *count); * @retval #ACCOUNT_ERROR_PERMISSION_DENIED DB Access fail by permission * @retval #ACCOUNT_ERROR_DATABASE_BUSY SQLite handler is busy * @retval #ACCOUNT_ERROR_DB_NOT_OPENED Account database did not opened + * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported * * @pre This function requires an open connection to an account service by account_connect() on tizen 2.3 (MOBILE).\n * But the account_connect() is not required to use this function since tizen 2.4. @@ -1367,6 +1422,7 @@ int account_update_sync_status_by_id(int account_db_id, const account_sync_state * @retval #ACCOUNT_ERROR_NONE Successful * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of Memory * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported * * @see account_type_destroy() */ @@ -1385,6 +1441,7 @@ int account_type_create(account_type_h *account_type); * otherwise a negative error value * @retval #ACCOUNT_ERROR_NONE Successful * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported * * @see account_type_create() */ @@ -1409,6 +1466,7 @@ int account_type_destroy(account_type_h account_type); * @retval #ACCOUNT_ERROR_PERMISSION_DENIED DB Access fail by permission * @retval #ACCOUNT_ERROR_DATABASE_BUSY SQLite handler is busy * @retval #ACCOUNT_ERROR_DB_NOT_OPENED Account database did not opened + * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported * * @pre This function requires an open connection to an account service by account_connect() on tizen 2.3 (MOBILE).\n * But the account_connect() is not required to use this function since tizen 2.4. @@ -1458,6 +1516,7 @@ bool account_type_query_supported_feature(const char *app_id, const char *capabi * @retval #ACCOUNT_ERROR_NONE Successful * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of memory + * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported * * @see account_type_foreach_account_type_from_db() * @see account_type_query_by_app_id() @@ -1479,6 +1538,7 @@ int account_type_get_app_id(account_type_h account_type, char **app_id); * @retval #ACCOUNT_ERROR_NONE Successful * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of memory + * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported * * @see account_type_foreach_account_type_from_db() * @see account_type_query_by_app_id() @@ -1500,6 +1560,7 @@ int account_type_get_service_provider_id(account_type_h account_type, char **ser * @retval #ACCOUNT_ERROR_NONE Successful * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of memory + * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported * * @see account_type_foreach_account_type_from_db() * @see account_type_query_by_app_id() @@ -1521,6 +1582,7 @@ int account_type_get_icon_path(account_type_h account_type, char **icon_path); * @retval #ACCOUNT_ERROR_NONE Successful * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of memory + * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported * * @see account_type_foreach_account_type_from_db() * @see account_type_query_by_app_id() @@ -1541,6 +1603,7 @@ int account_type_get_small_icon_path(account_type_h account_type, char **small_i * @retval #ACCOUNT_ERROR_NONE Successful * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of memory + * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported * * @see account_type_foreach_account_type_from_db() * @see account_type_query_by_app_id() @@ -1562,6 +1625,7 @@ int account_type_get_multiple_account_support(account_type_h account_type, int * * @retval #ACCOUNT_ERROR_NONE Successful * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter * @retval #ACCOUNT_ERROR_DB_FAILED Database operation failed + * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported * * @pre This function requires an open connection to an account service by account_connect() on tizen 2.3 (MOBILE).\n * But the account_connect() is not required to use this function since tizen 2.4. @@ -1572,6 +1636,8 @@ int account_type_get_provider_feature_all(account_type_h account_type, provider_ * @brief Gets the specific label information detail of an account provider. * * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif + * @remarks You must release @a label using free(). + * * @param[in] account_type The account provider handle\n * It should be given by account_type_query_* functions or account_type_foreach_account_type_from_db(). * @param[in] locale The locale is specified as an ISO 3166 alpha-2 two letter country-code followed by ISO 639-1 for the two-letter language code.\n @@ -1583,6 +1649,7 @@ int account_type_get_provider_feature_all(account_type_h account_type, provider_ * @retval #ACCOUNT_ERROR_NONE Successful * @retval #ACCOUNT_ERROR_RECORD_NOT_FOUND No label for the given locale * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported * * @see account_type_foreach_account_type_from_db() * @see account_type_query_by_app_id() @@ -1603,6 +1670,7 @@ int account_type_get_label_by_locale(account_type_h account_type, const char *lo * otherwise a negative error value * @retval #ACCOUNT_ERROR_NONE Successful * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported * * @see account_type_foreach_account_type_from_db() * @see account_type_query_by_app_id() @@ -1629,6 +1697,7 @@ int account_type_get_label(account_type_h account_type, account_label_cb callbac * @retval #ACCOUNT_ERROR_PERMISSION_DENIED DB Access fail by permission * @retval #ACCOUNT_ERROR_DATABASE_BUSY SQLite handler is busy * @retval #ACCOUNT_ERROR_DB_NOT_OPENED Account database did not opened + * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported * * @pre This function requires an open connection to an account service by account_connect() on tizen 2.3 (MOBILE).\n * But the account_connect() is not required to use this function since tizen 2.4. @@ -1656,6 +1725,7 @@ int account_type_query_label_by_app_id(account_label_cb callback, const char *ap * @retval #ACCOUNT_ERROR_PERMISSION_DENIED DB Access fail by permission * @retval #ACCOUNT_ERROR_DATABASE_BUSY SQLite handler is busy * @retval #ACCOUNT_ERROR_DB_NOT_OPENED Account database did not opened + * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported * * @pre This function requires an open connection to an account service by account_connect() on tizen 2.3 (MOBILE).\n * But the account_connect() is not required to use this function since tizen 2.4. @@ -1690,6 +1760,7 @@ int account_type_query_by_app_id(const char *app_id, account_type_h *account_typ * @retval #ACCOUNT_ERROR_PERMISSION_DENIED DB Access fail by permission * @retval #ACCOUNT_ERROR_DATABASE_BUSY SQLite handler is busy * @retval #ACCOUNT_ERROR_DB_NOT_OPENED Account database did not opened + * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported * * @pre This function requires an open connection to an account service by account_connect() on tizen 2.3 (MOBILE).\n * But the account_connect() is not required to use this function since tizen 2.4. @@ -1725,6 +1796,7 @@ int account_type_foreach_account_type_from_db(account_type_cb callback, void *us * @retval #ACCOUNT_ERROR_PERMISSION_DENIED DB Access fail by permission * @retval #ACCOUNT_ERROR_DATABASE_BUSY SQLite handler is busy * @retval #ACCOUNT_ERROR_DB_NOT_OPENED Account database did not opened + * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported * * @pre This function requires an open connection to an account service by account_connect() on tizen 2.3 (MOBILE).\n * But the account_connect() is not required to use this function since tizen 2.4. @@ -1751,6 +1823,7 @@ int account_type_query_label_by_locale(const char *app_id, const char *locale, c * @retval #ACCOUNT_ERROR_PERMISSION_DENIED DB Access fail by permission * @retval #ACCOUNT_ERROR_DATABASE_BUSY SQLite handler is busy * @retval #ACCOUNT_ERROR_DB_NOT_OPENED Account database did not opened + * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported * * @pre This function requires an open connection to an account service by account_connect() on tizen 2.3 (MOBILE).\n * But the account_connect() is not required to use this function since tizen 2.4. @@ -1774,6 +1847,7 @@ int account_type_query_by_provider_feature(account_type_cb callback, const char * @retval #ACCOUNT_ERROR_PERMISSION_DENIED DB Access fail by permission * @retval #ACCOUNT_ERROR_DATABASE_BUSY SQLite handler is busy * @retval #ACCOUNT_ERROR_DB_NOT_OPENED Account database did not opened + * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported * * @pre This function requires an open connection to an account service by account_connect() on tizen 2.3 (MOBILE).\n * But the account_connect() is not required to use this function since tizen 2.4. @@ -1799,6 +1873,7 @@ int account_type_query_app_id_exist(const char *app_id); * @retval #ACCOUNT_ERROR_NONE Successful * @retval #ACCOUNT_ERROR_OUT_OF_MEMORY Out of Memory * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported * * @see account_unsubscribe_notification() * @see account_subscribe_notification() @@ -1821,6 +1896,7 @@ int account_subscribe_create(account_subscribe_h *account_subscribe); * @retval #ACCOUNT_ERROR_NONE Successful * @retval #ACCOUNT_ERROR_EVENT_SUBSCRIPTION_FAIL Subscription fail * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported * * @pre account_subscribe_create() * @@ -1844,6 +1920,7 @@ int account_subscribe_notification(account_subscribe_h account_subscribe, accoun * @retval #ACCOUNT_ERROR_NONE Successful * @retval #ACCOUNT_ERROR_INVALID_PARAMETER Invalid parameter * @retval #ACCOUNT_ERROR_EVENT_SUBSCRIPTION_FAIL Unsubscription failed + * @retval #ACCOUNT_ERROR_NOT_SUPPORTED Not supported * * @see account_create() */ diff --git a/packaging/libaccount-service.spec b/packaging/libaccount-service.spec index 417104e..a15b2d1 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.15 +Version: 0.4.16 Release: 1 Group: Social & Content/API License: Apache-2.0 @@ -9,6 +9,7 @@ Source0: libaccount-service-%{version}.tar.gz BuildRequires: cmake BuildRequires: pkgconfig(dlog) BuildRequires: pkgconfig(capi-base-common) +BuildRequires: pkgconfig(capi-system-info) BuildRequires: pkgconfig(vconf) BuildRequires: pkgconfig(glib-2.0) >= 2.26 BuildRequires: pkgconfig(gio-unix-2.0) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 961eeff..25eafe9 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -12,6 +12,7 @@ pkg_check_modules(clientpkgs REQUIRED glib-2.0 gio-unix-2.0 capi-base-common + capi-system-info vconf account-common db-util diff --git a/src/account.c b/src/account.c index 59983d0..67af409 100644 --- a/src/account.c +++ b/src/account.c @@ -224,6 +224,8 @@ ACCOUNT_API int account_disconnect(void) 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")); @@ -262,6 +264,8 @@ CATCH: 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; @@ -306,6 +310,8 @@ ACCOUNT_API int account_delete_from_db_by_id(int account_db_id) 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"); @@ -358,6 +364,8 @@ ACCOUNT_API int account_delete_from_db_by_user_name(char *user_name, char *packa 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; @@ -407,12 +415,16 @@ int _account_delete_from_db_by_package_name(const char *package_name, bool permi 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; @@ -459,6 +471,8 @@ ACCOUNT_API int account_update_to_db_by_id(account_h account, int account_id) 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); @@ -467,6 +481,8 @@ ACCOUNT_API int account_update_to_db_by_id_ex(account_h account, int 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; @@ -532,6 +548,8 @@ ACCOUNT_INTERNAL_API int account_update_to_db_by_id_without_permission(account_h 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; @@ -577,6 +595,8 @@ ACCOUNT_API int account_update_to_db_by_user_name(account_h account, const char 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__); @@ -610,6 +630,8 @@ ACCOUNT_API int account_create(account_h *account) ACCOUNT_API int account_destroy(account_h account) { + CHECK_ACCOUNT_SUPPORTED(ACCOUNT_FEATURE); + _INFO("account_destroy start"); account_s *data = (account_s *)account; @@ -623,6 +645,8 @@ ACCOUNT_API int account_destroy(account_h 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; @@ -647,6 +671,8 @@ ACCOUNT_API int account_set_user_name(account_h account, const char *user_name) 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; @@ -671,6 +697,8 @@ ACCOUNT_API int account_set_display_name(account_h account, const char *display_ 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; @@ -695,6 +723,8 @@ ACCOUNT_API int account_set_email_address(account_h account, const char *email_a 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; @@ -719,6 +749,8 @@ ACCOUNT_API int account_set_icon_path(account_h account, const char *icon_path) 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; @@ -742,6 +774,8 @@ ACCOUNT_API int account_set_source(account_h account, const char *source) 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; @@ -766,6 +800,8 @@ ACCOUNT_API int account_set_package_name(account_h account, const char *package_ 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; @@ -789,6 +825,8 @@ ACCOUNT_API int account_set_domain_name(account_h account, const char *domain_na 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; @@ -813,6 +851,8 @@ ACCOUNT_API int account_set_access_token(account_h account, const char *access_t 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; @@ -841,6 +881,8 @@ ACCOUNT_API int account_set_user_text(account_h account, int idx, const char *us 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; @@ -929,6 +971,8 @@ ACCOUNT_API int account_set_custom(account_h account, const char *key, const cha 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)) @@ -943,6 +987,8 @@ ACCOUNT_API int account_set_auth_type(account_h account, const account_auth_type 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)) @@ -957,6 +1003,8 @@ ACCOUNT_API int account_set_secret(account_h account, const account_secrecy_stat 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)) @@ -971,6 +1019,8 @@ ACCOUNT_API int account_set_sync_support(account_h account, const account_sync_s 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; @@ -986,6 +1036,8 @@ ACCOUNT_API int account_set_user_int(account_h account, int idx, const int user_ 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")); @@ -1035,6 +1087,8 @@ ACCOUNT_API int account_set_capability(account_h account, const char *capability 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; @@ -1055,6 +1109,8 @@ ACCOUNT_API int account_get_user_name(account_h account, char **user_name) 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; @@ -1077,6 +1133,8 @@ ACCOUNT_API int account_get_display_name(account_h account, char **display_name) 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; @@ -1098,6 +1156,8 @@ ACCOUNT_API int account_get_email_address(account_h account, char **email_addres 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; @@ -1119,6 +1179,8 @@ ACCOUNT_API int account_get_icon_path(account_h account, char **icon_path) ACCOUNT_API int account_get_source(account_h account, char **source) { + CHECK_ACCOUNT_SUPPORTED(ACCOUNT_FEATURE); + if (!account) return ACCOUNT_ERROR_INVALID_PARAMETER; @@ -1140,6 +1202,8 @@ ACCOUNT_API int account_get_source(account_h account, char **source) 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; @@ -1162,6 +1226,8 @@ ACCOUNT_API int account_get_package_name(account_h account, char **package_name) 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; @@ -1183,6 +1249,8 @@ ACCOUNT_API int account_get_domain_name(account_h account, char **domain_name) 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; @@ -1204,6 +1272,8 @@ ACCOUNT_API int account_get_access_token(account_h account, char **access_token) 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; @@ -1227,6 +1297,8 @@ ACCOUNT_API int account_get_user_text(account_h account, int user_text_index, ch 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; @@ -1242,6 +1314,8 @@ ACCOUNT_API int account_get_auth_type(account_h account, account_auth_type_e *au 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; @@ -1257,6 +1331,8 @@ ACCOUNT_API int account_get_secret(account_h account, account_secrecy_state_e *s 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; @@ -1272,6 +1348,8 @@ ACCOUNT_API int account_get_sync_support(account_h account, account_sync_state_e 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; @@ -1287,6 +1365,8 @@ ACCOUNT_API int account_get_account_id(account_h account, int *account_id) 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; @@ -1304,6 +1384,8 @@ ACCOUNT_API int account_get_user_int(account_h account, int user_int_index, int 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")); @@ -1327,6 +1409,8 @@ ACCOUNT_API int account_get_capability(account_h account, const char *capability 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")); @@ -1347,6 +1431,8 @@ ACCOUNT_API int account_get_capability_all(account_h account, capability_cb call 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")); @@ -1376,6 +1462,8 @@ ACCOUNT_API int account_get_custom(account_h account, const char *key, char **va 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")); @@ -1398,6 +1486,8 @@ ACCOUNT_API int account_get_custom_all(account_h account, account_custom_cb call 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")); @@ -1446,6 +1536,8 @@ ACCOUNT_API int account_foreach_account_from_db(account_cb callback, void *user_ 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")); @@ -1496,6 +1588,8 @@ ACCOUNT_API int account_query_account_by_account_id(int account_db_id, account_h 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")); @@ -1547,6 +1641,8 @@ ACCOUNT_API int account_query_account_by_user_name(account_cb callback, const ch 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")); @@ -1605,6 +1701,8 @@ ACCOUNT_API int account_query_account_by_package_name(account_cb callback, const 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")); @@ -1661,6 +1759,8 @@ ACCOUNT_API int account_query_account_by_capability(account_cb callback, const c 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")); @@ -1712,6 +1812,8 @@ ACCOUNT_API int account_query_account_by_capability_type(account_cb callback, co 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")); @@ -1762,6 +1864,8 @@ ACCOUNT_API int account_query_capability_by_account_id(capability_cb callback, i 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) { @@ -1793,6 +1897,8 @@ static int _account_get_total_count(int *count, bool include_hidden) 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); @@ -1800,6 +1906,8 @@ ACCOUNT_API int account_get_total_count_from_db(int *count) 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); @@ -1807,6 +1915,8 @@ ACCOUNT_INTERNAL_API int account_get_total_count_from_db_ex(int *count) 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; @@ -1836,6 +1946,8 @@ ACCOUNT_API int account_update_sync_status_by_id(int account_db_id, const accoun 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; @@ -1865,6 +1977,8 @@ ACCOUNT_API int account_type_create(account_type_h *account_type) 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; @@ -1881,6 +1995,8 @@ ACCOUNT_API int account_type_destroy(account_type_h 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; @@ -1905,6 +2021,8 @@ ACCOUNT_INTERNAL_API int account_type_set_app_id(account_type_h account_type, co 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; @@ -1925,6 +2043,8 @@ ACCOUNT_INTERNAL_API int account_type_set_service_provider_id(account_type_h acc 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; @@ -1945,6 +2065,8 @@ ACCOUNT_INTERNAL_API int account_type_set_icon_path(account_type_h account_type, 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; @@ -1965,6 +2087,8 @@ ACCOUNT_INTERNAL_API int account_type_set_small_icon_path(account_type_h account 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; @@ -1976,6 +2100,8 @@ ACCOUNT_INTERNAL_API int account_type_set_multiple_account_support(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; @@ -2015,6 +2141,8 @@ ACCOUNT_INTERNAL_API int account_type_set_label(account_type_h account_type, con 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")); @@ -2058,6 +2186,8 @@ ACCOUNT_INTERNAL_API int account_type_set_provider_feature(account_type_h accoun 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")); @@ -2112,6 +2242,8 @@ ACCOUNT_API int account_type_query_provider_feature_by_app_id(provider_feature_c 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) { @@ -2151,6 +2283,8 @@ ACCOUNT_API bool account_type_query_supported_feature(const char *app_id, const 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; @@ -2171,6 +2305,8 @@ ACCOUNT_API int account_type_get_app_id(account_type_h account_type, char **app_ 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; @@ -2191,6 +2327,8 @@ ACCOUNT_API int account_type_get_service_provider_id(account_type_h account_type 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; @@ -2211,6 +2349,8 @@ ACCOUNT_API int account_type_get_icon_path(account_type_h account_type, char **i 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; @@ -2232,6 +2372,8 @@ ACCOUNT_API int account_type_get_small_icon_path(account_type_h account_type, ch 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; @@ -2247,6 +2389,8 @@ ACCOUNT_API int account_type_get_multiple_account_support(account_type_h account 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")); @@ -2269,6 +2413,8 @@ ACCOUNT_API int account_type_get_provider_feature_all(account_type_h account_typ 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")); @@ -2336,6 +2482,8 @@ ACCOUNT_API int account_type_get_label_by_locale(account_type_h account_type, co 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")); @@ -2358,6 +2506,8 @@ ACCOUNT_API int account_type_get_label(account_type_h account_type, account_labe 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")); @@ -2405,6 +2555,8 @@ ACCOUNT_INTERNAL_API int account_type_insert_to_db(account_type_h account_type, 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; @@ -2437,6 +2589,8 @@ ACCOUNT_INTERNAL_API int account_type_update_to_db_by_app_id(const account_type_ 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; @@ -2471,6 +2625,8 @@ ACCOUNT_INTERNAL_API int account_type_delete_by_app_id(const char *app_id) 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")); @@ -2517,6 +2673,8 @@ ACCOUNT_API int account_type_query_label_by_app_id(account_label_cb callback, co 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")); @@ -2563,6 +2721,8 @@ ACCOUNT_API int account_type_query_by_app_id(const char *app_id, account_type_h 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")); @@ -2613,6 +2773,8 @@ ACCOUNT_API int account_type_foreach_account_type_from_db(account_type_cb callba 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")); @@ -2656,6 +2818,8 @@ ACCOUNT_API int account_type_query_label_by_locale(const char *app_id, const cha 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")); @@ -2707,6 +2871,8 @@ ACCOUNT_API int account_type_query_by_provider_feature(account_type_cb callback, 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; @@ -2791,6 +2957,8 @@ static void _account_subscribe_vconf_callback(keynode_t *key, void *user_data) 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; @@ -2809,6 +2977,8 @@ ACCOUNT_API int account_subscribe_create(account_subscribe_h *account_subscribe) 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; @@ -2833,6 +3003,8 @@ ACCOUNT_API int account_subscribe_notification(account_subscribe_h account_subsc 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; @@ -2909,6 +3081,8 @@ static void _account_subscribe_vconf_callback_ex(keynode_t *key, void *user_data 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; @@ -2926,6 +3100,8 @@ ACCOUNT_API int account_unsubscribe_notification_ex(account_subscribe_h account_ 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;