1)在nvram_main.c 添加一个函数:
void mmi_phb_write_default_caller_group(void)
{
mmi_phb_group_info_struct* all_group_info;
kal_uint32 i;
ltable_entry_struct *ldi;
kal_uint8 PHB_CALLER_GROUP_DEFAULT[] =
{
0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00,
0x00, 0x00,//group name:A
0x00, 0x00,//ringtone_id;
0x00, 0x00,//image_id;
0x00, 0x00,//led_id;
#ifdef __MMI_INCOMING_CALL_VIDEO__
0xFF, 0xFF,//video_id;
#endif
0xFF, //alert_type;
0x00,//order_index;
0x42, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,0x00, 0x00, 0x00,
0x00, 0x00,//group name:B
0x00, 0x00,//ringtone_id;
0x00, 0x00,//image_id;
0x00, 0x00,//led_id;
#ifdef __MMI_INCOMING_CALL_VIDEO__
0xFF, 0xFF,//video_id;
#endif
0xFF, //alert_type;
0x01,//order_index;
};
all_group_info = (kal_uint8*)
get_ctrl_buffer(NVRAM_EF_PHB_GROUP_INFO_SIZE);
{
//write callergroup default value
nvram_get_data_item(ldi,
NVRAM_EF_PHB_GROUP_INFO_LID);
nvram_read_data_item(ldi, 1, 1, (kal_uint8
*)all_group_info, NVRAM_EF_PHB_GROUP_INFO_SIZE);
memcpy(all_group_info,PHB_CALLER_GROUP_DEFAULT,sizeof(
PHB_CALLER_GROUP_DEFAULT));
nvram_write_data_item(ldi, 1, (kal_uint8 *)all_group_info,
KAL_FALSE);
//nvram_read_data_item(ldi, 1, 1, (kal_uint8
*)all_group_info, NVRAM_EF_PHB_GROUP_INFO_SIZE);
free_ctrl_buffer(all_group_info, __FILE__, __LINE__);
}
}
2)在nvram_init 的最后return 之前添加mmi_phb_write_default_caller_group()
此方法是实现了预置2 个caller group,请在此基础上再作扩展。