#endif
#include <pthread.h>
#include <vconf.h>
+#include <pkgmgr_installer_info.h>
#include <dbg.h>
#include <account-private.h>
GVariant *account_serialized_old = NULL;
_INFO("before query() account_id[%d]", account_id);
- bool is_success = account_manager_call_account_query_account_by_account_id_sync(acc_mgr, account_id, (int)getuid(), &account_serialized_old, NULL, &error);
+
+ uid_t uid = -1;
+ if (pkgmgr_installer_info_get_target_uid(&uid) < 0) {
+ _ERR("pkgmgr_installer_info_get_target_uid() fail");
+ return ACCOUNT_ERROR_DB_NOT_OPENED;
+ }
+ bool is_success = account_manager_call_account_query_account_by_account_id_sync(acc_mgr, account_id, (int)uid, &account_serialized_old, NULL, &error);
if (!is_success) {
error_code = _account_get_error_code(is_success, error);
}
GVariant *account_list_variant = NULL;
+
+ uid_t uid = -1;
+ if (pkgmgr_installer_info_get_target_uid(&uid) < 0) {
+ _ERR("pkgmgr_installer_info_get_target_uid() fail");
+ return ACCOUNT_ERROR_DB_NOT_OPENED;
+ }
+
bool is_success = account_manager_call_account_query_account_by_package_name_sync(acc_mgr, package_name, (int)getuid(), &account_list_variant, NULL, &error);
_account_manager_release_instance();
int db_id = -1;
GVariant *account_type_serialized = marshal_account_type((account_type_s *)account_type);
- bool is_success = account_manager_call_account_type_add_sync(acc_mgr, account_type_serialized, (int)getuid(), &db_id, NULL, &error);
+
+ uid_t uid = -1;
+ if (pkgmgr_installer_info_get_target_uid(&uid) < 0) {
+ _ERR("pkgmgr_installer_info_get_target_uid() fail");
+ return ACCOUNT_ERROR_DB_NOT_OPENED;
+ }
+
+ bool is_success = account_manager_call_account_type_add_sync(acc_mgr, account_type_serialized, (int)uid, &db_id, NULL, &error);
_account_manager_release_instance();
int ret = _account_get_error_code(is_success, error);
return ACCOUNT_ERROR_PERMISSION_DENIED;
}
- bool is_success = account_manager_call_account_type_delete_by_app_id_sync(acc_mgr, app_id, (int)getuid(), NULL, &error);
+ uid_t uid = -1;
+ if (pkgmgr_installer_info_get_target_uid(&uid) < 0) {
+ _ERR("pkgmgr_installer_info_get_target_uid() fail");
+ return ACCOUNT_ERROR_DB_NOT_OPENED;
+ }
+ bool is_success = account_manager_call_account_type_delete_by_app_id_sync(acc_mgr, app_id, (int)uid, NULL, &error);
_account_manager_release_instance();
error_code = _account_get_error_code(is_success, error);