跟綜下來發現control_sound這個函數中if (behavior == MMI_NOTI_SND_BEHA_NO_PLAY){#ifdef MMI_NOTI_MGR_UTplay_sound = MMI_FALSE;snd_action = action;play_sound_id = to ...
跟綜下來發現control_sound這個函數中
if (behavior == MMI_NOTI_SND_BEHA_NO_PLAY)
{
#ifdef MMI_NOTI_MGR_UT
play_sound = MMI_FALSE;
snd_action = action;
play_sound_id = tone_id;
#endif /* MMI_NOTI_MGR_UT */
return;
}返回了.
修改方法:
關註//add begin和//add end 之間的語句。
static MMI_BOOL
control_notification(
U8 notification_type,
notification_info_struct *noti_info)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
mmi_app_scenario_struct noti_scen, active_scen;
mmi_app_behavior_struct internal_behavior;
mmi_scenario_id active_scen_id;
MMI_BOOL display_scrn = MMI_FALSE;
const mmi_events_notify_struct *notify_event_info = NULL;
mmi_nmgr_behavior_enum attri_action;
mmi_attribute_action_struct action_struct;
MMI_BOOL is_stop_tone = MMI_FALSE;
MMI_BOOL is_stop_vib = MMI_FALSE;
MMI_BOOL is_stop_text_preview = MMI_FALSE;
#ifdef __MMI_NSS_SUPPORT__
U16 notification_setting_value = 0;
#endif
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
#ifdef __DM_LAWMO_SUPPORT__
if (mmi_dmui_is_phone_lock() && (notification_type ==
MMI_NOTIFY_COMM_POPUP))
{
MMI_TRACE(MMI_FW_TRC_G1_FRM, TRC_MMI_FRM_NMGR_DISBALE_NMGR_BY_DM_LOCK);
return MMI_FALSE;
}
#endif
if (mmi_frm_has_no_scenario_been_started() == MMI_TRUE)
{
return MMI_FALSE;
}
if (g_enable_nmgr == MMI_FALSE)
{
return MMI_FALSE;
}
active_scen_id = mmi_frm_get_active_scenario_id();
get_scenario_info(noti_info->noti_scen_id, ¬i_scen);
get_scenario_info(active_scen_id, &active_scen);
compare_scenario_and_get_behavior(active_scen_id, noti_info->noti_scen_id,
&internal_behavior);
if( active_scen.scrn_priority >= MMI_SCEN_SCRN_PRIO_HIGH)
{
is_stop_text_preview = MMI_TRUE;
}
/* Get notify configuration information by user to decide the action of
each attribute. */
notify_event_info = mmi_nmgr_get_event_notify_info(noti_info->notify_type,
active_scen_id);
MMI_ASSERT(NULL != notify_event_info);
attri_action = notify_event_info->behavior;
parse_attri_action(attri_action, &action_struct);
if (notification_type == MMI_NOTIFY_BY_IDLE)
{/* App handle screen work flow, may add extra info, like setting key,
scrn handler */
MMI_ASSERT(noti_info->scrn_func_ptr == NULL && noti_info->arg == NULL);
/* Won't check screen behavior since this kind of screen will be displayed
when goback to idle */
display_scrn = control_idle_screen(noti_info->noti_scen_id, noti_info-
>notify_type, noti_scen.scrn_priority, noti_info->string,
internal_behavior.scrn_behavior);
}
else if (notification_type == MMI_NOTIFY_BY_APP)
{/* App may not display screen for some special case */
display_scrn = control_app_screen(
noti_info->noti_scen_id,
noti_scen.scrn_priority,
internal_behavior.scrn_behavior,
noti_info->scrn_func_ptr,
noti_info->arg,
action_struct.scrn_action,
NULL,
noti_info->notify_type);
}
else if (notification_type == MMI_NOTIFY_COMM_POPUP)
{
display_scrn = control_popup_screen(noti_info->noti_scen_id, noti_info-
>string, noti_info->notify_type, internal_behavior.scrn_behavior,
action_struct.scrn_action);
}
else if (notification_type == MMI_NOTIFY_SUBLCD)
{
}
else if (notification_type == MMI_NOTIFY_PREVIEW)
{
#ifdef __MMI_NCENTER_SUPPORT__
control_preview(noti_info->notify_type, noti_info->notification, NULL,
is_stop_text_preview);
if (noti_info->notification->option & MMI_FRM_NMGR_DISABLE_TONE)
{
is_stop_tone = MMI_TRUE;
}
if (noti_info->notification->option & MMI_FRM_NMGR_DISABLE_VIB)
{
is_stop_vib = MMI_TRUE;
}
#endif
}
else if (notification_type == MMI_NOTIFY_BALLOON)
{
#ifdef __COSMOS_MMI_PACKAGE__
display_scrn = control_balloon(noti_info->notify_type, noti_info-
>balloon_type, noti_info->string, NULL);
#endif
}
else if (notification_type == MMI_NOTIFY_ALERT)
{
/*Show notification by its alert type*/
if (noti_info->alert_info->behavior_mask == ALERT_TYPE_STATUS_BAR)
{/*Show status bar (text preview or balloon)*/
if(noti_info->alert_info->status_bar_para.status_bar_type ==
MMI_FRM_NMGR_ALERT_ST_PREVIEW_TYPE)
{/*text preview*/
#ifdef __MMI_NCENTER_SUPPORT__
mmi_frm_notification_para_struct temp_preview;
temp_preview.text = noti_info->alert_info->status_bar_para.display_string;
temp_preview.option = noti_info->alert_info->alert_option;
control_preview(noti_info->notify_type, &temp_preview, noti_info-
>alert_info, is_stop_text_preview);
#endif
}
if(noti_info->alert_info->status_bar_para.status_bar_type ==
MMI_FRM_NMGR_ALERT_ST_BALLOON_TYPE)
{/*balloon*/
#ifdef __COSMOS_MMI_PACKAGE__
display_scrn = control_balloon(noti_info->notify_type,
MMI_NMGR_BALLOON_TYPE_INFO,
(WCHAR *)noti_info->alert_info->status_bar_para.display_string, noti_info-
>alert_info);
#endif
}
}
if(noti_info->alert_info->behavior_mask == ALERT_TYPE_POPUP)
{ /*Show popup*/
mmi_noti_scrn_func_ptr popup_scrn_entry = nmgr_alert_general_popup;
void *popup_scrn_para = noti_info->alert_info;
display_scrn = control_app_screen(noti_info->noti_scen_id,
noti_scen.scrn_priority,
internal_behavior.scrn_behavior,
popup_scrn_entry,
popup_scrn_para,
action_struct.scrn_action,
noti_info->alert_info,
noti_info->notify_type);
}
/*Extract option for sound and vibration usage*/
if ( noti_info->alert_info->alert_option & MMI_FRM_NMGR_DISABLE_TONE)
{
is_stop_tone = MMI_TRUE;
}
if (noti_info->alert_info->alert_option & MMI_FRM_NMGR_DISABLE_VIB)
{
is_stop_vib = MMI_TRUE;
}
/*Extract the sound setting from NSS*/
#ifdef __MMI_NSS_SUPPORT__
mmi_srv_nss_get_setting(noti_info->alert_info->app_id, NSS_SETTING_SOUND,
¬ification_setting_value);
if(notification_setting_value == SETTING_OFF)
{
is_stop_tone = MMI_TRUE;
}
#endif
/*According to UE design, we will show status bar icon even the NSS is
none or popup*/
if (noti_info->alert_info->behavior_mask == ALERT_TYPE_POPUP ||
noti_info->alert_info->behavior_mask == ALERT_TYPE_NONE)
{
control_status_icon(noti_info->alert_info->app_id,
noti_info->alert_info->alert_option,
noti_info->alert_info->status_bar_icon_para.icon_id
);
}
}
else
{
MMI_ASSERT(0);
}
control_sublcd(noti_info->noti_scen_id, internal_behavior.scrn_behavior);
if (!nmgr_is_in_defer_process() && !only_control_scrn)
{/* These three attribute should be invoked immediately! */
//add begin
/* compare scenario again */
active_scen_id = mmi_frm_get_active_scenario_id();
get_scenario_info(noti_info->noti_scen_id, ¬i_scen);
get_scenario_info(active_scen_id, &active_scen);
compare_scenario_and_get_behavior(active_scen_id, noti_info->noti_scen_id,
&internal_behavior);
/* Get notify configuration information by user to decide the action of
each attribute. */
notify_event_info = mmi_nmgr_get_event_notify_info(noti_info->notify_type,
active_scen_id);
MMI_ASSERT(NULL != notify_event_info);
attri_action = notify_event_info->behavior;
parse_attri_action(attri_action, &action_struct);
//add end
if (notification_type != MMI_NOTIFY_BALLOON)
{
if (is_stop_tone == MMI_FALSE)
{
mmi_nmgr_sound_play_evt_struct sound_event;
MMI_FRM_INIT_EVENT(&sound_event, SOUND_PLAY_EVT);
sound_event.noti_scen_id = noti_info->noti_scen_id;
sound_event.tone_id = notify_event_info->tone_id;
sound_event.behavior = internal_behavior.snd_behavior;
sound_event.action = action_struct.snd_action;
sound_event.display_scrn = display_scrn;
if(noti_info->alert_info!=NULL)
{
memcpy(&sound_event.snd_info, ¬i_info->alert_info->snd_para,
sizeof(mmi_frm_nmgr_alert_snd_struct));
if(sound_event.snd_info.sound_type == MMI_NMGR_SND_FILE_PATH)
{
sound_event.snd_info.sound.file_path =
mmi_frm_alloc_and_copy_string_to_nmgr_buff_internal(
noti_info->alert_info->snd_para.sound.file_path,MMI_MAX_FILE_NAME_LEN);
}
}
MMI_FRM_POST_EVENT(&sound_event, nmgr_control_proc, NULL);
}
if (is_stop_vib == MMI_FALSE)
{
mmi_nmgr_vib_play_evt_struct vib_event;
MMI_FRM_INIT_EVENT(&vib_event, VIB_PLAY_EVT);
vib_event.noti_scen_id = noti_info->noti_scen_id;
vib_event.behavior = internal_behavior.vib_behavior;
vib_event.action = action_struct.vib_action;
MMI_FRM_POST_EVENT(&vib_event, nmgr_control_proc, NULL);
}
}
if (!(notification_type == MMI_NOTIFY_BALLOON && display_scrn ==
MMI_FALSE))
{
mmi_nmgr_bl_ctrl_evt_struct bl_event;
MMI_FRM_INIT_EVENT(&bl_event,BACKLIGHT_CTRL);
bl_event.action = action_struct.bl_action;
bl_event.behavior = internal_behavior.bl_behavior;
MMI_FRM_POST_EVENT(&bl_event, nmgr_control_proc, NULL);
}
}
return display_scrn;
}
以上修改可以打patch MAUI_03207462。