JProfileStorageHandler.c
资源名称:mmi.rar [点击查看]
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:26k
源码类别:
MTK
开发平台:
C/C++
- /*****************************************************************************
- * Copyright Statement:
- * --------------------
- * This software is protected by Copyright and the information contained
- * herein is confidential. The software may not be copied and the information
- * contained herein may not be used or disclosed except with the written
- * permission of MediaTek Inc. (C) 2005
- *
- * BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
- * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
- * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
- * AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
- * NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
- * SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
- * SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
- * THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
- * NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
- * SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
- *
- * BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
- * LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
- * AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
- * OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
- * MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
- *
- * THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
- * WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
- * LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
- * RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
- * THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
- *
- *****************************************************************************/
- /*****************************************************************************
- *
- * Filename:
- * ---------
- * JProfileStorageHandler.C
- *
- * Project:
- * --------
- * MAUI
- *
- * Description:
- * ------------
- * This is source file for NVRAM storage related part for the profiles (BROWSER & MMS .....)
- *
- * Author:
- * -------
- * -------
- *
- *============================================================================
- * HISTORY
- * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
- *------------------------------------------------------------------------------
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- *------------------------------------------------------------------------------
- * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
- *============================================================================
- ****************************************************************************/
- #ifndef _JPROFILESTORAGEHANDLER_C
- #define _JPROFILESTORAGEHANDLER_C
- #include "MMI_features.h"
- #if defined (JATAAYU_SUPPORT) && (defined (WAP_SUPPORT) || (defined (MMS_SUPPORT)))
- #include "stdC.h"
- #include "L4Dr1.h"
- #include "PixtelDataTypes.h"
- #include "EventsGprot.h"
- #include "Ucs2prot.h"
- #include "Unicodexdcl.h"
- #include "wgui_categories_util.h"
- #include "NVRAMType.h"
- #include "NVRAMProt.h"
- #include "NVRAMEnum.h"
- #include "custom_nvram_editor_data_item.h"
- #include "JProvWap.h"
- #include "JProfileHandlerDefs.h"
- #include "JProfileHandlerTypes.h"
- #include "JProfileHandlerProts.h"
- #if defined(MMS_SUPPORT)//dilip
- extern void mmi_jmms_set_profile(void);
- #endif
- extern pBOOL GetUCS2Flag(PS8 buffer);
- /*****************************************************************************
- * FUNCTION
- * mmi_ph_get_brw_profile_name_list
- * DESCRIPTION
- * This reads the browser profile name list from the NVRAM
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_ph_get_brw_profile_name_list(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 error;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_ph_wap_prof_name_arr_p == NULL)
- {
- g_ph_wap_prof_name_arr_p =
- (nvram_wap_profile_name_array_struct*) jdd_MemAlloc(NVRAM_EF_WAP_PROFILE_NAMES_SIZE, 1);
- }
- ReadRecord(NVRAM_EF_WAP_PROFILE_NAMES_LID, 1, g_ph_wap_prof_name_arr_p, NVRAM_EF_WAP_PROFILE_NAMES_SIZE, &error);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_ph_get_mms_profile_name_list
- * DESCRIPTION
- * This reads the MMS profile name list from the NVRAM
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_ph_get_mms_profile_name_list(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 error;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_ph_mms_prof_name_arr_p == NULL)
- {
- g_ph_mms_prof_name_arr_p =
- (nvram_mms_profile_name_array_struct*) jdd_MemAlloc(NVRAM_EF_MMS_PROFILE_NAMES_SIZE, 1);
- }
- ReadRecord(NVRAM_EF_MMS_PROFILE_NAMES_LID, 1, g_ph_mms_prof_name_arr_p, NVRAM_EF_MMS_PROFILE_NAMES_SIZE, &error);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_ph_get_profile_nvram_content_data
- * DESCRIPTION
- * This reads the content data for the given profile index from the NVRAM
- * PARAMETERS
- * index [IN] Index of the profile
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_ph_get_profile_nvram_content_data(U8 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 error;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_ph_cntx.profile_module == PH_BROWSER_PROFILE)
- {
- ReadRecord(
- NVRAM_EF_WAP_PROFILE_CONTENT_LID,
- (U16) (index + 1),
- g_ph_wap_profile_p,
- NVRAM_EF_WAP_PROFILE_CONTENT_SIZE,
- &error);
- }
- else if (g_ph_cntx.profile_module == PH_MMS_PROFILE)
- {
- ReadRecord(
- NVRAM_EF_MMS_PROFILE_CONTENT_LID,
- (U16) (index + 1),
- g_ph_mms_profile_p,
- NVRAM_EF_MMS_PROFILE_CONTENT_SIZE,
- &error);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_ph_get_activated_profile_data
- * DESCRIPTION
- * This gets the activated profile content data from the NVRAM into the global context of the activated profile
- * PARAMETERS
- * profile [IN] Profile type(Browser,MMS.....)
- * index [IN] Activated profile index
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_ph_get_activated_profile_data(ph_profile_enum profile, U8 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 error;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (profile == PH_BROWSER_PROFILE)
- {
- ReadRecord(
- NVRAM_EF_WAP_PROFILE_CONTENT_LID,
- (U16) (index + 1),
- g_ph_activated_wap_profile,
- NVRAM_EF_WAP_PROFILE_CONTENT_SIZE,
- &error);
- }
- else if (profile == PH_MMS_PROFILE)
- {
- ReadRecord(
- NVRAM_EF_MMS_PROFILE_CONTENT_LID,
- (U16) (index + 1),
- g_ph_activated_mms_profile,
- NVRAM_EF_MMS_PROFILE_CONTENT_SIZE,
- &error);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_ph_update_nvram_wap_profile
- * DESCRIPTION
- * This API updates the NVRAM data for the browser profile (both Name & Content)
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_ph_update_nvram_wap_profile(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 error;
- U32 index = g_ph_cntx.profile_index;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (UCS2Strlen((S8*) g_ph_cntx.profile_display_p->profile_name))
- {
- if (GetUCS2Flag((S8*) g_ph_cntx.profile_display_p->profile_name))
- {
- g_ph_wap_prof_name_arr_p->nvram_wap_profile_name_array[index].dcs = PH_DCS_UCS;
- UCS2Strncpy(
- (S8*) (g_ph_wap_prof_name_arr_p->nvram_wap_profile_name_array[index].profile_name),
- (S8*) g_ph_cntx.profile_display_p->profile_name,
- NVRAM_WAP_PROFILE_PROFILE_NAME_LEN);
- }
- else
- {
- g_ph_wap_prof_name_arr_p->nvram_wap_profile_name_array[index].dcs = PH_DCS_ASCII;
- UnicodeToAnsii(
- (S8*) (g_ph_wap_prof_name_arr_p->nvram_wap_profile_name_array[index].profile_name),
- (S8*) g_ph_cntx.profile_display_p->profile_name);
- }
- }
- else
- {
- S8 temp_unicode[8];
- S8 temp[4];
- S8 *profile_name_p;
- profile_name_p = (S8*) get_string((MMI_ID_TYPE) STR_ID_PROF_HDLR_PROFILE);
- gui_itoa((S32) (index + 1), (U16*) temp, 10);
- AnsiiToUnicodeString((S8*) temp_unicode, (S8*) temp);
- UCS2Strcpy((S8*) g_ph_cntx.profile_display_p->profile_name, profile_name_p);
- UCS2Strcat((S8*) g_ph_cntx.profile_display_p->profile_name, temp_unicode);
- g_ph_wap_prof_name_arr_p->nvram_wap_profile_name_array[index].dcs = PH_DCS_UCS;
- UCS2Strncpy(
- (S8*) (g_ph_wap_prof_name_arr_p->nvram_wap_profile_name_array[index].profile_name),
- (S8*) g_ph_cntx.profile_display_p->profile_name,
- NVRAM_WAP_PROFILE_PROFILE_NAME_LEN);
- }
- UnicodeToAnsii((S8*) g_ph_wap_profile_p->homepage_url, (S8*) (g_ph_cntx.profile_display_p->homepage_url));
- UnicodeToAnsii((S8*) (g_ph_wap_profile_p->username), (S8*) (g_ph_cntx.profile_display_p->username));
- UnicodeToAnsii((S8*) (g_ph_wap_profile_p->password), (S8*) (g_ph_cntx.profile_display_p->password));
- if (index == g_ph_cntx.wap_actived_profile_index)
- {
- memcpy(g_ph_activated_wap_profile, g_ph_wap_profile_p, NVRAM_EF_WAP_PROFILE_CONTENT_SIZE);
- }
- WriteRecord(
- NVRAM_EF_WAP_PROFILE_CONTENT_LID,
- (U16) (index + 1),
- g_ph_wap_profile_p,
- NVRAM_EF_WAP_PROFILE_CONTENT_SIZE,
- &error);
- WriteRecord(NVRAM_EF_WAP_PROFILE_NAMES_LID, 1, g_ph_wap_prof_name_arr_p, NVRAM_EF_WAP_PROFILE_NAMES_SIZE, &error);
- DisplayPopup((PU8) GetString(STR_GLOBAL_DONE), IMG_GLOBAL_ACTIVATED, 1, UI_POPUP_NOTIFYDURATION_TIME, SUCCESS_TONE);
- DeleteNHistory(1);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_ph_update_nvram_mms_profile
- * DESCRIPTION
- * This API updates the NVRAM data for the MMS profile (both Name & Content)
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_ph_update_nvram_mms_profile(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 error;
- U32 index = g_ph_cntx.profile_index;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (UCS2Strlen((S8*) g_ph_cntx.profile_display_p->profile_name))
- {
- if (GetUCS2Flag((S8*) g_ph_cntx.profile_display_p->profile_name))
- {
- g_ph_mms_prof_name_arr_p->nvram_mms_profile_name_array[index].dcs = PH_DCS_UCS;
- UCS2Strncpy(
- (S8*) (g_ph_mms_prof_name_arr_p->nvram_mms_profile_name_array[index].profile_name),
- (S8*) g_ph_cntx.profile_display_p->profile_name,
- NVRAM_WAP_PROFILE_PROFILE_NAME_LEN);
- }
- else
- {
- g_ph_mms_prof_name_arr_p->nvram_mms_profile_name_array[index].dcs = PH_DCS_ASCII;
- UnicodeToAnsii(
- (S8*) (g_ph_mms_prof_name_arr_p->nvram_mms_profile_name_array[index].profile_name),
- (S8*) g_ph_cntx.profile_display_p->profile_name);
- }
- }
- else
- {
- S8 temp_unicode[8];
- S8 temp[4];
- S8 *profile_name_p;
- profile_name_p = (S8*) get_string((MMI_ID_TYPE) STR_ID_PROF_HDLR_PROFILE);
- gui_itoa((S32) (index + 1), (U16*) temp, 10);
- AnsiiToUnicodeString((S8*) temp_unicode, (S8*) temp);
- UCS2Strcpy((S8*) g_ph_cntx.profile_display_p->profile_name, profile_name_p);
- UCS2Strcat((S8*) g_ph_cntx.profile_display_p->profile_name, temp_unicode);
- g_ph_mms_prof_name_arr_p->nvram_mms_profile_name_array[index].dcs = PH_DCS_UCS;
- UCS2Strncpy(
- (S8*) (g_ph_mms_prof_name_arr_p->nvram_mms_profile_name_array[index].profile_name),
- (S8*) g_ph_cntx.profile_display_p->profile_name,
- NVRAM_WAP_PROFILE_PROFILE_NAME_LEN);
- }
- UnicodeToAnsii((S8*) g_ph_mms_profile_p->mmsc_url, (S8*) (g_ph_cntx.profile_display_p->homepage_url));
- UnicodeToAnsii((S8*) (g_ph_mms_profile_p->username), (S8*) (g_ph_cntx.profile_display_p->username));
- UnicodeToAnsii((S8*) (g_ph_mms_profile_p->password), (S8*) (g_ph_cntx.profile_display_p->password));
- if (index == g_ph_cntx.mms_actived_profile_index)
- {
- memcpy(g_ph_activated_mms_profile, g_ph_mms_profile_p, NVRAM_EF_MMS_PROFILE_CONTENT_SIZE);
- #if defined(MMS_SUPPORT)/*dilip*/
- mmi_jmms_set_profile();
- #endif
- }
- WriteRecord(
- NVRAM_EF_MMS_PROFILE_CONTENT_LID,
- (U16) (index + 1),
- g_ph_mms_profile_p,
- NVRAM_EF_MMS_PROFILE_CONTENT_SIZE,
- &error);
- WriteRecord(NVRAM_EF_MMS_PROFILE_NAMES_LID, 1, g_ph_mms_prof_name_arr_p, NVRAM_EF_MMS_PROFILE_NAMES_SIZE, &error);
- DisplayPopup((PU8) GetString(STR_GLOBAL_DONE), IMG_GLOBAL_ACTIVATED, 1, UI_POPUP_NOTIFYDURATION_TIME, SUCCESS_TONE);
- DeleteNHistory(1);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_ph_update_nvram_activated_wap_profile
- * DESCRIPTION
- * Updates the NVRAM browser activated profile content data
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_ph_update_nvram_activated_wap_profile(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 error;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- WriteRecord(
- NVRAM_EF_WAP_PROFILE_CONTENT_LID,
- (U16) (g_ph_cntx.wap_actived_profile_index + 1),
- g_ph_activated_wap_profile,
- NVRAM_EF_WAP_PROFILE_CONTENT_SIZE,
- &error);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_ph_update_nvram_activated_mms_profile
- * DESCRIPTION
- * Updates the NVRAM MMS activated profile content data
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_ph_update_nvram_activated_mms_profile(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 error;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- WriteRecord(
- NVRAM_EF_MMS_PROFILE_CONTENT_LID,
- (U16) (g_ph_cntx.mms_actived_profile_index + 1),
- g_ph_activated_mms_profile,
- NVRAM_EF_MMS_PROFILE_CONTENT_SIZE,
- &error);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_ph_update_prov_nvram_wap_profile
- * DESCRIPTION
- * Updates the NVRAM browser profile data(Both Name & Content) with the provisioing data for the index selected
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_ph_update_prov_nvram_wap_profile(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 error;
- U8 conn_type;
- U32 len = 0;
- U32 index = g_ph_cntx.profile_index;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_ph_wap_profile_p->data_account = g_ph_cntx.profile_display_p->data_account;
- WriteRecord(
- NVRAM_EF_WAP_PROFILE_CONTENT_LID,
- (U16) (index + 1),
- g_ph_wap_profile_p,
- NVRAM_EF_WAP_PROFILE_CONTENT_SIZE,
- &error);
- if (index == g_ph_cntx.wap_actived_profile_index)
- {
- memcpy(g_ph_activated_wap_profile, g_ph_wap_profile_p, NVRAM_EF_WAP_PROFILE_CONTENT_SIZE);
- }
- conn_type = g_ph_wap_profile_p->conn_type;
- g_ph_wap_prof_name_arr_p->nvram_wap_profile_name_array[index].conn_type = conn_type;
- len = strlen((PS8) g_prov_profile_name_p);
- if ((g_prov_profile_name_p != NULL) && (len > 0))
- {
- g_ph_wap_prof_name_arr_p->nvram_wap_profile_name_array[index].dcs = PH_DCS_ASCII;
- if (len >= PROV_PROFILE_PROFILE_NAME_LEN)
- {
- len = PROV_PROFILE_PROFILE_NAME_LEN - 1;
- }
- memcpy(g_ph_wap_prof_name_arr_p->nvram_wap_profile_name_array[index].profile_name, g_prov_profile_name_p, len);
- g_ph_wap_prof_name_arr_p->nvram_wap_profile_name_array[index].profile_name[len] = ' ';
- jdd_MemFree(g_prov_profile_name_p);
- g_prov_profile_name_p = NULL;
- }
- else
- {
- S8 temp_unicode[8];
- S8 temp[4];
- S8 *profile_name_p;
- S8 temp_name[PROV_PROFILE_PROFILE_NAME_LEN + 1];
- profile_name_p = (S8*) get_string((MMI_ID_TYPE) STR_ID_PROF_HDLR_PROFILE);
- len = UCS2Strlen((S8*) profile_name_p);
- if (len > (PROV_PROFILE_PROFILE_NAME_LEN / 2))
- {
- len = PROV_PROFILE_PROFILE_NAME_LEN / 2;
- }
- if (GetUCS2Flag((S8*) profile_name_p))
- {
- gui_itoa((S32) (index + 1), (U16*) temp, 10);
- AnsiiToUnicodeString((S8*) temp_unicode, (S8*) temp);
- UCS2Strcat((S8*) profile_name_p, (S8*) temp_unicode);
- g_ph_wap_prof_name_arr_p->nvram_wap_profile_name_array[index].dcs = PH_DCS_UCS;
- memcpy(
- g_ph_wap_prof_name_arr_p->nvram_wap_profile_name_array[index].profile_name,
- profile_name_p,
- len * ENCODING_LENGTH);
- }
- else
- {
- UnicodeNToAnsii((S8*) temp_name, (S8*) profile_name_p, len);
- temp_name[len] = ' ';
- gui_itoa((S32) (index + 1), (U16*) temp, 10);
- strcat(temp_name, temp);
- len = strlen(temp_name);
- memcpy(g_ph_wap_prof_name_arr_p->nvram_wap_profile_name_array[index].profile_name, temp_name, len + 1);
- g_ph_wap_prof_name_arr_p->nvram_wap_profile_name_array[index].dcs = PH_DCS_ASCII;
- }
- }
- WriteRecord(NVRAM_EF_WAP_PROFILE_NAMES_LID, 1, g_ph_wap_prof_name_arr_p, NVRAM_EF_WAP_PROFILE_NAMES_SIZE, &error);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_ph_update_prov_nvram_mms_profile
- * DESCRIPTION
- * Updates the NVRAM browser profile data(Both Name & Content) with the provisioing data for the index selected
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_ph_update_prov_nvram_mms_profile(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 error;
- U32 len;
- U32 index = g_ph_cntx.profile_index;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_ph_mms_profile_p->data_account = g_ph_cntx.profile_display_p->data_account;
- WriteRecord(
- NVRAM_EF_MMS_PROFILE_CONTENT_LID,
- (U16) (index + 1),
- g_ph_mms_profile_p,
- NVRAM_EF_MMS_PROFILE_CONTENT_SIZE,
- &error);
- if (index == g_ph_cntx.mms_actived_profile_index)
- {
- memcpy(g_ph_activated_mms_profile, g_ph_mms_profile_p, NVRAM_EF_MMS_PROFILE_CONTENT_SIZE);
- #if defined(MMS_SUPPORT)/*dilip*/
- mmi_jmms_set_profile();
- #endif
- }
- len = strlen((PS8) g_prov_profile_name_p);
- if ((g_prov_profile_name_p != NULL) && (len > 0))
- {
- g_ph_mms_prof_name_arr_p->nvram_mms_profile_name_array[index].dcs = PH_DCS_ASCII;
- if (len >= PROV_PROFILE_PROFILE_NAME_LEN)
- {
- len = PROV_PROFILE_PROFILE_NAME_LEN - 1;
- }
- memcpy(g_ph_mms_prof_name_arr_p->nvram_mms_profile_name_array[index].profile_name, g_prov_profile_name_p, len);
- g_ph_mms_prof_name_arr_p->nvram_mms_profile_name_array[index].profile_name[len] = ' ';
- jdd_MemFree(g_prov_profile_name_p);
- g_prov_profile_name_p = NULL;
- }
- else
- {
- S8 temp_unicode[8];
- S8 temp[4];
- S8 *profile_name_p;
- S8 temp_name[PROV_PROFILE_PROFILE_NAME_LEN + 1];
- profile_name_p = (S8*) get_string((MMI_ID_TYPE) STR_ID_PROF_HDLR_PROFILE);
- len = UCS2Strlen((S8*) profile_name_p);
- if (len > PROV_PROFILE_PROFILE_NAME_LEN)
- {
- len = PROV_PROFILE_PROFILE_NAME_LEN;
- }
- if (GetUCS2Flag((S8*) profile_name_p))
- {
- gui_itoa((S32) (index + 1), (U16*) temp, 10);
- AnsiiToUnicodeString((S8*) temp_unicode, (S8*) temp);
- UCS2Strcat((S8*) profile_name_p, (S8*) temp_unicode);
- g_ph_mms_prof_name_arr_p->nvram_mms_profile_name_array[index].dcs = PH_DCS_UCS;
- memcpy(
- g_ph_mms_prof_name_arr_p->nvram_mms_profile_name_array[index].profile_name,
- profile_name_p,
- len * ENCODING_LENGTH);
- }
- else
- {
- UnicodeNToAnsii((S8*) temp_name, (S8*) profile_name_p, len);
- temp_name[len] = ' ';
- gui_itoa((S32) (index + 1), (U16*) temp, 10);
- strcat(temp_name, temp);
- len = strlen(temp_name);
- memcpy(g_ph_mms_prof_name_arr_p->nvram_mms_profile_name_array[index].profile_name, temp_name, len + 1);
- g_ph_mms_prof_name_arr_p->nvram_mms_profile_name_array[index].dcs = PH_DCS_ASCII;
- }
- }
- WriteRecord(NVRAM_EF_MMS_PROFILE_NAMES_LID, 1, g_ph_mms_prof_name_arr_p, NVRAM_EF_MMS_PROFILE_NAMES_SIZE, &error);
- }
- #endif /* defined (JATAAYU_SUPPORT) && (defined (WAP_SUPPORT) || (defined (MMS_SUPPORT))) */
- #endif /* _JPROFILESTORAGEHANDLER_C */