[NewAPI][Querying for deleted account information] 19/208719/1
authorAbhishek Vijay <abhishek.v@samsung.com>
Thu, 27 Jun 2019 11:03:39 +0000 (16:33 +0530)
committerAbhishek Vijay <abhishek.v@samsung.com>
Thu, 27 Jun 2019 11:03:39 +0000 (16:33 +0530)
Change-Id: I896471d45a90af6278c054cd77fc1be688e670a0
Signed-off-by: Abhishek Vijay <abhishek.v@samsung.com>
common/account_mgr.xml
common/src/account_db_helper.c

index 0278c68..7410f94 100644 (file)
@@ -46,6 +46,7 @@
     <method name="account_query_account_by_account_id">
       <arg type="i" name="account_db_id" direction="in" />
       <arg type="i" name="uid" direction="in" />
+      <arg type="b" name="query_del_acc" direction="in" />
       <arg type="a{sv}" name="account_data" direction="out" />
     </method>
     <method name="account_update_to_db_by_user_name">
index c0429b6..35f33c4 100644 (file)
@@ -1183,7 +1183,7 @@ static bool _account_add_custom_to_account_cb(const char *key, const char *value
 }
 
 int _account_query_by_account_id(sqlite3 *account_db_handle, account_add_capability_cb capability_cb,
-                                       account_add_custom_cb custom_cb, int account_id, void *user_data, bool is_deleted)
+                                       account_add_custom_cb custom_cb, int account_id, void *user_data, bool query_del_acc)
 {
        _INFO("_account_query_by_account_id start");
 
@@ -1201,7 +1201,7 @@ int _account_query_by_account_id(sqlite3 *account_db_handle, account_add_capabil
 
        /*check in proper tables of Capability & Account_Custom*/
        if (capability_cb != NULL) {
-               if (!is_deleted) {
+               if (!query_del_acc) {
                        _INFO("account query capability by account-id - original capability table");
                        ACCOUNT_SNPRINTF(query, sizeof(query), "SELECT * FROM %s WHERE account_id = %d", CAPABILITY_TABLE, account_id);
                } else {
@@ -1210,7 +1210,7 @@ int _account_query_by_account_id(sqlite3 *account_db_handle, account_add_capabil
                }
                query_for_capability = true;
        } else if (custom_cb != NULL) {
-               if (!is_deleted) {
+               if (!query_del_acc) {
                        _INFO("account query capability by account-id - original custom table");
                        ACCOUNT_SNPRINTF(query, sizeof(query), "SELECT * FROM %s WHERE AccountId = %d", ACCOUNT_CUSTOM_TABLE, account_id);
                } else {
@@ -1289,22 +1289,22 @@ CATCH:
        return error_code;
 }
 
-int _account_query_capability_by_account_id(sqlite3 *account_db_handle, account_add_capability_cb callback, int account_id, void *user_data, bool is_deleted)
+int _account_query_capability_by_account_id(sqlite3 *account_db_handle, account_add_capability_cb callback, int account_id, void *user_data, bool query_del_acc)
 {
        int error_code = _ACCOUNT_ERROR_NONE;
 
-       error_code = _account_query_by_account_id(account_db_handle, callback, NULL, account_id, user_data, is_deleted);
+       error_code = _account_query_by_account_id(account_db_handle, callback, NULL, account_id, user_data, query_del_acc);
 
        ACCOUNT_RETURN_VAL((error_code == _ACCOUNT_ERROR_NONE), {}, error_code, ("_account_query_by_account_id failed for capability"));
 
        return error_code;
 }
 
-int _account_query_custom_by_account_id(sqlite3 *account_db_handle, account_add_custom_cb callback, int account_id, void *user_data, bool is_deleted)
+int _account_query_custom_by_account_id(sqlite3 *account_db_handle, account_add_custom_cb callback, int account_id, void *user_data, bool query_del_acc)
 {
        int error_code = _ACCOUNT_ERROR_NONE;
 
-       error_code = _account_query_by_account_id(account_db_handle, NULL, callback, account_id, user_data, is_deleted);
+       error_code = _account_query_by_account_id(account_db_handle, NULL, callback, account_id, user_data, query_del_acc);
 
        ACCOUNT_RETURN_VAL((error_code == _ACCOUNT_ERROR_NONE), {}, error_code, ("_account_query_by_account_id failed for custom"));