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

Developer

Forums

Forums:

Hi BMP Support We wanted to update the content of "My Name Card" which is the default profile data in native Contact but update is failing with api "pim_IRecordStore_UpdateRecord". Record which has "X-VZW-CONID:MNC" field will be treated as "My Name Card" and can not be deleted from the device, also we can't modify the cell number from this vCard because it is tagged with MDN of device. Sample MNC Record 

BEGIN:VCARD 
VERSION:3.0 
N:Card;My;Name 
FN:My Name Card 
PHOTO:rs:/img/pictureid/PictureID01.hpc 
TEL;TYPE=CELL:4088911215 
TEL;TYPE=HOME:888888888 
X-VZW-CONID:MNC 
X-VZW-SOURCEID:VZW 
X-VZW-NWFLDS:NO 
REV:63 
END:VCARD 


Now when we try to update this record by trying to change some data "pim_IRecordStore_UpdateRecord" fails and it return error code EBADITEM. 

We are seeing below message in the log 

efsdbDevice.c:3652 - efsdbDevice_UpdateRecord: update record COMMIT failed. 

Please find the sample code which is used to retrieve the record and update it. 

UpdateRecord(MyApp*pMe, int nRecordID) 
{ 
int EntryLenReq = 0, EntryLen=0; 
char* Entry = NULL; 
nResult = pim_IRecordStore_GetRecord(pMe->pContactsStore,nRecordID,0,NULL,0,&EntryLenReq); 
if(EntryLenReq > 0 ) 
{ 
char *pResult = NULL; 
Entry = (char*) MALLOC(EntryLenReq + 1); 
EntryLen = EntryLenReq;	
nResult = pim_IRecordStore_GetRecord(pMe->pContactsStore,nRecordID,0,(unsigned char*)Entry,EntryLen,&EntryLenReq); 
//Now check if this is MNC record???? 
pResult = STRISTR(Entry, "X-VZW-CONID:MNC"); 

if(pResult) 
{ 
FREEIF(Entry); 
//We are using same record but just chaned "TYPE=HOME:999999999" param 
Entry = STRDUP("BEGIN:VCARD\r\nVERSION:3.0\r\n\N:Card;My;Name\r\nFN:My Name Card\r\nPHOTO:rs:/img/pictureid/PictureID01.hpc\r\nTEL;TYPE=HOME:999999999\r\nX-VZW-CONID:MNC\r\nX-VZW-SOURCEID:VZW\r\nX-VZW-NWFLDS:NO\r\nREV:63\r\nEND:VCARD\0"); 
nResult = pim_IRecordStore_UpdateRecord(pMe->pContactsStore,UnchangedIDs[j],(const unsigned char*) Entry, STRLEN(Entry)+ 1); 
if(nResult != AEE_SUCCESS) 
{ 
DBGPRINTF("pim_IRecordStore_UpdateRecord Failed Error Code %d",nResult ); 
 
else 
{ 
DBGPRINTF("Record update Successful" ); 
 
 
FREEIF(Entry); 
 
 


Please note that this update fails even if do not change the content of vCard and just update it with the content which we have retrieved through "pim_IRecordStore_GetRecord" call. 

Also Update for other records are working fine without any issues 

This issue we are observing in Pantech CDM8999 and when we copied contact db to simulator we are having similar exception. 

Hi Anand, MNC cannot be deleted or updated per ICS requirement using pim_IRecordStore. 
Thanks,
Mahesh

Hi Anand, MNC cannot be deleted or updated per ICS requirement using pim_IRecordStore. 
Thanks,
Mahesh