[NewAPI][Querying for deleted account information] 20/208720/6 accepted/tizen_5.5_unified accepted/tizen_5.5_unified_mobile_hotfix accepted/tizen_5.5_unified_wearable_hotfix tizen_5.5_mobile_hotfix tizen_5.5_tv tizen_5.5_wearable_hotfix accepted/tizen/5.5/unified/20191031.031010 accepted/tizen/5.5/unified/mobile/hotfix/20201027.065541 accepted/tizen/5.5/unified/wearable/hotfix/20201027.121447 accepted/tizen/unified/20191009.231701 submit/tizen/20191007.061836 submit/tizen_5.5/20191031.000002 submit/tizen_5.5_mobile_hotfix/20201026.185102 submit/tizen_5.5_wearable_hotfix/20201026.184302 tizen_5.5.m2_release
authorAbhishek Vijay <abhishek.v@samsung.com>
Thu, 27 Jun 2019 11:05:00 +0000 (16:35 +0530)
committerAbhishek Vijay <abhishek.v@samsung.com>
Fri, 27 Sep 2019 08:42:59 +0000 (14:12 +0530)
Change-Id: I88f0e3371a2771c19c65e8df9c6c359c6da56e86
Signed-off-by: Abhishek Vijay <abhishek.v@samsung.com>
Signed-off-by: Dewal Agarwal <d1.agarwal@samsung.com>
include/account.h
packaging/libaccount-service.spec
src/account.c

index 312b42a..639d3ed 100644 (file)
@@ -572,7 +572,7 @@ int account_set_user_name(account_h account, const char *user_name);
  * @retval  #ACCOUNT_ERROR_OUT_OF_MEMORY      Out of memory
  * @retval  #ACCOUNT_ERROR_NOT_SUPPORTED      Not supported
  *
- * @see account_get_display_name()
+ * @see account_set_display_name()
  */
 int account_get_display_name(account_h account, char **display_name);
 
@@ -1162,7 +1162,6 @@ int account_get_custom_all(account_h account, account_custom_cb callback, void *
  */
 int account_foreach_account_from_db(account_cb callback, void *user_data);
 
-
 /**
  * @brief  Retrieves an account with the account ID.
  *
@@ -1195,6 +1194,35 @@ int account_foreach_account_from_db(account_cb callback, void *user_data);
 int account_query_account_by_account_id(int account_db_id, account_h *account);
 
 /**
+ * @brief  Retrieves deleted account with the account ID.
+ *
+ * @since_tizen 5.5
+ * @privlevel   public
+ * @privilege   %http://tizen.org/privilege/account.read
+ * @remarks     The  @a account should be released using account_destroy().
+ *
+ * @param[in]   account_db_id  The id of the account to find in the database
+ * @param[out]  account        The account handle
+ *
+ * @return  @c 0 on success,
+ *          otherwise a negative error value
+ * @retval  #ACCOUNT_ERROR_NONE               Successful
+ * @retval  #ACCOUNT_ERROR_NOT_SUPPORTED      Not supported
+ * @retval  #ACCOUNT_ERROR_PERMISSION_DENIED  DB Access fail by permission
+ * @retval  #ACCOUNT_ERROR_INVALID_PARAMETER  Invalid parameter
+ * @retval  #ACCOUNT_ERROR_OUT_OF_MEMORY      Out of Memory
+ * @retval  #ACCOUNT_ERROR_DB_FAILED          Database operation failed
+ * @retval  #ACCOUNT_ERROR_DATABASE_BUSY      SQLite handler is busy
+ * @retval  #ACCOUNT_ERROR_DB_NOT_OPENED      Account database did not opened
+ *
+ * @see account_query_account_by_account_id()
+ * @see account_query_account_by_user_name()
+ * @see account_query_account_by_package_name()
+ * @see account_query_account_by_capability()
+ */
+int account_query_deleted_account_info_by_account_id(int account_db_id, account_h *account);
+
+/**
  * @brief  Retrieves all accounts with the user name.
  *
  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
@@ -1433,7 +1461,7 @@ int account_type_create(account_type_h *account_type);
  *
  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
  *
- * @remarks    When you get @a account_type_h using account_type_create(), you must release the handle using account_destroy() to avoid the memory leak.
+ * @remarks    When you get @a account_type using account_type_create(), you must release the handle using account_destroy() to avoid the memory leak.
  *
  * @param[in]  account_type  The account provider handle
  *
@@ -1595,7 +1623,7 @@ int account_type_get_small_icon_path(account_type_h account_type, char **small_i
  *
  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
  * @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.
+ *                                        It should be given by account_type_query_* functions or account_type_foreach_account_type_from_db().
  * @param[out]  multiple_account_support  The flag indicating support for multiple accounts accounts\n
  *                                        TRUE or FALSE.
  *
@@ -1899,8 +1927,6 @@ int account_subscribe_create(account_subscribe_h *account_subscribe);
  * @retval  #ACCOUNT_ERROR_INVALID_PARAMETER        Invalid parameter
  * @retval  #ACCOUNT_ERROR_NOT_SUPPORTED            Not supported
  *
- * @pre account_subscribe_create()
- *
  * @see account_unsubscribe_notification()
  * @see account_subscribe_notification()
  */
@@ -1912,7 +1938,7 @@ int account_subscribe_notification(account_subscribe_h account_subscribe, accoun
  * @since_tizen @if MOBILE 2.3 @elseif WEARABLE 3.0 @endif
  * @privlevel   public
  * @privilege   %http://tizen.org/privilege/account.read \n
- * @remarks     You must call @a account_unsubscribe_notification when you do not need to subscribe account event.
+ * @remarks     You must call account_unsubscribe_notification() when you do not need to subscribe account event.
  *
  * @param[in]   account_subscribe  The account subscription handle
  *
index eee2342..931cdf5 100644 (file)
@@ -1,6 +1,6 @@
 Name:       libaccount-service
 Summary:    Account DB library
-Version:    0.4.18
+Version:    0.4.19
 Release:    1
 Group:      Social & Content/API
 License:    Apache-2.0
index ccab17d..3891e6c 100644 (file)
@@ -297,7 +297,7 @@ ACCOUNT_API int account_delete_from_db_by_id(int account_db_id)
 
        _INFO("2. Before account_manager_call_account_query_account_by_account_id_sync");
        GVariant *account_serialized_old = NULL;
-       bool is_success = account_manager_call_account_query_account_by_account_id_sync(acc_mgr, account_db_id, (int)getuid(), &account_serialized_old, NULL, &error);
+       bool is_success = account_manager_call_account_query_account_by_account_id_sync(acc_mgr, account_db_id, (int)getuid(), false, &account_serialized_old, NULL, &error);
 
        if (!is_success) {
                error_code = _account_get_error_code(is_success, error);
@@ -457,7 +457,7 @@ ACCOUNT_API int account_update_to_db_by_id(account_h account, int account_id)
 
        _INFO("2. Before account_manager_call_account_query_account_by_account_id_sync");
        GVariant *account_serialized_old = NULL;
-       bool is_success = account_manager_call_account_query_account_by_account_id_sync(acc_mgr, account_id, (int)getuid(), &account_serialized_old, NULL, &error);
+       bool is_success = account_manager_call_account_query_account_by_account_id_sync(acc_mgr, account_id, (int)getuid(), false, &account_serialized_old, NULL, &error);
 
        if (!is_success) {
                error_code = _account_get_error_code(is_success, error);
@@ -525,7 +525,7 @@ ACCOUNT_INTERNAL_API int account_update_to_db_by_id_without_permission(account_h
        if (uid == 0)
                uid = getuid();
 
-       bool is_success = account_manager_call_account_query_account_by_account_id_sync(acc_mgr, account_id, (int)uid, &account_serialized_old, NULL, &error);
+       bool is_success = account_manager_call_account_query_account_by_account_id_sync(acc_mgr, account_id, (int)uid, false, &account_serialized_old, NULL, &error);
 
        if (!is_success) {
                error_code = _account_get_error_code(is_success, error);
@@ -583,7 +583,7 @@ ACCOUNT_API int account_update_to_db_by_user_name(account_h account, const char
 
        GVariant *account_serialized_old = NULL;
        account_s *account_data = (account_s *)account;
-       bool is_success = account_manager_call_account_query_account_by_account_id_sync(acc_mgr, account_data->id, (int)getuid(), &account_serialized_old, NULL, &error);
+       bool is_success = account_manager_call_account_query_account_by_account_id_sync(acc_mgr, account_data->id, (int)getuid(), false, &account_serialized_old, NULL, &error);
 
        if (!is_success) {
                error_code = _account_get_error_code(is_success, error);
@@ -1536,11 +1536,11 @@ ACCOUNT_API int account_foreach_account_from_db(account_cb callback, void *user_
        return ACCOUNT_ERROR_NONE;
 }
 
-ACCOUNT_API int account_query_account_by_account_id(int account_db_id, account_h *account)
+int _account_query_account_for_account_id(int account_db_id, account_h *account, bool query_del_acc)
 {
        CHECK_ACCOUNT_SUPPORTED(ACCOUNT_FEATURE);
 
-       _INFO("account_query_account_by_account_id start [%d]", account_db_id);
+       _INFO("_account_query_account_for_account_id start db_id [%d] del_acc [%d]", account_db_id, query_del_acc);
 
        ACCOUNT_RETURN_VAL((account_db_id > 0), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("ACCOUNT INDEX IS LESS THAN 0"));
        ACCOUNT_RETURN_VAL((account != NULL), {}, ACCOUNT_ERROR_INVALID_PARAMETER, ("ACCOUNT POINTER IS NULL"));
@@ -1559,7 +1559,7 @@ ACCOUNT_API int account_query_account_by_account_id(int account_db_id, account_h
                uid = 5001;
 
        GVariant *account_variant = NULL;
-       bool is_success = account_manager_call_account_query_account_by_account_id_sync(acc_mgr, account_db_id, (int)uid, &account_variant, NULL, &error);
+       bool is_success = account_manager_call_account_query_account_by_account_id_sync(acc_mgr, account_db_id, (int)uid, query_del_acc, &account_variant, NULL, &error);
        _account_manager_release_instance();
 
        int error_code = _account_get_error_code(is_success, error);
@@ -1583,11 +1583,25 @@ ACCOUNT_API int account_query_account_by_account_id(int account_db_id, account_h
 
        *input = account_data;
 
-       _INFO("account_query_account_by_account_id end");
+       _INFO("_account_query_account_for_account_id end");
 
        return ACCOUNT_ERROR_NONE;
 }
 
+ACCOUNT_API int account_query_account_by_account_id(int account_db_id, account_h *account)
+{
+       _INFO("account_query_account_by_account_id - account_db_id[%d]");
+
+       return _account_query_account_for_account_id(account_db_id, account, false);
+}
+
+ACCOUNT_API int account_query_deleted_account_info_by_account_id(int account_db_id, account_h *account)
+{
+       _INFO("account_query_deleted_account_info_by_account_id - account_db_id[%d]");
+
+       return _account_query_account_for_account_id(account_db_id, account, true);
+}
+
 ACCOUNT_API int account_query_account_by_user_name(account_cb callback, const char *user_name, void *user_data)
 {
        CHECK_ACCOUNT_SUPPORTED(ACCOUNT_FEATURE);