char *address, char *db_sid);
int _bt_update_notification(bt_appdata_t *ad, notification_h noti,
- char *title, char *content, char *icon_path, char *opc_count);
+ char *title, char *content, char *dev_name, char *icon_path, char *opc_count);
int _bt_update_notification_progress(notification_h noti,
int id,
bd_addr, NULL);
} else {
_bt_update_notification(ad, ad->send_noti,
- NULL, NULL, NULL, NULL);
+ NULL, NULL, NULL, NULL, NULL);
}
g_free(file_path);
if ((ad->send_data.tr_success + ad->send_data.tr_fail) != 0) {
_bt_update_notification(ad, ad->send_noti,
- NULL, NULL, NULL, NULL);
+ NULL, NULL, NULL, NULL, NULL);
} else {
_bt_delete_notification(ad->send_noti);
}
if ((ad->recv_data.tr_success + ad->recv_data.tr_fail) != 0) {
_bt_update_notification(ad, ad->receive_noti,
- NULL, NULL, NULL, NULL);
+ NULL, NULL, NULL, NULL, NULL);
} else {
_bt_delete_notification(ad->receive_noti);
}
int mmc_status = 0;
int default_memory = 0;
int ret = NOTIFICATION_ERROR_NONE;
+ char *root_path = NULL;
+ char *download_path = NULL;
DBG_SECURE("key=%s", vconf_keynode_get_name(node));
bt_appdata_t *ad = (bt_appdata_t *)data;
DBG_SECURE("Default Memory set to Phone");
}
}
+ } else if (mmc_status == VCONFKEY_SYSMAN_MMC_MOUNTED) {
+ vconf_get_int(VCONFKEY_SETAPPL_DEFAULT_MEM_BLUETOOTH_INT, &default_memory);
+ if (default_memory == BT_DEFAULT_MEM_MMC) /* MMC */ {
+ download_path = _bt_share_get_storage_path(default_memory);
+ root_path = _bt_share_get_storage_path(default_memory);
+
+ if (download_path == NULL)
+ download_path = g_strdup(BT_DOWNLOAD_DEFAULT_MEDIA_FOLDER);
+
+ if (root_path == NULL)
+ root_path = g_strdup(BT_DOWNLOAD_DEFAULT_MEDIA_FOLDER);
+
+ } else {
+ download_path = g_strdup(BT_DOWNLOAD_DEFAULT_MEDIA_FOLDER);
+ root_path = g_strdup(BT_DOWNLOAD_DEFAULT_MEDIA_FOLDER);
+ }
+
+ if (access(download_path, W_OK) != 0) {
+ warn_if(mkdir(download_path, 0755) < 0,
+ "mkdir fail![%s]", download_path);
+ }
+
+ bluetooth_obex_server_set_root(root_path);
+ bluetooth_obex_server_set_destination_path(download_path);
+
+ g_free(download_path);
+ g_free(root_path);
}
}
notification_h noti = NULL;
notification_error_e ret = NOTIFICATION_ERROR_NONE;
notification_type_e noti_type = NOTIFICATION_TYPE_NONE;
- char *stms_str = NULL;
char *title = NULL;
char *content = NULL;
char *icon_path = NULL;
int flag = -1;
int success = 0;
int fail = 0;
+ bool include_name_param = false;
DBG("Create notification type : %d", type);
fail = ad->send_data.tr_fail;
if (success == 0) {
- title = g_strdup("IDS_BT_MBODY_SENDING_FAILED");
+ title = "IDS_BT_MBODY_SENDING_FAILED";
} else {
- stms_str = BT_STR_FILES_SENT_TO;
- title = g_strdup_printf(stms_str, dev_name);
+ title = "IDS_WIFI_BODY_FILES_SENT_TO_PS_M_STATUS";
+ include_name_param = true;
}
if (success == 0 && fail > 0)
- content = g_strdup("IDS_BT_SBODY_PD_FAILED_ABB");
+ content = "IDS_BT_SBODY_PD_FAILED_ABB";
else if (fail == 0 && success > 0)
- content = g_strdup("IDS_BT_SBODY_PD_SUCCEEDED_ABB");
+ content = "IDS_BT_SBODY_PD_SUCCEEDED_ABB";
else
- content = g_strdup("IDS_BT_SBODY_P1SD_SUCCEEDED_P2SD_FAILED_ABB2");
+ content = "IDS_BT_SBODY_P1SD_SUCCEEDED_P2SD_FAILED_ABB2";
icon_path = BT_ICON_NOTIFICATION_SENT;
indicator_icon_path = BT_ICON_NOTIFICATION_SENT_INDICATOR;
if (success == 0 && fail > 0) {
content = "IDS_BT_SBODY_PD_FAILED_ABB";
- title = g_strdup("IDS_BT_MBODY_RECEIVING_FAILED");
+ title = "IDS_BT_MBODY_RECEIVING_FAILED";
} else if (fail == 0 && success > 0) {
- stms_str = BT_STR_FILES_RECEIVED_FROM;
- title = g_strdup_printf(stms_str, dev_name);
+ title = "IDS_WIFI_MBODY_FILES_RECEIVED_FROM_PS";
content = "IDS_BT_SBODY_PD_SUCCEEDED_ABB";
+ include_name_param = true;
} else {
- stms_str = BT_STR_FILES_RECEIVED_FROM;
- title = g_strdup_printf(stms_str, dev_name);
+ title = "IDS_WIFI_MBODY_FILES_RECEIVED_FROM_PS";
content = "IDS_BT_SBODY_P1SD_SUCCEEDED_P2SD_FAILED_ABB2";
+ include_name_param = true;
}
icon_path = BT_ICON_NOTIFICATION_RECEIVED;
indicator_icon_path = BT_ICON_NOTIFICATION_RECEIVED_INDICATOR;
app_id = NOTI_OPS_APP_ID;
noti_type = NOTIFICATION_TYPE_NOTI;
} else if (type == BT_SENDING_NOTI) {
- title = g_strdup("IDS_BT_SBODY_PREPARING_TO_SEND_FILES_ING_ABB");
+ title = "IDS_BT_SBODY_PREPARING_TO_SEND_FILES_ING_ABB";
icon_path = BT_ICON_NOTIFICATION_SENDING;
indicator_icon_path = BT_ICON_NOTIFICATION_SENDING_INDICATOR;
flag = NOTIFICATION_PROP_DISABLE_TICKERNOTI;
noti_type = NOTIFICATION_TYPE_ONGOING;
} else if (type == BT_RECEIVING_NOTI) {
- title = g_strdup("IDS_BT_SBODY_PREPARING_TO_RECEIVE_FILES_ING_ABB");
+ title = "IDS_BT_SBODY_PREPARING_TO_RECEIVE_FILES_ING_ABB";
icon_path = BT_ICON_NOTIFICATION_RECEIVING;
indicator_icon_path = BT_ICON_NOTIFICATION_RECEIVING_INDICATOR;
flag = NOTIFICATION_PROP_DISABLE_TICKERNOTI;
noti = notification_create(noti_type);
if (!noti) {
ERR("Fail to notification_create");
- g_free(title);
return NULL;
}
notification_set_text_domain(noti, BT_COMMON_PKG, BT_COMMON_RES);
if (title) {
- ret = notification_set_text(noti, NOTIFICATION_TEXT_TYPE_TITLE,
- NULL, title,
- NOTIFICATION_VARIABLE_TYPE_NONE);
- free(title);
+ if (include_name_param == true) {
+ ret = notification_set_text(noti, NOTIFICATION_TEXT_TYPE_TITLE,
+ NULL, title,
+ NOTIFICATION_VARIABLE_TYPE_STRING, dev_name,
+ NOTIFICATION_VARIABLE_TYPE_NONE);
+ } else {
+ ret = notification_set_text(noti, NOTIFICATION_TEXT_TYPE_TITLE,
+ NULL, title,
+ NOTIFICATION_VARIABLE_TYPE_NONE);
+ }
warn_if(ret != NOTIFICATION_ERROR_NONE,
"Fail to notification_set_text [%d]", ret);
}
}
int _bt_update_notification(bt_appdata_t *ad,
- notification_h noti, char *title, char *content, char *icon_path,
- char *opc_count)
+ notification_h noti, char *title, char *content, char *dev_name,
+ char *icon_path, char *opc_count)
{
retvm_if(!noti, BT_SHARE_FAIL, "noti is NULL");
NOTIFICATION_VARIABLE_TYPE_NONE);
}
} else {
- ret = notification_set_text(noti, NOTIFICATION_TEXT_TYPE_CONTENT,
- NULL, content, NOTIFICATION_VARIABLE_TYPE_NONE);
+ if (dev_name) {
+ ret = notification_set_text(noti, NOTIFICATION_TEXT_TYPE_CONTENT,
+ NULL, content,
+ NOTIFICATION_VARIABLE_TYPE_STRING, dev_name,
+ NOTIFICATION_VARIABLE_TYPE_NONE);
+ } else {
+ ret = notification_set_text(noti, NOTIFICATION_TEXT_TYPE_CONTENT,
+ NULL, content, NOTIFICATION_VARIABLE_TYPE_NONE);
+ }
}
warn_if(ret != NOTIFICATION_ERROR_NONE,
ad->send_data.tr_success = snd_noti_info->send_data.tr_success;
ad->send_data.tr_fail = snd_noti_info->send_data.tr_fail;
_bt_update_notification(ad, ad->send_noti, NULL, NULL,
- NULL, NULL);
+ NULL, NULL, NULL);
}
/* Update Database with Notification ID*/
__bt_update_db_with_noti_id(BT_DB_OUTBOUND, snd_noti_info->send_noti,
_bt_update_transfer_list_view("outbound");
if (ad->opc_noti && is_tr_wait == false) {
- char *tmp = BT_STR_SENDING_FILES_TO;
- char *sending_files = g_strdup_printf(tmp, node->name);
- _bt_update_notification(ad, ad->opc_noti, name, sending_files, NULL, opc_cnt);
+ char *sending_files = "IDS_WIFI_BODY_SENDING_FILES_TO_PS_ING";
+ _bt_update_notification(ad, ad->opc_noti, name, sending_files, node->name, NULL, opc_cnt);
_bt_update_notification_progress(NULL, ad->opc_noti_id, 0);
- g_free(sending_files);
}
g_free(opc_cnt);
if (ad->opc_noti) {
if (is_tr_wait == true) {
- char *tmp = BT_STR_SENDING_FILES_TO;
- char *sending_files = g_strdup_printf(tmp, node->name);
+ char *sending_files = "IDS_WIFI_BODY_SENDING_FILES_TO_PS_ING";
if (node->file_cnt > 1)
opc_cnt = g_strdup_printf("[%d/%d]", send_index, node->file_cnt);
_bt_update_notification(ad, ad->opc_noti, name, sending_files,
- NULL, opc_cnt);
+ node->name, NULL, opc_cnt);
g_free(opc_cnt);
- g_free(sending_files);
is_tr_wait = false;
}
_bt_update_notification_progress(NULL, ad->opc_noti_id, percentage);
name = client_info->filename;
if (ad->opc_noti && is_tr_wait == true) {
- char *tmp = BT_STR_SENDING_FILES_TO;
- char *sending_files = g_strdup_printf(tmp, node->name);
+ char *sending_files = "IDS_WIFI_BODY_SENDING_FILES_TO_PS_ING";
if (node->file_cnt > 1)
opc_cnt = g_strdup_printf("[%d/%d]", send_index, node->file_cnt);
- _bt_update_notification(ad, ad->opc_noti, name, sending_files, NULL, opc_cnt);
+ _bt_update_notification(ad, ad->opc_noti, name, sending_files, node->name, NULL, opc_cnt);
g_free(opc_cnt);
- g_free(sending_files);
is_tr_wait = false;
}
transfer_info->transfer_id);
}
- char *tmp = BT_STR_RECEIVING_FILES_FROM;
-
#ifdef ENABLE_CONTACTS_SERVICE2
{
+#if 0
int contact_id = -1;
if (transfer_info->contact_auth_info) {
DBG_SECURE("contact_id: %d | contact_name: [%s]", contact_id, contact_name);
}
}
- char *receiving_files = g_strdup_printf(tmp,
- contact_name ? contact_name : transfer_info->device_name);
+#endif
+ char *receiving_files = "IDS_WIFI_BODY_RECEIVING_FILES_FROM_PS_ING";
}
#else
- char *receiving_files = g_strdup_printf(tmp, transfer_info->device_name);
+ char *receiving_files = "IDS_WIFI_BODY_RECEIVING_FILES_FROM_PS_ING";
#endif
INFO("Notification data: %p", data);
if (data) {
_bt_update_notification(ad, data->noti_handle,
- transfer_info->filename, receiving_files, NULL, opc_cnt);
+ transfer_info->filename, receiving_files,
+ transfer_info->device_name, NULL, opc_cnt);
_bt_update_notification_progress(data->noti_handle,
data->noti_id, 0);
}
mkdir -p %{buildroot}%{upgrade_script_path}
mkdir -p %{buildroot}%{upgrade_data_path}
-cp -f packaging/bluetooth-share_upgrade.sh %{buildroot}%{upgrade_script_path}
+cp -f packaging/500.bluetooth-share_upgrade.sh %{buildroot}%{upgrade_script_path}
cp -f packaging/init_db.sh %{buildroot}%{upgrade_data_path}
%post
#%{_datadir}/dbus-1/system-services/org.bluetooth.share.service
%{TZ_COMM_DATA}/%{name}/init_db.sh
%{_libdir}/systemd/system/bluetooth-share.service
-%{upgrade_script_path}/bluetooth-share_upgrade.sh
+%{upgrade_script_path}/500.bluetooth-share_upgrade.sh
%{upgrade_data_path}/init_db.sh
%files -n libbluetooth-share