SettingProf.c
资源名称:mmi.rar [点击查看]
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:199k
源码类别:
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:
- * ---------
- * SettingProf.c
- *
- * Project:
- * --------
- * MAUI
- *
- * Description:
- * ------------
- * This file is intends for profile API
- *
- * Author:
- * -------
- * -------
- *
- *============================================================================
- * HISTORY
- * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
- *------------------------------------------------------------------------------
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- *------------------------------------------------------------------------------
- * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
- *============================================================================
- ****************************************************************************/
- /**
- * Copyright Notice
- * ?2002 - 2003, Pixtel Communications, Inc., 1489 43rd Ave. W.,
- * Vancouver, B.C. V6M 4K8 Canada. All Rights Reserved.
- * (It is illegal to remove this copyright notice from this software or any
- * portion of it)
- */
- /***************** Settings Application implementation *********************/
- /**************************************************************
- FILENAME : Profiles.c
- PURPOSE : API's to all applications.
- REMARKS : nil
- AUTHOR : Ashima Bajaj, Deepali
- DATE : 5/5/2003
- **************************************************************/
- #include "MMI_features.h" //KP Jerry add on 2007-4-27
- #include "PixtelDataTypes.h"
- #include "CommonScreens.h"
- #include "SettingProfile.h"
- #include "CustDataRes.h"
- #include "SettingDefs.h"
- #include "ProfileGprots.h"
- #include "EventsGprot.h"
- #include "ProfilesEnum.h"
- #include "ProfilesGexdcl.h"
- #include "NVRAMEnum.h"
- #include "NVRAMProt.h"
- #include "NVRAMType.h"
- #include "DebugInitDef.h"
- #include "gpioInc.h"
- #include "AudioInc.h"
- #include "mdi_audio.h"
- #include "Globaldefs.h"
- #include "IdleAppDef.h"
- #include "ProfilesGexdcl.h"
- #include "CallManagementGProt.h"
- #include "KeyBrd.h"
- #include "Profiles_prot.h"
- #include "ProfilesDefs.h" /* MTK robin 1119, AT command set wallpaper and profile */
- #include "ATHandlerProt.h"
- /* Leo add for DLT */
- #include "DownloadDefs.h"
- #include "SimDetectionGprot.h"
- /* Leo end */
- #ifdef __MMI_BT_PROFILE__
- #ifdef __MMI_BT_MTK_SUPPORT__
- #include "BTMMICM.h"
- #include "BTMMICMGprots.h"
- #else /* __MMI_BT_MTK_SUPPORT__ */
- #include "BTMMIBCHS.h"
- #include "BTMMIBCHSGprots.h"
- #endif /* __MMI_BT_MTK_SUPPORT__ */
- #include "BTMMIScr.h"
- #include "BTMMIScrGprots.h"
- #endif /* __MMI_BT_PROFILE__ */
- #ifdef __MMI_USB_SUPPORT__
- #define MMI_PROF_GENERAL_KEYPAD_TIMER_DUR 15 /* sec */
- #ifdef MMI_ON_HARDWARE_P
- extern kal_bool INT_USBBoot(void);
- #endif
- #endif /* __MMI_USB_SUPPORT__ */
- #ifdef __MMI_AUDIO_PLAYER__
- extern BOOL mmi_audply_save_volume(U8 volume);
- extern void mmi_audply_bt_power_off_callback(BOOL success);
- #ifdef __MMI_AUDIO_SPECTRUM_DISPLAY__
- extern void mmi_audply_disable_spectrum_display(void);
- #endif
- #endif /* __MMI_AUDIO_PLAYER__ */
- #ifdef __MMI_FM_RADIO__
- extern void mmi_fmrdo_power_on_main_screen(BOOL turn_on);
- extern void mmi_fmrdo_power_on(BOOL turn_on);
- #endif /* __MMI_FM_RADIO__ */
- #if defined(__MMI_ALM_AUDIO_OPTIONS__) || defined(__MMI_ALM_CUSTOMIZE_TONE__)
- #include "AlarmDef.h"
- #include "AlarmProt.h"
- extern alm_context_struct g_alm_cntx;
- extern alm_framework_context_struct g_alm_frm_cntx;
- #endif /* defined(__MMI_ALM_AUDIO_OPTIONS__) || defined(__MMI_ALM_CUSTOMIZE_TONE__) */
- extern void mdi_audio_set_audio_mode(U8 mode);
- extern void change_font(void);
- #ifdef __MMI_BT_PROFILE__
- extern void mmi_bt_a2dp_deactivate_req(void);
- U8 g_mmi_profiles_bt_reset_pending = 0;
- BOOL g_mmi_profiles_bt_in_call = FALSE;
- static MMI_BOOL g_mmi_profiles_bt_allow_sco = MMI_TRUE; /* Allow SCO connection */
- static MMI_BOOL g_mmi_profiles_bt_inquerying = MMI_FALSE; /* No SCO connection when inquerying */
- #if defined(__MMI_BT_BCHS_SUPPORT__) && defined(__MMI_A2DP_SUPPORT__)
- static BOOL a2dp_signal_disconnecting = FALSE;
- #endif
- #ifdef __MMI_HFP_SUPPORT__
- BOOL g_mmi_profiles_bt_always_use_in_call = FALSE;
- static void (*mmi_profiles_bt_connect_sco_app_callback) (void) = NULL;
- BOOL g_mmi_profiles_bt_app_in_use = FALSE;
- #endif /* __MMI_HFP_SUPPORT__ */
- #endif /* __MMI_BT_PROFILE__ */
- #if defined(__MMI_BT_AUDIO_VIA_SCO__) || defined(__MMI_BT_FM_VIA_SCO__)
- #include "mdi_video.h"
- #define BT_SCO_CONNECT_TIMEOUT_DURATION 20000 /* Timeout to disconnect duration */
- static MMI_BOOL g_mmi_profiles_bt_sco_timeout = MMI_TRUE; /* Timeout mechanism */
- static void (*g_mmi_profiles_bt_inquery_callback) (void) = NULL;
- #endif /* #if defined(__MMI_BT_AUDIO_VIA_SCO__) || defined(__MMI_BT_FM_VIA_SCO__) */
- /*****************************************************************************
- * FUNCTION
- * initializeProfiles
- * DESCRIPTION
- * Set default values in profiles structure.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void initializeProfiles(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- GetDynamicToneIds();
- /* Initialising General Profile */
- gprofiles[0].toneSetup.ringTone = gstartMidiId;
- gprofiles[0].toneSetup.alarmTone = (gstartMidiId + 1);
- gprofiles[0].toneSetup.powerOnTone = (gstartGeneralToneId);
- gprofiles[0].toneSetup.powerOffTone = (gstartGeneralToneId + 1);
- /* MTK brian added to wrap cover open/close tone setup, 2003/10/18 */
- #ifdef __MMI_CLAMSHELL__
- gprofiles[0].toneSetup.coverOpenTone = (gstartGeneralToneId + 2);
- gprofiles[0].toneSetup.coverCloseTone = (gstartGeneralToneId + 3);
- #endif /* __MMI_CLAMSHELL__ */
- /* MTK end */
- gprofiles[0].toneSetup.messageTone = (gstartMiscToneId + 4);
- gprofiles[0].toneSetup.keypadTone = KEYPAD_TONE;
- gprofiles[0].mtCallAlertTypeEnum = MMI_RING;
- gprofiles[0].ringTypeEnum = REPEAT;
- gprofiles[0].extraTone.connectTone = 0;
- gprofiles[0].extraTone.errorTone = 1;
- gprofiles[0].extraTone.campOnTone = 1;
- gprofiles[0].extraTone.warningTone = 1;
- /* MTK brian added to wrap cover open/close tone setup, 2003/10/18 */
- #ifdef __MMI_CLAMSHELL__
- gprofiles[0].answeringMode.coverAnswer = 1;
- #endif
- /* MTK end */
- gprofiles[0].answeringMode.anyKey = 0;
- gprofiles[0].answeringMode.automatic = 1;
- gprofiles[0].light.timer.setsec = 15;
- gprofiles[0].light.status = COLOR_PATTERN1;
- gprofiles[0].fontSizeEnum = THEME_DEFAULT;
- gprofiles[0].keypadVolumeLevel = LEVEL2;
- gprofiles[0].ringVolumeLevel = LEVEL4;
- gprofiles[0].loudSpeakerVolumeLevel = LEVEL4;
- gprofiles[0].intelligentCallAlert = MMI_INTELLIGENT_CALL_ALERT_OFF;
- gprofiles[1].toneSetup.ringTone = gstartMidiId;
- gprofiles[1].toneSetup.alarmTone = (gstartMidiId + 1);
- gprofiles[1].toneSetup.powerOnTone = (POWERON_SILENT);
- gprofiles[1].toneSetup.powerOffTone = (POWEROFF_SILENT);
- /* MTK brian added to wrap cover open/close tone setup, 2003/10/18 */
- #ifdef __MMI_CLAMSHELL__
- gprofiles[1].toneSetup.coverOpenTone = (COVER_OPEN_SILENT);
- gprofiles[1].toneSetup.coverCloseTone = (COVER_CLOSE_SILENT);
- #endif /* __MMI_CLAMSHELL__ */
- /* MTK end */
- gprofiles[1].toneSetup.messageTone = (MESSAGE_SILENT);
- gprofiles[1].toneSetup.keypadTone = KEYPAD_SILENT;
- gprofiles[1].mtCallAlertTypeEnum = MMI_VIBRATION_ONLY;
- gprofiles[1].ringTypeEnum = SINGLE;
- gprofiles[1].extraTone.connectTone = 0;
- gprofiles[1].extraTone.errorTone = 0;
- gprofiles[1].extraTone.campOnTone = 0;
- gprofiles[1].extraTone.warningTone = 0;
- /* MTK brian added to wrap cover open/close tone setup, 2003/10/18 */
- #ifdef __MMI_CLAMSHELL__
- gprofiles[1].answeringMode.coverAnswer = 1;
- #endif
- /* MTK end */
- gprofiles[1].answeringMode.anyKey = 0;
- gprofiles[1].answeringMode.automatic = 1;
- gprofiles[1].light.timer.setsec = 15;
- gprofiles[1].light.status = COLOR_PATTERN1;
- gprofiles[1].fontSizeEnum = THEME_DEFAULT;
- gprofiles[1].keypadVolumeLevel = LEVEL1;
- gprofiles[1].ringVolumeLevel = LEVEL4;
- gprofiles[1].loudSpeakerVolumeLevel = LEVEL4;
- gprofiles[1].intelligentCallAlert = MMI_INTELLIGENT_CALL_ALERT_OFF;
- /* Initialising Outdoor Profile */
- gprofiles[2].toneSetup.ringTone = gstartMidiId;
- gprofiles[2].toneSetup.alarmTone = (gstartMidiId + 1);
- gprofiles[2].toneSetup.powerOnTone = (gstartGeneralToneId + 0);
- gprofiles[2].toneSetup.powerOffTone = (gstartGeneralToneId + 1);
- /* MTK brian added to wrap cover open/close tone setup, 2003/10/18 */
- #ifdef __MMI_CLAMSHELL__
- gprofiles[2].toneSetup.coverOpenTone = (gstartGeneralToneId + 2);
- gprofiles[2].toneSetup.coverCloseTone = (gstartGeneralToneId + 3);
- #endif /* __MMI_CLAMSHELL__ */
- /* MTK end */
- gprofiles[2].toneSetup.messageTone = (gstartMiscToneId + 4);
- gprofiles[2].toneSetup.keypadTone = KEYPAD_TONE;
- gprofiles[2].mtCallAlertTypeEnum = MMI_VIBRATION_AND_RING;
- gprofiles[2].ringTypeEnum = REPEAT;
- gprofiles[2].extraTone.connectTone = 0;
- gprofiles[2].extraTone.errorTone = 1;
- gprofiles[2].extraTone.campOnTone = 1;
- gprofiles[2].extraTone.warningTone = 1;
- /* MTK brian added to wrap cover open/close tone setup, 2003/10/18 */
- #ifdef __MMI_CLAMSHELL__
- gprofiles[2].answeringMode.coverAnswer = 1;
- #endif
- /* MTK end */
- gprofiles[2].answeringMode.anyKey = 0;
- gprofiles[2].answeringMode.automatic = 1;
- gprofiles[2].light.timer.setsec = 15;
- gprofiles[2].light.status = COLOR_PATTERN1;
- gprofiles[2].fontSizeEnum = THEME_DEFAULT;
- gprofiles[2].keypadVolumeLevel = LEVEL7;
- gprofiles[2].ringVolumeLevel = LEVEL7;
- gprofiles[2].loudSpeakerVolumeLevel = LEVEL4;
- gprofiles[2].intelligentCallAlert = MMI_INTELLIGENT_CALL_ALERT_OFF;
- /* Initialising Indoor Profile */
- gprofiles[3].toneSetup.ringTone = gstartMidiId;
- gprofiles[3].toneSetup.alarmTone = (gstartMidiId + 1);
- gprofiles[3].toneSetup.powerOnTone = (gstartGeneralToneId + 0);
- gprofiles[3].toneSetup.powerOffTone = (gstartGeneralToneId + 1);
- /* MTK brian added to wrap cover open/close tone setup, 2003/10/18 */
- #ifdef __MMI_CLAMSHELL__
- gprofiles[3].toneSetup.coverOpenTone = (gstartGeneralToneId + 2);
- gprofiles[3].toneSetup.coverCloseTone = (gstartGeneralToneId + 3);
- #endif /* __MMI_CLAMSHELL__ */
- /* MTK end */
- gprofiles[3].toneSetup.messageTone = (gstartMiscToneId + 4);
- gprofiles[3].toneSetup.keypadTone = KEYPAD_TONE;
- gprofiles[3].mtCallAlertTypeEnum = MMI_RING;
- gprofiles[3].ringTypeEnum = ASCENDING;
- gprofiles[3].extraTone.connectTone = 0;
- gprofiles[3].extraTone.errorTone = 1;
- gprofiles[3].extraTone.campOnTone = 1;
- gprofiles[3].extraTone.warningTone = 1;
- /* MTK brian added to wrap cover open/close tone setup, 2003/10/18 */
- #ifdef __MMI_CLAMSHELL__
- gprofiles[3].answeringMode.coverAnswer = 1;
- #endif
- /* MTK end */
- gprofiles[3].answeringMode.anyKey = 0;
- gprofiles[3].answeringMode.automatic = 1;
- gprofiles[3].light.timer.setsec = 15;
- gprofiles[3].light.status = COLOR_PATTERN1;
- gprofiles[3].fontSizeEnum = THEME_DEFAULT;
- gprofiles[3].keypadVolumeLevel = LEVEL1;
- gprofiles[3].ringVolumeLevel = LEVEL3;
- gprofiles[3].loudSpeakerVolumeLevel = LEVEL4;
- gprofiles[3].intelligentCallAlert = MMI_INTELLIGENT_CALL_ALERT_OFF;
- /* Initialising Headset Profile */
- gprofiles[4].toneSetup.ringTone = gstartMidiId;
- gprofiles[4].toneSetup.alarmTone = (gstartMidiId + 1);
- gprofiles[4].toneSetup.powerOnTone = (gstartGeneralToneId + 0);
- gprofiles[4].toneSetup.powerOffTone = (gstartGeneralToneId + 1);
- /* MTK brian added to wrap cover open/close tone setup, 2003/10/18 */
- #ifdef __MMI_CLAMSHELL__
- gprofiles[4].toneSetup.coverOpenTone = (gstartGeneralToneId + 2);
- gprofiles[4].toneSetup.coverCloseTone = (gstartGeneralToneId + 3);
- #endif /* __MMI_CLAMSHELL__ */
- /* MTK end */
- gprofiles[4].toneSetup.messageTone = (gstartMiscToneId + 4);
- gprofiles[4].toneSetup.keypadTone = KEYPAD_TONE;
- gprofiles[4].mtCallAlertTypeEnum = MMI_RING;
- gprofiles[4].ringTypeEnum = REPEAT;
- gprofiles[4].extraTone.connectTone = 0;
- gprofiles[4].extraTone.errorTone = 1;
- gprofiles[4].extraTone.campOnTone = 1;
- gprofiles[4].extraTone.warningTone = 1;
- /* MTK brian added to wrap cover open/close tone setup, 2003/10/18 */
- #ifdef __MMI_CLAMSHELL__
- gprofiles[4].answeringMode.coverAnswer = 1;
- #endif
- /* MTK end */
- gprofiles[4].answeringMode.anyKey = 0;
- /* MTK: Brian added for KLM */
- gprofiles[4].answeringMode.automatic = 1;
- /* MTK end */
- gprofiles[4].light.timer.setsec = 15;
- gprofiles[4].light.status = COLOR_PATTERN1;
- gprofiles[4].fontSizeEnum = THEME_DEFAULT;
- gprofiles[4].keypadVolumeLevel = LEVEL2;
- gprofiles[4].ringVolumeLevel = LEVEL4;
- gprofiles[4].loudSpeakerVolumeLevel = LEVEL4;
- gprofiles[4].intelligentCallAlert = MMI_INTELLIGENT_CALL_ALERT_OFF;
- /* Initialising Silent Profile */
- gprofiles[5].toneSetup.ringTone = gstartMidiId;
- gprofiles[5].toneSetup.alarmTone = (gstartMidiId + 1);
- gprofiles[5].toneSetup.powerOnTone = (POWERON_SILENT);
- gprofiles[5].toneSetup.powerOffTone = (POWEROFF_SILENT);
- /* MTK brian added to wrap cover open/close tone setup, 2003/10/18 */
- #ifdef __MMI_CLAMSHELL__
- gprofiles[5].toneSetup.coverOpenTone = (COVER_OPEN_SILENT);
- gprofiles[5].toneSetup.coverCloseTone = (COVER_CLOSE_SILENT);
- #endif /* __MMI_CLAMSHELL__ */
- /* MTK end */
- gprofiles[5].toneSetup.messageTone = (MESSAGE_SILENT);
- gprofiles[5].toneSetup.keypadTone = KEYPAD_TONE;
- gprofiles[5].mtCallAlertTypeEnum = MMI_RING;
- gprofiles[5].ringTypeEnum = REPEAT;
- gprofiles[5].extraTone.connectTone = 0;
- gprofiles[5].extraTone.errorTone = 1;
- gprofiles[5].extraTone.campOnTone = 1;
- gprofiles[5].extraTone.warningTone = 1;
- /* MTK brian added to wrap cover open/close tone setup, 2003/10/18 */
- #ifdef __MMI_CLAMSHELL__
- gprofiles[5].answeringMode.coverAnswer = 1;
- #endif
- /* MTK end */
- gprofiles[5].answeringMode.anyKey = 0;
- gprofiles[5].answeringMode.automatic = 1;
- gprofiles[5].light.timer.setsec = 15;
- gprofiles[5].light.status = COLOR_PATTERN1;
- gprofiles[5].fontSizeEnum = THEME_DEFAULT;
- gprofiles[5].keypadVolumeLevel = LEVEL5;
- gprofiles[5].ringVolumeLevel = LEVEL3;
- gprofiles[5].loudSpeakerVolumeLevel = LEVEL4;
- gprofiles[5].intelligentCallAlert = MMI_INTELLIGENT_CALL_ALERT_OFF;
- /* Initialising LoudSpeaker Profile */
- gprofiles[6].toneSetup.ringTone = gstartMidiId;
- gprofiles[6].toneSetup.alarmTone = (gstartMidiId + 1);
- gprofiles[6].toneSetup.powerOnTone = (gstartGeneralToneId + 0);
- gprofiles[6].toneSetup.powerOffTone = (gstartGeneralToneId + 1);
- /* MTK brian added to wrap cover open/close tone setup, 2003/10/18 */
- #ifdef __MMI_CLAMSHELL__
- gprofiles[6].toneSetup.coverOpenTone = (gstartGeneralToneId + 2);
- gprofiles[6].toneSetup.coverCloseTone = (gstartGeneralToneId + 3);
- #endif /* __MMI_CLAMSHELL__ */
- /* MTK end */
- gprofiles[6].toneSetup.messageTone = (gstartMiscToneId + 4);
- gprofiles[6].toneSetup.keypadTone = KEYPAD_TONE;
- gprofiles[6].mtCallAlertTypeEnum = MMI_RING;
- gprofiles[6].ringTypeEnum = REPEAT;
- gprofiles[6].extraTone.connectTone = 0;
- gprofiles[6].extraTone.errorTone = 1;
- gprofiles[6].extraTone.campOnTone = 1;
- gprofiles[6].extraTone.warningTone = 1;
- /* MTK brian added to wrap cover open/close tone setup, 2003/10/18 */
- #ifdef __MMI_CLAMSHELL__
- gprofiles[6].answeringMode.coverAnswer = 1;
- #endif
- /* MTK end */
- gprofiles[6].answeringMode.anyKey = 0;
- gprofiles[6].answeringMode.automatic = 1;
- gprofiles[6].light.timer.setsec = 15;
- gprofiles[6].light.status = COLOR_PATTERN1;
- gprofiles[6].fontSizeEnum = THEME_DEFAULT;
- gprofiles[6].keypadVolumeLevel = LEVEL5;
- gprofiles[6].ringVolumeLevel = LEVEL3;
- gprofiles[6].loudSpeakerVolumeLevel = LEVEL4;
- gprofiles[6].intelligentCallAlert = MMI_INTELLIGENT_CALL_ALERT_OFF;
- }
- /*****************************************************************************
- * FUNCTION
- * GetRingVolumeLevel
- * DESCRIPTION
- * Setting Ring Volume Level for a Profile
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- MMI_VOLUME_LEVEL_ENUM GetRingVolumeLevel(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MMI_VOLUME_LEVEL_ENUM ringVolumeLevel;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ringVolumeLevel = gcurrentprofile.ringVolumeLevel;
- PRINT_INFORMATION(("File: Setting Prof.c <<GetRingVolumeLevel>
- the ring volume level is : %d n", ringVolumeLevel));
- return ringVolumeLevel;
- }
- /*****************************************************************************
- * FUNCTION
- * GetLoudspkrVolumeLevel
- * DESCRIPTION
- * Setting Ring Volume Level for a Profile
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- MMI_VOLUME_LEVEL_ENUM GetLoudspkrVolumeLevel(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MMI_VOLUME_LEVEL_ENUM loudspkr;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- loudspkr = gprofiles[6].loudSpeakerVolumeLevel;
- PRINT_INFORMATION(("File: Setting Prof.c <<GetLoudspkrVolumeLevel>
- the loud volume level is : %d n", loudspkr));
- return loudspkr;
- }
- /*****************************************************************************
- * FUNCTION
- * GetKeypadVolumeLevel
- * DESCRIPTION
- * Setting Keypad Volume Level for a Profile
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- MMI_VOLUME_LEVEL_ENUM GetKeypadVolumeLevel(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MMI_VOLUME_LEVEL_ENUM keypadVolumeLevel;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- keypadVolumeLevel = gcurrentprofile.keypadVolumeLevel;
- PRINT_INFORMATION(("File: Setting Prof.c <<GetKeypadVolumeLevel>
- the keypadVolumeLevel is : %d n", keypadVolumeLevel));
- return keypadVolumeLevel;
- }
- /*****************************************************************************
- * FUNCTION
- * GetMtCallAlertTypeEnum
- * DESCRIPTION
- * Setting Call Alert type for a Profile
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- MMI_ALERT_TYPE GetMtCallAlertTypeEnum(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MMI_ALERT_TYPE mtCallAlertTypeEnum;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mtCallAlertTypeEnum = gcurrentprofile.mtCallAlertTypeEnum;
- PRINT_INFORMATION(("File: Setting Prof.c <<GetMtCallAlertTypeEnum>
- the mtCallAlertTypeEnum is : %d n", mtCallAlertTypeEnum));
- return mtCallAlertTypeEnum;
- }
- /*****************************************************************************
- * FUNCTION
- * GetLightStatus
- * DESCRIPTION
- * Setting Light for a Profile
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- MMI_LEDLIGHT_STATUS_ENUM GetLightStatus(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- LIGHT templight;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- templight.status = gcurrentprofile.light.status;
- PRINT_INFORMATION(("File: Setting Prof.c <<GetLightStatus>
- the light color is : %d n", templight.status));
- return templight.status;
- }
- /*****************************************************************************
- * FUNCTION
- * GetRingTypeEnum
- * DESCRIPTION
- * Setting Ring_Type for a Profile
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- MMI_RING_TYPE_ENUM GetRingTypeEnum(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MMI_RING_TYPE_ENUM ringType;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ringType = gcurrentprofile.ringTypeEnum;
- switch (ringType)
- {
- case SINGLE:
- return 2;
- case REPEAT:
- return 1;
- case ASCENDING:
- return 0;
- default:
- return 1;
- }
- PRINT_INFORMATION(("File: Setting Prof.c <<GetRingTypeEnum>
- the ringType is : %d n", ringType));
- }
- #ifdef __MMI_CONNECT_NOTICE__
- /*****************************************************************************
- * FUNCTION
- * GetConnectNoticeType
- * DESCRIPTION
- * Setting Call Alert type for a Profile
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- U16 GetConnectNoticeType(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MMI_CONNECT_NOTICE_TYPE connectNotice;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- connectNotice = gcurrentprofile.extraTone.connectTone;
- PRINT_INFORMATION(("File: Setting Prof.c <<GetConnectNoticeType>
- the GetConnectNoticeType is : %d n", connectNotice));
- return (U16) connectNotice;
- }
- #endif /* __MMI_CONNECT_NOTICE__ */
- /*****************************************************************************
- * FUNCTION
- * GetAnsweringMode
- * DESCRIPTION
- * Setting Answering mode for a Profile
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- MMI_ANSWERING_MODE *GetAnsweringMode(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- static MMI_ANSWERING_MODE answeringMode;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* MTK brian added to wrap cover open/close tone setup, 2003/10/18 */
- #ifdef __MMI_CLAMSHELL__
- answeringMode.coverAnswer = gcurrentprofile.answeringMode.coverAnswer;
- #endif
- /* MTK end */
- /* MTK: Brian modified for auto answer if test sim, 031020 */
- #ifdef MMI_ON_HARDWARE_P
- if (is_test_sim() || gactivatedprofile == MMI_PROFILE_HEADSET)
- {
- answeringMode.automatic = gcurrentprofile.answeringMode.automatic;
- }
- else
- {
- answeringMode.automatic = FALSE;
- }
- #else /* MMI_ON_HARDWARE_P */
- if (gactivatedprofile == MMI_PROFILE_HEADSET)
- {
- answeringMode.automatic = gcurrentprofile.answeringMode.automatic;
- }
- else
- {
- answeringMode.automatic = FALSE;
- }
- #endif /* MMI_ON_HARDWARE_P */
- //MTK: Brian end
- //answeringMode.automatic = gcurrentprofile.answeringMode.automatic;
- answeringMode.anyKey = gcurrentprofile.answeringMode.anyKey;
- return &answeringMode;
- }
- /*****************************************************************************
- * FUNCTION
- * LoudSpeaker
- * DESCRIPTION
- * Setting loud speaker for a Profile
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- pBOOL LoudSpeaker(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- pBOOL loudSpeaker;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- loudSpeaker = gloudSpeaker;
- PRINT_INFORMATION(("File: Setting Prof.c <<LoudSpeaker>
- the loudSpeaker is : %d n", loudSpeaker));
- return loudSpeaker;
- }
- /*****************************************************************************
- * FUNCTION
- * FontSizeEnum
- * DESCRIPTION
- * Setting Font Size for a Profile
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- MMI_FONT_SIZE_ENUM FontSizeEnum(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MMI_FONT_SIZE_ENUM fontSize;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- fontSize = gcurrentprofile.fontSizeEnum;
- PRINT_INFORMATION(("File: Setting Prof.c <<FontSizeEnum>
- the fontSize is : %d n", fontSize));
- return fontSize;
- }
- /*****************************************************************************
- * FUNCTION
- * GetConnectToneStatus
- * DESCRIPTION
- * Setting Extra Tone for a Profile
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- pBOOL GetConnectToneStatus(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- EXTRA_TONE tempExtraTone;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- tempExtraTone.connectTone = gcurrentprofile.extraTone.connectTone;
- PRINT_INFORMATION(("File: Setting Prof.c <<GetConnectToneStatus>
- the connectTone is : %d n", tempExtraTone.connectTone));
- return tempExtraTone.connectTone;
- }
- /*****************************************************************************
- * FUNCTION
- * GetErrorToneStatus
- * DESCRIPTION
- * Setting Extra Tone for a Profile
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- pBOOL GetErrorToneStatus(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- EXTRA_TONE tempExtraTone;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- tempExtraTone.errorTone = gcurrentprofile.extraTone.errorTone;
- PRINT_INFORMATION(("File: Setting Prof.c <<GetErrorToneStatus>
- the errorTone is : %d n", tempExtraTone.errorTone));
- return tempExtraTone.errorTone;
- }
- /*****************************************************************************
- * FUNCTION
- * GetRingToneID
- * DESCRIPTION
- * Setting ringtone
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- U16 GetRingToneID(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- TONE_SETUP temptoneSetup;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- temptoneSetup.ringTone = gcurrentprofile.toneSetup.ringTone;
- PRINT_INFORMATION(("File: Setting Prof.c <<GetRingToneID>
- the RingToneID is : %d n", temptoneSetup.ringTone));
- return temptoneSetup.ringTone;
- }
- /*****************************************************************************
- * FUNCTION
- * GetPowerOnToneType
- * DESCRIPTION
- * Setting power tone
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- POWERON_TONE_ENUM GetPowerOnToneType(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- TONE_SETUP temptoneSetup;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- temptoneSetup.powerOnTone = gcurrentprofile.toneSetup.powerOnTone;
- PRINT_INFORMATION(("File: Setting Prof.c <<GetPowerOnToneType>
- the PowerOnTone is : %d n", temptoneSetup.powerOnTone));
- return temptoneSetup.powerOnTone;
- }
- /*****************************************************************************
- * FUNCTION
- * GetPowerOffToneType
- * DESCRIPTION
- * Setting power tone
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- POWEROFF_TONE_ENUM GetPowerOffToneType(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- TONE_SETUP temptoneSetup;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- temptoneSetup.powerOffTone = gcurrentprofile.toneSetup.powerOffTone;
- PRINT_INFORMATION(("File: Setting Prof.c <<GetPowerOffToneType>
- the PowerOffTone is : %d n", temptoneSetup.powerOffTone));
- return temptoneSetup.powerOffTone;
- }
- /* MTK brian added to wrap cover open/close tone setup, 2003/10/18 */
- #ifdef __MMI_CLAMSHELL__
- /*****************************************************************************
- * FUNCTION
- * GetCoverOpenToneType
- * DESCRIPTION
- * Setting coveropentone
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- COVER_OPEN_TONE_ENUM GetCoverOpenToneType(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- TONE_SETUP temptoneSetup;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- temptoneSetup.coverOpenTone = gcurrentprofile.toneSetup.coverOpenTone;
- PRINT_INFORMATION(("File: Setting Prof.c <<GetCoverOpenToneType>
- the CoverOpenTone is : %d n", temptoneSetup.coverOpenTone));
- return temptoneSetup.coverOpenTone;
- }
- /*****************************************************************************
- * FUNCTION
- * GetCoverCloseToneType
- * DESCRIPTION
- * Setting power tone
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- COVER_CLOSE_TONE_ENUM GetCoverCloseToneType(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- TONE_SETUP temptoneSetup;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- temptoneSetup.coverCloseTone = gcurrentprofile.toneSetup.coverCloseTone;
- PRINT_INFORMATION(("File: Setting Prof.c <<GetCoverCloseToneType>
- the CoverCloseTone is : %d n", temptoneSetup.coverCloseTone));
- return temptoneSetup.coverCloseTone;
- }
- #endif /* __MMI_CLAMSHELL__ */
- /* MTK end */
- /*****************************************************************************
- * FUNCTION
- * GetKeypadToneType
- * DESCRIPTION
- * Setting Keypad tone
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- KEYPAD_TONE_ENUM GetKeypadToneType(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- TONE_SETUP temptoneSetup;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- temptoneSetup.keypadTone = gcurrentprofile.toneSetup.keypadTone;
- PRINT_INFORMATION(("File: Setting Prof.c <<GetKeypadToneType>
- the keypadTone is : %d n", temptoneSetup.keypadTone));
- return temptoneSetup.keypadTone;
- }
- /*****************************************************************************
- * FUNCTION
- * GetWarningToneType
- * DESCRIPTION
- * Setting warning tone
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- pBOOL GetWarningToneType(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- EXTRA_TONE temptoneSetup;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- temptoneSetup.warningTone = gcurrentprofile.extraTone.warningTone;
- PRINT_INFORMATION(("File: Setting Prof.c <<GetWarningToneType>
- the warningTone is : %d n", temptoneSetup.warningTone));
- return temptoneSetup.warningTone;
- }
- /*****************************************************************************
- * FUNCTION
- * GetMessageToneType
- * DESCRIPTION
- * Setting warning tone
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- MESSAGE_TONE_ENUM GetMessageToneType(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- TONE_SETUP temptoneSetup;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- temptoneSetup.messageTone = gcurrentprofile.toneSetup.messageTone;
- PRINT_INFORMATION(("File: Setting Prof.c <<GetMessageToneType>
- the messageTone is : %d n", temptoneSetup.messageTone));
- return temptoneSetup.messageTone;
- }
- /*****************************************************************************
- * FUNCTION
- * GetAlarmToneType
- * DESCRIPTION
- * Setting warning tone
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- ALARM_TONE_ENUM GetAlarmToneType(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- TONE_SETUP temptoneSetup;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- temptoneSetup.alarmTone = gcurrentprofile.toneSetup.alarmTone;
- PRINT_INFORMATION(("File: Setting Prof.c <<GetAlarmToneType>
- the alarmTone is : %d n", temptoneSetup.alarmTone));
- return (ALARM_TONE_ENUM) (temptoneSetup.alarmTone);
- }
- /*****************************************************************************
- * FUNCTION
- * get_lcdbacklighttimer
- * DESCRIPTION
- * Setting lcdbacklight timer value
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- U8 get_lcdbacklighttimer(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- LIGHT tempLight;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- #ifdef __MMI_USB_SUPPORT__
- if (INT_USBBoot())
- {
- return MMI_PROF_GENERAL_KEYPAD_TIMER_DUR;
- }
- #endif /* __MMI_USB_SUPPORT__ */
- tempLight.timer.setsec = gcurrentprofile.light.timer.setsec;
- PRINT_INFORMATION(("File: Setting Prof.c <<get_lcdbacklighttimer>
- the timer is %d seconds n", tempLight.timer.setsec));
- return tempLight.timer.setsec;
- }
- /*****************************************************************************
- * FUNCTION
- * ActivateProfile
- * DESCRIPTION
- * Activating a profile
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ActivateProfile(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 error = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ReadValue(NVRAM_PROFILES_ACTIVATED, &gactivatedprofile, DS_BYTE, &error);
- PRINT_INFORMATION(("Activated Profile : %d ", (int)gactivatedprofile));
- if (gactivatedprofile == 0xff)
- {
- gactivatedprofile = 0;
- WriteValue(NVRAM_PROFILES_ACTIVATED, &gactivatedprofile, DS_BYTE, &error);
- memcpy(&gcurrentprofile, &gprofiles[gprofileId], sizeof(PROFILE));
- /* SetRingerVolume(GetRingVolumeLevel()); */
- mdi_audio_set_volume_no_apply(MDI_VOLUME_MEDIA, GetRingVolumeLevel());
- SetKeyPadVolume(GetKeypadVolumeLevel());
- }
- else
- {
- memcpy(&gcurrentprofile, &gprofiles[gactivatedprofile], sizeof(PROFILE));
- /* SetRingerVolume(GetRingVolumeLevel()); */
- mdi_audio_set_volume_no_apply(MDI_VOLUME_MEDIA, GetRingVolumeLevel());
- SetKeyPadVolume(GetKeypadVolumeLevel());
- }
- //KP Jerry add on 2007-03-31 start
- #ifdef __MMI_PROFILE_POWER_SAVING__
- ProfileResetBackLightSetting();
- ProfilesResetKeyBacklight();
- SetGPIOLevelReq(GPIO_DEV_LED_MAINLCD, LED_LIGHT_LEVEL5);
- #endif
- //KP Jerry add on 2007-03-31 end
- mdi_audio_set_mic_volume();
- showAlertStatusIcons();
- change_font();
- /*******************************************************/
- /* Robin 0602, Remove set AT command profile functions */
- /* AT command will query MMI when needed */
- /*******************************************************/
- /*
- * if (gactivatedprofile==5)
- * SilentModeOn();
- * else
- * SilentModeOff();
- */
- }
- /*****************************************************************************
- * FUNCTION
- * ActivatefirstProfile
- * DESCRIPTION
- * Activating the profile first time bootup
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ActivatefirstProfile()
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gactivatedprofile = gprofileId;
- memcpy(&gcurrentprofile, &gprofiles[gprofileId], sizeof(PROFILE));
- }
- /*****************************************************************************
- * FUNCTION
- * StopSilentProfileVibrator
- * DESCRIPTION
- * Stop Silent profile Vibrator
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void StopSilentProfileVibrator(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- StopTimer(TIMER_PROFILES_TONE_PLAY);
- VibratorOff();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_profiles_restore_activated_profile
- * DESCRIPTION
- * restore audio mode & current activated profile after factory mode
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_profiles_restore_activated_profile(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (mmi_gpio_is_earphone_plug_in())
- {
- /* enter headset mode */
- mdi_audio_set_audio_mode(AUD_MODE_HEADSET);
- SetModeSpeechVolume();
- mmi_profiles_headset_activate_profile();
- }
- else
- {
- /* enter non-headset mode */
- mdi_audio_set_audio_mode(AUD_MODE_NORMAL);
- SetModeSpeechVolume();
- ActivateProfile();
- }
- }
- /*****************************************************************************
- * FUNCTION
- * ActivateSilentProfile
- * DESCRIPTION
- * Silent Profile
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ActivateSilentProfile(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 error = 0;
- U16 j = 1;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ClearKeyEvents();
- //KP Jerry modify on 2007-4-3 start
- #ifdef __MMI_PROFILE_POWER_SAVING__
- #ifdef __MMI_BT_PROFILE__
- if ((gactivatedprofile != MMI_PROFILE_SILENT) && (gprofileheadset != 1) && (gactivatedprofile != MMI_PROFILE_BT) && (gactivatedprofile != MMI_PROFILE_POWER_SAVING))
- #else
- if ((gactivatedprofile != MMI_PROFILE_SILENT) && (gprofileheadset != 1) && (gactivatedprofile != MMI_PROFILE_POWER_SAVING))
- #endif
- #else/*!__MMI_PROFILE_POWER_SAVING__*/
- #ifdef __MMI_BT_PROFILE__
- if ((gactivatedprofile != MMI_PROFILE_SILENT) && (gprofileheadset != 1) && (gactivatedprofile != MMI_PROFILE_BT))
- #else
- if ((gactivatedprofile != MMI_PROFILE_SILENT) && (gprofileheadset != 1))
- #endif
- #endif/*__MMI_PROFILE_POWER_SAVING__*/
- //KP Jerry modify on 2007-4-3 end
- {
- memcpy(&gcurrentprofile, &gprofiles[gactivatedprofile], sizeof(PROFILE));
- glastactivatedprofile = gactivatedprofile;
- gactivatedprofile = gprofileId = MMI_PROFILE_SILENT;
- WriteValue(NVRAM_PROFILES_ACTIVATED, &gactivatedprofile, DS_BYTE, &error);
- WriteValue(NVRAM_PROFILES_LASTACTIVATED, &glastactivatedprofile, DS_BYTE, &error);
- /* MTK brian modified to make it vibrate in silent mode, 2003/10/28 */
- gcurrentprofile.mtCallAlertTypeEnum = MMI_VIBRATION_ONLY;
- /* MTK brian added to wrap cover open/close tone setup, 2003/10/18 */
- #ifdef __MMI_CLAMSHELL__
- gcurrentprofile.toneSetup.coverCloseTone = COVER_CLOSE_SILENT;
- gcurrentprofile.toneSetup.coverOpenTone = COVER_OPEN_SILENT;
- #endif /* __MMI_CLAMSHELL__ */
- /* MTK end */
- gcurrentprofile.toneSetup.keypadTone = KEYPAD_SILENT;
- gcurrentprofile.toneSetup.messageTone = MESSAGE_SILENT;
- gcurrentprofile.toneSetup.powerOffTone = POWEROFF_SILENT;
- gcurrentprofile.toneSetup.powerOnTone = POWERON_SILENT;
- gcurrentprofile.extraTone.campOnTone = 0;
- gcurrentprofile.extraTone.errorTone = 0;
- gcurrentprofile.extraTone.connectTone = 0;
- gcurrentprofile.extraTone.warningTone = 0;
- gcurrentprofile.intelligentCallAlert = MMI_INTELLIGENT_CALL_ALERT_OFF;
- memcpy(&gprofiles[gactivatedprofile], &gcurrentprofile, sizeof(PROFILE));
- WriteRecord(NVRAM_EF_PROFILES_LID, j, &gprofiles[0], NVRAM_PROFILES_RECORD_SIZE, &error);
- DisplayPopup((U8*) GetString(STR_SILENT_ACTIVATE_MESSAGE), IMG_GLOBAL_ACTIVATED, 1, 2000, (U8) SUCCESS_TONE);
- DeleteScreenIfPresent(IDLE_SCREEN_DIGIT_HANDLER_ID);
- showAlertStatusIcons();
- /************************************************/
- /* Robin 0602, Remove set AT command profile functions */
- /* AT command will query MMI when needed */
- /************************************************/
- /* SilentModeOn(); */
- VibratorOn();
- StartTimer(TIMER_PROFILES_TONE_PLAY, 1000, StopSilentProfileVibrator);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * DeactivateSilentProfile
- * DESCRIPTION
- * DeactivateSilent Profile
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void DeactivateSilentProfile(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 error = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (gactivatedprofile == MMI_PROFILE_SILENT)
- {
- gprofileId = 0;
- gactivatedprofile = glastactivatedprofile;
- memcpy(&gcurrentprofile, &gprofiles[gactivatedprofile], sizeof(PROFILE));
- WriteValue(NVRAM_PROFILES_ACTIVATED, &gactivatedprofile, DS_BYTE, &error);
- /* SetRingerVolume(GetRingVolumeLevel()); */
- mdi_audio_set_volume_no_apply(MDI_VOLUME_MEDIA, GetRingVolumeLevel());
- SetKeyPadVolume(GetKeypadVolumeLevel());
- change_font();
- switch (gactivatedprofile)
- {
- case MMI_PROFILE_GENERAL:
- DisplayPopup(
- (U8*) GetString(STR_GENERAL_RESTORED_MESSAGE),
- IMG_GLOBAL_ACTIVATED,
- 1,
- 2000,
- (U8) SUCCESS_TONE);
- break;
- case MMI_PROFILE_MEETING:
- DisplayPopup(
- (U8*) GetString(STR_MEETING_RESTORED_MESSAGE),
- IMG_GLOBAL_ACTIVATED,
- 1,
- 2000,
- (U8) SUCCESS_TONE);
- break;
- case MMI_PROFILE_OUTDOOR:
- DisplayPopup(
- (U8*) GetString(STR_OUTDOOR_RESTORED_MESSAGE),
- IMG_GLOBAL_ACTIVATED,
- 1,
- 2000,
- (U8) SUCCESS_TONE);
- break;
- case MMI_PROFILE_INDOOR:
- DisplayPopup(
- (U8*) GetString(STR_INDOOR_RESTORED_MESSAGE),
- IMG_GLOBAL_ACTIVATED,
- 1,
- 2000,
- (U8) SUCCESS_TONE);
- break;
- case MMI_PROFILE_HEADSET:
- /* DisplayPopup((U8*)GetString(STR_HEADSET_RESTORED_MESSAGE),IMG_GLOBAL_ACTIVATED,1,2000,(U8)SUCCESS_TONE); */
- break;
- //KP Jerry add on 2007-4-1 start
- #ifdef __MMI_PROFILE_POWER_SAVING__
- case MMI_PROFILE_POWER_SAVING:
- DisplayPopup(
- (U8*) GetString(STR_POWER_SAVING_RESTORED_MESSAGE),
- IMG_GLOBAL_ACTIVATED,
- 1,
- 2000,
- (U8) SUCCESS_TONE);
- break;
- #endif
- //KP Jerry add on 2007-4-1 end
- case MMI_PROFILE_SILENT:
- /* DisplayPopup((U8*)GetString(STR_SILENT_RESTORED_MESSAGE),IMG_GLOBAL_ACTIVATED,1,2000,(U8)SUCCESS_TONE); */
- break;
- #ifdef __MMI_BT_PROFILE__
- case MMI_PROFILE_BT:
- #endif
- break;
- }
- DeleteScreenIfPresent(IDLE_SCREEN_DIGIT_HANDLER_ID);
- showAlertStatusIcons();
- /************************************************/
- /* Robin 0602, Remove set AT command profile functions */
- /* AT command will query MMI when needed */
- /************************************************/
- /* SilentModeOff(); */
- }
- }
- /*************************************************************************
- Set Functions
- **************************************************************************/
- /*****************************************************************************
- * FUNCTION
- * SetRingVolumeLevel
- * DESCRIPTION
- * Setting Ring Volume Level
- * PARAMETERS
- * volumelevel [IN]
- * RETURNS
- * void
- *****************************************************************************/
- S16 SetRingVolumeLevel(MMI_VOLUME_LEVEL_ENUM volumelevel)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 error = 0;
- U16 j = 1;
- MMI_VOLUME_LEVEL_ENUM ringVolumeLevel;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gprofiles[gprofileId].ringVolumeLevel = volumelevel;
- if (gactivatedprofile == gprofileId)
- {
- memcpy(&gcurrentprofile, &gprofiles[gprofileId], sizeof(PROFILE));
- }
- if (WriteRecord(
- NVRAM_EF_PROFILES_LID,
- j,
- &gprofiles[0],
- NVRAM_PROFILES_RECORD_SIZE,
- &error) < NVRAM_PROFILES_RECORD_SIZE)
- {
- PRINT_INFORMATION(("## ERROR: SetRingVolumeLevel: WriteRecord " "to NVRAM failed (ecode%d)n", (int)error));
- return error;
- }
- /***** restore the ring volume of activated profile******/
- ringVolumeLevel = gprofiles[gactivatedprofile].ringVolumeLevel;
- SetRingerVolume(ringVolumeLevel);
- return 0;
- }
- /* MTK Brian added for setting activated ring tone volume, 2003/12/02 */
- /*****************************************************************************
- * FUNCTION
- * SetActivatedRingVolumeLevel
- * DESCRIPTION
- * Setting Ring Volume Level of the Activated Profile
- * PARAMETERS
- * volumelevel [IN]
- * RETURNS
- * void
- *****************************************************************************/
- S16 SetActivatedRingVolumeLevel(MMI_VOLUME_LEVEL_ENUM volumelevel)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 error = 0;
- U16 j = 1;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gprofiles[gactivatedprofile].ringVolumeLevel = volumelevel;
- gcurrentprofile.ringVolumeLevel = volumelevel;
- if (WriteRecord(
- NVRAM_EF_PROFILES_LID,
- j,
- &gprofiles[0],
- NVRAM_PROFILES_RECORD_SIZE,
- &error) < NVRAM_PROFILES_RECORD_SIZE)
- {
- PRINT_INFORMATION(("## ERROR: SetRingVolumeLevel: WriteRecord " "to NVRAM failed (ecode%d)n", (int)error));
- return error;
- }
- SetRingerVolume(volumelevel);
- return 0;
- }
- /*****************************************************************************
- * FUNCTION
- * SetKeypadVolumeLevel
- * DESCRIPTION
- * Setting Keypad Volume Level
- * PARAMETERS
- * volumelevel [IN]
- * RETURNS
- * void
- *****************************************************************************/
- S16 SetKeypadVolumeLevel(MMI_VOLUME_LEVEL_ENUM volumelevel)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 error = 0;
- U16 j = 1;
- MMI_VOLUME_LEVEL_ENUM keypadVolumelevel;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gprofiles[gprofileId].keypadVolumeLevel = volumelevel;
- if (gactivatedprofile == gprofileId)
- {
- memcpy(&gcurrentprofile, &gprofiles[gprofileId], sizeof(PROFILE));
- }
- if (WriteRecord(
- NVRAM_EF_PROFILES_LID,
- j,
- &gprofiles[0],
- NVRAM_PROFILES_RECORD_SIZE,
- &error) < NVRAM_PROFILES_RECORD_SIZE)
- {
- PRINT_INFORMATION(("## ERROR: SetKeypadVolumeLevel: WriteRecord " "to NVRAM failed (ecode%d)n", (int)error));
- return error;
- }
- /***** restore the keypad tone volume of activated profile******/
- keypadVolumelevel = gprofiles[gactivatedprofile].keypadVolumeLevel;
- SetKeyPadVolume(keypadVolumelevel);
- return 0;
- }
- /* MTK Brian added for setting activated keypad volume, 2003/12/02 */
- /*****************************************************************************
- * FUNCTION
- * SetActivatedKeypadVolumeLevel
- * DESCRIPTION
- * Setting Keypad Volume Level of the Activated Profile
- * PARAMETERS
- * volumelevel [IN]
- * RETURNS
- * void
- *****************************************************************************/
- S16 SetActivatedKeypadVolumeLevel(MMI_VOLUME_LEVEL_ENUM volumelevel)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 error = 0;
- U16 j = 1;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gprofiles[gactivatedprofile].keypadVolumeLevel = volumelevel;
- gcurrentprofile.keypadVolumeLevel = volumelevel;
- if (WriteRecord(
- NVRAM_EF_PROFILES_LID,
- j,
- &gprofiles[0],
- NVRAM_PROFILES_RECORD_SIZE,
- &error) < NVRAM_PROFILES_RECORD_SIZE)
- {
- PRINT_INFORMATION(("## ERROR: SetActivatedKeypadVolumeLevel: WriteRecord "
- "to NVRAM failed (ecode%d)n", (int)error));
- return error;
- }
- SetKeyPadVolume(volumelevel);
- return 0;
- }
- /*****************************************************************************
- * FUNCTION
- * SetMtCallAlertTypeEnum
- * DESCRIPTION
- * Setting Call Alert Type
- * PARAMETERS
- * callalerttype [IN]
- * RETURNS
- * void
- *****************************************************************************/
- S16 SetMtCallAlertTypeEnum(MMI_ALERT_TYPE callalerttype)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 error = 0;
- U16 j = 1;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* MTK Brian modified to skip writing nvram if no change, 2003/11/26 */
- if (gprofiles[gprofileId].mtCallAlertTypeEnum != callalerttype)
- {
- gprofiles[gprofileId].mtCallAlertTypeEnum = callalerttype;
- if (WriteRecord(
- NVRAM_EF_PROFILES_LID,
- j,
- &gprofiles[0],
- NVRAM_PROFILES_RECORD_SIZE,
- &error) < NVRAM_PROFILES_RECORD_SIZE)
- {
- PRINT_INFORMATION(("## ERROR: SetMtCallAlertTypeEnum: WriteRecord "
- "to NVRAM failed (ecode%d)n", (int)error));
- return error;
- }
- if (gactivatedprofile == gprofileId)
- {
- memcpy(&gcurrentprofile, &gprofiles[gprofileId], sizeof(PROFILE));
- }
- showAlertStatusIcons();
- /************************************************/
- /* Robin 0602, Remove set AT command profile functions */
- /* AT command will query MMI when needed */
- /************************************************/
- /*
- * if (callalerttype == MMI_VIBRATION_ONLY ||
- * callalerttype == MMI_VIBRATION_AND_RING||
- * callalerttype == MMI_VIBRATION_THEN_RING)
- * SendSetVibrationMode(1);
- * else
- * SendSetVibrationMode(0);
- */
- }
- return 0;
- }
- /*****************************************************************************
- * FUNCTION
- * SetRingToneID
- * DESCRIPTION
- * Setting Ring tone ID.
- * PARAMETERS
- * ringtoneid [IN]
- * RETURNS
- * void
- *****************************************************************************/
- S16 SetRingToneID(U16 ringtoneid)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 error = 0;
- U16 j = 1;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gprofiles[gprofileId].toneSetup.ringTone = ringtoneid;
- if (WriteRecord(
- NVRAM_EF_PROFILES_LID,
- j,
- &gprofiles[0],
- NVRAM_PROFILES_RECORD_SIZE,
- &error) < NVRAM_PROFILES_RECORD_SIZE)
- {
- PRINT_INFORMATION(("## ERROR: SetRingToneID: WriteRecord " "to NVRAM failed (ecode%d)n", (int)error));
- return error;
- }
- if (gactivatedprofile == gprofileId)
- {
- memcpy(&gcurrentprofile, &gprofiles[gprofileId], sizeof(PROFILE));
- }
- return 0;
- }
- #ifdef __MMI_DOWNLOADABLE_THEMES_SUPPORT__
- /*****************************************************************************
- * FUNCTION
- * ThemeManagerSetRingTone
- * DESCRIPTION
- *
- * PARAMETERS
- * ringtoneid [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void ThemeManagerSetRingTone(U16 ringtoneid)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 error = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gprofiles[gactivatedprofile].toneSetup.ringTone = ringtoneid;
- WriteRecord(NVRAM_EF_PROFILES_LID, 1, &gprofiles[0], NVRAM_PROFILES_RECORD_SIZE, &error);
- memcpy(&gcurrentprofile, &gprofiles[gactivatedprofile], sizeof(PROFILE));
- }
- /*****************************************************************************
- * FUNCTION
- * ThemeManagerResetRingTone
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ThemeManagerResetRingTone(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 flag = 0, i;
- S16 error;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- for (i = 0; i < MAX_ELEMENTS; ++i)
- {
- if (gprofiles[i].toneSetup.ringTone == CURRENT_THEME_INCOMING_CALL_TONE)
- {
- flag = 1;
- gprofiles[i].toneSetup.ringTone = MIDI_1;
- }
- }
- if (flag)
- {
- WriteRecord(NVRAM_EF_PROFILES_LID, 1, &gprofiles[0], NVRAM_PROFILES_RECORD_SIZE, &error);
- memcpy(&gcurrentprofile, &gprofiles[gactivatedprofile], sizeof(PROFILE));
- }
- }
- #endif /* __MMI_DOWNLOADABLE_THEMES_SUPPORT__ */
- /*****************************************************************************
- * FUNCTION
- * SetLightStatus
- * DESCRIPTION
- * Setting Light status (Color)
- * PARAMETERS
- * backlightstatus [IN]
- * RETURNS
- * void
- *****************************************************************************/
- S16 SetLightStatus(MMI_LEDLIGHT_STATUS_ENUM backlightstatus)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 error = 0;
- U16 j = 1;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gprofiles[gprofileId].light.status = backlightstatus;
- if (WriteRecord(
- NVRAM_EF_PROFILES_LID,
- j,
- &gprofiles[0],
- NVRAM_PROFILES_RECORD_SIZE,
- &error) < NVRAM_PROFILES_RECORD_SIZE)
- {
- PRINT_INFORMATION(("## ERROR: SetLightStatus: WriteRecord " "to NVRAM failed (ecode%d)n", (int)error));
- return error;
- }
- if (gactivatedprofile == gprofileId)
- {
- memcpy(&gcurrentprofile, &gprofiles[gprofileId], sizeof(PROFILE));
- }
- return 0;
- }
- /*****************************************************************************
- * FUNCTION
- * SetRingTypeEnum
- * DESCRIPTION
- * Setting Ring Type
- * PARAMETERS
- * ringtype [IN]
- * RETURNS
- * void
- *****************************************************************************/
- S16 SetRingTypeEnum(MMI_RING_TYPE_ENUM ringtype)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 error = 0;
- U16 j = 1;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gprofiles[gprofileId].ringTypeEnum = ringtype;
- if (WriteRecord(
- NVRAM_EF_PROFILES_LID,
- j,
- &gprofiles[0],
- NVRAM_PROFILES_RECORD_SIZE,
- &error) < NVRAM_PROFILES_RECORD_SIZE)
- {
- PRINT_INFORMATION(("## ERROR: SetRingTypeEnum: WriteRecord " "to NVRAM failed (ecode%d)n", (int)error));
- return error;
- }
- if (gactivatedprofile == gprofileId)
- {
- memcpy(&gcurrentprofile, &gprofiles[gprofileId], sizeof(PROFILE));
- }
- return 0;
- }
- #ifdef __MMI_CONNECT_NOTICE__
- /*****************************************************************************
- * FUNCTION
- * SetConnectNotice
- * DESCRIPTION
- * Setting Connect Notice Type
- * PARAMETERS
- * type [IN]
- * RETURNS
- * void
- *****************************************************************************/
- S16 SetConnectNotice(U16 type)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 error = 0;
- U16 j = 1;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gprofiles[gprofileId].extraTone.connectTone = type;
- if (WriteRecord(
- NVRAM_EF_PROFILES_LID,
- j,
- &gprofiles[0],
- NVRAM_PROFILES_RECORD_SIZE,
- &error) < NVRAM_PROFILES_RECORD_SIZE)
- {
- PRINT_INFORMATION(("## ERROR: SetConnectNoticeEnum: WriteRecord " "to NVRAM failed (ecode%d)n", (int)error));
- return error;
- }
- if (gactivatedprofile == gprofileId)
- {
- memcpy(&gcurrentprofile, &gprofiles[gprofileId], sizeof(PROFILE));
- }
- return 0;
- }
- #endif /* __MMI_CONNECT_NOTICE__ */
- /*****************************************************************************
- * FUNCTION
- * SetAnsweringMode
- * DESCRIPTION
- * Setting Answering Mode
- * PARAMETERS
- * answeringmode [IN]
- * RETURNS
- * void
- *****************************************************************************/
- S16 SetAnsweringMode(MMI_ANSWERING_MODE answeringmode)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 error = 0;
- U16 j = 1;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- memcpy(&gprofiles[gprofileId].answeringMode, &answeringmode, sizeof(MMI_ANSWERING_MODE));
- if (WriteRecord(
- NVRAM_EF_PROFILES_LID,
- j,
- &gprofiles[0],
- NVRAM_PROFILES_RECORD_SIZE,
- &error) < NVRAM_PROFILES_RECORD_SIZE)
- {
- PRINT_INFORMATION(("## ERROR: SetAnsweringModeEnum: WriteRecord " "to NVRAM failed (ecode%d)n", (int)error));
- return error;
- }
- if (gactivatedprofile == gprofileId)
- {
- memcpy(&gcurrentprofile, &gprofiles[gprofileId], sizeof(PROFILE));
- }
- return 0;
- }
- /*****************************************************************************
- * FUNCTION
- * SetLoudSpeaker
- * DESCRIPTION
- * Setting Loud Speaker (On/Off)
- * PARAMETERS
- * loudspeaker [IN]
- * RETURNS
- * void
- *****************************************************************************/
- S16 SetLoudSpeaker(pBOOL loudspeaker)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (loudspeaker == 1)
- {
- gloudSpeaker = loudspeaker;
- }
- else
- {
- gloudSpeaker = loudspeaker;
- }
- SetRingerVolume(GetRingVolumeLevel());
- SetKeyPadVolume(GetKeypadVolumeLevel());
- return 0;
- }
- /*****************************************************************************
- * FUNCTION
- * SetErrorToneStatus
- * DESCRIPTION
- * Setting Error Tone status (On/Off)
- * PARAMETERS
- * errortonestatus [IN]
- * RETURNS
- * void
- *****************************************************************************/
- S16 SetErrorToneStatus(pBOOL errortonestatus)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 error = 0;
- U16 j = 1;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gprofiles[gprofileId].extraTone.errorTone = errortonestatus;
- if (WriteRecord(
- NVRAM_EF_PROFILES_LID,
- j,
- &gprofiles[0],
- NVRAM_PROFILES_RECORD_SIZE,
- &error) < NVRAM_PROFILES_RECORD_SIZE)
- {
- PRINT_INFORMATION(("## ERROR: SetErrorToneStatus: WriteRecord " "to NVRAM failed (ecode%d)n", (int)error));
- return error;
- }
- if (gactivatedprofile == gprofileId)
- {
- memcpy(&gcurrentprofile, &gprofiles[gprofileId], sizeof(PROFILE));
- }
- return 0;
- }
- #ifndef __MMI_CONNECT_NOTICE__
- /*****************************************************************************
- * FUNCTION
- * SetConnectToneStatus
- * DESCRIPTION
- * Setting Connect Tone status (On/Off)
- * PARAMETERS
- * connecttone [IN]
- * RETURNS
- * void
- *****************************************************************************/
- S16 SetConnectToneStatus(pBOOL connecttone)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 error = 0;
- U16 j = 1;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gprofiles[gprofileId].extraTone.connectTone = connecttone;
- if (WriteRecord(
- NVRAM_EF_PROFILES_LID,
- j,
- &gprofiles[0],
- NVRAM_PROFILES_RECORD_SIZE,
- &error) < NVRAM_PROFILES_RECORD_SIZE)
- {
- PRINT_INFORMATION(("## ERROR: SetConnectToneStatus: WriteRecord " "to NVRAM failed (ecode%d)n", (int)error));
- return error;
- }
- if (gactivatedprofile == gprofileId)
- {
- memcpy(&gcurrentprofile, &gprofiles[gprofileId], sizeof(PROFILE));
- }
- return 0;
- }
- #endif /* __MMI_CONNECT_NOTICE__ */
- /*****************************************************************************
- * FUNCTION
- * SetPowerOnToneType
- * DESCRIPTION
- *
- * PARAMETERS
- * tone [IN]
- * RETURNS
- * void
- *****************************************************************************/
- S16 SetPowerOnToneType(TONE_SETUP tone)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 error = 0;
- U16 j = 1;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gprofiles[gprofileId].toneSetup.powerOnTone = tone.powerOnTone;
- if (WriteRecord(
- NVRAM_EF_PROFILES_LID,
- j,
- &gprofiles[0],
- NVRAM_PROFILES_RECORD_SIZE,
- &error) < NVRAM_PROFILES_RECORD_SIZE)
- {
- PRINT_INFORMATION(("## ERROR: SetPowerOnToneType: WriteRecord " "to NVRAM failed (ecode%d)n", (int)error));
- return error;
- }
- if (gactivatedprofile == gprofileId)
- {
- memcpy(&gcurrentprofile, &gprofiles[gprofileId], sizeof(PROFILE));
- }
- return 0;
- }
- /*****************************************************************************
- * FUNCTION
- * SetPowerOffToneType
- * DESCRIPTION
- *
- * PARAMETERS
- * tone [IN]
- * RETURNS
- * void
- *****************************************************************************/
- S16 SetPowerOffToneType(TONE_SETUP tone)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 error = 0;
- U16 j = 1;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gprofiles[gprofileId].toneSetup.powerOffTone = tone.powerOffTone;
- if (WriteRecord(
- NVRAM_EF_PROFILES_LID,
- j,
- &gprofiles[0],
- NVRAM_PROFILES_RECORD_SIZE,
- &error) < NVRAM_PROFILES_RECORD_SIZE)
- {
- PRINT_INFORMATION(("## ERROR: SetPowerOffToneType: WriteRecord " "to NVRAM failed (ecode%d)n", (int)error));
- return error;
- }
- if (gactivatedprofile == gprofileId)
- {
- memcpy(&gcurrentprofile, &gprofiles[gprofileId], sizeof(PROFILE));
- }
- return 0;
- }
- /* MTK brian added to wrap cover open/close tone setup, 2003/10/18 */
- #ifdef __MMI_CLAMSHELL__
- /*****************************************************************************
- * FUNCTION
- * SetCoverOpenToneType
- * DESCRIPTION
- *
- * PARAMETERS
- * tone [IN]
- * RETURNS
- * void
- *****************************************************************************/
- S16 SetCoverOpenToneType(TONE_SETUP tone)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 error = 0;
- U16 j = 1;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gprofiles[gprofileId].toneSetup.coverOpenTone = tone.coverOpenTone;
- if (WriteRecord(
- NVRAM_EF_PROFILES_LID,
- j,
- &gprofiles[0],
- NVRAM_PROFILES_RECORD_SIZE,
- &error) < NVRAM_PROFILES_RECORD_SIZE)
- {
- PRINT_INFORMATION(("## ERROR: SetCoverOpenToneType: WriteRecord " "to NVRAM failed (ecode%d)n", (int)error));
- return error;
- }
- if (gactivatedprofile == gprofileId)
- {
- memcpy(&gcurrentprofile, &gprofiles[gprofileId], sizeof(PROFILE));
- }
- return 0;
- }
- /*****************************************************************************
- * FUNCTION
- * SetCoverCloseToneType
- * DESCRIPTION
- *
- * PARAMETERS
- * tone [IN]
- * RETURNS
- * void
- *****************************************************************************/
- S16 SetCoverCloseToneType(TONE_SETUP tone)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 error = 0;
- U16 j = 1;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gprofiles[gprofileId].toneSetup.coverCloseTone = tone.coverCloseTone;
- if (WriteRecord(
- NVRAM_EF_PROFILES_LID,
- j,
- &gprofiles[0],
- NVRAM_PROFILES_RECORD_SIZE,
- &error) < NVRAM_PROFILES_RECORD_SIZE)
- {
- PRINT_INFORMATION(("## ERROR: SetCoverCloseToneType: WriteRecord " "to NVRAM failed (ecode%d)n", (int)error));
- return error;
- }
- if (gactivatedprofile == gprofileId)
- {
- memcpy(&gcurrentprofile, &gprofiles[gprofileId], sizeof(PROFILE));
- }
- return 0;
- }
- #endif /* __MMI_CLAMSHELL__ */
- /* MTK end */
- /*****************************************************************************
- * FUNCTION
- * SetKeypadToneType
- * DESCRIPTION
- *
- * PARAMETERS
- * keypadtone [IN]
- * RETURNS
- * void
- *****************************************************************************/
- S16 SetKeypadToneType(KEYPAD_TONE_ENUM keypadtone)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 error = 0;
- U16 j = 1;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gprofiles[gprofileId].toneSetup.keypadTone = keypadtone;
- if (WriteRecord(
- NVRAM_EF_PROFILES_LID,
- j,
- &gprofiles[0],
- NVRAM_PROFILES_RECORD_SIZE,
- &error) < NVRAM_PROFILES_RECORD_SIZE)
- {
- PRINT_INFORMATION(("## ERROR: SetKeypadToneType: WriteRecord " "to NVRAM failed (ecode%d)n", (int)error));
- return error;
- }
- if (gactivatedprofile == gprofileId)
- {
- memcpy(&gcurrentprofile, &gprofiles[gprofileId], sizeof(PROFILE));
- }
- return 0;
- }
- /*****************************************************************************
- * FUNCTION
- * GetIntelligentCallAert
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * MMI_INTELLIGENT_CALL_ALERT_TYPE
- *****************************************************************************/
- MMI_INTELLIGENT_CALL_ALERT_TYPE GetIntelligentCallAert(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MMI_INTELLIGENT_CALL_ALERT_TYPE intelligentCallAlert = gcurrentprofile.intelligentCallAlert;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION(("File: Setting Prof.c <<GetIntelligentCallAlert> the intelligentCallAlert is : %d n",
- intelligentCallAlert));
- return intelligentCallAlert;
- }
- /*****************************************************************************
- * FUNCTION
- * SetIntelligentCallAert
- * DESCRIPTION
- *
- * PARAMETERS
- * intelligentCallAlert [IN]
- * RETURNS
- * void
- *****************************************************************************/
- S16 SetIntelligentCallAert(MMI_INTELLIGENT_CALL_ALERT_TYPE intelligentCallAlert)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 error = 0;
- U16 j = 1;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gprofiles[gprofileId].intelligentCallAlert = intelligentCallAlert;
- if (WriteRecord(
- NVRAM_EF_PROFILES_LID,
- j,
- &gprofiles[0],
- NVRAM_PROFILES_RECORD_SIZE,
- &error) < NVRAM_PROFILES_RECORD_SIZE)
- {
- PRINT_INFORMATION(("## ERROR: SetIntelligentCallAert: WriteRecord " "to NVRAM failed (ecode%d)n", (int)error));
- return error;
- }
- if (gactivatedprofile == gprofileId)
- {
- memcpy(&gcurrentprofile, &gprofiles[gprofileId], sizeof(PROFILE));
- }
- return 0;
- }
- /*****************************************************************************
- * FUNCTION
- * SetMessageToneType
- * DESCRIPTION
- * Setting Connect Tone status (On/Off)
- * PARAMETERS
- * tone [IN]
- * RETURNS
- * void
- *****************************************************************************/
- S16 SetMessageToneType(TONE_SETUP tone)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 error = 0;
- U16 j = 1;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gprofiles[gprofileId].toneSetup.messageTone = tone.messageTone;
- if (WriteRecord(
- NVRAM_EF_PROFILES_LID,
- j,
- &gprofiles[0],
- NVRAM_PROFILES_RECORD_SIZE,
- &error) < NVRAM_PROFILES_RECORD_SIZE)
- {
- PRINT_INFORMATION(("## ERROR: SetMessageToneType: WriteRecord " "to NVRAM failed (ecode%d)n", (int)error));
- return error;
- }
- if (gactivatedprofile == gprofileId)
- {
- memcpy(&gcurrentprofile, &gprofiles[gprofileId], sizeof(PROFILE));
- }
- return 0;
- }
- /*****************************************************************************
- * FUNCTION
- * SetAlarmToneID
- * DESCRIPTION
- *
- * PARAMETERS
- * id [IN]
- * RETURNS
- * void
- *****************************************************************************/
- S16 SetAlarmToneID(U16 id)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 error = 0;
- U16 j = 1;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gprofiles[gprofileId].toneSetup.alarmTone = id;
- if (WriteRecord(
- NVRAM_EF_PROFILES_LID,
- j,
- &gprofiles[0],
- NVRAM_PROFILES_RECORD_SIZE,
- &error) < NVRAM_PROFILES_RECORD_SIZE)
- {
- PRINT_INFORMATION(("## ERROR: SetAlarmToneType: WriteRecord " "to NVRAM failed (ecode%d)n", (int)error));
- return error;
- }
- if (gactivatedprofile == gprofileId)
- {
- memcpy(&gcurrentprofile, &gprofiles[gprofileId], sizeof(PROFILE));
- }
- return 0;
- }
- #ifdef __MMI_DOWNLOADABLE_THEMES_SUPPORT__ /* ritesh */
- /*****************************************************************************
- * FUNCTION
- * ThemeManagerSetAlarmTone
- * DESCRIPTION
- *
- * PARAMETERS
- * ringtoneid [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void ThemeManagerSetAlarmTone(U16 ringtoneid)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /* PMT SHARIQ DLT_PATCH 20060814 START */
- #if 0
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/