icfans

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

0
阅读(322) 评论(0)

[DESCRIPTION]
常见的情况是:A,在电话本设置中,优先存储位置选择All 时,列表界面显示所有联系人;B,优先存储位置选择
SIM卡时,列表界面显示SIM卡中的联系人;添加联系人时,只能往SIM卡上添加;需要实现的效果:设置优先存储位置
,只限制添加联系人时的存储位置,不影响列表界面显示,列表界面一直显示所有的联系人;
[SOLUTION]ICfans
在09A上,参考下面的修改:
在mmi_phb_check_store_index_by_storage 直接返回
return MMI_TRUE;
在 mmi_phb_entry_quick_search_list 中,注释掉灰色的部分,增加红色部分:
void mmi_phb_entry_quick_search_list(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
U8 *guiBuffer;
U16 entryCount;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
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;
}
/* Add new contact , so count + 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' is used only for this screen. */
}
else if (g_phb_cntx.refresh_list == MMI_PHB_ENTRY_REFRESH && !mmi_is_redrawing_bk_screens())
{
/* calculate the new highlight index */
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注释掉灰色的部分,增加红色部分:
void mmi_phb_quick_search_get_index(S32 nIndex)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
U16 i, count = 0;
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
#if defined(__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;
#if defined(__MMI_WGUI_CSK_ENABLE__)
ChangeCenterSoftkey(0, IMG_ID_PHB_CSK_ADD);
#endif
SetKeyHandler(NULL, KEY_SEND, KEY_EVENT_UP);
return;
}
else
{
nIndex--;
}
}
#if defined(__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[i], g_phb_cntx.prefer_storage))
if (!mmi_phb_check_store_index_by_storage(g_phb_name_index[i], 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;
#if defined(__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__) */
}