From: Kyeonghun Lee Date: Mon, 10 Oct 2016 07:41:46 +0000 (+0900) Subject: [TSAM-8527] set proper applist for notification X-Git-Tag: submit/tizen/20161011.092348^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=178d19131e4f413dc96150e29f45525a21f9a54f;p=platform%2Fcore%2Fmessaging%2Fmsg-service.git [TSAM-8527] set proper applist for notification Change-Id: I9ec0e547b7f58ac4aa1d3f1423a65a49d12ba1c6 Signed-off-by: Kyeonghun Lee --- diff --git a/manager/inc/msg-manager-notification.h b/manager/inc/msg-manager-notification.h index 1367fbb..b672ace 100644 --- a/manager/inc/msg-manager-notification.h +++ b/manager/inc/msg-manager-notification.h @@ -197,7 +197,13 @@ #define MSG_ACTIVE_NOTI_BUTTON_NUM 3 #define MAX_QUERY_LEN 4096 - +#define MSG_ACTIVE_NOTI_BUTTON_NUM_NONE 0 +#define MSG_ACTIVE_NOTI_BUTTON_NUM_NORMAL_MESSAGE 3 +#define MSG_ACTIVE_NOTI_BUTTON_NUM_UNRETRIVED_MESSAGE 1 +#define MSG_ACTIVE_NOTI_BUTTON_NUM_UNKNOWN_SENDER 1 +#define MSG_ACTIVE_NOTI_BUTTON_NUM_CB_MESSAGE 1 +#define MSG_ACTIVE_NOTI_BUTTON_NUM_PUSH_MESSAGE 1 +#define MSG_ACTIVE_NOTI_BUTTON_NUM_CLASS0_MESSAGE 1 typedef unsigned char msg_mgr_notification_type_t; /* _msg_notification_type_e */ typedef unsigned char msg_mgr_active_notification_type_t; /* _msg_active_notification_type_e */ diff --git a/manager/src/msg-manager-notification.cpp b/manager/src/msg-manager-notification.cpp index 9412bd3..2f85874 100644 --- a/manager/src/msg-manager-notification.cpp +++ b/manager/src/msg-manager-notification.cpp @@ -358,7 +358,7 @@ int MsgMgrInsertOnlyActiveNotification(msg_mgr_notification_type_t noti_type, MS MSG_MGR_NOTI_INFO_S noti_info = {0, }; noti_info.type = noti_type; - noti_info.active_noti_button_num = 1; + noti_info.active_noti_button_num = MSG_ACTIVE_NOTI_BUTTON_NUM_CLASS0_MESSAGE; createActiveInfoData(¬i_info, msg_info); @@ -1444,7 +1444,7 @@ void setNotification(notification_h noti_h, MSG_MGR_NOTI_INFO_S *noti_info, bool MSG_MGR_DEBUG("active num [%d]", noti_info->active_noti_button_num); - if (bFeedback && noti_info->active_noti_button_num > 0 && + if (bFeedback && noti_info->active_noti_button_num > MSG_ACTIVE_NOTI_BUTTON_NUM_NONE && ((noti_info->type >= MSG_MGR_NOTI_TYPE_NORMAL && noti_info->type <= MSG_MGR_NOTI_TYPE_SIM) || noti_info->type == MSG_MGR_NOTI_TYPE_CLASS0)) { notification_h active_noti_h = notification_create(NOTIFICATION_TYPE_NOTI); @@ -1711,22 +1711,22 @@ int getLatestMsgInfo(MSG_MGR_NOTI_INFO_S *noti_info, bool isForInstantMessage) } if (i == 1) { - noti_info->active_noti_button_num = 1; + noti_info->active_noti_button_num = MSG_ACTIVE_NOTI_BUTTON_NUM_UNKNOWN_SENDER; } } else { char *senderStr = NULL; if (subType == MSG_CB_SMS) { senderStr = get_translate_text(MSG_APP_PACKAGE_NAME, MSG_APP_LOCALEDIR, CB_MESSAGE); g_strlcat(noti_info->sender, senderStr, sizeof(noti_info->sender)-strlen(noti_info->sender)); - noti_info->active_noti_button_num = 1; + noti_info->active_noti_button_num = MSG_ACTIVE_NOTI_BUTTON_NUM_CB_MESSAGE; } else if (subType == MSG_SYNCML_CP) { senderStr = get_translate_text(MSG_APP_PACKAGE_NAME, MSG_APP_LOCALEDIR, CP_MESSAGE); g_strlcat(noti_info->sender, senderStr, sizeof(noti_info->sender)-strlen(noti_info->sender)); - noti_info->active_noti_button_num = 1; + noti_info->active_noti_button_num = MSG_ACTIVE_NOTI_BUTTON_NUM_PUSH_MESSAGE; } else if (subType == MSG_WAP_SI_SMS || subType == MSG_WAP_SL_SMS) { senderStr = get_translate_text(MSG_APP_PACKAGE_NAME, MSG_APP_LOCALEDIR, PUSH_MESSAGE); g_strlcat(noti_info->sender, senderStr, sizeof(noti_info->sender)-strlen(noti_info->sender)); - noti_info->active_noti_button_num = 1; + noti_info->active_noti_button_num = MSG_ACTIVE_NOTI_BUTTON_NUM_PUSH_MESSAGE; } else { g_strlcat(noti_info->sender, tmpAddressInfo.addressVal, sizeof(noti_info->sender)-strlen(noti_info->sender)); } @@ -2613,24 +2613,28 @@ void createInfoData(MSG_MGR_NOTI_INFO_S *noti_info, msg_mgr_active_notification_ addServiceExtraData(noti_info->svc_h, "msgId", noti_info->msg_id); addServiceExtraData(noti_info->svc_h, "http://tizen.org/appcontrol/data/notification", "new_message"); - if (noti_info->active_noti_button_num == 0) - noti_info->active_noti_button_num = 3; + if (active_noti == MSG_MGR_ACTIVE_NOTI_TYPE_ACTIVE) { + if (noti_info->active_noti_button_num == MSG_ACTIVE_NOTI_BUTTON_NUM_NONE) + noti_info->active_noti_button_num = MSG_ACTIVE_NOTI_BUTTON_NUM_NORMAL_MESSAGE; - int activated_conv_id = -1; - vconf_get_int(VCONFKEY_MESSAGE_ACTIVATED_CONVERSATION_ID, &activated_conv_id); + int activated_conv_id = -1; + vconf_get_int(VCONFKEY_MESSAGE_ACTIVATED_CONVERSATION_ID, &activated_conv_id); - if (activated_conv_id == -1) { - noti_info->applist = NOTIFICATION_DISPLAY_APP_NOTIFICATION_TRAY|NOTIFICATION_DISPLAY_APP_LOCK|NOTIFICATION_DISPLAY_APP_INDICATOR; - } else if (activated_conv_id == 0) { - noti_info->active_noti_button_num = 0; - noti_info->applist = NOTIFICATION_DISPLAY_APP_NOTIFICATION_TRAY|NOTIFICATION_DISPLAY_APP_LOCK|NOTIFICATION_DISPLAY_APP_INDICATOR|NOTIFICATION_DISPLAY_APP_TICKER; - } else if (activated_conv_id > 0){ - noti_info->active_noti_button_num = 0; - - if (activated_conv_id != noti_info->conv_id) + if (activated_conv_id == -1) { + noti_info->applist = NOTIFICATION_DISPLAY_APP_NOTIFICATION_TRAY|NOTIFICATION_DISPLAY_APP_LOCK|NOTIFICATION_DISPLAY_APP_INDICATOR; + } else if (activated_conv_id == 0) { + noti_info->active_noti_button_num = MSG_ACTIVE_NOTI_BUTTON_NUM_NONE; noti_info->applist = NOTIFICATION_DISPLAY_APP_NOTIFICATION_TRAY|NOTIFICATION_DISPLAY_APP_LOCK|NOTIFICATION_DISPLAY_APP_INDICATOR|NOTIFICATION_DISPLAY_APP_TICKER; - else - MSG_MGR_WARN("No adding Notification : activated conv id [%d] / notification conv id [%d]", activated_conv_id, noti_info->conv_id); + } else if (activated_conv_id > 0){ + noti_info->active_noti_button_num = MSG_ACTIVE_NOTI_BUTTON_NUM_NONE; + + if (activated_conv_id != noti_info->conv_id) + noti_info->applist = NOTIFICATION_DISPLAY_APP_NOTIFICATION_TRAY|NOTIFICATION_DISPLAY_APP_LOCK|NOTIFICATION_DISPLAY_APP_INDICATOR|NOTIFICATION_DISPLAY_APP_TICKER; + else + MSG_MGR_WARN("No adding Notification : activated conv id [%d] / notification conv id [%d]", activated_conv_id, noti_info->conv_id); + } + } else { + noti_info->applist = NOTIFICATION_DISPLAY_APP_NOTIFICATION_TRAY|NOTIFICATION_DISPLAY_APP_LOCK|NOTIFICATION_DISPLAY_APP_INDICATOR; } break; @@ -2651,7 +2655,7 @@ void createInfoData(MSG_MGR_NOTI_INFO_S *noti_info, msg_mgr_active_notification_ else noti_info->applist = NOTIFICATION_DISPLAY_APP_NOTIFICATION_TRAY|NOTIFICATION_DISPLAY_APP_INDICATOR; - noti_info->active_noti_button_num = 1; + noti_info->active_noti_button_num = MSG_ACTIVE_NOTI_BUTTON_NUM_CB_MESSAGE; break; } case MSG_MGR_NOTI_TYPE_SIM: { @@ -2670,8 +2674,8 @@ void createInfoData(MSG_MGR_NOTI_INFO_S *noti_info, msg_mgr_active_notification_ else noti_info->applist = NOTIFICATION_DISPLAY_APP_NOTIFICATION_TRAY|NOTIFICATION_DISPLAY_APP_INDICATOR; - if (noti_info->active_noti_button_num == 0) - noti_info->active_noti_button_num = 3; + if (noti_info->active_noti_button_num == MSG_ACTIVE_NOTI_BUTTON_NUM_NONE) + noti_info->active_noti_button_num = MSG_ACTIVE_NOTI_BUTTON_NUM_NORMAL_MESSAGE; break; } case MSG_MGR_NOTI_TYPE_FAILED: { @@ -2698,7 +2702,7 @@ void createInfoData(MSG_MGR_NOTI_INFO_S *noti_info, msg_mgr_active_notification_ } if (active_noti != MSG_MGR_ACTIVE_NOTI_TYPE_ACTIVE) - noti_info->active_noti_button_num = 0; + noti_info->active_noti_button_num = MSG_ACTIVE_NOTI_BUTTON_NUM_NONE; MSG_MGR_END(); }