Forums | developer.brewmp.com Forums | developer.brewmp.com

Developer

Forums

Forums:

Hi, we have the following bug with the LGE VX4400 handset:

BREW application unable to enumerate the first phone book entry using IADDRBOOK_EnumRecInit and IADDRBOOK_EnumNextRec

Steps to reproduce:
1. Erase phone book and reset phone settings to factory defaults using "Settings -> Security" menu.
2. Add contact: phone number "1", label "Home", name "A"
3. Add contact: phone number "2", label "Home", name "B"
4. Erase contact "B"
5. Use any application that enumerates phone book like this:

ISHELL_CreateInstance(pi->a.m_pIShell, AEECLSID_ADDRBOOK, (void**)&pAddrbook);
IADDRBOOK_EnumRecInit(pAddrbook, AEE_ADDR_CAT_NONE, AEE_ADDRFIELD_NONE, NULL, 0);
recnum = 0;
while(pAddrbook && (pAddrRec = IADDRBOOK_EnumNextRec(pAddrbook)) != NULL)
{
++recnum;
IADDRREC_Release(pAddrRec);

IADDRBOOK_Release(pAddrbook);

Results:
1. recnum will be 0 in spite of there is 1 record in phone book

Comments:
1. IADDRBOOK_GetNumRecs returns 1 - correct number of records
2. The following code also returns 1 in recnum - correct number:

ISHELL_CreateInstance(pi->a.m_pIShell, AEECLSID_ADDRBOOK, (void**)&pAddrbook);
recnum = 0;
for(ndx = 0; ndx < 30; ++ndx)
{
pAddrRec = IADDRBOOK_GetRecByID(pAddrbook, ndx);
if(pAddrRec)
{
++recnum;
IADDRREC_Release(pAddrRec);
}

IADDRBOOK_Release(pAddrbook);

Could you, please, confirm if this is a handset or BREW issue? In our application we need to enumerate all the records in address book and therefore we use IADDRBOOK_EnumRecInit. But with this bug it's hard to rely on it. Is there any workaround you can suggest?