微波EDA网,见证研发工程师的成长!
首页 > 研发问答 > 手机设计讨论 > MTK手机平台交流 > mt2503 在电话本中显示所有存储位置上的联系人

mt2503 在电话本中显示所有存储位置上的联系人

时间:10-02 整理:3721RD 点击:
[DESCRIPTION]
常见的情况是:A,在电话本设置中,优先存储位置选择All时,列表界面显示所有联系人;B,优先存储位置选择SIM卡时,列表界面显示SIM卡中的联系人;添加联系人时,只能往SIM卡上添加;需要实现的效果:设置优先存储位置,只限制添加联系人时的存储位置,不影响列表界面显示,列表界面一直显示所有的联系人;
[SOLUTION]
在09A上,参考下面的修改:
在MMI_phb_check_store_index_by_storage直接返回
returnMMI_TRUE;
在mmi_phb_entry_quick_search_list中,注释掉灰色的部分,增加红色部分:
voidmmi_phb_entry_quick_search_list(void)
{
/*----------------------------------------------------------------*/
/*LocalVariables*/
/*----------------------------------------------------------------*/
U8*guiBuffer;
U16entryCount;
/*----------------------------------------------------------------*/
/*CodeBody*/
/*----------------------------------------------------------------*/
EntryNewScreen(
SCR_ID_PHB_QUICK_SEARCH_LIST,
mmi_phb_exit_quick_search_list,
mmi_phb_quick_search_list_pre_entry,
MMI_FULL_SCREEN);
guiBuffer=GetCurrGuiBuffer(SCR_ID_PHB_QUICK_SEARCH_LIST);
RegisterHighlightHandler(mmi_phb_quick_search_get_index);
RegisterCat200SearchFunction(mmi_phb_quick_search_find_entry);
g_phb_quick_search_enter=MMI_PHB_QUICK_SEARCH_MAIN;
if(guiBuffer==NULL)
{
//entryCount=mmi_phb_num_of_phb_contact_in_storage(g_phb_cntx.prefer_storage);
entryCount=mmi_phb_num_of_phb_contact_in_storage(MMI_STORAGE_BOTH);
if(entryCount==0)
{
g_phb_cntx.highlight_entry=0;
}
else
{
g_phb_cntx.highlight_entry=1;
}
/*Addnewcontact,socount+1*/
entryCount++;
g_phb_cntx.new_highlight_entry=0xffff;
mEMSet(g_phb_qsearch_input,0,ENCODING_LENGTH);
memset(g_phb_qsearch_bitmask,0xff,(MAX_PB_ENTRIES+7)/8);
g_phb_cntx.refresh_list=MMI_PHB_ENTRY_NO_CHANGE;/*'2'isusedonlyforthisscreen.*/
}
elseif(g_phb_cntx.refresh_list==MMI_PHB_ENTRY_REFRESH&&!mmi_is_redrawing_bk_screens())
{
/*calculatethenewhighlightindex*/
mmi_phb_first_screen_calc_highlight_index();
memset(g_phb_qsearch_input,0,ENCODING_LENGTH);
memset(g_phb_qsearch_bitmask,0xff,(MAX_PB_ENTRIES+7)/8);
//entryCount=mmi_phb_num_of_phb_contact_in_storage(g_phb_cntx.prefer_storage);
entryCount=mmi_phb_num_of_phb_contact_in_storage(MMI_STORAGE_BOTH);
if(entryCount==0)
{
g_phb_cntx.highlight_entry=0;
}

在mmi_phb_quick_search_get_index注释掉灰色的部分,增加红色部分:
voidmmi_phb_quick_search_get_index(S32nIndex)
{
/*----------------------------------------------------------------*/
/*LocalVariables*/
/*----------------------------------------------------------------*/
U16i,count=0;
/*----------------------------------------------------------------*/
/*CodeBody*/
/*----------------------------------------------------------------*/
#ifdefined(__MMI_INTELLIGENT_CALL_ALERT__)
StopTimer(PHB_LIST_SPEAK_NAME_TIMER);
if(g_phb_is_speaking_name)
{
mdi_audio_stop_string();
g_phb_is_speaking_name=0;
}
#endif/*defined(__MMI_INTELLIGENT_CALL_ALERT__)*/
#ifdef__MMI_PHB_DEFAULT_NUMBER__
SetKeyHandler(mmi_phb_og_pre_dial_default_number_or_start_browser,KEY_SEND,KEY_EVENT_UP);
#else
SetKeyHandler(mmi_phb_dial_normal_call,KEY_SEND,KEY_EVENT_UP);
#endif
if(mmi_ucs2strlen((S8*)g_phb_qsearch_input)==0)
{
if(nIndex==0)
{
g_phb_cntx.active_index=0xffff;
#ifdefined(__MMI_WGUI_CSK_ENABLE__)
ChangeCenterSoftkey(0,IMG_ID_PHB_CSK_ADD);
#endif
SetKeyHandler(NULL,KEY_SEND,KEY_EVENT_UP);
return;
}
else
{
nIndex--;
}
}
#ifdefined(__MMI_WGUI_CSK_ENABLE__)
ChangeCenterSoftkey(0,IMG_GLOBAL_VIEW_CSK);
#endif
for(i=0;i<PhoneBookEntryCount;i++)
{
//if(!mmi_phb_check_store_index_by_storage(g_phb_name_index,g_phb_cntx.prefer_storage))
if(!mmi_phb_check_store_index_by_storage(g_phb_name_index,MMI_STORAGE_BOTH))
{
continue;
}
if(g_phb_qsearch_bitmask[i>>BYTE_SIZE_SHIFT_ARITHMETIC]&(1<<(i%BYTE_SIZE)))
{
if(count==nIndex)
{
break;
}
count++;
}
}
g_phb_cntx.active_index=i;
#ifdefined(__MMI_INTELLIGENT_CALL_ALERT__)
if(g_phb_cntx.speak_name)
{
StartTimer(PHB_LIST_SPEAK_NAME_TIMER,UI_POPUP_NOTIFYDURATION_TIME,mmi_phb_list_speak_name);
}
#endif/*defined(__MMI_INTELLIGENT_CALL_ALERT__)*/
}
在09B和10A,请参考下面的修改:
在srv_phb_check_store_index_in_storage直接返回
returnMMI_TRUE;
在mmi_phb_entry_quick_search_list修改,注释掉灰色的部分,增加红色部分:
staticvoidmmi_phb_entry_quick_search_list(void)
{
/*----------------------------------------------------------------*/
/*LocalVariables*/
/*----------------------------------------------------------------*/
U8*gui_buffer;
U16contact_count;
srv_phb_fiLTEr_struct*filter;
U32handle;
mmi_phb_refresh_struct*refresh_data=NULL;
#ifdef__MMI_FTE_SUPPORT__
S32item_count=3;
PU8item_icon[3]={NULL,NULL,NULL};
PU8item_disable_icon[3]={NULL,NULL,NULL};
PU8string[3]={NULL,NULL,NULL};
#endif/*__MMI_FTE_SUPPORT__*/
/*----------------------------------------------------------------*/
/*CodeBody*/
/*----------------------------------------------------------------*/
if(!mmi_frm_scrn_enter(
GRP_ID_PHB_MAIN,
SCR_ID_PHB_QUICK_SEARCH_LIST,
mmi_phb_exit_quick_search_list,
mmi_phb_launch_entry,
MMI_FRM_FULL_SCRN))
{
return;
}
gui_buffer=mmi_frm_scrn_get_active_gui_buf();
RegisterHighlightHandler(mmi_phb_quick_search_get_index);
RegisterCat200SearchFunction(mmi_phb_quick_search_find_entry);
g_phb_quick_search_enter=MMI_PHB_QUICK_SEARCH_MAIN;
g_mmi_phb_list_p->storage=PHB_STORAGE_MAX;
/*refreshpreferstorage*/
if(//g_mmi_phb_list_p->storage!=mmi_phb_get_preferred_storage()||
g_mmi_phb_list_p->display_type!=srv_phb_get_name_display_type())
{
//g_mmi_phb_list_p->storage=(U8)mmi_phb_get_preferred_storage();
g_mmi_phb_list_p->display_type=(U8)srv_phb_get_name_display_type();
gui_buffer=NULL;
g_mmi_phb_list_p->qsearch_input_buffer[0]=0;
}
……
}

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

网站地图

Top