icfans

震动或静音模式下,Java应用响应情景模式

0
阅读(186) 评论(0)

[DESCRIPTION]
震动或静音模式下,Java应用响应情景模式
[SOLUTION]
适用版本09A\09B\10A
[声音]来自半导体社区
kal_uint8 jam_get_aud_volume_level(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
#ifdef __USER_PROFILE_JAVA___
srv_prof_alert_type_enum alert_type = SRV_PROF_ALERT_TYPE_INVALID;
//add line
static U8 old_vol_level = 0;
static MMI_BOOL is_prev_slient = FALSE;
srv_prof_get_current_profile_value(SRV_PROF_SETTINGS_ALERT_TYPE, (void*)&alert_type);
if(alert_type == SRV_PROF_ALERT_TYPE_VIB_ONLY ||
alert_type == SRV_PROF_ALERT_TYPE_SILENT)
{
if(!is_prev_slient)
{
old_vol_level = g_mmi_java_aud_volume_level;
}
g_mmi_java_aud_volume_level = 0;
is_prev_slient = TRUE;
}
else
{
if(is_prev_slient)
{
g_mmi_java_aud_volume_level = old_vol_level;
}
is_prev_slient = FALSE;
}
#endif
//add line
return g_mmi_java_aud_volume_level;
}
[震动]
参考[声音]
Midlet 震动函数为
jvm_startVibrate
如果是在非震动模式,不期望Java应用震动,可以如上设置Flage根据当前情景模式判断是否要Java震动。