mt2503 BT call无震动,不可调节铃声
时间:10-02
整理:3721RD
点击:
[DESCRIPTION]
从Setting -> profiles 中调节铃声类型,音量大小等,对BT call没有效果。
[SOLUTION]
请参考下面的修改方法:
1. Ucmbt.res文件
1) 添加一个Timer id
//..
<TIMER id="UCM_TONE_AFTER_VIBRATION_BT"/>
//..
2) make resgen
3) make remake MMIresource
2. UcmKernelBT.c文件
1) 替换下面两个函数实现
void mmi_ucm_play_incoming_ringtone_bt(MMI_BOOL is_wait_call)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
srv_prof_alert_type_enum alert_type = SRV_PROF_ALERT_TYPE_INVALID;
/*----------------------------------------------------------------*/
/* Code */
/*----------------------------------------------------------------*/
MMI_TRACE(MMI_COMMON_TRC_G5_CALL, TRC_MMI_UCM_BT_RING_TONE, g_ucm_p_bt->ucm_ringtone);
if (g_ucm_p_bt->ucm_ringtone)
{
if (is_wait_call)
{
mmi_ucm_play_waitingtone_bt();
}
else
{
g_ucm_p_bt->ucm_ringtone = MMI_FALSE;
srv_prof_get_current_profile_value(SRV_PROF_SETTINGS_ALERT_TYPE, &alert_type);
switch(alert_type)
{
case SRV_PROF_ALERT_TYPE_RING:
{
mmi_ucm_play_ringtone_bt();
}
break;
case SRV_PROF_ALERT_TYPE_VIB_ONLY:
{
srv_vibrator_on();
}
break;
case SRV_PROF_ALERT_TYPE_VIB_AND_RING:
{
srv_vibrator_on();
mmi_ucm_play_ringtone_bt();
}
break;
case SRV_PROF_ALERT_TYPE_VIB_THEN_RING:
{
srv_vibrator_on();
StartTimer(UCM_TONE_AFTER_VIBRATION_BT, MMI_UCM_VIB_THEN_RING_DURATION,
mmi_ucm_play_tone_after_vibration_bt);
}
break;
case SRV_PROF_ALERT_TYPE_SILENT:
{
}
break;
default:
break;
}
}
}
}
void mmi_ucm_stop_incoming_ringtone_bt(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
srv_prof_alert_type_enum alert_type = SRV_PROF_ALERT_TYPE_INVALID;
/*----------------------------------------------------------------*/
/* Code */
/*----------------------------------------------------------------*/
MMI_TRACE(MMI_COMMON_TRC_G5_CALL, TRC_MMI_UCM_BT_STOP_RING_TONE);
srv_prof_get_current_profile_value(SRV_PROF_SETTINGS_ALERT_TYPE, &alert_type);
switch(alert_type)
{
case SRV_PROF_ALERT_TYPE_RING:
{
srv_prof_stop_tone(SRV_PROF_TONE_INCOMING_CALL);
}
break;
case SRV_PROF_ALERT_TYPE_VIB_ONLY:
{
srv_vibrator_off();
}
break;
case SRV_PROF_ALERT_TYPE_VIB_AND_RING:
{
srv_vibrator_off();
srv_prof_stop_tone(SRV_PROF_TONE_INCOMING_CALL);
}
break;
case SRV_PROF_ALERT_TYPE_VIB_THEN_RING:
{
srv_vibrator_off();
StopTimer(UCM_TONE_AFTER_VIBRATION_BT);
srv_prof_stop_tone(SRV_PROF_TONE_INCOMING_CALL);
}
break;
case SRV_PROF_ALERT_TYPE_SILENT:
{
}
break;
default:
break;
}
}
2) 请在mmi_ucm_play_incoming_ringtone_bt函数前添加下面函数
static void mmi_ucm_play_ringtone_bt(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
srv_prof_play_req_struct play_req;
/*----------------------------------------------------------------*/
/* Code */
/*----------------------------------------------------------------*/
srv_prof_play_req_struct_init(&play_req, SRV_PROF_TONE_INCOMING_CALL);
srv_prof_get_current_profile_value(SRV_PROF_SETTINGS_RING_VOL_LEVEL,&play_req.volume);
play_req.aud_path = MDI_DEVICE_LOUDSPEAKER;
srv_prof_get_current_profile_value(SRV_PROF_SETTINGS_RING_TYPE, &play_req.play_style);
srv_prof_get_current_profile_value(SRV_PROF_SETTINGS_MT_CALL_TONE, &play_req.audio_id);
play_req.callback = NULL;
play_req.audio_type = SRV_PROF_AUDIO_STRING;
srv_prof_play_tone_with_full_struct(&play_req);
}
static void mmi_ucm_play_tone_after_vibration_bt(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
StopTimer(UCM_TONE_AFTER_VIBRATION_BT);
srv_vibrator_off(); /* O */
mmi_ucm_play_ringtone_bt();
}
3) make remake mmi_app
从Setting -> profiles 中调节铃声类型,音量大小等,对BT call没有效果。
[SOLUTION]
请参考下面的修改方法:
1. Ucmbt.res文件
1) 添加一个Timer id
//..
<TIMER id="UCM_TONE_AFTER_VIBRATION_BT"/>
//..
2) make resgen
3) make remake MMIresource
2. UcmKernelBT.c文件
1) 替换下面两个函数实现
void mmi_ucm_play_incoming_ringtone_bt(MMI_BOOL is_wait_call)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
srv_prof_alert_type_enum alert_type = SRV_PROF_ALERT_TYPE_INVALID;
/*----------------------------------------------------------------*/
/* Code */
/*----------------------------------------------------------------*/
MMI_TRACE(MMI_COMMON_TRC_G5_CALL, TRC_MMI_UCM_BT_RING_TONE, g_ucm_p_bt->ucm_ringtone);
if (g_ucm_p_bt->ucm_ringtone)
{
if (is_wait_call)
{
mmi_ucm_play_waitingtone_bt();
}
else
{
g_ucm_p_bt->ucm_ringtone = MMI_FALSE;
srv_prof_get_current_profile_value(SRV_PROF_SETTINGS_ALERT_TYPE, &alert_type);
switch(alert_type)
{
case SRV_PROF_ALERT_TYPE_RING:
{
mmi_ucm_play_ringtone_bt();
}
break;
case SRV_PROF_ALERT_TYPE_VIB_ONLY:
{
srv_vibrator_on();
}
break;
case SRV_PROF_ALERT_TYPE_VIB_AND_RING:
{
srv_vibrator_on();
mmi_ucm_play_ringtone_bt();
}
break;
case SRV_PROF_ALERT_TYPE_VIB_THEN_RING:
{
srv_vibrator_on();
StartTimer(UCM_TONE_AFTER_VIBRATION_BT, MMI_UCM_VIB_THEN_RING_DURATION,
mmi_ucm_play_tone_after_vibration_bt);
}
break;
case SRV_PROF_ALERT_TYPE_SILENT:
{
}
break;
default:
break;
}
}
}
}
void mmi_ucm_stop_incoming_ringtone_bt(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
srv_prof_alert_type_enum alert_type = SRV_PROF_ALERT_TYPE_INVALID;
/*----------------------------------------------------------------*/
/* Code */
/*----------------------------------------------------------------*/
MMI_TRACE(MMI_COMMON_TRC_G5_CALL, TRC_MMI_UCM_BT_STOP_RING_TONE);
srv_prof_get_current_profile_value(SRV_PROF_SETTINGS_ALERT_TYPE, &alert_type);
switch(alert_type)
{
case SRV_PROF_ALERT_TYPE_RING:
{
srv_prof_stop_tone(SRV_PROF_TONE_INCOMING_CALL);
}
break;
case SRV_PROF_ALERT_TYPE_VIB_ONLY:
{
srv_vibrator_off();
}
break;
case SRV_PROF_ALERT_TYPE_VIB_AND_RING:
{
srv_vibrator_off();
srv_prof_stop_tone(SRV_PROF_TONE_INCOMING_CALL);
}
break;
case SRV_PROF_ALERT_TYPE_VIB_THEN_RING:
{
srv_vibrator_off();
StopTimer(UCM_TONE_AFTER_VIBRATION_BT);
srv_prof_stop_tone(SRV_PROF_TONE_INCOMING_CALL);
}
break;
case SRV_PROF_ALERT_TYPE_SILENT:
{
}
break;
default:
break;
}
}
2) 请在mmi_ucm_play_incoming_ringtone_bt函数前添加下面函数
static void mmi_ucm_play_ringtone_bt(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
srv_prof_play_req_struct play_req;
/*----------------------------------------------------------------*/
/* Code */
/*----------------------------------------------------------------*/
srv_prof_play_req_struct_init(&play_req, SRV_PROF_TONE_INCOMING_CALL);
srv_prof_get_current_profile_value(SRV_PROF_SETTINGS_RING_VOL_LEVEL,&play_req.volume);
play_req.aud_path = MDI_DEVICE_LOUDSPEAKER;
srv_prof_get_current_profile_value(SRV_PROF_SETTINGS_RING_TYPE, &play_req.play_style);
srv_prof_get_current_profile_value(SRV_PROF_SETTINGS_MT_CALL_TONE, &play_req.audio_id);
play_req.callback = NULL;
play_req.audio_type = SRV_PROF_AUDIO_STRING;
srv_prof_play_tone_with_full_struct(&play_req);
}
static void mmi_ucm_play_tone_after_vibration_bt(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
StopTimer(UCM_TONE_AFTER_VIBRATION_BT);
srv_vibrator_off(); /* O */
mmi_ucm_play_ringtone_bt();
}
3) make remake mmi_app