if (!bus) {
MSAPI_DBG("Failed to get gdbus connection: %s", error->message);
g_error_free(error);
- return MS_MEDIA_ERR_INTERNAL;
+ return MS_MEDIA_ERR_SEND_NOTI_FAIL;
}
if (item == MS_MEDIA_ITEM_FILE) {
message = g_variant_new("(iiissis)", item, pid, update_type, path, uuid, media_type, mime_type);
} else {
MSAPI_DBG_ERR("uuid or mime_type is NULL");
- return MS_MEDIA_ERR_INVALID_PARAMETER;
+ return MS_MEDIA_ERR_SEND_NOTI_FAIL;
}
} else if (item == MS_MEDIA_ITEM_DIRECTORY) {
MSAPI_DBG("DIRECTORY CHANGED");
if (message == NULL) {
MSAPI_DBG_ERR("g_dbus_message_new_signal failed");
- return MS_MEDIA_ERR_INTERNAL;
+ return MS_MEDIA_ERR_SEND_NOTI_FAIL;
}
/* Send the signal */
g_object_unref(bus);
g_error_free(error);
}
- return MS_MEDIA_ERR_INTERNAL;
+ return MS_MEDIA_ERR_SEND_NOTI_FAIL;
}
g_object_unref(bus);
- /* Return TRUE to tell the event loop we want to be called again */
return MS_MEDIA_ERR_NONE;
}
typedef int (*SET_ITEM_VALIDITY_BEGIN)(int);
typedef int (*SET_ITEM_VALIDITY_END)(uid_t);
-typedef int (*SEND_DIR_UPDATE_NOTI)(sqlite3 *, const char *, const char *, const char *, int, int);
+typedef int (*SEND_DIR_UPDATE_NOTI)(const char *, const char *, int, int);
typedef int (*INSERT_ITEM)(sqlite3 *, const char *, const char *, int, uid_t);
typedef int (*SET_ITEM_VALIDITY)(const char *, const char *, int, int, uid_t);
typedef int (*DELETE_ITEM)(sqlite3 *, const char *, const char *, uid_t);
bool ms_delete_invalid_items(sqlite3 *handle, const char *storage_id, uid_t uid);
int ms_set_folder_item_validity(sqlite3 *handle, const char *storage_id, const char *path, int validity, int recursive, uid_t uid);
int ms_delete_invalid_items_in_folder(sqlite3 *handle, const char *storage_id, const char *path, bool is_recursive, uid_t uid);
-int ms_send_dir_update_noti(sqlite3 *handle, const char *storage_id, const char *path, const char *folder_id, ms_noti_type_e noti_type, int pid);
+int ms_send_dir_update_noti(const char *path, const char *folder_id, ms_noti_type_e noti_type, int pid);
int ms_update_folder_time(sqlite3 *handle, const char *storage_id, char *folder_path, uid_t uid);
int ms_get_storage_id(sqlite3 *handle, const char *path, char *storage_id, uid_t uid);
int ms_set_storage_scan_status(sqlite3 *handle, char *storage_id, media_scan_status_e scan_status, uid_t uid);
return ret;
}
-int ms_send_dir_update_noti(sqlite3 *handle, const char* storage_id, const char*path, const char*folder_id, ms_noti_type_e noti_type, int pid)
+int ms_send_dir_update_noti(const char*path, const char*folder_id, ms_noti_type_e noti_type, int pid)
{
int lib_index;
int ret = MS_MEDIA_ERR_NONE;
for (lib_index = 0; lib_index < lib_num; lib_index++) {
- ret = ((SEND_DIR_UPDATE_NOTI)func_array[lib_index][eSEND_DIR_UPDATE_NOTI])(handle, storage_id, path, folder_id, (int)noti_type, pid); /*dlopen*/
+ ret = ((SEND_DIR_UPDATE_NOTI)func_array[lib_index][eSEND_DIR_UPDATE_NOTI])(path, folder_id, (int)noti_type, pid); /*dlopen*/
MS_DBG_RETVM_IF(ret != MS_MEDIA_ERR_NONE, ret, "Error : %s", g_array_index(so_array, char*, lib_index));
}
char *folder_uuid = NULL;
ms_get_folder_id(handle, storage_id, extract_data->msg, &folder_uuid);
MS_DBG_WARN("storage_id = [%s], dir Path = [%s], folder_uuid = [%s], noti_type = [%d]", storage_id, update_path, folder_uuid, noti_type);
- ms_send_dir_update_noti(handle, storage_id, update_path, folder_uuid, noti_type, extract_data->pid);
+ ms_send_dir_update_noti(update_path, folder_uuid, noti_type, extract_data->pid);
}
extract_data->msg_type = MS_MSG_EXTRACTOR_COMPLETE;
msc_send_result(ret, extract_data);
__msc_set_storage_extract_status(MS_STORAGE_SCAN_COMPLETE);
/* send notification */
- ms_send_dir_update_noti(handle, extract_data->storage_id, update_path, NULL, MS_ITEM_UPDATE, extract_data->pid);
+ ms_send_dir_update_noti(update_path, NULL, MS_ITEM_UPDATE, extract_data->pid);
/* set vconf key db extract status */
__msc_extract_set_db_status(MS_DB_UPDATED);
goto STOP_DISC;
}
/*if (ret != MS_MEDIA_ERR_SCANNER_FORCE_STOP) {
- ms_send_dir_update_noti(handle, storage_id, scan_data->msg, folder_uuid, noti_type, scan_data->pid);
+ ms_send_dir_update_noti(scan_data->msg, folder_uuid, noti_type, scan_data->pid);
}*/
SCAN_DONE:
}
}
if (noti_type == MS_ITEM_DELETE) {
- ms_send_dir_update_noti(handle, storage_id, scan_data->msg, folder_uuid, noti_type, scan_data->pid);
+ ms_send_dir_update_noti(scan_data->msg, folder_uuid, noti_type, scan_data->pid);
}
msc_insert_exactor_request(scan_data->msg_type, TRUE, scan_data->storage_id, scan_data->msg, scan_data->pid, uid, noti_type);
}
}
/* send notification */
- /*ms_send_dir_update_noti(handle, scan_data->storage_id, update_path, NULL, MS_ITEM_UPDATE, scan_data->pid);*/
+ /*ms_send_dir_update_noti(update_path, NULL, MS_ITEM_UPDATE, scan_data->pid);*/
if (ret == MS_MEDIA_ERR_SCANNER_FORCE_STOP) {
ms_set_storage_scan_status(handle, scan_data->storage_id, MEDIA_SCAN_STOP, uid);
if (noti_type != MS_ITEM_DELETE)
ms_get_folder_id(handle, storage_id, scan_data->msg, &folder_uuid);
- ms_send_dir_update_noti(handle, storage_id, scan_data->msg, folder_uuid, noti_type, scan_data->pid);
+ ms_send_dir_update_noti(scan_data->msg, folder_uuid, noti_type, scan_data->pid);
}
if (power_off) {
}
/* send notification */
- ms_send_dir_update_noti(handle, storage_id, update_path, NULL, MS_ITEM_UPDATE, scan_data->pid);
+ ms_send_dir_update_noti(update_path, NULL, MS_ITEM_UPDATE, scan_data->pid);
if (ret == MS_MEDIA_ERR_SCANNER_FORCE_STOP)
ms_set_db_status(MS_DB_STOPPED, storage_type);
ret = __msc_dir_scan_meta_update(usr_path, INTERNAL_STORAGE_ID, scan_data->uid);
/* send notification */
- ms_send_dir_update_noti(handle, INTERNAL_STORAGE_ID, usr_path, NULL, MS_ITEM_UPDATE, scan_data->pid);
+ ms_send_dir_update_noti(usr_path, NULL, MS_ITEM_UPDATE, scan_data->pid);
MS_SAFE_FREE(usr_path);
/*__msc_dir_scan_meta_update For Each External Storage*/
ret = __msc_dir_scan_meta_update(stg_info->stg_path, stg_info->storage_id, scan_data->uid);
/* send notification */
- ms_send_dir_update_noti(handle, stg_info->storage_id, stg_info->stg_path, NULL, MS_ITEM_UPDATE, scan_data->pid);
+ ms_send_dir_update_noti(stg_info->stg_path, NULL, MS_ITEM_UPDATE, scan_data->pid);
MS_SAFE_FREE(stg_info->stg_path);
MS_SAFE_FREE(stg_info->storage_id);