修改方案为:
static srv_prof_volume_level srv_prof_play_audio_query_volume(srv_prof_tone_enum tone_type)
{
switch(tone_type)
{
。。。。。。。。。。。。。。。。
case SRV_PROF_TONE_KEYPAD:
{
return g_srv_prof.cur_setting.keypad_vol;
}
。。。。。。。。。。。。。。。。
case SRV_PROF_TONE_ERROR:
case SRV_PROF_TONE_WARNING:
case SRV_PROF_TONE_EMPTY_LIST:
case SRV_PROF_TONE_FILE_ARRIVAL:
case SRV_PROF_TONE_GENERAL_TONE:
case SRV_PROF_TONE_AUX:
case SRV_PROF_TONE_BATTERY_LOW:
case SRV_PROF_TONE_BATTERY_WARNING:
case SRV_PROF_TONE_EXPLICITLY_SAVE:
case SRV_PROF_TONE_SENT:
case SRV_PROF_TONE_DELETED:
case SRV_PROF_TONE_PROBLEM:
case SRV_PROF_TONE_CONFIRM:
case SRV_PROF_TONE_NOT_AVAILABLE:
case SRV_PROF_TONE_ANS_PHONE:
case SRV_PROF_TONE_REMIND:
{
/* alert type tone use default volume 3 as long as system alert is allowed to play */
return SRV_PROF_VOL_LEVEL_3;
}
//add begin添加下面这一段,因为在不管是设置为什么的时候,都是会走到下面的default中,所以做了个判断,在
// ring_vol为0的时候,设置为SRV_PROF_VOL_LEVEL_4 ,如果不为0的话,还是会去调用g_srv_prof.cur_setting.ring_vol
case SRV_PROF_TONE_ALARM:
{
if(g_srv_prof.cur_setting.ring_vol==SRV_PROF_VOL_LEVEL_0)
return SRV_PROF_VOL_LEVEL_3 ;
else
return g_srv_prof.cur_setting.ring_vol;
}
//add end
default:
{
return g_srv_prof.cur_setting.ring_vol;
}
}
}
static srv_prof_volume_level srv_prof_play_audio_query_volume(srv_prof_tone_enum tone_type)
{
switch(tone_type)
{
。。。。。。。。。。。。。。。。
case SRV_PROF_TONE_KEYPAD:
{
return g_srv_prof.cur_setting.keypad_vol;
}
。。。。。。。。。。。。。。。。
case SRV_PROF_TONE_ERROR:
case SRV_PROF_TONE_WARNING:
case SRV_PROF_TONE_EMPTY_LIST:
case SRV_PROF_TONE_FILE_ARRIVAL:
case SRV_PROF_TONE_GENERAL_TONE:
case SRV_PROF_TONE_AUX:
case SRV_PROF_TONE_BATTERY_LOW:
case SRV_PROF_TONE_BATTERY_WARNING:
case SRV_PROF_TONE_EXPLICITLY_SAVE:
case SRV_PROF_TONE_SENT:
case SRV_PROF_TONE_DELETED:
case SRV_PROF_TONE_PROBLEM:
case SRV_PROF_TONE_CONFIRM:
case SRV_PROF_TONE_NOT_AVAILABLE:
case SRV_PROF_TONE_ANS_PHONE:
case SRV_PROF_TONE_REMIND:
{
/* alert type tone use default volume 3 as long as system alert is allowed to play */
return SRV_PROF_VOL_LEVEL_3;
}
//add begin添加下面这一段,因为在不管是设置为什么的时候,都是会走到下面的default中,所以做了个判断,在
// ring_vol为0的时候,设置为SRV_PROF_VOL_LEVEL_4 ,如果不为0的话,还是会去调用g_srv_prof.cur_setting.ring_vol
case SRV_PROF_TONE_ALARM:
{
if(g_srv_prof.cur_setting.ring_vol==SRV_PROF_VOL_LEVEL_0)
return SRV_PROF_VOL_LEVEL_3 ;
else
return g_srv_prof.cur_setting.ring_vol;
}
//add end
default:
{
return g_srv_prof.cur_setting.ring_vol;
}
}
}