芯方式

打开DIGIT_TONE_SUPPORT 功能,进入电话本报号重启

0
阅读(54) 评论(0)

[Version]芯方式
MAUI.10A.W11.08.MP.V3
[DESCRIPTION]
打开 DIGIT_TONE_SUPPORT 此功能,电话本报号。进入电话本菜单,高亮某联系人号码报号,手机重
启。
分析memory dump,srv_prof_get_current_profile_value 中指针错误,
srv_prof_get_current_profile_value{…
switch(setting)
{
/* Ring volume level : srv_prof_volume_level */
case SRV_PROF_SETTINGS_RING_VOL_LEVEL:
{
srv_prof_volume_level* vol = (srv_prof_volume_level*)value; /* */
*vol = MDI_AUD_VOL_MUTE(g_srv_prof.cur_setting.ring_vol); break;
}
...
}
原因是mmi_phb_list_speak_name在调用srv_prof_get_current_profile_value,第二个参数传入了
整形变量,而此函数的原形中第二个参数是指针。
[SOLUTION]
在调用srv_prof_get_current_profile_value的函数中,对参数作修改,如下,
static void mmi_phb_list_speak_name(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
U16 text[(MMI_PHB_NAME_LENGTH + MMI_PHB_NUMBER_LENGTH + 10)];
U16 length = 0;
srv_prof_volume_level value;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
#ifdef __MMI_SILENT_MEETING_PROFILE__
if (srv_prof_is_profile_activated(SRV_PROF_MEETING_MODE) ==
SRV_PROF_RET_PROFILE_ACTIVATED)
{
/**
* not to play sound
*/
return;
}
#endif
if (mmi_phb_get_speak_name() &&
(srv_ucm_query_call_count(SRV_UCM_CALL_STATE_ALL, SRV_UCM_CALL_TYPE_ALL, NULL)
== 0) &&
(srv_prof_is_profile_activated(SRV_PROF_SILENT_MODE) !=
SRV_PROF_RET_PROFILE_ACTIVATED))
{
#if defined(SIMPLE_TTS) || defined(DIGIT_TONE_SUPPORT)
srv_phb_get_name(g_mmi_phb_list_p->store_index, text, (U16)(MMI_PHB_NAME_LENGTH
+ MMI_PHB_NUMBER_LENGTH + 10));
length = mmi_wcslen(text);
#endif
#ifdef DIGIT_TONE_SUPPORT
srv_phb_get_number(g_mmi_phb_list_p->store_index, (U16*)(text + length),
(MMI_PHB_NUMBER_LENGTH + 1));
length = mmi_wcslen(text);
#endif
if (length > 0)
{
mdi_result result = mdi_audio_play_text_with_vol_path(
(U8*) text,
length,
100,
mmi_phb_speak_name_handler,
NULL,
srv_prof_get_current_profile_value(SRV_PROF_SETTINGS
_RING_VOL_LEVEL, (void *)&value),
MDI_DEVICE_SPEAKER2);/* value前加上&,使它变成地址
,以便给函数里的局部变量指针srv_prof_volume_level* vol赋值*/
。。。

来自半导体社区