微波EDA网,见证研发工程师的成长!
首页 > 研发问答 > 手机设计讨论 > MTK手机平台交流 > mt2503 如何在IDLE界面拨打SDN号码时能显示其名称?

mt2503 如何在IDLE界面拨打SDN号码时能显示其名称?

时间:10-02 整理:3721RD 点击:
[DESCRIPTION]
SDN(Service Dialing Number)在SDN列表中能显示号码和其对应的名称,如果从SDN列表界面呼叫,呼叫界面显示匹配的名称,但是在IDLE界面拨打SDN号码,呼叫界面不能匹配到SDN列表中相应的名称。
[SOLUTION]
目前设计是在开机的时候load了 ADN 和FDN中具体的号码和姓名等信息,并没有初始化SDN,只是在进入SDN 列表的时候l才去load的 SDN 号码。若实现该功能,需要在开机的过程中也把SDN load出来,可以参考如下修改:
1)PhbSrvGprot.h
//增加函数申明
/*****************************************************************************
* FUNCTION
* srv_phb_xmgnt_search_sdn_by_number
* DESCRIPTION
* This function is used to search SDN name (SIM1 or SIM2) by number.
* PARAMETERS
* sim_interface: [IN] SIM1/SIM2
* number: [IN] Number to dial
* name: [OUT] Name to match the number
* RETURNS
* PHB entry index
*****************************************************************************/
extern U16 srv_phb_xmgnt_search_sdn_by_number(U8 sim_interface, U16 *number, U16
*name);

2)PhbSrv.h
//增加函数申明
/*****************************************************************************
* FUNCTION
* srv_phb_xmgnt_read_sdn_to_ram
* DESCRIPTION
* This function is used to read SDN list (both SIM1 and SIM2) to ram for call querying name.
* PARAMETERS
* init_cb: [IN] startup callback
* RETURNS
* void
*****************************************************************************/
void srv_phb_xmgnt_read_sdn_to_ram(sim_interface_enum sim_id,
srv_phb_startup_callback_type init_cb, void* user_data);
/*****************************************************************************
* FUNCTION
* srv_phb_xmgnt_read_sdn_to_ram_rsp
* DESCRIPTION
*
* PARAMETERS
* info [IN]
* RETURNS
* void
*****************************************************************************/
void srv_phb_xmgnt_read_sdn_to_ram_rsp(void *info, int mod_id);

3)PhbSrv.c
//修改函数srv_phb_get_caller_info_by_number()
/* We will try to search the name in FDN list */
store_index = srv_phb_xmgnt_search_fdn_by_number(cm_param->sim_interface, cm_param-
>number, phb_info->name);
if (store_index != 0xFFFF)
{
// phb_info->phb_id.storage_type = PHB_FDN;
// phb_info->phb_id.contact_index = store_index;
return MMI_TRUE;
}
//增加开始点
/* We will try to search the name in SDN list */
store_index = srv_phb_xmgnt_search_sdn_by_number(cm_param->sim_interface, cm_param-
>number, phb_info->name);
if (store_index != 0xFFFF)
{
// phb_info->phb_id.storage_type = PHB_FDN;
// phb_info->phb_id.contact_index = store_index;
return MMI_TRUE;
}
//增加结束点

4)PhbStartupSrv.c
//增加函数申明
static void srv_phb_startup_read_fdn_hdlr(void *user_data);
//修改函数srv_phb_startup_read_fdn_hdlr()
/*****************************************************************************
* FUNCTION
* srv_phb_startup_read_fdn_hdlr
* DESCRIPTION
*
* PARAMETERS
* void
* RETURNS
* void
*****************************************************************************/
static void srv_phb_startup_read_fdn_hdlr(void * user_data)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
srv_phb_startup_finish_cntx_struct* finish_cntx =
(srv_phb_startup_finish_cntx_struct*)user_data;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
//删除开始点
//srv_phb_datamgr_startup_read_sim_finish(finish_cntx->sim_id, finish_cntx->sim_total);
//srv_phb_mem_free(finish_cntx);
//删除结束点
//新增开始点
srv_phb_xmgnt_read_sdn_to_ram((sim_interface_enum)(finish_cntx->sim_id),
srv_phb_startup_read_sdn_hdlr, user_data);
//新增结束点
}
//新增函数srv_phb_startup_read_sdn_hdlr
/*****************************************************************************
* FUNCTION
* srv_phb_startup_read_sdn_hdlr
* DESCRIPTION
*
* PARAMETERS
* void
* RETURNS
* void
*****************************************************************************/
static void srv_phb_startup_read_sdn_hdlr(void * user_data)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
srv_phb_startup_finish_cntx_struct* finish_cntx =
(srv_phb_startup_finish_cntx_struct*)user_data;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
srv_phb_datamgr_startup_read_sim_finish(finish_cntx->sim_id, finish_cntx->sim_total);
srv_phb_mem_free(finish_cntx);
}
//修改函数srv_phb_startup_read_entry_by_index_rsp()
void srv_phb_startup_read_entry_by_index_rsp(void *info, int mod_src)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
U8 sim_id = srv_phb_get_sim_id_by_mod_id(mod_src);
phb_type_enum entry_type = srv_phb_startup_get_initing_entry_type(sim_id);
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
#ifdef __MMI_PHB_USIM_SUPPORT__
if (entry_type == PHB_ANR)
{
srv_phb_read_anr_rsp(info, mod_src);
}
else
#endif
if (entry_type == PHB_FDN)
{
srv_phb_xmgnt_read_fdn_to_ram_rsp(info, mod_src);
}
//新增开始点
else if (entry_type == PHB_SDN)
{
srv_phb_xmgnt_read_sdn_to_ram_rsp(info, mod_src);
}
//新增结束点
}
5)PhbXmgntSrv.c
//新增SDN功能实现
#define SRV_PHB_SDN_SEARCH
/*
* Typedef
*/
typedef struct
{
srv_phb_xmgnt_entry_struct sdn_entry[SRV_PHB_XMGNT_SIM_ENTRIES];
U16 entry_count;
MMI_BOOL is_ready;
} srv_phb_sdn_list_struct;
typedef struct
{
srv_phb_sdn_list_struct sdn_list[MMI_SIM_TOTAL];
void *user_data[MMI_SIM_TOTAL];
srv_phb_startup_callback_type startup_callback;
} srv_phb_sdn_cntx_struct;
/*
* Local Variable
*/
static srv_phb_sdn_cntx_struct g_srv_phb_sdn_cntx;
/*
* Local Function
*/
static void srv_phb_xmgnt_read_sdn_to_ram_hdlr(sim_interface_enum sim_id);
static void srv_phb_xmgnt_read_sdn_to_ram_req(sim_interface_enum sim_id);
/*****************************************************************************
* FUNCTION
* srv_phb_xmgnt_read_sdn_to_ram
* DESCRIPTION
* This function is used to read SDN list (both SIM1 and SIM2) to ram for call querying
name.
* PARAMETERS
* init_cb: [IN] startup callback
* RETURNS
* void
*****************************************************************************/
void srv_phb_xmgnt_read_sdn_to_ram(sim_interface_enum sim_id,
srv_phb_startup_callback_type init_cb, void* user_data)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
g_srv_phb_sdn_cntx.startup_callback = init_cb;
g_srv_phb_sdn_cntx.user_data[sim_id] = user_data;
g_srv_phb_sdn_cntx.sdn_list[sim_id].is_ready = MMI_FALSE;
g_srv_phb_sdn_cntx.sdn_list[sim_id].entry_count = 0;
srv_phb_xmgnt_read_sdn_to_ram_req(sim_id);
}
/*****************************************************************************
* FUNCTION
* srv_phb_xmgnt_read_sdn_to_ram_hdlr
* DESCRIPTION
*
* PARAMETERS
* void
* RETURNS
* void
*****************************************************************************/
static void srv_phb_xmgnt_read_sdn_to_ram_hdlr(sim_interface_enum sim_id)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
if (g_srv_phb_sdn_cntx.startup_callback != NULL)
{
g_srv_phb_sdn_cntx.startup_callback(g_srv_phb_sdn_cntx.user_data[sim_id]);
}
}
/*****************************************************************************
* FUNCTION
* srv_phb_xmgnt_read_sdn_to_ram_req
* DESCRIPTION
*
* PARAMETERS
* void
* RETURNS
* void
*****************************************************************************/
static void srv_phb_xmgnt_read_sdn_to_ram_req(sim_interface_enum sim_id)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
mmi_phb_get_entry_by_index_req_struct *local_ptr;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
local_ptr = (mmi_phb_get_entry_by_index_req_struct*)
OslConstructDataPtr(sizeof(mmi_phb_get_entry_by_index_req_struct));
local_ptr->type = PHB_SDN;
local_ptr->index = g_srv_phb_sdn_cntx.sdn_list[sim_id].entry_count + 1; /* l4phb entry
index starts fROM 1 */
local_ptr->record_index = 0xFFFF;
local_ptr->no_data = PHB_MAX_PHB_ENTRIES;
local_ptr->storage = srv_phb_get_storage_by_sim_id(sim_id);
srv_phb_startup_set_initing_entry_type(sim_id, PHB_SDN);
mmi_frm_set_protocol_event_handler(PRT_PHB_GET_ENTRY_BY_INDEX_RSP,
(PsIntFuncPtr)srv_phb_startup_read_entry_by_index_rsp, MMI_FALSE);
mmi_frm_send_ilm(mmi_frm_sim_to_l4c_mod(mmi_frm_index_to_sim(sim_id)),
PRT_PHB_GET_ENTRY_BY_INDEX_REQ, (oslParaType*) local_ptr, NULL);
}
/*****************************************************************************
* FUNCTION
* srv_phb_xmgnt_read_sdn_to_ram_rsp
* DESCRIPTION
*
* PARAMETERS
* info [IN]
* RETURNS
* void
*****************************************************************************/
void srv_phb_xmgnt_read_sdn_to_ram_rsp(void *info, int mod_id)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
mmi_phb_get_entry_by_index_rsp_struct *local_ptr;
U16 i, index;
sim_interface_enum sim_id;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
local_ptr = (mmi_phb_get_entry_by_index_rsp_struct*) info;
sim_id =
(sim_interface_enum)(mmi_frm_sim_to_index(mmi_frm_l4c_mod_to_sim((module_type)mod_id)))
;
if (local_ptr->result.flag == L4C_OK)
{
for (i = 0; i < local_ptr->no_list; i++)
{
if (g_srv_phb_sdn_cntx.sdn_list[sim_id].entry_count >= SRV_PHB_XMGNT_SIM_ENTRIES)
{
break;
}
index = g_srv_phb_sdn_cntx.sdn_list[sim_id].entry_count;
g_srv_phb_sdn_cntx.sdn_list[sim_id].entry_count++;
g_srv_phb_sdn_cntx.sdn_list[sim_id].sdn_entry[index].alpha_id.name_length = local_ptr-
>list.alpha_id.name_length;
g_srv_phb_sdn_cntx.sdn_list[sim_id].sdn_entry[index].alpha_id.name_dcs = local_ptr-
>list.alpha_id.name_dcs;
g_srv_phb_sdn_cntx.sdn_list[sim_id].sdn_entry[index].record_index = local_ptr-
>list.record_index;
srv_phb_parse_l4phb_entry(
&(local_ptr->list),
g_srv_phb_sdn_cntx.sdn_list[sim_id].sdn_entry[index].alpha_id.name,
NULL,
g_srv_phb_sdn_cntx.sdn_list[sim_id].sdn_entry[index].tel.number);
g_srv_phb_sdn_cntx.sdn_list[sim_id].sdn_entry[index].tel.type = local_ptr-
>list.tel.type;
g_srv_phb_sdn_cntx.sdn_list[sim_id].sdn_entry[index].tel.length = local_ptr-
>list.tel.length;
}
if (local_ptr->no_list == PHB_MAX_PHB_ENTRIES)
{
srv_phb_xmgnt_read_sdn_to_ram_req(sim_id);
return;
}
}
g_srv_phb_sdn_cntx.sdn_list[sim_id].is_ready = MMI_TRUE;
srv_phb_xmgnt_read_sdn_to_ram_hdlr(sim_id);
}
/*****************************************************************************
* FUNCTION
* srv_phb_xmgnt_search_sdn_by_number
* DESCRIPTION
* This function is used to search SDN name (SIM1 or SIM2) by number.
* PARAMETERS
* sim_interface: [IN] SIM1/SIM2
* number: [IN] Number to dial
* name: [OUT] Name to match the number
* RETURNS
* PHB entry index
*****************************************************************************/
U16 srv_phb_xmgnt_search_sdn_by_number(U8 sim_interface, U16 *number, U16 *name)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
U16 i, count = 0;
U16 sdn_list_count;
srv_phb_xmgnt_entry_struct *sdn_list;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
sdn_list_count = g_srv_phb_sdn_cntx.sdn_list[sim_interface].entry_count;
sdn_list = g_srv_phb_sdn_cntx.sdn_list[sim_interface].sdn_entry;
for (i = 0; i < SRV_PHB_XMGNT_SIM_ENTRIES && count < sdn_list_count; i ++)
{
if (sdn_list.record_index > 0)
{
if (srv_phb_compare_number(sdn_list.tel.number, number))
{
mmi_wcscpy(name, (U16*) sdn_list.alpha_id.name);
return i;
}
count ++;
}
}
return 0xFFFF;
}

路过!

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top