SFSize_T SFApp_GetCommandLine(UChar* aBuffer,SFSize_T aSize) { SFSize_T realSize; realSize = pfnUnicodeStrlen((S8 *)u16_g_game_file_name); if(realSize >= aSize) { realSize = aSize - 1; } if(realSize > 0) { pfnUnicodeStrncpy((PS8)aBuffer, (PS8)u16_g_game_file_name,realSize); aBuffer[realSize + 1] = 0x0; } return realSize; }
//added by guojian :get the fdn list to gFDLBDLContext, not PhoneBook[]. for our fdn process, not the same with previous one void GetFDLToContext(void *info) { MSG_PHB_GET_ENTRY_BY_INDEX_RSP_STRUCT* localPtr; U8 i= 0,j=0; //micha0317 U8 TempBuff[(MAX_PB_NUMBER_LENGTH+2)*ENCODING_LENGTH]; U8 *tmpConvertBuf = NULL; U16 convertOutLen = 0; U8 name_dcs;//Renwy add 2008/06/25 for '$' error U8 nSimId = 0; #ifdef __MMI_MULTI_SIM__ nSimId = gSecSetupMenuSimID; #endif mmi_trace(1, TSTXT("GetFDLToContext")); localPtr = (MSG_PHB_GET_ENTRY_BY_INDEX_RSP_STRUCT *)info; if (localPtr->result.flag == 0 /*OK*/) { mmi_trace(1, TSTXT("if GetFDLToContext (localPtr->result.flag == 0 /*OK*/) ")); i = gFDLBDLContext[nSimId].FDNBDNCount; gFDLBDLContext[nSimId].FDNBDNCount = localPtr->no_list; //Add number of new entries in current list length. mmi_trace(TRUE," Func: %s gpFDLBDLContext->FDNBDNCount=%d", __FUNCTION__,gFDLBDLContext[nSimId].FDNBDNCount); if (gFDLBDLContext[nSimId].FDNBDNCount > MAX_SIM_ENTRIES) gFDLBDLContext[nSimId].FDNBDNCount = MAX_SIM_ENTRIES; for (; i < gFDLBDLContext[nSimId].FDNBDNCount; i++, j++) { gFDLBDLContext[nSimId].FDLBDLEntries[i].storage = localPtr->list[j].storage; gFDLBDLContext[nSimId].FDLBDLEntries[i].index = localPtr->list[j].index; gFDLBDLContext[nSimId].FDLBDLEntries[i].record_index = localPtr->list[j].record_index; memset(gFDLBDLContext[nSimId].FDLBDLEntries[i].alpha_id.name, 0, MAX_NAME_LEN_FSB_LIST*ENCODING_LENGTH); memset(gFDLBDLContext[nSimId].FDLBDLEntries[i].tel.number, 0, MAX_NUMBER_LEN_FSB_LIST*ENCODING_LENGTH); gFDLBDLContext[nSimId].FDLBDLEntries[i].alpha_id.name_length = localPtr->list[j].alpha_id.name_length; gFDLBDLContext[nSimId].FDLBDLEntries[i].alpha_id.name_dcs = localPtr->list[j].alpha_id.name_dcs; {//Renwy add begine 2008/06/25 for '$' error name_dcs = gFDLBDLContext[0].FDLBDLEntries[i].alpha_id.name_dcs; if (MMI_PHB_ASCII == gFDLBDLContext[0].FDLBDLEntries[i].alpha_id.name_dcs) { name_dcs = MMI_8BIT_DCS; } }//Renwy add end 2008/06/25 for '$' error tmpConvertBuf = CovertStringForPlatform(localPtr->list[j].alpha_id.name, gFDLBDLContext[nSimId].FDLBDLEntries[i].alpha_id.name_length,name_dcs,&convertOutLen);//Renwy modify 2008/06/25 //tmpConvertBuf = CovertStringForPlatform(localPtr->list[j].alpha_id.name, gFDLBDLContext.FDLBDLEntries[i].alpha_id.name_length,gFDLBDLContext.FDLBDLEntries[i].alpha_id.name_dcs,&convertOutLen); gFDLBDLContext[nSimId].FDLBDLEntries[i].alpha_id.name_length = (U8) convertOutLen; if (pfnUnicodeStrlen((PS8) tmpConvertBuf) <= MAX_PB_NAME_LENGTH) { pfnUnicodeStrcpy((PS8) gFDLBDLContext[nSimId].FDLBDLEntries[i].alpha_id.name, (PS8) tmpConvertBuf); } else { pfnUnicodeStrncpy((PS8) gFDLBDLContext[nSimId].FDLBDLEntries[i].alpha_id.name, (PS8) tmpConvertBuf, MAX_PB_NAME_LENGTH); } if (tmpConvertBuf!=NULL) OslMfree(tmpConvertBuf); if (localPtr->list[j].tel.type == MMI_CSMCC_INTERNATIONAL_ADDR) { gFDLBDLContext[nSimId].FDLBDLEntries[i].tel.type = localPtr->list[j].tel.type; gFDLBDLContext[nSimId].FDLBDLEntries[i].tel.number[0] = '+';//insert '+' before the number. gFDLBDLContext[nSimId].FDLBDLEntries[i].tel.length = localPtr->list[j].tel.length; AnsiiToUnicodeString((PS8)TempBuff, (PS8)localPtr->list[j].tel.number); memcpy(gFDLBDLContext[nSimId].FDLBDLEntries[i].tel.number + ENCODING_LENGTH, TempBuff, (localPtr->list[j].tel.length)*ENCODING_LENGTH); } else { gFDLBDLContext[nSimId].FDLBDLEntries[i].tel.type = localPtr->list[j].tel.type; gFDLBDLContext[nSimId].FDLBDLEntries[i].tel.length = localPtr->list[j].tel.length; AnsiiToUnicodeString((PS8)TempBuff, (PS8)localPtr->list[j].tel.number); memcpy(gFDLBDLContext[nSimId].FDLBDLEntries[i].tel.number, (PS8)TempBuff, (localPtr->list[j].tel.length)*ENCODING_LENGTH); } } } }
/************************************************************** FUNCTION NAME : SECSETGetFdlEntriesRsp(void) PURPOSE : getting all entries rsp INPUT PARAMETERS : nil OUTPUT PARAMETERS : nil RETURNS : void Author : Vanita Jain **************************************************************/ void SECSETGetFdlEntriesRsp(void *info) { MSG_PHB_GET_ENTRY_BY_INDEX_RSP_STRUCT* localPtr; U8 i= 0,j=0; //micha0317 U8 TempBuff[(MAX_PB_NUMBER_LENGTH+2)*ENCODING_LENGTH]; U8 *tmpConvertBuf = NULL; U16 convertOutLen = 0; U8 name_dcs;//Renwy add 2008/06/25 for '$' error U8 nSimID; nSimID = MTPNP_AD_get_protocol_event_src_mode(); mmi_trace(1, TSTXT("SECSETGetFdlEntriesRsp")); SetProtocolEventHandlerExt(NULL, PRT_PHB_GET_ENTRY_BY_INDEX_RSP,nSimID); localPtr = (MSG_PHB_GET_ENTRY_BY_INDEX_RSP_STRUCT *)info; if (localPtr->result.flag == 0 /*OK*/) { mmi_trace(1, TSTXT("if (localPtr->result.flag == 0 /*OK*/) ")); i = gpFDLBDLContext->FDNBDNCount; gpFDLBDLContext->FDNBDNCount += localPtr->no_list; //Add number of new entries in current list length. if (gpFDLBDLContext->FDNBDNCount > MAX_SIM_ENTRIES) gpFDLBDLContext->FDNBDNCount = MAX_SIM_ENTRIES; for (; i < gpFDLBDLContext->FDNBDNCount; i++, j++) { gpFDLBDLContext->FDLBDLEntries[i].storage = localPtr->list[j].storage; gpFDLBDLContext->FDLBDLEntries[i].index = localPtr->list[j].index; gpFDLBDLContext->FDLBDLEntries[i].record_index = localPtr->list[j].record_index; memset(gpFDLBDLContext->FDLBDLEntries[i].alpha_id.name, 0, MAX_NAME_LEN_FSB_LIST*ENCODING_LENGTH); memset(gpFDLBDLContext->FDLBDLEntries[i].tel.number, 0, MAX_NUMBER_LEN_FSB_LIST*ENCODING_LENGTH); gpFDLBDLContext->FDLBDLEntries[i].alpha_id.name_length = localPtr->list[j].alpha_id.name_length; gpFDLBDLContext->FDLBDLEntries[i].alpha_id.name_dcs = localPtr->list[j].alpha_id.name_dcs; {//Renwy add begine 2008/06/25 for '$' error name_dcs = gpFDLBDLContext->FDLBDLEntries[i].alpha_id.name_dcs; if (MMI_PHB_ASCII == gpFDLBDLContext->FDLBDLEntries[i].alpha_id.name_dcs) { name_dcs = MMI_8BIT_DCS; } }//Renwy add end 2008/06/25 for '$' error tmpConvertBuf = CovertStringForPlatform(localPtr->list[j].alpha_id.name, gpFDLBDLContext->FDLBDLEntries[i].alpha_id.name_length,name_dcs,&convertOutLen);//Renwy modify 2008/06/25 //tmpConvertBuf = CovertStringForPlatform(localPtr->list[j].alpha_id.name, gFDLBDLContext.FDLBDLEntries[i].alpha_id.name_length,gFDLBDLContext.FDLBDLEntries[i].alpha_id.name_dcs,&convertOutLen); gpFDLBDLContext->FDLBDLEntries[i].alpha_id.name_length = (U8) convertOutLen; if (pfnUnicodeStrlen((PS8) tmpConvertBuf) <= MAX_PB_NAME_LENGTH) { pfnUnicodeStrcpy((PS8) gpFDLBDLContext->FDLBDLEntries[i].alpha_id.name, (PS8) tmpConvertBuf); } else { pfnUnicodeStrncpy((PS8) gpFDLBDLContext->FDLBDLEntries[i].alpha_id.name, (PS8) tmpConvertBuf, MAX_PB_NAME_LENGTH); } if (tmpConvertBuf!=NULL) OslMfree(tmpConvertBuf); if (localPtr->list[j].tel.type == MMI_CSMCC_INTERNATIONAL_ADDR) { gpFDLBDLContext->FDLBDLEntries[i].tel.type = localPtr->list[j].tel.type; gpFDLBDLContext->FDLBDLEntries[i].tel.number[0] = '+';//insert '+' before the number. gpFDLBDLContext->FDLBDLEntries[i].tel.length = localPtr->list[j].tel.length; AnsiiToUnicodeString((PS8)TempBuff, (PS8)localPtr->list[j].tel.number); memcpy(gpFDLBDLContext->FDLBDLEntries[i].tel.number + ENCODING_LENGTH, TempBuff, (localPtr->list[j].tel.length)*ENCODING_LENGTH); } else { gpFDLBDLContext->FDLBDLEntries[i].tel.type = localPtr->list[j].tel.type; gpFDLBDLContext->FDLBDLEntries[i].tel.length = localPtr->list[j].tel.length; AnsiiToUnicodeString((PS8)TempBuff, (PS8)localPtr->list[j].tel.number); memcpy(gpFDLBDLContext->FDLBDLEntries[i].tel.number, (PS8)TempBuff, (localPtr->list[j].tel.length)*ENCODING_LENGTH); } } if (localPtr->no_list == MAX_ENTRIES_IN_LIST) { mmi_trace(1, TSTXT(" if (localPtr->no_list == MAX_ENTRIES_IN_LIST) ")); SECSETGetFdlEntriesReq(); } else { mmi_trace(1, TSTXT(" ViewFDList ")); if(g_FixedInit[nSimID] != TRUE)////man for fdn { ViewFDList(); } gSimReady[nSimID] = TRUE; /* * Retrieve FDN list to ADN buffer when FDN is enable. * Because ADN will not read when FDN is on, so use ADN's buffer to store FDN temporarily * This is for call lookup FDN number usage. */ // if(g_SecuritySetupContext.FdlStatus) // mmi_phb_fdn_get_list_to_ram(); } } else if (localPtr->result.flag == 1 && localPtr->result.cause == 5) { // gFDLBDLContext.FDNBDNCount = 0; gSimReady[nSimID] = TRUE; ViewFDList(); } else { DisplayPopup((PU8)GetString(STR_GLOBAL_UNFINISHED) ,IMG_GLOBAL_UNFINISHED, 1,ST_NOTIFYDURATION,ERROR_TONE); DeleteUptoScrID(SCR_ID_SECSET_FIX_DIAL); } }