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;
success = ad->send_data.tr_success;
fail = ad->send_data.tr_fail;
- if (success == 0)
- title = "IDS_BT_MBODY_SENDING_FAILED";
- else
- title = "IDS_BT_MBODY_FILE_SENT";
+ if (success == 0) {
+ title = g_strdup("IDS_BT_MBODY_SENDING_FAILED");
+ } else {
+ stms_str = BT_STR_FILES_SENT_TO;
+ title = g_strdup_printf(stms_str, dev_name);
+ }
if (success == 0 && fail > 0)
- content = "IDS_BT_SBODY_PD_FAILED_ABB";
+ content = g_strdup("IDS_BT_SBODY_PD_FAILED_ABB");
else if (fail == 0 && success > 0)
- content = "IDS_BT_SBODY_PD_SUCCEEDED_ABB";
+ content = g_strdup("IDS_BT_SBODY_PD_SUCCEEDED_ABB");
else
- content = "IDS_BT_SBODY_P1SD_SUCCEEDED_P2SD_FAILED_ABB2";
+ content = g_strdup("IDS_BT_SBODY_P1SD_SUCCEEDED_P2SD_FAILED_ABB2");
icon_path = BT_ICON_NOTIFICATION_SENT;
indicator_icon_path = BT_ICON_NOTIFICATION_SENT_INDICATOR;
success = ad->recv_data.tr_success;
fail = ad->recv_data.tr_fail;
- title = "IDS_BT_MBODY_FILE_RECEIVED";
if (success == 0 && fail > 0) {
content = "IDS_BT_SBODY_PD_FAILED_ABB";
- title = "IDS_BT_MBODY_RECEIVING_FAILED";
+ title = g_strdup("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);
content = "IDS_BT_SBODY_PD_SUCCEEDED_ABB";
} else {
+ stms_str = BT_STR_FILES_RECEIVED_FROM;
+ title = g_strdup_printf(stms_str, dev_name);
content = "IDS_BT_SBODY_P1SD_SUCCEEDED_P2SD_FAILED_ABB2";
}
icon_path = BT_ICON_NOTIFICATION_RECEIVED;
app_id = NOTI_OPS_APP_ID;
noti_type = NOTIFICATION_TYPE_NOTI;
} else if (type == BT_SENDING_NOTI) {
- title = "IDS_BT_SBODY_PREPARING_TO_SEND_FILES_ING_ABB";
+ title = g_strdup("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 = "IDS_BT_SBODY_PREPARING_TO_RECEIVE_FILES_ING_ABB";
+ title = g_strdup("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);
- retvm_if(!noti, NULL, "Fail to notification_create");
+ if (!noti) {
+ ERR("Fail to notification_create");
+ g_free(title);
+ return NULL;
+ }
notification_set_text_domain(noti, BT_COMMON_PKG, BT_COMMON_RES);
ret = notification_set_text(noti, NOTIFICATION_TEXT_TYPE_TITLE,
NULL, title,
NOTIFICATION_VARIABLE_TYPE_NONE);
+ free(title);
warn_if(ret != NOTIFICATION_ERROR_NONE,
"Fail to notification_set_text [%d]", ret);
}