MMITask.c
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:89k
- /*****************************************************************************
- * 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:
- * ---------
- * MMITask.C
- *
- * Project:
- * --------
- * MAUI
- *
- * Description:
- * ------------
- * Protocol task functionality.
- *
- * 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!
- *
- * 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)
- */
- /**************************************************************
- FILENAME : MMItask.c
- PURPOSE : Protocol task functionality
- REMARKS : nil
- AUTHOR : Neeraj Sharma
- DATE : Dec' 28, 2002
- **************************************************************/
- /*****************************************************************************
- * Include
- *****************************************************************************/
- #if !defined(__MTK_TARGET__) || defined(MMI_ON_WIN32)
- #include <windows.h>
- #endif
- #include "stdC.h"
- #include <string.h>
- #include "L4Dr1.h"
- #include "MMI_features.h"
- /* __CUSTPACK_MULTIBIN Terry BEGIN */
- #include "wgui_categories_inputs.h"
- #include "IMERes.h"
- /* __CUSTPACK_MULTIBIN Terry END */
- #include "GlobalConstants.h"
- #include "TaskInit.h"
- #include "MMItaskProt.h"
- #if defined(__MMI_RESOURCE_ENFB_SUPPORT__)
- #include "ResMemMgrGprot.h"
- #endif /* __MMI_RESOURCE_ENFB_SUPPORT__ */
- #include "ThrdOsInterface.h"
- #include "GlobalStruct.h"
- #include "DebugInitDef.h"
- #include "ProtocolEvents.h"
- #include "AsyncEventsGprot.h"
- #include "ATHandlerProt.h"
- #include "AlarmFrameWorkProt.h"
- #include "CallManagementGprot.h"
- #include "CallManagementStruct.h"
- #include "SettingProfile.h"
- #include "ProfileGprots.h"
- #include "Service.h"
- #include "SATGProts.h"
- #include "CPHSProtocolHandlers.h"
- #include "EngineerModeProt.h"
- #include "FactoryModeProt.h"
- #include "gpioInc.h"
- #include "PhoneBookGProt.h"
- #include "CallHistoryMain.h"
- #include "FunAndGamesProts.h"
- #include "MessagesResourceData.h"
- #include "OrganizerGprot.h"
- #include "AlarmGprot.h"
- #include "ScheduledPowerOnOffGprot.h"
- #include "Unicodedcl.h"
- #include "Unicodedef.h"
- #include "OrganizerGProt.h"
- #include "ExtraGProt.h"
- #include "IdleAppProt.h"
- #include "Conversions.h"
- #include "NVRAMProt.h"
- #include "datetimetype.h"
- #include "app_datetime.h"
- //KP Jerry add on 2007-2-15 start
- #ifdef __DUAL_SIM_SUPPORT__
- extern void LoadSIMSwitchAllData(void);
- #endif
- //KP Jerry add on 2007-2-15 end
- #ifdef __MMI_THEMES_V2_SUPPORT__
- #include "ThemeManager.h"
- #endif
- #include "MessagesExDcl.h"
- #ifdef __MMI_USB_SUPPORT__
- #include "USBDeviceGprot.h"
- #ifndef MMI_ON_WIN32
- extern kal_bool INT_USBBoot(void);
- #endif
- #endif /* __MMI_USB_SUPPORT__ */
- #ifdef __MMI_IRDA_SUPPORT__
- #include "IrdaMMIGprots.h"
- #endif
- #ifdef __MMI_BT_HP_SUPPORT__
- #include "BTMMIHPGprots.h"
- #endif
- #ifdef __MMI_BT_SUPPORT__
- #include "BTMMIScrGprots.h"
- #endif
- #ifdef __MMI_FILE_MANAGER__
- #include "FileManagerGProt.h"
- #include "msdc_def.h"
- #endif /* __MMI_FILE_MANAGER__ */
- #ifdef __MMI_WEBCAM__
- #include "mdi_datatype.h"
- #include "mdi_webcam.h"
- #endif /* __MMI_WEBCAM__ */
- #include "SoundEffect.h"
- #include "vObjects.h"
- #include "vCalendar.h"
- #include "ShortcutsProts.h"
- #include "SubLCDHistoryGprot.h"
- #include "ToDoListDef.h"
- #include "DataAccountGProt.h"
- #include "WPSSProtos.h"
- #include "CallerIdGprot.h"
- #if defined(__MMI_STOPWATCH__)
- #include "StopwatchGprot.h"
- #endif
- #if defined(__MMI_EMAIL__)
- #include "EmailAppGProt.h"
- #endif /* def __MMI_EMAIL__ */
- #include "OSThreadInterfaceGprot.h"
- #ifdef MMI_ON_WIN32
- extern BOOL flagMMIStart;
- #include "BUildCfg.h"
- #endif /* MMI_ON_WIN32 */
- #include "EventsGprot.h"
- #include "AllAppGprot.h"
- #include "WrapperGprot.h"
- #include "QueueGprot.h"
- #ifdef __MMI_EBOOK_READER__
- #include "EbookProt.h"
- #endif
- #include "KeyBrd.h"
- #include "NVRAMExdcl.h"
- #include "SimDetectionGprot.h"
- #include "wgui_status_icons.h"
- #include "PowerOnChargerProt.h"
- #include "SettingGprots.h"
- #include "SimDetectionGexdcl.h"
- #include "PhoneSetupGprots.h" /* PhnsetReadNvramCalibrationData */
- #if defined(__MMI_SMART_MESSAGE_MO__) && !defined(__MMI_MESSAGES_EMS__)
- #include "SmsGuiInterfaceType.h"
- #endif
- #ifdef __MMI_VOIP__
- #include "VoIPGProt.h"
- #endif
- #ifdef __MMI_POC__
- #include "PoCGProt.h"
- #endif
- #ifdef __SYNCML_SUPPORT__
- #include "SyncMLGProt.h" /* mmi_syncml_init */
- #endif
- extern void InitAlarmHandler(void);
- #if defined(__MMI_THEMES_APPLICATION__)
- extern void InitThemes(void);
- #endif
- #ifdef __FLIGHT_MODE_SUPPORT__
- #include "WallpaperDefs.h"
- #include "DownloadDefs.h"
- #include "PhoneSetup.h"
- #endif /* __FLIGHT_MODE_SUPPORT__ */
- extern void ATHandlerInit(void);
- #if defined(__MMI_NITZ__)
- extern void NITZHandlerInit(void);
- #endif
- extern void PhnsetInitSetTimeNDateNvram(void);
- extern void ReadValueCityNVRAM(void);
- #ifndef MMI_ON_WIN32
- #include "lcd_sw.h"
- #include "lcd_sw_inc.h"
- #include "sublcd.h"
- #else /* MMI_ON_WIN32 */
- #include "lcd_if.h"
- #endif /* MMI_ON_WIN32 */
- #include "ComposeRingToneProts.h"
- #ifdef __MMI_IMPS__
- #include "mmi_imps_gprot.h"
- #endif
- /* Cylen */
- #include "gdi_include.h"
- //#include "gdi_lcd.h"
- //extern void gdi_init(void);
- //extern GDI_RESULT gdi_layer_clear(gdi_color bg_color);
- //extern gdi_color GDI_COLOR_BLACK;
- #ifdef __MMI_UNIFIED_MESSAGE__
- #include "UnifiedMessageGProt.h"
- #endif
- #ifdef __MMI_UNIFIED_COMPOSER__
- #include "UnifiedComposerGProt.h"
- #endif
- #ifdef __MMI_WLAN_FEATURES__
- #include "NetworkSetupDefs.h"
- #endif
- //U8 isIdleScreenReached=0;
- //U8 IsBeforePowerOn=1;
- U8 gInitAllAppFlag = 0;
- U8 gInsertSimAppFlag = 0;
- MYTIME StartUpTime, LastDuration;
- extern U8 isEarphonePlugged;
- extern U8 gMMIClamState;
- extern void goto_opening_screen(void);
- extern void InitNvramData(void);
- #ifdef __MMI_PROFILE_EXTMELODY_SUPPORT__
- extern void PmgInitExtMelodyStruct(void);
- #endif
- extern void InitAllApplications(void);
- extern void InitDownloadNVRAM(void);
- extern void ReadThemesFromNVRAM(void);
- extern void initnvramprofapp(void);
- extern void InitializeChargingScr(void);
- extern void InitializeAll(void);
- extern void QuitSystemOperation(void);
- extern void mmi_pwron_entry_animation_screen(void);
- /*
- * for MDI
- */
- extern void mdi_audio_init(void);
- extern void mdi_audio_init_event_hdlrs(void);
- extern void setup_UI_wrappers(void);
- /*
- * For Input method
- */
- #ifdef __MMI_T9__
- extern void InitInputMethod(void);
- #elif defined __MMI_ZI__
- extern void InitZiInputMethod(void);
- //KP Jerry add on 2007-3-8 start
- #elif defined __MMI_CSTAR__
- extern void InitCstarInputMethod(void);
- //KP Jerry add on 2007-3-8 end
- #elif defined(__MMI_KA__)
- extern void InitKonkaInputMethod(void);
- #elif defined(__MMI_ITAP__)
- /* under construction !*/
- #endif
- /* __CUSTPACK_MULTIBIN Terry BEGIN */
- extern U8 MMI_english_input_mode_set[INPUT_MODE_MAX_NUM];
- extern U8 MMI_qsearch_input_mode_set[INPUT_MODE_MAX_NUM];
- extern U8 MMI_all_input_mode_set[INPUT_MODE_MAX_NUM];
- #ifdef __MMI_PREFER_INPUT_METHOD__
- extern U16 MMI_all_prefered_input_mode_set[INPUT_MODE_MAX_NUM];
- #endif
- extern const sIMEModeDetails *gIMEModeArray;
- extern const sIMEModeDetails *gIMEQSearchModeArray;
- extern const U8 MMI_implement_input_mode_set[];
- /* __CUSTPACK_MULTIBIN Terry END */
- extern void mmiapi_init_engine(void);
- /*
- * Move InitPhoneSetupApp() to InitializeAll() for text encoding
- */
- extern void InitPhoneSetupApp(void);
- extern void InitPhoneSetupCntx(void);
- extern void InitAppMem(void);
- extern void CheckAndPrintMsgId(U16 Id);
- #if defined(__MMI_VRSD__)
- extern void mmi_vrsd_init(void);
- #endif
- #if defined(__MMI_VRSI__)
- extern mmi_vrsi_init(void);
- #endif
- #if defined(__MMI_SOUND_RECORDER__)
- extern void InitSoundRecorderApp(void);
- #endif
- extern void mmi_phb_sos_list_init(void);
- #ifdef __MMI_MESSAGES_CHAT__
- extern void InitializeChatApp(void);
- #endif
- #ifdef __MMI_IRDA_SUPPORT__
- extern void mmi_irda_init_menu_hdlr(void);
- #endif
- #ifdef __MMI_BT_HP_SUPPORT__
- extern void mmi_bt_scr_init(void);
- extern void mmi_bt_init_menu_highlight_hdlr(void);
- #endif /* __MMI_BT_HP_SUPPORT__ */
- /* for PC simulator */
- #if !defined(__MMI_BT_SUPPORT__) && defined(MMI_ON_WIN32)
- extern void mmi_bt_init(void);
- #endif
- #ifndef __DISABLE_SHORTCUTS_IMPL__
- extern void ShctInit(void);
- #endif
- extern void SetDateTime(void *t);
- extern void mmi_frm_sms_init(void);
- /* diamond, 2005/07/05 Flight mode */
- #ifdef __FLIGHT_MODE_SUPPORT__
- extern void PowerOnFlightMode(void);
- extern void PowerOnNormalMode(void);
- extern void EntryQueryFlightModeScreen(void);
- extern void PhnsetFlightModeQueryBackground(void); /* diamond, 2006/01/01 Force to draw the background */
- extern void PhnsetFlightModePowerOnException(void);
- extern void mmi_flight_mode_set_mode(U8 bFlightMode); /* send the mode to L4C ASAP to speed up the L4C startup time */
- extern PHNSET_CNTX g_phnset_cntx;
- #endif /* __FLIGHT_MODE_SUPPORT__ */
- /* end, diamond */
- #ifdef __MMI_BG_SOUND_EFFECT__
- extern void mmi_bgsnd_init(void);
- #endif
- #if defined(__MMI_FM_RADIO_SCHEDULE_REC__)
- extern void mmi_fmsr_init_app(void);
- #endif
- #if defined(__MMI_DOWNLOAD_AGENT__)
- extern void mmi_da_init_app(void);
- #endif
- extern void mdi_audio_set_audio_mode(U8 mode);
- extern void PhnsetReadGPIOSetting(void);
- #ifdef __MMI_USER_CTRL_PLMN_SUPPORT__
- extern void mmi_netset_init_user_ctrl_plmn(void);
- #endif
- #ifdef __MMI_SWFLASH__
- extern void mmi_swflash_init_app(void);
- #endif
- #ifdef __MMI_CCA_SUPPORT__
- extern void mmi_cca_init(void);
- #endif
- #ifndef MMI_ON_WIN32
- #include "l4dr.h"
- #include "MMITaskProt.h"
- /*
- * MTK added for two kinds of timer, one is for exactly time, another allow to delay.
- */
- stack_timer_struct base_timer1; /* no alignment timer */
- stack_timer_struct base_timer2; /* allow alignment timer */
- event_scheduler *event_scheduler1_ptr, *event_scheduler2_ptr;
- oslMsgqid mmi_ext_qid;
- MMI_BOOL g_keypad_flag = MMI_FALSE;
- drv_get_key_func keypad_ptr;
- extern kal_mutexid mmi_mutex_trace;
- /*****************************************************************************
- * FUNCTION
- * MMI_Init
- * DESCRIPTION
- * MMI Init Function
- * PARAMETERS
- * task_indx [IN] Index of task
- * RETURNS
- * void
- *****************************************************************************/
- MMI_BOOL MMI_Init(task_indx_type task_indx)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- #ifndef MMI_ON_WIN32
- mmi_mutex_trace = kal_create_mutex("mmi_trace");
- #endif
- mmi_frm_get_2step_keys();
- /*
- * initial the system service timer
- */
- L4InitTimer();
- setup_UI_wrappers();
- #if defined(__MMI_RESOURCE_ENFB_SUPPORT__)
- /*
- * Init Resource Memory Manamger for E-NFB
- */
- mmi_frm_resmem_init();
- #endif /* __MMI_RESOURCE_ENFB_SUPPORT__ */
- return MMI_TRUE;
- }
- /*****************************************************************************
- * FUNCTION
- * EvshedMMITimerHandler
- * DESCRIPTION
- * MMI Timer Event Scheduler
- * PARAMETERS
- * dataPtr [IN] Data from L4
- * RETURNS
- * void
- *****************************************************************************/
- void EvshedMMITimerHandler(void *dataPtr)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- stack_timer_struct *stack_timer_ptr;
- stack_timer_ptr = (stack_timer_struct*) dataPtr;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (stack_timer_ptr == &base_timer1)
- {
- if (stack_is_time_out_valid(&base_timer1))
- {
- evshed_timer_handler(event_scheduler1_ptr);
- }
- stack_process_time_out(&base_timer1);
- }
- else if (stack_timer_ptr == &base_timer2)
- {
- if (stack_is_time_out_valid(&base_timer2))
- {
- evshed_timer_handler(event_scheduler2_ptr);
- }
- stack_process_time_out(&base_timer2);
- }
- }
- #endif /* MMI_ON_WIN32 */
- /*****************************************************************************
- * FUNCTION
- * FlightModeCheckBeforeAnimation
- * DESCRIPTION
- * Flight mode query screen before animation
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- /* static U8 gFlightModeFromCalibration; */
- void FlightModeCheckBeforeAnimation()
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* diamond, 2005/07/05 Flight mode */
- #ifdef __FLIGHT_MODE_SUPPORT__
- switch (g_phnset_cntx.curFlightMode)
- {
- case FLIGHTMODE_QUERY:
- TurnOnBacklight(1);
- PhnsetFlightModeQueryBackground(); /* diamond, 2006/01/01 Force to draw the background */
- EntryQueryFlightModeScreen();
- break;
- case FLIGHTMODE_SILENT:
- case FLIGHTMODE_OFF:
- mmi_bootup_exit_flight_mode_query();
- break;
- default:
- PowerOnNormalMode();
- break;
- }
- #else /* __FLIGHT_MODE_SUPPORT__ */
- mmi_bootup_entry_animation(); /* not necessary to enter flight mode query screen if it is not supported */
- #endif /* __FLIGHT_MODE_SUPPORT__ */
- /* end, diamond */
- }
- /*****************************************************************************
- * FUNCTION
- * InitEventHandlersBeforePowerOn
- * DESCRIPTION
- * Init event handlers before power on indication
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- static void InitEventHandlersBeforePowerOn(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- InitEvents();
- InitKeypadBeforePWRON();
- #ifndef MMI_ON_WIN32
- SetProtocolEventHandler(GpioDetectInd, MSG_ID_MMI_EQ_GPIO_DETECT_IND);
- SetProtocolEventHandler(BatteryStatusRsp, MSG_ID_MMI_EQ_BATTERY_STATUS_IND);
- #ifdef __MMI_USB_SUPPORT__
- SetProtocolEventHandler(UsbDetectIndHdlr, PRT_EQ_USB_DETECT_IND);
- #endif
- InitAlarmHandler();
- #endif /* MMI_ON_WIN32 */
- #ifdef __MMI_TVOUT__
- /* init tvout, since TV-out indication will come before poweron indication */
- mmi_phnset_early_init_tvout_before_pwron();
- #endif
- }
- #ifndef MMI_ON_WIN32
- /*****************************************************************************
- * FUNCTION
- * mmi_frm_check_is_valid_msg
- * DESCRIPTION
- * Check if the follow message is useful
- * If the successive messages are MSG_ID_TIMER_EXPIRY,
- * only one message will be usegful. We will keep only one
- * MSG_ID_TIMER_EXPIRY in the queue
- * PARAMETERS
- * base [IN]
- * msg [IN]
- * RETURNS
- * 0 - the message is invalid, and discard the message
- * 1 - the message is vaild
- *****************************************************************************/
- U8 mmi_frm_check_is_valid_msg(MYQUEUE *base, MYQUEUE *msg)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if ((base != NULL) && (msg != NULL) && (base->msg_id == msg->msg_id))
- {
- switch (base->msg_id)
- {
- case MSG_ID_TIMER_EXPIRY:
- {
- kal_uint16 msg_len = 0;
- stack_timer_struct *base_timer_ptr;
- stack_timer_struct *timer_ptr;
- base_timer_ptr = (stack_timer_struct*) get_local_para_ptr(base->oslDataPtr, &msg_len);
- timer_ptr = (stack_timer_struct*) get_local_para_ptr(msg->oslDataPtr, &msg_len);
- if (base_timer_ptr == timer_ptr)
- {
- stack_is_time_out_valid(base_timer_ptr);
- stack_process_time_out(base_timer_ptr);
- /* msg is invalid, can discard it */
- return 0;
- }
- }
- break;
- default:
- break;
- }
- }
- /* msg is valid, can't discard */
- return 1;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_frm_fetch_msg_from_extQ_to_circularQ
- * DESCRIPTION
- * fetch the message from external queue and put
- * in the circular queue.
- * (*) Need to set my_index & mmi_ext_qid before using
- * this function
- * PARAMETERS
- * void
- * RETURNS
- * 1 - the message is invalid, and discard the message
- * 0 - the message is vaild
- *****************************************************************************/
- void mmi_frm_fetch_msg_from_extQ_to_circularQ(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MYQUEUE Message;
- U32 my_index;
- U32 queue_node_number = 0;
- MYQUEUE checkBaseNode = {0};
- U8 flag = 0;
- ilm_struct ilm_ptr;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (IsInNVRAMProcedure() == MMI_FALSE)
- {
- /*
- * If not in NVRAM access procedure,
- * receive the message from MMI queue and put in circular queue
- */
- msg_get_ext_queue_info(mmi_ext_qid, &queue_node_number);
- while ((queue_node_number > 0) && !OslIsCircularQFull())
- {
- OslReceiveMsgExtQ(mmi_ext_qid, &Message);
- OslGetMyTaskIndex(&my_index);
- OslStackSetActiveModuleID(my_index, MOD_MMI);
- OslLookUpLastCircularQMsg((void*)&checkBaseNode);
- if (mmi_frm_check_is_valid_msg(&checkBaseNode, &Message) == 1)
- {
- /* put Message in circular queue */
- ilm_ptr.src_mod_id = Message.src_mod_id;
- ilm_ptr.dest_mod_id = Message.dest_mod_id;
- ilm_ptr.msg_id = Message.msg_id;
- ilm_ptr.sap_id = Message.sap_id;
- ilm_ptr.local_para_ptr = Message.local_para_ptr;
- ilm_ptr.peer_buff_ptr = Message.peer_buff_ptr;
- flag = OslWriteCircularQ(&ilm_ptr);
- MMI_ASSERT(flag == 1);
- /* TIMER use special data in the local_para_ptr field. Can NOT treat as general ILM */
- if (Message.src_mod_id != MOD_TIMER)
- {
- hold_local_para(ilm_ptr.local_para_ptr);
- hold_peer_buff(ilm_ptr.peer_buff_ptr);
- }
- }
- OslFreeInterTaskMsg(&Message);
- msg_get_ext_queue_info(mmi_ext_qid, &queue_node_number);
- }
- }
- }
- #endif /* MMI_ON_WIN32 */
- /*****************************************************************************
- * FUNCTION
- * mmi_frm_power_on_set_mode
- * DESCRIPTION
- * Power on set flight mode before initializa all applications
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_frm_power_on_set_mode(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- #ifdef __FLIGHT_MODE_SUPPORT__
- /* send the mode to L4C ASAP to speed up the L4C startup time */
- if (g_phnset_cntx.curFlightMode == FLIGHTMODE_SILENT)
- {
- mmi_flight_mode_set_mode(1);
- }
- else if (g_phnset_cntx.curFlightMode == FLIGHTMODE_OFF)
- {
- #ifdef __MMI_WLAN_FEATURES__
- if (mmi_netset_get_active_preferred_mode() == P_WLAN_ONLY)
- mmi_flight_mode_set_mode(1);
- else
- #endif /* __MMI_WLAN_FEATURES__ */
- mmi_flight_mode_set_mode(0);
- }
- else
- {
- /* display qurey screen after InitializeAll */
- }
- #endif /* __FLIGHT_MODE_SUPPORT__ */
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_frm_power_on_init_procedure
- * DESCRIPTION
- * Power on initializations
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_frm_power_on_init_procedure(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- static U8 bInit = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (!bInit)
- {
- InitializeAll();
- OslDumpDataInFile();
- InitNvramData();
- bInit = 1;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * MMI_task
- * DESCRIPTION
- * Entry function for Protocol task
- *
- * This receives protocol task events from the stack and forwards it to
- * MMI task.
- * PARAMETERS
- * entry_param [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void MMI_task(oslEntryType *entry_param)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MYQUEUE Message;
- oslMsgqid qid;
- #ifndef MMI_ON_WIN32
- U32 my_index;
- U32 count = 0;
- U32 queue_node_number = 0;
- #endif /* MMI_ON_WIN32 */
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- #ifndef MMI_ON_WIN32
- qid = task_info_g[entry_param->task_indx].task_ext_qid;
- mmi_ext_qid = qid;
- InitEventHandlersBeforePowerOn();
- #endif /* MMI_ON_WIN32 */
- while (1)
- {
- #ifndef MMI_ON_WIN32
- {
- if (g_keypad_flag == MMI_TRUE)
- {
- L4KeyHandle(NULL);
- }
- /* Leo start 20050825 */
- /********************************************************************
- * Check if number of events in queue increases.
- * If yes, clear more external queue events, else clear less external queue events.
- * At lease clear one external queue event.
- ********************************************************************/
- /* Get Total count in external queue */
- msg_get_ext_queue_info(mmi_ext_qid, &queue_node_number);
- if ((queue_node_number == 0) && (OslNumOfCircularQMsgs() == 0) && (g_keypad_flag == MMI_FALSE))
- {
- U8 flag = 0;
- ilm_struct ilm_ptr;
- /* MMI task suspends for the queue */
- OslReceiveMsgExtQ(qid, &Message);
- OslGetMyTaskIndex(&my_index);
- OslStackSetActiveModuleID(my_index, MOD_MMI);
- /* put Message in circular queue */
- ilm_ptr.src_mod_id = Message.src_mod_id;
- ilm_ptr.dest_mod_id = Message.dest_mod_id;
- ilm_ptr.msg_id = Message.msg_id;
- ilm_ptr.sap_id = Message.sap_id;
- ilm_ptr.local_para_ptr = Message.local_para_ptr;
- ilm_ptr.peer_buff_ptr = Message.peer_buff_ptr;
- flag = OslWriteCircularQ(&ilm_ptr);
- MMI_ASSERT(flag == 1);
- /* TIMER use special data in the local_para_ptr field. Can NOT treat as general ILM */
- if (Message.src_mod_id != MOD_TIMER)
- {
- hold_local_para(ilm_ptr.local_para_ptr);
- hold_peer_buff(ilm_ptr.peer_buff_ptr);
- OslFreeInterTaskMsg(&Message);
- }
- }
- else
- {
- mmi_frm_fetch_msg_from_extQ_to_circularQ();
- }
- count = OslNumOfCircularQMsgs();
- while (count > 0)
- {
- OslGetMyTaskIndex(&my_index);
- OslStackSetActiveModuleID(my_index, MOD_MMI);
- if (OslReadCircularQ(&Message))
- {
- CheckAndPrintMsgId((U16) (Message.msg_id));
- if (Message.dest_mod_id == MOD_WAP)
- {
- #ifdef JATAAYU_SUPPORT
- extern void mmi_wap_handle_msg(void *msgPtr);
- mmi_wap_handle_msg((void*)&Message);
- #endif /* JATAAYU_SUPPORT */
- }
- else
- {
- switch (Message.msg_id)
- {
- case MSG_ID_TIMER_EXPIRY:
- {
- kal_uint16 msg_len;
- EvshedMMITimerHandler(get_local_para_ptr(Message.oslDataPtr, &msg_len));
- }
- break;
- case MSG_ID_MMI_EQ_POWER_ON_IND:
- {
- mmi_eq_power_on_ind_struct *p = (mmi_eq_power_on_ind_struct*) Message.oslDataPtr;
- /* To initialize data/time */
- SetDateTime((void*)&(p->rtc_time));
- gdi_init();
- g_pwr_context.PowerOnMMIStatus = MMI_POWER_ON_INDICATION; /* 0x01: POWER_ON_KEYPAD indication */
-
- #ifdef __MMI_TVOUT__
- mmi_phnset_tvout_check_pwron_start();
- #endif
-
- switch (p->poweron_mode)
- {
- case POWER_ON_KEYPAD:
- OslMemoryStart(TRUE);
- g_charbat_context.PowerOnCharger = 0;
- g_pwr_context.PowerOnMode = POWER_ON_KEYPAD;
- DTGetRTCTime(&StartUpTime);
- memset(&LastDuration, 0, sizeof(LastDuration));
- //KP Jerry add for reading correct SIM ID after 06B version when dual SIM support on 2007-3-20 start
- #ifdef __DUAL_SIM_SUPPORT__
- mmi_frm_power_on_init_procedure();
- #endif
- //KP Jerry add for reading correct SIM ID after 06B version when dual SIM support on 2007-3-20 end
- #if (defined(MMI_ON_HARDWARE_P) && !defined(__MTK_TARGET__)) /* MoDIS only */
- mmi_netset_write_auto_test_result(MMI_FALSE);
- #endif
- /* disk check */
- #ifdef __FLIGHT_MODE_SUPPORT__
- g_phnset_cntx.curFlightMode = p->flightmode_state;
- #endif
- mmi_bootup_entry_disk_check();
- PRINT_INFORMATION((" NORMAL POWER ON SUCCESS!!!!"));
- break;
- case POWER_ON_PRECHARGE:
- case POWER_ON_CHARGER_IN:
- /**************************************
- * Always send charger-in indication
- * to avoid fast repeating charger
- * in-out b4 power-on completes
- * Lisen 04/13/2004
- ***************************************/
- g_pwr_context.PowerOnMode = p->poweron_mode; /* Charger/Pre-charge Power On */
- InitializeChargingScr();
- if (!g_charbat_context.isChargerConnected)
- {
- QuitSystemOperation();
- }
- PRINT_INFORMATION((" CHARGER POWER ON SUCCESS!!!!"));
- break;
- case POWER_ON_ALARM:
- g_pwr_context.PowerOnMode = POWER_ON_ALARM;
- #ifdef __MMI_SUBLCD__
- gdi_lcd_set_active(GDI_LCD_SUB_LCD_HANDLE);
- gdi_layer_clear(GDI_COLOR_BLACK);
- gdi_lcd_set_active(GDI_LCD_MAIN_LCD_HANDLE);
- #endif /* __MMI_SUBLCD__ */
- gdi_layer_clear(GDI_COLOR_BLACK);
- AlmInitRTCPwron();
- PRINT_INFORMATION((" ALARM POWER ON SUCCESS!!!!"));
- break;
- case POWER_ON_EXCEPTION:
- g_pwr_context.PowerOnMode = POWER_ON_EXCEPTION;
- #ifdef __MMI_SUBLCD__
- gdi_lcd_set_active(GDI_LCD_SUB_LCD_HANDLE);
- gdi_layer_clear(GDI_COLOR_BLACK);
- gdi_lcd_set_active(GDI_LCD_MAIN_LCD_HANDLE);
- #endif /* __MMI_SUBLCD__ */
- gdi_layer_clear(GDI_COLOR_BLACK);
- OslMemoryStart(TRUE);
- SetAbnormalReset();
- InitializeAll();
- OslDumpDataInFile();
- PRINT_INFORMATION((" Exception POWER ON SUCCESS!!!!"));
- ClearInputEventHandler(MMI_DEVICE_ALL);
- ClearKeyHandler(KEY_END, KEY_LONG_PRESS);
- /**************************************
- * Please note that the order of the following actions matters.
- * NVRAM data must be read before InitAllApplications, or there might be
- * unexpected errors.
- ***************************************/
- InitNvramData();
- InitAllApplications();
- #ifdef __FLIGHT_MODE_SUPPORT__
- PhnsetFlightModePowerOnException();
- #endif
- /***************************************
- * To check power on display if need restore
- ***************************************/
- mmi_pwron_exception_check_display();
- break;
- #ifdef __MMI_USB_SUPPORT__
- case POWER_ON_USB:
- g_pwr_context.PowerOnMode = POWER_ON_USB;
- /***************************************
- * Because Aux task will not init in USB boot mode
- * Interrupt service routine for clam detection CLAM_EINT_HISR()
- * is not register, force the clam state to open
- * If Aux task is necessary in USB mode, this tircky could be removed
- * Robin 1209
- ***************************************/
- gMMIClamState = 1;
- InitializeUsbScr();
- /***************************************
- * To disable keypad tone state
- ***************************************/
- mmi_frm_kbd_set_tone_state(MMI_KEY_TONE_DISABLED);
- PRINT_INFORMATION((" USB POWER ON SUCCESS!!!!"));
- break;
- #endif /* __MMI_USB_SUPPORT__ */
- default:
- break;
- }
- }
- break;
- default:
- ProtocolEventHandler(
- (U16) Message.oslMsgId,
- (void*)Message.oslDataPtr,
- (int)Message.oslSrcId,
- (void*)&Message);
- break;
- }
- }
- OslFreeInterTaskMsg(&Message);
- } /* OslReadCircularQ(&Message) */
- msg_get_ext_queue_info(mmi_ext_qid, &queue_node_number);
- count--;
- }
- }
- #else /* MMI_ON_WIN32 */
- {
- qid = task_info_g1[(U16) entry_param].task_ext_qid;
- OslReceiveMsgExtQ(qid, &Message);
- if (!ProcessPCKeyEvent(Message.oslMsgId, (KEYBRD_MESSAGE*) Message.oslDataPtr))
- {
- switch (Message.oslMsgId)
- {
- case PRT_MMI_TIMER_IND:
- {
- oslTimerid timerid;
- timerid = (oslTimerid)((TIMER_MESSAGE *) Message.oslDataPtr)->id;
- timerid->tmr_callback(timerid->tmr_callback_arg);
- }
- break;
-
- case MMI_EQ_POWER_ON_IND:
- {
- mmi_eq_power_on_ind_struct *p = (mmi_eq_power_on_ind_struct*) Message.oslDataPtr;
- gdi_init();
- g_pwr_context.PowerOnMMIStatus = MMI_POWER_ON_INDICATION; /* 0x01: POWER_ON_KEYPAD indication */
- switch (p->poweron_mode)
- {
- case POWER_ON_KEYPAD:
- OslMemoryStart(TRUE);
- #ifdef MMI_ON_WIN32
- if (flagMMIStart)
- {
- break;
- }
- flagMMIStart = TRUE;
- #endif /* MMI_ON_WIN32 */
- g_charbat_context.PowerOnCharger = 0;
- InitializeAll();
- OslDumpDataInFile();
- /***************************************
- * To initialize nvram data
- ***************************************/
- InitNvramData();
- /* diamond, 2005/07/05 Flight mode */
- //#ifdef __FLIGHT_MODE_SUPPORT__
- //EntryQueryFlightModeScreen();
- //#else
- mmi_pwron_entry_animation_screen(); /* to display power on animation */
- // #endif
- PRINT_INFORMATION((" NORMAL POWER ON SUCCESS!!!!"));
- break;
- case POWER_ON_PRECHARGE: /* Cylen, Precharge Power On */
- case POWER_ON_CHARGER_IN:
- g_pwr_context.PowerOnMode = p->poweron_mode; /* Cylen, Precharge Power On */
- InitializeChargingScr();
- break;
- case POWER_ON_ALARM:
- AlmInitRTCPwron();
- break;
- /***************************************
- * For abnormal reset when invalid SIM
- ***************************************/
- case POWER_ON_EXCEPTION:
- OslMemoryStart(TRUE);
- SetAbnormalReset();
- InitializeAll();
- OslDumpDataInFile();
- PRINT_INFORMATION((" Exception POWER ON SUCCESS!!!!"));
- /* goto_opening_screen(); */
- ClearInputEventHandler(MMI_DEVICE_ALL);
- ClearKeyHandler(KEY_END, KEY_LONG_PRESS);
- InitNvramData();
- AlmReInitialize();
- InitAllApplications();
- /***************************************
- * To check power on display if need restore
- ***************************************/
- mmi_pwron_exception_check_display();
- break;
- }
- }
- break;
- default:
- ProtocolEventHandler(
- (U16) Message.oslMsgId,
- (void*)Message.oslDataPtr,
- (int)Message.oslSrcId,
- (void*)Message.oslPeerBuffPtr);
- break;
- }
- }
- OslFreeInterTaskMsg(&Message);
- }
- #endif /* MMI_ON_WIN32 */
- }
- }
- /* __CUSTPACK_MULTIBIN Terry BEGIN */
- /*****************************************************************************
- * FUNCTION
- * IMECheck
- * DESCRIPTION
- * To Check IME,
- *
- * This is used to To Check IME,.
- * PARAMETERS
- * IME_Mode [IN]
- * all_implement_IME [IN]
- * RETURNS
- * MMI_TRUE : if the IME_Mode is in
- * MMI_FALSE : if the IME_Mode is not in
- *****************************************************************************/
- BOOL IMECheck(U8 IME_Mode, const U8 all_implement_IME[])
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- int i = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- for (;;)
- {
- if ((0xff) != all_implement_IME[i])
- {
- if (IME_Mode == all_implement_IME[i])
- {
- return MMI_TRUE;
- }
- }
- else
- {
- return MMI_FALSE;
- }
- i++;
- if (i > INPUT_MODE_MAX_NUM)
- {
- ASSERT(0);
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * InitIMESetting
- * DESCRIPTION
- * To Initialize IME,
- *
- * This is used to To Initialize IME,.
- * PARAMETERS
- * IMEArray [IN]
- * allIME [OUT]
- * englishOnlyIME [OUT]
- * PreferedIME [OUT]
- * RETURNS
- * void
- *****************************************************************************/
- void InitIMESetting(const sIMEModeDetails *IMEArray, U8 *allIME, U8 *englishOnlyIME, U16 *PreferedIME)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- int i = 0, j = 0, k = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- for (;;)
- {
- if ((0xff) != IMEArray[i].IME_Mode_ID)
- {
- /* W05.34 Fix Compile Warning */
- if (!IMECheck((U8) IMEArray[i].IME_Mode_ID, MMI_implement_input_mode_set))
- {
- ASSERT(0);
- }
- allIME[i] = IMEArray[i].IME_Mode_ID;
- #ifdef __MMI_PREFER_INPUT_METHOD__
- if ((NULL != PreferedIME) && (0 != IMEArray[i].IME_Type_ID))
- {
- PreferedIME[k] = IMEArray[i].IME_Type_ID;
- k++;
- }
- #endif /* __MMI_PREFER_INPUT_METHOD__ */
- if (IMEArray[i].English_Only_Flag)
- {
- englishOnlyIME[j] = IMEArray[i].IME_Mode_ID;
- j++;
- }
- i++;
- }
- else
- {
- break;
- }
- if (i > INPUT_MODE_MAX_NUM)
- {
- ASSERT(0);
- }
- }
- allIME[i] = 0xff;
- PreferedIME[k] = 0xffff;
- englishOnlyIME[j] = 0xff;
- }
- /*****************************************************************************
- * FUNCTION
- * InitIMEQSearch
- * DESCRIPTION
- * To Initialize IME,
- *
- * This is used to To Initialize IME,.
- * PARAMETERS
- * IMEQArray [IN]
- * QuickIME [OUT]
- * RETURNS
- * void
- *****************************************************************************/
- void InitIMEQSearch(const sIMEModeDetails *IMEQArray, U8 *QuickIME)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- int i = 0, j = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- for (;;)
- {
- if ((0xff) != IMEQArray[i].IME_Mode_ID)
- {
- i++;
- QuickIME[j] = IMEQArray[i - 1].IME_Mode_ID;
- j++;
- }
- else
- {
- break;
- }
- if (i > INPUT_MODE_MAX_NUM)
- {
- ASSERT(0);
- }
- }
- QuickIME[j] = 0xff;
- }
- /*****************************************************************************
- * FUNCTION
- * InitIME
- * DESCRIPTION
- * To Initialize IME,
- *
- * This is used to To Initialize IME,.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void InitIME(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- // #if defined(__MMI_MULTIPLE_BIN_IME__)||defined(__MMI_MULTIPLE_BIN_LANG_PACK__)
- #ifdef __MMI_PREFER_INPUT_METHOD__
- InitIMESetting(gIMEModeArray, MMI_all_input_mode_set, MMI_english_input_mode_set, MMI_all_prefered_input_mode_set);
- #else
- InitIMESetting(gIMEModeArray, MMI_all_input_mode_set, MMI_english_input_mode_set, NULL);
- #endif
- InitIMEQSearch(gIMEQSearchModeArray, MMI_qsearch_input_mode_set);
- // #endif
- #ifdef __MMI_T9__
- InitInputMethod();
- #elif defined __MMI_ZI__
- InitZiInputMethod();
- //KP Jerry add on 2007-3-8 start
- #elif defined __MMI_CSTAR__
- InitCstarInputMethod();
- //KP Jerry add on 2007-3-8 end
- #elif defined __MMI_KA__
- InitKonkaInputMethod();
- #elif defined __MMI_ITAP__
- /* under construction !*/
- #endif
- }
- /* __CUSTPACK_MULTIBIN Terry END */
- /*****************************************************************************
- * FUNCTION
- * InitFramework
- * DESCRIPTION
- * To Initialize framework,
- *
- * This is used to To Initialize framework,.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void InitFramework(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /*
- * Initialize events handler
- */
- InitEvents();
- /*
- * Initialize keyprocess
- */
- InitProcessKeyEvent();
- /*
- * Initialize history
- */
- InitHistory(NULL, SubLCDIdleScreen);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_enable_str_dump
- * DESCRIPTION
- * The message handler of MSG_ID_MMI_EQ_STR_ENABLE_REQ_IND
- *
- * PARAMETERS
- * void* [IN]
- * RETURNS
- * void
- *****************************************************************************/
- static void mmi_enable_str_dump(void *info)
- {
- #ifdef __MTK_TARGET__
- mmi_eq_str_enable_req_ind_struct *data = (mmi_eq_str_enable_req_ind_struct *)info;
- mmi_at_general_res_req_struct *rsp_msg;
- #ifndef __MMI_SUPPORT_DUMP_SCREEN_STRING__
- kal_bool ret = KAL_FALSE;
- #else
- kal_bool ret = KAL_TRUE;
-
- g_mmi_frm_cntx.dump_screen_info.is_enable = (MMI_BOOL)(data->enable);
- g_mmi_frm_cntx.dump_screen_info.hightlight_type = 0;
- g_mmi_frm_cntx.dump_screen_info.backup_hightlight_type = 0;
- g_mmi_frm_cntx.dump_screen_info.y = 0;
- g_mmi_frm_cntx.dump_screen_info.backup_y = 0;
- g_mmi_frm_cntx.dump_screen_info.combined_chars_x = 0;
- g_mmi_frm_cntx.dump_screen_info.combined_chars_y = 0;
- memset(g_mmi_frm_cntx.dump_screen_info.backup_string, 0, MMI_SCREEN_STR_MAX_LENGTH);
- #endif
-
- /* confirm the message */
- rsp_msg = (mmi_at_general_res_req_struct *) OslConstructDataPtr( sizeof(mmi_at_general_res_req_struct) );
- rsp_msg->result = ret;
- SendMsg2AT(MSG_ID_MMI_AT_GENERAL_RES_REQ, (void *)rsp_msg, NULL);
- #endif
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_str_cmd_ind
- * DESCRIPTION
- * The message handler of MSG_ID_MMI_EQ_STR_REQ_IND
- *
- * PARAMETERS
- * void* [IN]
- * RETURNS
- * void
- *****************************************************************************/
- static void mmi_str_cmd_ind(void *info)
- {
- #ifdef __MTK_TARGET__
- mmi_eq_str_req_ind_struct *data = (mmi_eq_str_req_ind_struct *)info;
- mmi_at_general_res_req_struct *rsp_msg;
- MMI_ASSERT(data->length <= MMI_SCREEN_STR_MAX_LENGTH);
- /* process the string command here */
- /* confirm the message */
- rsp_msg = (mmi_at_general_res_req_struct *) OslConstructDataPtr( sizeof(mmi_at_general_res_req_struct) );
- rsp_msg->result = KAL_TRUE;
- SendMsg2AT(MSG_ID_MMI_AT_GENERAL_RES_REQ, (void *)rsp_msg, NULL);
- #endif
- }
- #ifdef __MMI_SUPPORT_DUMP_SCREEN_STRING__
- // #define ENABLE_DUMP_SCREEN_STRING_TRACE
- extern MMI_BOOL mmi_trace_screen_string(S32 x, S32 y, U8 *str, S32 len, S32 Bordered);
- /*****************************************************************************
- * FUNCTION
- * mmi_no_more_str_hdlr
- * DESCRIPTION
- * Sending the termination of dumpping screen string
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- static void mmi_no_more_str_hdlr(void)
- {
- mmi_eq_str_res_req_struct *rsp_msg;
- if (UCS2Strlen(g_mmi_frm_cntx.dump_screen_info.combined_chars))
- {
- mmi_trace_screen_string(
- g_mmi_frm_cntx.dump_screen_info.combined_chars_x,
- g_mmi_frm_cntx.dump_screen_info.combined_chars_y,
- (U8*)g_mmi_frm_cntx.dump_screen_info.combined_chars,
- UCS2Strlen(g_mmi_frm_cntx.dump_screen_info.combined_chars),
- 0);
- }
- memset(g_mmi_frm_cntx.dump_screen_info.combined_chars, 0, ENCODING_LENGTH);
- g_mmi_frm_cntx.dump_screen_info.allow_dump_screen_str = MMI_FALSE;
- g_mmi_frm_cntx.dump_screen_info.hightlight_type = 0;
- g_mmi_frm_cntx.dump_screen_info.backup_hightlight_type = 0;
- g_mmi_frm_cntx.dump_screen_info.y = 0;
- g_mmi_frm_cntx.dump_screen_info.backup_y = 0;
- g_mmi_frm_cntx.dump_screen_info.combined_chars_x = 0;
- g_mmi_frm_cntx.dump_screen_info.combined_chars_y = 0;
- #ifdef __MTK_TARGET__
- rsp_msg = (mmi_eq_str_res_req_struct *) OslConstructDataPtr( sizeof(mmi_eq_str_res_req_struct) );
- kal_sprintf((char*)rsp_msg->data_string, "%d", MMI_SCREEN_NO_STR);
- rsp_msg->length = strlen((char*)rsp_msg->data_string);
- SendMsg2AT(MSG_ID_MMI_EQ_STR_RES_REQ, (void *)rsp_msg, NULL);
- #elif !defined(MMI_ON_WIN32)
- #ifdef ENABLE_DUMP_SCREEN_STRING_TRACE
- kal_printf("n <<END>> n");
- #endif
- #endif
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_trace_screen_string
- * DESCRIPTION
- * Sending the screen string
- *
- * PARAMETERS
- * x [IN]
- * y [IN]
- * str [IN]
- * len [IN]
- * Bordered [IN]
- * RETURNS
- * MMI_BOOL
- *****************************************************************************/
- MMI_BOOL mmi_trace_screen_string(S32 x, S32 y, U8 *str, S32 len, S32 Bordered)
- {
- MMI_BOOL ret = MMI_FALSE;
- #ifdef __MTK_TARGET__
- mmi_eq_str_res_req_struct *rsp_msg;
- #elif !defined(MMI_ON_WIN32)
- U8 data_string[200];
- #endif
- /* If having combined_chars, dump the string first */
- if (UCS2Strlen(g_mmi_frm_cntx.dump_screen_info.combined_chars))
- {
- #ifdef __MTK_TARGET__
- rsp_msg = (mmi_eq_str_res_req_struct *) OslConstructDataPtr( sizeof(mmi_eq_str_res_req_struct) );
- kal_sprintf((char*)rsp_msg->data_string, "%d,(%d,%d),%d,",
- 1, /* Normal string */
- g_mmi_frm_cntx.dump_screen_info.combined_chars_x,
- g_mmi_frm_cntx.dump_screen_info.combined_chars_y,
- UCS2Strlen(g_mmi_frm_cntx.dump_screen_info.combined_chars));
- rsp_msg->length = strlen((char*)rsp_msg->data_string);
- UCS2Strncpy((S8*)(rsp_msg->data_string+rsp_msg->length), (S8*)g_mmi_frm_cntx.dump_screen_info.combined_chars, MMI_SCREEN_COMBINED_CHAR_MAX_LENGTH/ENCODING_LENGTH);
- rsp_msg->length += UCS2Strlen(g_mmi_frm_cntx.dump_screen_info.combined_chars)*ENCODING_LENGTH;
- MMI_ASSERT(rsp_msg->length <= MMI_SCREEN_STR_MAX_LENGTH);
- SendMsg2AT(MSG_ID_MMI_EQ_STR_RES_REQ, (void *)rsp_msg, NULL);
- #elif !defined(MMI_ON_WIN32)
- kal_sprintf((char*)data_string, "%d,(%d,%d),%d,",
- 1, /* Normal string */
- g_mmi_frm_cntx.dump_screen_info.combined_chars_x,
- g_mmi_frm_cntx.dump_screen_info.combined_chars_y,
- UCS2Strlen(g_mmi_frm_cntx.dump_screen_info.combined_chars));
- #ifdef ENABLE_DUMP_SCREEN_STRING_TRACE
- kal_printf(data_string);
- kal_printf("%c%c%c%c%c ...",g_mmi_frm_cntx.dump_screen_info.combined_chars[0], g_mmi_frm_cntx.dump_screen_info.combined_chars[2],
- g_mmi_frm_cntx.dump_screen_info.combined_chars[4], g_mmi_frm_cntx.dump_screen_info.combined_chars[6],
- g_mmi_frm_cntx.dump_screen_info.combined_chars[8]);
- kal_printf(" ++++ n");
- #endif /* ENABLE_DUMP_SCREEN_STRING_TRACE */
- #endif
- }
- /* Dump the screen string */
- if (g_mmi_frm_cntx.dump_screen_info.is_enable
- && (g_mmi_frm_cntx.dump_screen_info.allow_dump_screen_str
- || g_mmi_frm_cntx.dump_screen_info.allow_dump_dm_screen))
- {
- /* check if the string is the same */
- if (UCS2Strlen((S8*)str) &&
- (UCS2Strcmp((S8*)str, g_mmi_frm_cntx.dump_screen_info.backup_string) != 0 || g_mmi_frm_cntx.dump_screen_info.y != y))
- {
- UCS2Strncpy(g_mmi_frm_cntx.dump_screen_info.backup_string, (S8*)str, MMI_SCREEN_STR_MAX_LENGTH/ENCODING_LENGTH);
- g_mmi_frm_cntx.dump_screen_info.y = y;
- if (g_mmi_frm_cntx.dump_screen_info.backup_hightlight_type &&
- g_mmi_frm_cntx.dump_screen_info.backup_y == y)
- {
- g_mmi_frm_cntx.dump_screen_info.hightlight_type = g_mmi_frm_cntx.dump_screen_info.backup_hightlight_type;
- }
- /*
- else
- {
- g_mmi_frm_cntx.dump_screen_info.backup_y = 0;
- g_mmi_frm_cntx.dump_screen_info.hightlight_type = 0;
- }
- */
- #ifdef __MTK_TARGET__
- rsp_msg = (mmi_eq_str_res_req_struct *) OslConstructDataPtr( sizeof(mmi_eq_str_res_req_struct) );
- kal_sprintf((char*)rsp_msg->data_string, "%d,(%d,%d),%d,",
- (g_mmi_frm_cntx.dump_screen_info.hightlight_type>0)?MMI_SCREEN_HIGHLIGHT_STR:MMI_SCREEN_NORMAL_STR,
- x,
- y,
- UCS2Strlen(g_mmi_frm_cntx.dump_screen_info.backup_string));
- rsp_msg->length = strlen((char*)rsp_msg->data_string);
- UCS2Strcpy((S8*)(rsp_msg->data_string+rsp_msg->length), g_mmi_frm_cntx.dump_screen_info.backup_string);
- rsp_msg->length += UCS2Strlen(g_mmi_frm_cntx.dump_screen_info.backup_string)*ENCODING_LENGTH;
- MMI_ASSERT(rsp_msg->length <= MMI_SCREEN_STR_MAX_LENGTH);
- SendMsg2AT(MSG_ID_MMI_EQ_STR_RES_REQ, (void *)rsp_msg, NULL);
- #elif !defined(MMI_ON_WIN32)
- kal_sprintf((char*)data_string, "%d,(%d,%d),%d,",
- (g_mmi_frm_cntx.dump_screen_info.hightlight_type>0)?MMI_SCREEN_HIGHLIGHT_STR:MMI_SCREEN_NORMAL_STR,
- x,
- y,
- UCS2Strlen(g_mmi_frm_cntx.dump_screen_info.backup_string));
- #ifdef ENABLE_DUMP_SCREEN_STRING_TRACE
- kal_printf(data_string);
- kal_printf("%c%c%c%c%c ...",str[0], str[2], str[4], str[6], str[8]);
- kal_printf(" ++++ n");
- #endif /* ENABLE_DUMP_SCREEN_STRING_TRACE */
- #endif
- if (g_mmi_frm_cntx.dump_screen_info.hightlight_type)
- {
- g_mmi_frm_cntx.dump_screen_info.backup_hightlight_type = g_mmi_frm_cntx.dump_screen_info.hightlight_type;
- g_mmi_frm_cntx.dump_screen_info.backup_y = y;
- }
- gui_cancel_timer(mmi_no_more_str_hdlr);
- gui_start_timer(MMI_STR_DUMP_TIMEOUT, mmi_no_more_str_hdlr);
- ret = MMI_TRUE;
- }
- }
- g_mmi_frm_cntx.dump_screen_info.hightlight_type = 0;
- if (UCS2Strlen(g_mmi_frm_cntx.dump_screen_info.combined_chars))
- {
- memset(g_mmi_frm_cntx.dump_screen_info.combined_chars, 0, ENCODING_LENGTH);
- g_mmi_frm_cntx.dump_screen_info.combined_chars_x = 0;
- g_mmi_frm_cntx.dump_screen_info.combined_chars_y = 0;
- }
- return ret;
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_trace_screen_char
- * DESCRIPTION
- * Sending the screen char
- *
- * PARAMETERS
- * x [IN]
- * y [IN]
- * unicode [IN]
- * len [IN]
- * Bordered [IN]
- * RETURNS
- * MMI_BOOL
- *****************************************************************************/
- MMI_BOOL mmi_trace_screen_char(S32 x, S32 y, U16 unicode, S32 len, S32 Bordered)
- {
- MMI_BOOL ret = MMI_FALSE;
-
- if (g_mmi_frm_cntx.dump_screen_info.is_enable
- && (g_mmi_frm_cntx.dump_screen_info.allow_dump_screen_str
- || g_mmi_frm_cntx.dump_screen_info.allow_dump_dm_screen))
- {
- #ifdef __COMBINE_CHAR_IN_DUMP_SCREEN_STRING__
- U8 dummy;
- S32 len;
- /* combine the separated chars to the string */
- len = UCS2Strlen(g_mmi_frm_cntx.dump_screen_info.combined_chars);
- if (g_mmi_frm_cntx.dump_screen_info.combined_chars_y == y)
- {
- /* chars are at The same column */
- UnicodeToUCS2Encoding(
- unicode,
- &dummy,
- (U8*)g_mmi_frm_cntx.dump_screen_info.combined_chars + len * ENCODING_LENGTH);
- memset(g_mmi_frm_cntx.dump_screen_info.combined_chars + ((len + 1) * ENCODING_LENGTH),
- 0,
- ENCODING_LENGTH);
- }
- else
- {
- /* chars are not at The same column */
- if (len)
- {
- mmi_trace_screen_string(
- g_mmi_frm_cntx.dump_screen_info.combined_chars_x,
- g_mmi_frm_cntx.dump_screen_info.combined_chars_y,
- (U8*)g_mmi_frm_cntx.dump_screen_info.combined_chars,
- len,
- 0);
- }
- UnicodeToUCS2Encoding(
- unicode,
- &dummy,
- (U8*)g_mmi_frm_cntx.dump_screen_info.combined_chars);
- memset(g_mmi_frm_cntx.dump_screen_info.combined_chars + ENCODING_LENGTH,
- 0,
- ENCODING_LENGTH);
- g_mmi_frm_cntx.dump_screen_info.combined_chars_x = x;
- g_mmi_frm_cntx.dump_screen_info.combined_chars_y = y;
- }
- #else
- /* Dump the separated chars directly */
- #ifdef __MTK_TARGET__
- {
- mmi_eq_str_res_req_struct *rsp_msg;
- rsp_msg = (mmi_eq_str_res_req_struct *) OslConstructDataPtr( sizeof(mmi_eq_str_res_req_struct) );
- kal_sprintf((char*)rsp_msg->data_string, "%d,(%d,%d),1,", 0, x, y);
-
- rsp_msg->length = strlen((char*)rsp_msg->data_string);
- memcpy((S8*)(rsp_msg->data_string+rsp_msg->length), &unicode, ENCODING_LENGTH);
- rsp_msg->length += ENCODING_LENGTH;
-
- SendMsg2AT(MSG_ID_MMI_EQ_STR_RES_REQ, (void *)rsp_msg, NULL);
- }
- #elif !defined(MMI_ON_WIN32)
- {
- U8 data_string[200];
- kal_sprintf((char*)data_string, "%d,(%d,%d),1,", 0, x, y);
- #ifdef ENABLE_DUMP_SCREEN_STRING_TRACE
- kal_printf(data_string);
- kal_printf(" %c ", unicode>>8);
- kal_printf(" %c ", unicode&0x00FF);
- kal_printf(" --- n");
- #endif /* ENABLE_DUMP_SCREEN_STRING_TRACE */
- }
- #endif
- #endif
- gui_cancel_timer(mmi_no_more_str_hdlr);
- gui_start_timer(MMI_STR_DUMP_TIMEOUT, mmi_no_more_str_hdlr);
- ret = MMI_TRUE;
- }
-
- return ret;
- }
- #endif /* __MMI_SUPPORT_DUMP_SCREEN_STRING__ */
- /*****************************************************************************
- * FUNCTION
- * InitializeAll
- * DESCRIPTION
- * This is used to To Initialize framework,.
- *
- * Remark: Initialization functions may be executed more than one times for
- * special poweron mode (e.g. Alarm poweron, Charger poweron, USB poweron)
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- #if defined(__MMI_SMART_MESSAGE_MO__) && !defined(__MMI_MESSAGES_EMS__)
- extern nsm_msg_struct g_nsm_msg_context;
- #endif
- void InitializeAll()
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- InitUnicodeSupport();
- /*
- * Init graphic lib
- */
- gdi_init();
- /*
- * Init media driver lib
- */
- mdi_audio_init();
- jdi_audio_init();
- #ifdef __MMI_WEBCAM__
- mdi_webcam_init();
- #endif
- #ifdef __MMI_USB_SUPPORT__
- {
- InitMMIUsbContext();
- }
- #endif /* __MMI_USB_SUPPORT__ */
- #ifdef __MMI_IRDA_SUPPORT__
- {
- mmi_irda_init_cntx();
- mmi_irda_set_recv_files_cnt(0);
- }
- #endif /* __MMI_IRDA_SUPPORT__ */
- /*
- * Initialize the ProtocolEvents
- */
- InitProtocolEvents();
- /*
- * Initialize framework
- */
- InitFramework();
- InitHardwareEvents();
- InitTime();
- InitMMI_App();
- setup_UI_wrappers();
- PopulateResData();
- PopulateResGetBaseIDTable();
- PowerAndEndKeyHandler();
- #ifdef __MMI_RESOURCE_ENFB_SUPPORT__
- #ifdef MMI_ON_WIN32
- SetCurrentLanguage(0);
- #endif
- #endif
- #ifdef __MMI_UNIFIED_MESSAGE__
- mmi_um_init();
- #endif
- #ifdef __MMI_UNIFIED_COMPOSER__
- mmi_uc_init();
- #endif
- #ifdef __MOD_SMSAL__
- {
- InitMessageProtocolEventHandlers();
- mmi_frm_sms_init();
- }
- #endif /* __MOD_SMSAL__ */
- /*
- * Data Account Application
- */
- #ifdef __TCPIP__
- {
- InitDataAccountApp();
- }
- #endif /* __TCPIP__ */
- /*
- * Call manahement needs to be initialized here because of SOS calls concept
- */
- InitCallManagement();
- initialize_UI_demo();
- InitNetWorkBootUpEventsCallBack();
- InitProfileApp();
- InitSimDetection();
- InitService();
- InitCPHS();
- //KP Jerry add on 2007-4-12 start
- #ifdef __MMI_MESSAGES_SENDMSG_QUICKLY__
- IdleScreenDigit_Init();
- Mmi_Msg_Sendmsg_Init();
- CallLog_SendMsg_Init();
- #endif
- //KP Jerry add on 2007-4-12 end
- /*
- * For engineer mode
- */
- #ifdef __MMI_ENGINEER_MODE__ /* For saperate MMI feature by project */
- {
- InitEngineerMode();
- }
- #endif /* __MMI_ENGINEER_MODE__ */
- #ifdef __MMI_FACTORY_MODE__ /* For saperate MMI feature by project */
- {
- InitFactoryMode();
- }
- #endif /* __MMI_FACTORY_MODE__ */
- #ifdef __MMI_FILE_MANAGER__
- {
- mmi_fmgr_init();
- }
- #endif /* __MMI_FILE_MANAGER__ */
- #ifdef __MMI_SOUND_RECORDER__
- {
- InitSoundRecorderApp();
- }
- #endif /* __MMI_SOUND_RECORDER__ */
- InitSoundEffect();
- mdi_audio_init_event_hdlrs();
- /*
- * To initialize T9 before power on for To Do List
- */
- /* __CUSTPACK_MULTIBIN Terry BEGIN */
- InitIME();
- /* __CUSTPACK_MULTIBIN Terry END */
- /*
- * Max: To add bacllight on/off interface for HW test 0925
- */
- InitHWBacklightTest();
- InitCallLogs();
- ATHandlerInit();
- #ifndef MMI_ON_WIN32
- {
- mmi_chset_init();
- }
- #endif /* MMI_ON_WIN32 */
- /*
- * Phonebook Protocol Initialization - Should be initialized before L4 PHB begin to read
- */
- mmi_phb_init_protocol();
- /*
- * Move from InitSettingApp() for text encoding
- */
- InitPhoneSetupCntx();
- InitPhoneSetupApp();
- #ifdef __MMI_BT_HP_SUPPORT__
- {
- mmi_bt_init_cntx();
- mmi_bt_scr_init();
- }
- #endif /* __MMI_BT_HP_SUPPORT__ */
- #ifdef __MMI_BT_SUPPORT__
- {
- mmi_bt_init();
- }
- #endif /* __MMI_BT_SUPPORT__ */
- /* for PC simulator */
- #if !defined(__MMI_BT_SUPPORT__) && defined(MMI_ON_WIN32)
- {
- mmi_bt_init();
- }
- #endif /* !defined(__MMI_BT_SUPPORT__) && defined(MMI_ON_WIN32) */
- #ifdef __MMI_IRDA_SUPPORT__
- mmi_irda_init_menu_hdlr();
- #endif /* __MMI_IRDA_SUPPORT__ */
- #if defined(__MMI_SMART_MESSAGE_MO__) && !defined(__MMI_MESSAGES_EMS__)
- {
- mmi_nsm2_init_nsm_msg_struct(&g_nsm_msg_context);
- }
- #endif /* defined(__MMI_SMART_MESSAGE_MO__) && !defined(__MMI_MESSAGES_EMS__) */
- #ifdef APPMEM_SUPPORT
- {
- InitAppMem();
- }
- #endif /* APPMEM_SUPPORT */
- #if defined(__MMI_FM_RADIO_SCHEDULE_REC__)
- mmi_fmsr_init_app();
- #endif
- #ifdef __MMI_BG_SOUND_EFFECT__
- mmi_bgsnd_init();
- #endif
- #ifndef MMI_ON_WIN32
- mmiapi_init_engine();
- #endif
- #if defined(JATAAYU_SUPPORT) && !defined(__MTK_TARGET__)
- {
- ilm_struct *ilm_ptr = NULL;
- ilm_ptr = allocate_ilm(MOD_MMI);
- ilm_ptr->local_para_ptr = NULL;
- ilm_ptr->msg_id = MSG_ID_MMI_EQ_POWER_ON_IND;
- ilm_ptr->peer_buff_ptr = NULL;
- ilm_ptr->src_mod_id = MOD_MMI;
- ilm_ptr->dest_mod_id = MOD_WAP;
- ilm_ptr->sap_id = WPS_APP_SAP;
- msg_send_ext_queue(ilm_ptr);
- }
- #endif /* defined(JATAAYU_SUPPORT) && !defined(__MTK_TARGET__) */
- #if defined(__MMI_NITZ__)
- NITZHandlerInit();
- #endif
- #if defined(__FOTA_ENABLE__)
- mmi_dm_fwu_init();
- #endif /* defined(__FOTA_ENABLE__) */
- SetProtocolEventHandler(mmi_enable_str_dump, MSG_ID_MMI_EQ_STR_ENABLE_REQ_IND);
- SetProtocolEventHandler(mmi_str_cmd_ind, MSG_ID_MMI_EQ_STR_REQ_IND);
- #ifdef __MMI_SUPPORT_DUMP_SCREEN_STRING__
- #if !defined(__MTK_TARGET__) && !defined(MMI_ON_WIN32)
- g_mmi_frm_cntx.dump_screen_info.is_enable = (MMI_BOOL)1;
- g_mmi_frm_cntx.dump_screen_info.hightlight_type = 0;
- g_mmi_frm_cntx.dump_screen_info.backup_hightlight_type = 0;
- g_mmi_frm_cntx.dump_screen_info.y = 0;
- g_mmi_frm_cntx.dump_screen_info.backup_y = 0;
- g_mmi_frm_cntx.dump_screen_info.combined_chars_x = 0;
- g_mmi_frm_cntx.dump_screen_info.combined_chars_y = 0;
- memset(g_mmi_frm_cntx.dump_screen_info.backup_string, 0, MMI_SCREEN_STR_MAX_LENGTH);
- #endif
- #endif /* __MMI_SUPPORT_DUMP_SCREEN_STRING__ */
- }
- /**************************br************************************
- FUNCTION NAME : ProtocolEventHandler(PRT_MESSAGE*)
- PURPOSE : To handle protocol events.
- INPUT PARAMETERS : U16 eventID
- OUTPUT PARAMETERS : nil
- RETURNS : static void
- REMARKS : This is used to handle protocol events .
- **************************************************************/
- /*****************************************************************************
- * FUNCTION
- * ProtocolEventHandler
- * DESCRIPTION
- *
- * PARAMETERS
- * eventID [IN]
- * MsgStruct [IN]
- * mod_src [IN]
- * peerBuf [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void ProtocolEventHandler(U16 eventID, void *MsgStruct, int mod_src, void *peerBuf)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* PRINT_INFORMATION(("n MMItask -> protocol event <id %d>n",eventID)); */
- PRINT_INFORMATION_2((MMI_TRACE_G1_FRM, "<<protocol event %d>>n", eventID));
- ExecuteCurrProtocolHandler((U16) eventID, MsgStruct, mod_src, peerBuf);
- }
- /*****************************************************************************
- * FUNCTION
- * InitUnicodeSupport
- * DESCRIPTION
- * Initalizes string functions for UCS2 support
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void InitUnicodeSupport(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- #ifdef __UCS2_ENCODING
- {
- pfnUnicodeToEncodingScheme = UnicodeToUCS2Encoding;
- pfnEncodingSchemeToUnicode = UCS2EncodingToUnicode;
- pfnUnicodeStrlen = UCS2Strlen;
- pfnUnicodeStrcpy = UCS2Strcpy;
- pfnUnicodeStrcmp = UCS2Strcmp;
- pfnUnicodeStrncpy = UCS2Strncpy;
- pfnUnicodeStrncmp = UCS2Strncmp;
- pfnUnicodeStrcat = UCS2Strcat;
- pfnUnicodeStrncat = UCS2Strncat;
- }
- #endif /* __UCS2_ENCODING */
- }
- /*****************************************************************************
- * FUNCTION
- * InitAllApplications
- * DESCRIPTION
- * Initialize all application
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void InitAllApplications(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gInitAllAppFlag = 1;
- gInsertSimAppFlag = 0;
- mmi_phb_sos_list_init();
- initalize_main_menu_application();
- /*
- * Initialize Setting application
- */
- InitSettingApp();
- /*
- * init fun and game applcations
- */
- mmi_fng_init_app();
- /*
- * Initialize phone book aplication
- */
- mmi_phb_init();
- #ifdef __MOD_SMSAL__
- InitMessagesApp(); /* sms-code */
- #ifdef __MMI_MESSAGES_CHAT__
- InitializeChatApp();
- #endif
- #endif /* __MOD_SMSAL__ */
- InitCallCost();
- InitCallHistory();
- #ifdef __MMI_STOPWATCH__
- InitStopwatchApp();
- #endif
- #ifdef __MMI_WLAN_FEATURES__
- mmi_wlan_post_init();
- mmi_netset_init_wlan_setting();
- #endif
- #ifdef __MMI_VOIP__
- mmi_voip_init();
- #endif
- #ifdef __MMI_POC__
- mmi_poc_init();
- #endif
- #ifdef __MMI_EMAIL__
- mmi_email_init();
- #endif
- OrgInit();
- ExtraInit();
- #if (defined(__MMI_VCARD__) || defined(__MMI_VCALENDAR__))
- #ifndef MMI_ON_WIN32
- mmi_vobj_init(); /* Initial after mmiapi */
- #elif defined(__MMI_VCALENDAR__)
- mmi_vclndr_init();
- #endif
- #endif /* (defined(__MMI_VCARD__) || defined(__MMI_VCALENDAR__)) */
- #ifdef __MMI_VRSD__
- mmi_vrsd_init();
- #endif
- #ifdef __MMI_VRSI__
- mmi_vrsi_init();
- #endif
- #ifdef __MMI_IMPS__
- mmi_imps_init();
- #endif
- #ifdef __MMI_DOWNLOAD_AGENT__
- mmi_da_init_app();
- #endif
- #ifdef __MMI_EBOOK_READER__
- InitEbookApp();
- #endif
- #ifdef __MMI_SWFLASH__
- mmi_swflash_init_app();
- #endif
- #ifdef __SYNCML_SUPPORT__
- mmi_syncml_init();
- #endif
- #ifdef __MMI_CCA_SUPPORT__
- mmi_cca_init();
- #endif
- /*
- * Note: all applications shall be initialized before shortcut
- */
- #ifndef __DISABLE_SHORTCUTS_IMPL__
- ShctInit();
- #endif
- }
- /*****************************************************************************
- * FUNCTION
- * InitInsertSimApp
- * DESCRIPTION
- * Initialize few applications which do not require SIM to be present
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void InitInsertSimApp(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gInsertSimAppFlag = 1;
- DinitSubLCDHistory();
- #ifdef __MMI_BT_HP_SUPPORT__
- mmi_bt_pwroff(); /* apply to handphone only */
- #endif
- /* diamond, 2006/03/31 Not re-init these applications if no sim indication is sent after successful power on with sim */
- if (!gInitAllAppFlag)
- {
- initalize_main_menu_application();
- mmi_fng_init_app();
- mmi_phb_init();
- OrgInit();
- ExtraInit();
- InitSettingApp(); /* diamond, 2005/12/23 Phone setup in option menu */
- #ifdef __MMI_STOPWATCH__
- InitStopwatchApp();
- #endif
- #if (defined(__MMI_VCARD__) || defined(__MMI_VCALENDAR__))
- #ifndef MMI_ON_WIN32
- mmi_vobj_init(); /* Initial after mmiapi */
- #endif
- #endif /* (defined(__MMI_VCARD__) || defined(__MMI_VCALENDAR__)) */
- #ifdef __MMI_DOWNLOAD_AGENT__
- mmi_da_init_app();
- #endif
- #ifdef __MMI_WLAN_FEATURES__
- mmi_wlan_post_init();
- mmi_netset_init_wlan_setting();
- #ifdef __MMI_VOIP__
- mmi_voip_init();
- #endif
- #ifdef __MMI_POC__
- mmi_poc_init();
- #endif
- #ifdef __MMI_EMAIL__
- mmi_email_init();
- #endif
- #ifdef __MMI_IMPS__
- mmi_imps_init();
- #endif
- #ifdef __SYNCML_SUPPORT__
- mmi_syncml_init();
- #endif
- #ifndef __DISABLE_SHORTCUTS_IMPL__
- ShctInit();
- #endif
- #else /* __MMI_WLAN_FEATURES__ */
- #ifdef __SYNCML_SUPPORT__
- mmi_syncml_read_settings_from_nvram();
- #endif
- #endif /* __MMI_WLAN_FEATURES__ */
- /* AlarmInitNvRam(); */
- }
- }
- /*****************************************************************************
- * FUNCTION
- * InitNvramData
- * DESCRIPTION
- * Allows the applications to read their NVRAM data
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void InitNvramData(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- InitDownloadNVRAM();
- #ifdef __MMI_PROFILE_EXTMELODY_SUPPORT__
- PmgInitExtMelodyStruct();
- #endif
- //KP Jerry add on 2007-2-15 start
- #ifdef __DUAL_SIM_SUPPORT__
- LoadSIMSwitchAllData();
- #endif
- //KP Jerry add on 2007-2-15 end
-
- /* __USB_IN_NORMAL_MODE__ */
- PhnsetReadWallpaper();
- PhnsetReadGPIOSetting();
- #if defined(__MMI_UI_TECHNO_IDLESCREEN_BAR__)
- PhnsetReadIdleClockType();
- #endif
- #ifdef __MMI_POWER_ON_OFF_DISPLAY__
- PhnsetReadPwrOnOffDisp();
- #endif
- /* __USB_IN_NORMAL_MODE__ */
- #ifdef __MMI_THEMES_V2_SUPPORT__
- mmi_theme_manager_init();
- #endif
- PhnsetInitSetTimeNDateNvram();
- PhnsetReadNvramScrSvrSettings();
- InitNvramCallerId();
- #ifdef __IP_NUMBER__
- LoadIPNumbers();
- #endif
- /*
- * Call Management:load black list
- */
- #ifdef __MMI_CM_BLACK_LIST__
- LoadBlackListNum();
- #endif
- initnvramprofapp();
- InitSettingNVRAM();
- ReadValueCityNVRAM();
- /*
- * MAX: for new alarm
- */
- InitAlarmFrameWork();
- #if defined(__MMI_THEMES_APPLICATION__)
- InitThemes();
- #endif
- SetModeSpeechVolume();
- #ifdef __MOD_SMSAL__
- InitCBNVRAMData();
- #ifdef __MMI_MESSAGES_TEMPLATE__
- InitTemplates();
- #endif
- #endif /* __MOD_SMSAL__ */
- #if defined(__MMI_RING_COMPOSER__) && defined(__MMI_IMELODY_SUPPORT__)
- InitRingToneComposer();
- #endif
- #ifdef __MMI_STOPWATCH__
- InitStopwatchNVRAM();
- #endif
- #ifdef __MMI_IMPS__
- mmi_imps_init_nvram();
- #endif
- #ifdef __MMI_USER_CTRL_PLMN_SUPPORT__
- mmi_netset_init_user_ctrl_plmn();
- #endif
- }
- /*****************************************************************************
- * FUNCTION
- * InitPCSimulatorBootup
- * DESCRIPTION
- * Automatically bootup the PC simulator only if level1
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- #if defined(MMI_ON_WIN32)
- void InitPCSimulatorBootup(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /*
- * For level 1 auto bootup
- */
- {
- MYQUEUE Message;
- mmi_eq_power_on_ind_struct *BootupReq;
- BootupReq = OslConstructDataPtr(sizeof(mmi_eq_power_on_ind_struct));
- BootupReq->poweron_mode = (U8) 0;
- BootupReq->battery_level = (U8) 0;
- BootupReq->build_label = (U8) 0;
- BootupReq->rtc_time.rtc_sec = (U8) 253;
- BootupReq->rtc_time.rtc_min = (U8) 253;
- BootupReq->rtc_time.rtc_hour = (U8) 253;
- BootupReq->rtc_time.rtc_day = (U8) 253;
- BootupReq->rtc_time.rtc_mon = (U8) 253;
- BootupReq->rtc_time.rtc_wday = (U8) 253;
- BootupReq->rtc_time.rtc_year = (U8) 253;
- Message.oslMsgId = MMI_EQ_POWER_ON_IND;
- Message.oslDataPtr = (oslParaType*) BootupReq;
- Message.oslPeerBuffPtr = NULL;
- Message.oslSrcId = MOD_L4C;
- Message.oslDestId = MOD_MMI;
- OslMsgSendExtQueue(&Message);
- }
- {
- MYQUEUE Message;
- mmi_smu_password_required_ind_struct *SIMInd;
- SIMInd = OslConstructDataPtr(sizeof(mmi_smu_password_required_ind_struct));
- SIMInd->type = 0;
- SIMInd->is_sim_change = 0;
- SIMInd->chv_info.chv1_count = 13;
- SIMInd->chv_info.chv2_count = 240;
- SIMInd->chv_info.ubchv1_count = 173;
- SIMInd->chv_info.ubchv2_count = 186;
- SIMInd->chv_info.is_chv1_enabled = 171;
- SIMInd->chv_info.is_chv1_verified = 171;
- Message.oslMsgId = MSG_ID_GET_PIN_RES;
- Message.oslDataPtr = (oslParaType*) SIMInd;
- Message.oslPeerBuffPtr = NULL;
- Message.oslSrcId = MOD_L4C;
- Message.oslDestId = MOD_MMI;
- OslMsgSendExtQueue(&Message);
- }
- {
- MYQUEUE Message;
- mmi_nw_attach_ind_struct *NetworkInd;
- NetworkInd = OslConstructDataPtr(sizeof(mmi_nw_attach_ind_struct));
- NetworkInd->status = 0;
- sprintf(NetworkInd->plmn, "46688");
- NetworkInd->gsm_state = 0;
- NetworkInd->gprs_state = 0;
- Message.oslMsgId = PRT_NW_ATTACH_IND;
- Message.oslDataPtr = (oslParaType*) NetworkInd;
- Message.oslPeerBuffPtr = NULL;
- Message.oslSrcId = MOD_L4C;
- Message.oslDestId = MOD_MMI;
- OslMsgSendExtQueue(&Message);
- }
- }
- #endif /* defined(MMI_ON_WIN32) */