FlightMode.c
资源名称:mmi.rar [点击查看]
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:89k
源码类别:
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:
- * ---------
- * FlightMode.c
- *
- * Project:
- * --------
- * MAUI
- *
- * Description:
- * ------------
- * This file is intends for phone setup application
- *
- * 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!
- *
- *------------------------------------------------------------------------------
- * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
- *==============================================================================
- *******************************************************************************/
- #include "MMI_features.h" /* Robin 1217 */
- #include "StdC.h"
- #include "L4Dr1.h"
- #include "PixtelDataTypes.h"
- #include "wgui_categories.h"
- #include "wgui_categories_inputs.h"
- #include "wgui_categories_popup.h"
- #include "CustDataRes.h"
- #include "CustMenuRes.h"
- #include "EventsGProt.h"
- #include "DebugInitDef.h"
- #include "HistoryGprot.h"
- #include "ProtocolEvents.h"
- #include "CommonScreens.h"
- #include "Globaldefs.h"
- #include "NVRAMType.h"
- #include "NVRAMProt.h"
- #include "NVRAMEnum.h"
- #include "SettingsGexdcl.h"
- #include "settingGprots.h"
- #include "SettingDefs.h"
- #include "MainMenuDef.h" /* MAIN_MENU_TITLE_SETTINGS_ICON */
- #include "QueueGProt.h" /* Osl Send Message */
- #include "settingprot.h" /* PhoneSetup Prototype */
- #include "SettingProfile.h" /* WARNING_TONE */
- #include "MessagesExDcl.h" /* GetChildMenuIDIndexByParentMenuID() */
- #include "PhoneSetup.h"
- #include "PhoneSetupGprots.h"
- #include "SimDetectionDef.h" /* for g_pwr_context */
- #include "SimDetectionGprot.h"
- #include "wgui_status_icons.h"
- #include "GlobalScrEnum.h" /* diamond, 2006/01/01 Force to draw the background */
- #include "FlightModeGProt.h"
- #ifdef __FLIGHT_MODE_SUPPORT__
- #include "SimDetectionGexdcl.h"
- #include "NetworkSetupGProt.h"
- #include "IdleAppProt.h" /* diamond, 2005/09/21 lock keypad by pressing RSK and # in flight mode */
- #include "CallSetUp.h" /* diamond, 2005/09/28 restore signal icon with line switch */
- #ifdef __MMI_STATUS_ICON_SIGNAL_WITH_LINE_SWITCH__
- #include "StatusIconRes.h"
- #endif
- #ifdef __MMI_BT_HP_SUPPORT__
- #include "BTMMIHPGprots.h"
- #include "BTMMIHP.h"
- #endif /* __MMI_BT_HP_SUPPORT__ */
- #ifdef __MMI_BT_SUPPORT__
- #include "BTMMIScrGprots.h"
- #endif
- #ifdef __MMI_IRDA_SUPPORT__
- #include "IrdaMMIGprots.h"
- #include "IrdaMMIScr.h"
- extern void mmi_irda_exec_close_menu(void);
- #endif /* __MMI_IRDA_SUPPORT__ */
- #include "MessagesMiscell.h"
- #include "SMSApi.h"
- #include "SMSStruct.h"
- #ifdef MMI_ON_HARDWARE_P
- #include "Wapadp.h"
- #endif
- #ifdef __MMI_BT_PROFILE__
- #include "ProfileGprots.h"
- #endif
- #ifdef __MMI_ENGINEER_MODE__
- #include "EngineerModeDef.h"
- #endif
- #ifdef __MMI_WLAN_FEATURES__
- #include "DataAccountGProt.h"
- #include "NetworkSetupDefs.h"
- #endif /* __MMI_WLAN_FEATURES__ */
- #endif /* __FLIGHT_MODE_SUPPORT__ */
- /* diamond, 2005/07/05 Flight mode */
- /*
- * External Variable
- */
- extern PHNSET_CNTX g_phnset_cntx;
- extern U8 gSignalStrengthLevel;
- /*
- * Local Variable
- */
- typedef struct _phnset_f_mode_req
- {
- FuncPtr phnset_flight_mode_req;
- U8 state;
- } PHNSETFMODEREQ;
- static PHNSETFMODEREQ mmi_phnset_f_mode_req[] =
- {
- {PhnsetFlightModeSelectionReq, 1},
- #ifdef __MMI_WLAN_FEATURES__
- {mmi_flight_mode_switch_wlan, 1},
- #endif
- #if defined(__MMI_BT_HP_SUPPORT__) || defined(__MMI_BT_SUPPORT__)
- {mmi_flight_mode_switch_bluetooth, 1},
- #endif
- #ifdef __MMI_IRDA_SUPPORT__
- {mmi_flight_mode_switch_irda, 1},
- #endif
- {NULL, 0} /* dummy one, please add callbacks before this entity */
- };
- U32 StatusIconFlags[30]; /* Need to sync with RemoveStatusIconsForSimRemoved in SimDetection.c */
- /*****************************************************************************
- * FUNCTION
- * PhnsetFlightModeHideButSaveStatusIcon
- * DESCRIPTION
- * Hide the specific status icons if they are required to show in flight mode
- * PARAMETERS
- * icon_ID [IN]
- * icon_flag [IN] The flag for display or hide
- * S16 icon ID the specific icon(?)
- * RETURNS
- * void
- *****************************************************************************/
- MMI_BOOL PhnsetFlightModeHideButSaveStatusIcon(S16 icon_ID, U32 icon_flag)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MMI_BOOL rtn = MMI_TRUE;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- #ifdef __MMI_WLAN_FEATURES__
- if (mmi_bootup_is_sim_valid() == MMI_FALSE && mmi_netset_get_active_preferred_mode() != P_GSM_ONLY)
- {
- if (icon_ID == STATUS_ICON_UNREAD_EMAIL_L1L2 || icon_ID == STATUS_ICON_UNREAD_EMAIL_L1|| icon_ID == STATUS_ICON_UNREAD_EMAIL_L2
- #ifdef __MMI_POC__
- || icon_ID == STATUS_ICON_POC
- #endif
- #ifdef __MMI_IMPS__
- || icon_ID == STATUS_ICON_IMPS_MSG || icon_ID == STATUS_ICON_IMPS_LOGIN
- #endif
- )
- {
- return MMI_FALSE;
- }
- }
- #endif /* __MMI_WLAN_FEATURES__ */
- switch (icon_ID)
- {
- case STATUS_ICON_ROAMING:
- StatusIconFlags[0] = icon_flag;
- break;
- case STATUS_ICON_CALL_DIVERT_L1L2:
- StatusIconFlags[1] = icon_flag;
- break;
- #ifdef __MMI_CFU_SEPARATE_LINE__
- case STATUS_ICON_CALL_DIVERT_L1:
- StatusIconFlags[2] = icon_flag;
- break;
- case STATUS_ICON_CALL_DIVERT_L2:
- StatusIconFlags[3] = icon_flag;
- break;
- #endif /* __MMI_CFU_SEPARATE_LINE__ */
- case STATUS_ICON_INCOMING_SMS:
- StatusIconFlags[4] = icon_flag;
- break;
- case STATUS_ICON_MISSED_CALL:
- StatusIconFlags[5] = icon_flag;
- break;
- #ifndef __MMI_SUBLCD_SHORT_STATUSICON_LIST__
- case STATUS_ICON_SUBLCD_MISSED_CALL:
- StatusIconFlags[6] = icon_flag;
- break;
- #endif /* __MMI_SUBLCD_SHORT_STATUSICON_LIST__ */
- case STATUS_ICON_UNREAD_VOICE_L1L2:
- StatusIconFlags[7] = icon_flag;
- break;
- case STATUS_ICON_UNREAD_VOICE_L1:
- StatusIconFlags[8] = icon_flag;
- break;
- case STATUS_ICON_UNREAD_VOICE_L2:
- StatusIconFlags[9] = icon_flag;
- break;
- case STATUS_ICON_UNREAD_FAX_L1L2:
- StatusIconFlags[10] = icon_flag;
- break;
- case STATUS_ICON_UNREAD_FAX_L1:
- StatusIconFlags[11] = icon_flag;
- break;
- case STATUS_ICON_UNREAD_FAX_L2:
- StatusIconFlags[12] = icon_flag;
- break;
- case STATUS_ICON_UNREAD_EMAIL_L1L2:
- StatusIconFlags[13] = icon_flag;
- break;
- case STATUS_ICON_UNREAD_EMAIL_L1:
- StatusIconFlags[14] = icon_flag;
- break;
- case STATUS_ICON_UNREAD_EMAIL_L2:
- StatusIconFlags[15] = icon_flag;
- break;
- case STATUS_ICON_SUBLCD_SMS:
- StatusIconFlags[16] = icon_flag;
- break;
- case STATUS_ICON_MMS_UNREAD:
- StatusIconFlags[17] = icon_flag;
- break;
- case STATUS_ICON_MMS_BUSY:
- StatusIconFlags[18] = icon_flag;
- break;
- case STATUS_ICON_CHAT_INDICATION_ROOM1:
- StatusIconFlags[19] = icon_flag;
- break;
- case STATUS_ICON_CHAT_INDICATION_ROOM2:
- StatusIconFlags[20] = icon_flag;
- break;
- case STATUS_ICON_WAP:
- StatusIconFlags[21] = icon_flag;
- break;
- /*
- * case STATUS_ICON_NETWORK_CIPHER_GSM:
- * StatusIconFlags[22] = icon_flag;
- * break;
- * case STATUS_ICON_NETWORK_CIPHER_GPRS:
- * StatusIconFlags[23] = icon_flag;
- * break;
- */
- #ifndef __MMI_STATUS_ICON_SIGNAL_WITH_LINE_SWITCH__
- case STATUS_ICON_ALTERNATE_LINE_L1:
- StatusIconFlags[24] = icon_flag;
- break;
- case STATUS_ICON_ALTERNATE_LINE_L2:
- StatusIconFlags[25] = icon_flag;
- break;
- #endif /* __MMI_STATUS_ICON_SIGNAL_WITH_LINE_SWITCH__ */
- #ifdef __MMI_POC__
- case STATUS_ICON_POC:
- StatusIconFlags[26] = icon_flag;
- break;
- #endif /* __MMI_POC__ */
- #ifdef __MMI_IMPS__
- case STATUS_ICON_IMPS_MSG:
- StatusIconFlags[27] = icon_flag;
- break;
- case STATUS_ICON_IMPS_LOGIN:
- StatusIconFlags[28] = icon_flag;
- break;
- #endif /* __MMI_IMPS__ */
- default:
- rtn = MMI_FALSE;
- break;
- }
- return rtn;
- }
- /*****************************************************************************
- * FUNCTION
- * PhnsetFlightModeQueryBackground
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void PhnsetFlightModeQueryBackground(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* diamond, 2006/01/01 Force to draw the background */
- EntryNewScreen(GLOBAL_SCR_DUMMY, NULL, PhnsetFlightModeQueryBackground, NULL);
- ShowCategory61Screen(NULL, IMG_BOOTUP_SCANNING_LOGO, NULL);
- }
- #ifdef __FLIGHT_MODE_SUPPORT__
- void mmi_msg_set_msg_icon(U8, U8);
- extern void SetCat165TimerExpireFunc(FuncPtr);
- extern U32 get_status_icon_flag(S16 icon_ID);
- extern void set_status_icon_flag(S16 icon_ID, U32 value);
- extern void RemoveStatusIconsForSimRemoved(void);
- #ifndef MMI_ON_HARDWARE_P
- #define NVRAM_EF_SYS_CACHE_OCTET_SIZE 8
- #endif
- pBOOL gPowerOnWithFlightMode = MMI_FALSE;
- pBOOL gSetModeFromMenu = MMI_FALSE;
- /*****************************************************************************
- * FUNCTION
- * PhnsetFlightModeSaveStatusIconFlags
- * DESCRIPTION
- * Save the status icons status before enter flight mode
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void PhnsetFlightModeSaveStatusIconFlags(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- StatusIconFlags[0] = get_status_icon_flag(STATUS_ICON_ROAMING);
- StatusIconFlags[1] = get_status_icon_flag(STATUS_ICON_CALL_DIVERT_L1L2);
- #ifdef __MMI_CFU_SEPARATE_LINE__
- StatusIconFlags[2] = get_status_icon_flag(STATUS_ICON_CALL_DIVERT_L1);
- StatusIconFlags[3] = get_status_icon_flag(STATUS_ICON_CALL_DIVERT_L2);
- #endif /* __MMI_CFU_SEPARATE_LINE__ */
- StatusIconFlags[4] = get_status_icon_flag(STATUS_ICON_INCOMING_SMS);
- StatusIconFlags[5] = get_status_icon_flag(STATUS_ICON_MISSED_CALL);
- #ifndef __MMI_SUBLCD_SHORT_STATUSICON_LIST__
- StatusIconFlags[6] = get_status_icon_flag(STATUS_ICON_SUBLCD_MISSED_CALL);
- #endif
- StatusIconFlags[7] = get_status_icon_flag(STATUS_ICON_UNREAD_VOICE_L1L2);
- StatusIconFlags[8] = get_status_icon_flag(STATUS_ICON_UNREAD_VOICE_L1);
- StatusIconFlags[9] = get_status_icon_flag(STATUS_ICON_UNREAD_VOICE_L2);
- StatusIconFlags[10] = get_status_icon_flag(STATUS_ICON_UNREAD_FAX_L1L2);
- StatusIconFlags[11] = get_status_icon_flag(STATUS_ICON_UNREAD_FAX_L1);
- StatusIconFlags[12] = get_status_icon_flag(STATUS_ICON_UNREAD_FAX_L2);
- StatusIconFlags[13] = get_status_icon_flag(STATUS_ICON_UNREAD_EMAIL_L1L2);
- StatusIconFlags[14] = get_status_icon_flag(STATUS_ICON_UNREAD_EMAIL_L1);
- StatusIconFlags[15] = get_status_icon_flag(STATUS_ICON_UNREAD_EMAIL_L2);
- StatusIconFlags[16] = get_status_icon_flag(STATUS_ICON_SUBLCD_SMS);
- StatusIconFlags[17] = get_status_icon_flag(STATUS_ICON_MMS_UNREAD);
- StatusIconFlags[18] = get_status_icon_flag(STATUS_ICON_MMS_BUSY);
- StatusIconFlags[19] = get_status_icon_flag(STATUS_ICON_CHAT_INDICATION_ROOM1);
- StatusIconFlags[20] = get_status_icon_flag(STATUS_ICON_CHAT_INDICATION_ROOM2);
- StatusIconFlags[21] = get_status_icon_flag(STATUS_ICON_WAP);
- /*
- * StatusIconFlags[22] = get_status_icon_flag(STATUS_ICON_NETWORK_CIPHER_GSM);
- * StatusIconFlags[23] = get_status_icon_flag(STATUS_ICON_NETWORK_CIPHER_GPRS);
- */
- #ifndef __MMI_STATUS_ICON_SIGNAL_WITH_LINE_SWITCH__
- StatusIconFlags[24] = get_status_icon_flag(STATUS_ICON_ALTERNATE_LINE_L1);
- StatusIconFlags[25] = get_status_icon_flag(STATUS_ICON_ALTERNATE_LINE_L2);
- #endif /* __MMI_STATUS_ICON_SIGNAL_WITH_LINE_SWITCH__ */
- #ifdef __MMI_POC__
- StatusIconFlags[26] = get_status_icon_flag(STATUS_ICON_POC);
- #endif
- #ifdef __MMI_IMPS__
- StatusIconFlags[27] = get_status_icon_flag(STATUS_ICON_IMPS_MSG);
- StatusIconFlags[28] = get_status_icon_flag(STATUS_ICON_IMPS_LOGIN);
- #endif /* __MMI_IMPS__ */
- }
- /*****************************************************************************
- * FUNCTION
- * PhnsetFlightModeRestoreStatusIconFlags
- * DESCRIPTION
- * Restire the status icons status before enter normal mode
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void PhnsetFlightModeRestoreStatusIconFlags(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- set_status_icon_flag(STATUS_ICON_ROAMING, StatusIconFlags[0]);
- set_status_icon_flag(STATUS_ICON_CALL_DIVERT_L1L2, StatusIconFlags[1]);
- #ifdef __MMI_CFU_SEPARATE_LINE__
- set_status_icon_flag(STATUS_ICON_CALL_DIVERT_L1, StatusIconFlags[2]);
- set_status_icon_flag(STATUS_ICON_CALL_DIVERT_L2, StatusIconFlags[3]);
- #endif /* __MMI_CFU_SEPARATE_LINE__ */
- set_status_icon_flag(STATUS_ICON_INCOMING_SMS, StatusIconFlags[4]);
- set_status_icon_flag(STATUS_ICON_MISSED_CALL, StatusIconFlags[5]);
- #ifndef __MMI_SUBLCD_SHORT_STATUSICON_LIST__
- set_status_icon_flag(STATUS_ICON_SUBLCD_MISSED_CALL, StatusIconFlags[6]);
- #endif
- set_status_icon_flag(STATUS_ICON_UNREAD_VOICE_L1L2, StatusIconFlags[7]);
- set_status_icon_flag(STATUS_ICON_UNREAD_VOICE_L1, StatusIconFlags[8]);
- set_status_icon_flag(STATUS_ICON_UNREAD_VOICE_L2, StatusIconFlags[9]);
- set_status_icon_flag(STATUS_ICON_UNREAD_FAX_L1L2, StatusIconFlags[10]);
- set_status_icon_flag(STATUS_ICON_UNREAD_FAX_L1, StatusIconFlags[11]);
- set_status_icon_flag(STATUS_ICON_UNREAD_FAX_L2, StatusIconFlags[12]);
- set_status_icon_flag(STATUS_ICON_UNREAD_EMAIL_L1L2, StatusIconFlags[13]);
- set_status_icon_flag(STATUS_ICON_UNREAD_EMAIL_L1, StatusIconFlags[14]);
- set_status_icon_flag(STATUS_ICON_UNREAD_EMAIL_L2, StatusIconFlags[15]);
- set_status_icon_flag(STATUS_ICON_SUBLCD_SMS, StatusIconFlags[16]);
- set_status_icon_flag(STATUS_ICON_MMS_UNREAD, StatusIconFlags[17]);
- set_status_icon_flag(STATUS_ICON_MMS_BUSY, StatusIconFlags[18]);
- set_status_icon_flag(STATUS_ICON_CHAT_INDICATION_ROOM1, StatusIconFlags[19]);
- set_status_icon_flag(STATUS_ICON_CHAT_INDICATION_ROOM2, StatusIconFlags[20]);
- set_status_icon_flag(STATUS_ICON_WAP, StatusIconFlags[21]);
- /*
- * set_status_icon_flag(STATUS_ICON_NETWORK_CIPHER_GSM, StatusIconFlags[22]);
- * set_status_icon_flag(STATUS_ICON_NETWORK_CIPHER_GPRS, StatusIconFlags[23]);
- */
- #ifdef __MMI_STATUS_ICON_SIGNAL_WITH_LINE_SWITCH__
- /* diamond, 2005/09/28 restore signal icon with line switch */
- if (mmi_bootup_is_sim_valid()) /* diamond, 2006/02/19 Not update line id if sim is not inserted after mode switch */
- {
- if (g_callset_context.LineID == LINE1)
- {
- ChangeStatusIconImage(STATUS_ICON_SIGNAL_STRENGTH, IMG_SI_SIGNAL_STRENGTH_L1);
- }
- else
- {
- ChangeStatusIconImage(STATUS_ICON_SIGNAL_STRENGTH, IMG_SI_SIGNAL_STRENGTH_L2);
- }
- }
- #else /* __MMI_STATUS_ICON_SIGNAL_WITH_LINE_SWITCH__ */
- set_status_icon_flag(STATUS_ICON_ALTERNATE_LINE_L1, StatusIconFlags[24]);
- set_status_icon_flag(STATUS_ICON_ALTERNATE_LINE_L2, StatusIconFlags[25]);
- #endif /* __MMI_STATUS_ICON_SIGNAL_WITH_LINE_SWITCH__ */
- #ifdef __MMI_POC__
- set_status_icon_flag(STATUS_ICON_POC, StatusIconFlags[26]);
- #endif
- #ifdef __MMI_IMPS__
- set_status_icon_flag(STATUS_ICON_IMPS_MSG, StatusIconFlags[27]);
- set_status_icon_flag(STATUS_ICON_IMPS_LOGIN, StatusIconFlags[28]);
- #endif /* __MMI_IMPS__ */
- }
- /*****************************************************************************
- * FUNCTION
- * HighlightPhnsetFlightMode
- * DESCRIPTION
- * This function is highlight handler for Phone Setup -> Flight Mode
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void HighlightPhnsetFlightMode(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* 1 Change left soft key icon and label */
- ChangeLeftSoftkey(STR_GLOBAL_OK, 0);
- /* 2 Change right soft key icon and label */
- ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
- #ifdef __MTK_TARGET__
- SetLeftSoftkeyFunction(EntryPhnsetFlightMode, KEY_EVENT_UP);
- SetKeyHandler(EntryPhnsetFlightMode, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- #else /* __MTK_TARGET__ */
- SetLeftSoftkeyFunction(PopupNoSupport, KEY_EVENT_UP);
- SetKeyHandler(PopupNoSupport, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- #endif /* __MTK_TARGET__ */
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * HintPhnsetFlightMode
- * DESCRIPTION
- * This function is hint handling function for Phone Setup -> Flight Mode
- * PARAMETERS
- * index [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void HintPhnsetFlightMode(U16 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 error;
- U8 data[NVRAM_EF_SYS_CACHE_OCTET_SIZE];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ReadRecord(NVRAM_EF_SYS_CACHE_OCTET_LID, 2, &data, NVRAM_EF_SYS_CACHE_OCTET_SIZE, &error);
- g_phnset_cntx.curFlightMode = data[0];
- switch (g_phnset_cntx.curFlightMode)
- {
- case FLIGHTMODE_OFF: /* 0x00 */
- pfnUnicodeStrcpy((PS8) hintData[index], (PS8) GetString(STR_FLIGHT_MODE_NORMAL));
- break;
- case FLIGHTMODE_SILENT: /* 0x01 */
- pfnUnicodeStrcpy((PS8) hintData[index], (PS8) GetString(STR_FLIGHT_MODE_SILENT));
- break;
- case FLIGHTMODE_QUERY: /* 0x02 */
- pfnUnicodeStrcpy((PS8) hintData[index], (PS8) GetString(STR_FLIGHT_MODE_QUERY));
- break;
- default:
- data[0] = FLIGHTMODE_OFF;
- data[1] = FLIGHTMODE_OFF;
- g_phnset_cntx.curFlightMode = 0;
- #ifdef __MMI_WLAN_FEATURES__
- g_phnset_cntx.curFlightMode2 = 0;
- #endif
- WriteRecord(NVRAM_EF_SYS_CACHE_OCTET_LID, 2, &data, NVRAM_EF_SYS_CACHE_OCTET_SIZE, &error);
- pfnUnicodeStrcpy((PS8) hintData[index], (PS8) GetString(STR_FLIGHT_MODE_NORMAL));
- break;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * HiliteHandlerFlightMode
- * DESCRIPTION
- * Highlight handler for mode selection
- * PARAMETERS
- * index [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void HiliteHandlerFlightMode(S32 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_phnset_cntx.selFlightMode = (U8) index;
- return;
- }
- /*****************************************************************************
- * FUNCTION
- * EntryFlightModeProgress
- * DESCRIPTION
- * Progressing screen for mode switch
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryFlightModeProgress(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_FLIGHT_MODE_PROGRESS, NULL, EntryFlightModeProgress, NULL);
- SetKeyHandler(NULL, KEY_END, KEY_EVENT_DOWN);
- SetKeyHandler(NULL, KEY_END, KEY_EVENT_UP);
- ShowCategory66Screen(
- STR_MENU_FLIGHT_MODE,
- 0,
- 0,
- 0,
- 0,
- 0,
- (PU8) GetString(STR_FLIGHT_MODE_PROGRESS),
- IMG_FLIGHT_MODE_PROGRESS,
- NULL);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_phnset_flight_mode_camp_on_tone_hdlr
- * DESCRIPTION
- * Timeout handler to play camp on tone after switch to normal mode
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- static void mmi_phnset_flight_mode_camp_on_tone_hdlr(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (mmi_idle_is_on_idle_screen())
- {
- playRequestedTone(CAMP_ON_TONE);
- }
- else
- {
- /* start timer again if */
- StartTimer(
- FLIGHT_MODE_CAMP_ON_TONE_TIMER,
- UI_POPUP_NOTIFYDURATION_TIME,
- mmi_phnset_flight_mode_camp_on_tone_hdlr);
- }
- }
- #ifdef __MMI_BT_SUPPORT__
- static pBOOL btNotReady = MMI_FALSE;
- static pBOOL btGotRsp = MMI_FALSE;
- #endif /* __MMI_BT_SUPPORT__ */
- /*****************************************************************************
- * FUNCTION
- * mmi_phnset_flight_mode_selection_finish
- * DESCRIPTION
- * Finish to perform mode switch
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_phnset_flight_mode_selection_finish(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION(("@@@@@ Flight mode: switch done @@@@@"));
- #ifdef __MMI_BT_SUPPORT__
- if (!gSetModeFromMenu)
- {
- /* BT always call this callback after set flight mode */
- /* MMI doesn't have screen for set mode in power on period */
- return;
- }
- if (btGotRsp)
- {
- return;
- }
- StopTimer(FLIGHT_MODE_DEACTIVATE_BT_TIMER);
- #endif /* __MMI_BT_SUPPORT__ */
- /* do not call this fuction for BT power on by init */
- if (GetActiveScreenId() != SCR_FLIGHT_MODE_PROGRESS)
- {
- DeleteScreenIfPresent(SCR_FLIGHT_MODE_PROGRESS); /* progressing */
- DeleteScreenIfPresent(SCR_FLIGHT_MODE_SELECTION); /* flight mode menu */
- DeleteScreenIfPresent(SCR9003_INITIALSETUP); /* phone setup */
- DeleteScreenIfPresent(SCR9000_SETTINGS); /* setting */
- DeleteScreenIfPresent(MAIN_MENU_SCREENID); /* main menu */
- DeleteScreenIfPresent(SCR_SIM_OPTION); /* sim option menu */
- if (mmi_bootup_is_sim_valid() && mmi_idle_is_on_idle_screen())
- {
- /* already in idle screen because mode switch is interrupted by other application */
- EntryIdleScreen();
- }
- if (g_pwr_context.CurrentServiceType == FULL_SERVICE)
- {
- /* play camp on tone */
- mmi_phnset_flight_mode_camp_on_tone_hdlr();
- }
- }
- else
- {
- DisplayPopupCallBack(
- (PU8) GetString(STR_GLOBAL_DONE),
- IMG_GLOBAL_ACTIVATED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- SUCCESS_TONE,
- DisplayIdleScreen);
- if (IsScreenPresent(SCR_SIM_INSERTION))
- {
- DeleteUptoScrID(SCR_SIM_INSERTION);
- }
- else if (IsScreenPresent(SCR_SIM_BLOCK))
- {
- DeleteUptoScrID(SCR_SIM_BLOCK);
- }
- else
- {
- DeleteUptoScrID(IDLE_SCREEN_ID);
- }
- if (g_pwr_context.CurrentServiceType == FULL_SERVICE)
- {
- /* play camp on tone */
- StartTimer(
- FLIGHT_MODE_CAMP_ON_TONE_TIMER,
- UI_POPUP_NOTIFYDURATION_TIME,
- mmi_phnset_flight_mode_camp_on_tone_hdlr);
- }
- }
- gSetModeFromMenu = MMI_FALSE;
- #ifdef __MMI_BT_SUPPORT__
- btGotRsp = MMI_TRUE;
- #endif
- }
- #ifdef __MMI_BT_SUPPORT__
- /*****************************************************************************
- * FUNCTION
- * mmi_phnset_flight_mode_bt_timeout_hdlr
- * DESCRIPTION
- * Timeout handler for no response from BT
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- static void mmi_phnset_flight_mode_bt_timeout_hdlr(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION(("@@@@@ Flight mode: BT deactivation timeout @@@@@"));
- /* Temporarily don't set BT not ready flag */
- /* btNotReady = MMI_TRUE; */
- //mmi_phnset_flight_mode_selection_finish();
- mmi_phnset_switch_flight_mode();
- }
- #endif /* __MMI_BT_SUPPORT__ */
- /*****************************************************************************
- * FUNCTION
- * mmi_flight_mode_switch_bluetooth
- * DESCRIPTION
- * Switch BT after flight mode switch
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_flight_mode_switch_bluetooth(void)
- {
- #if defined(__MMI_BT_HP_SUPPORT__) || defined(__MMI_BT_SUPPORT__)
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 btSimPresent;
- U8 btChipPresent;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- #ifdef __MMI_BT_HP_SUPPORT__
- btSimPresent = mmi_bootup_is_sim_valid();
- #else
- #ifdef __MMI_BT_SUPPORT__
- btSimPresent = 1; /* always turn on */
- #if 0
- #ifdef __MMI_BT_BCHS_SUPPORT__
- /* under construction !*/
- #else
- /* under construction !*/
- #endif
- #endif /* 0 */
- #endif /* __MMI_BT_SUPPORT__ */
- #endif /* __MMI_BT_HP_SUPPORT__ */
- #ifdef __MMI_BT_SUPPORT__
- btChipPresent = !btNotReady;
- #else
- btChipPresent = 1;
- #endif
- if (btSimPresent && btChipPresent)
- {
- PRINT_INFORMATION(("@@@@@ Flight mode: BT reset @@@@@"));
- btGotRsp = MMI_FALSE;
- StartTimer(FLIGHT_MODE_DEACTIVATE_BT_TIMER, 40000, mmi_phnset_flight_mode_bt_timeout_hdlr);
- if (mmi_bootup_get_active_flight_mode() == FLIGHTMODE_OFF)
- {
- mmi_bt_reset_hw_on();
- }
- else
- {
- mmi_bt_reset_hw_off();
- }
- }
- else
- {
- mmi_phnset_switch_flight_mode();
- }
- #endif /* defined(__MMI_BT_HP_SUPPORT__) || defined(__MMI_BT_SUPPORT__) */
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_flight_mode_switch_irda
- * DESCRIPTION
- * Switch IrDA after flight mode switch
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_flight_mode_switch_irda(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- #ifdef __MMI_IRDA_SUPPORT__
- if (MMI_IRDASCR_CNTX(irda_state) != MMIR_SCR_IRCLOSE &&
- mmi_bootup_get_active_flight_mode() == FLIGHTMODE_SILENT)
- {
- PRINT_INFORMATION(("@@@@@ Flight mode: IrDA disconnect @@@@@"));
- if (mmi_irda_is_ircomm_active() == MMI_TRUE)
- {
- mmi_irda_ircomm_disconnect_request();
- }
- mmi_irda_exec_close_menu();
- }
- #endif /* __MMI_IRDA_SUPPORT__ */
- mmi_phnset_switch_flight_mode();
- }
- /*****************************************************************************
- * FUNCTION
- * PhnsetFlightModeSelectionRsp
- * DESCRIPTION
- * Response of mode switch
- * PARAMETERS
- * info [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void PhnsetFlightModeSelectionRsp(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- mmi_nw_cfun_state_rsp_struct *cfun_state_rsp;
- extern U8 lastNwStatus;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- cfun_state_rsp = (mmi_nw_cfun_state_rsp_struct*) info;
- ClearProtocolEventHandler(PRT_NW_CFUN_STATE_RSP);
- #ifdef MMI_ON_HARDWARE_P
- if (cfun_state_rsp->result == KAL_TRUE)
- {
- #endif /* MMI_ON_HARDWARE_P */
- g_phnset_cntx.curFlightMode = g_phnset_cntx.selFlightMode; /* update flight mode if it is successfully changed */
- if (mmi_bootup_get_active_flight_mode() == FLIGHTMODE_OFF && /* normal mode to flight mode */
- #ifdef MMI_ON_HARDWARE_P
- #ifdef MMS_SUPPORT
- (mmi_frm_sms_get_sms_list_size(MMI_FRM_SMS_NOBOX) == MMI_FRM_SMS_INVALID_INDEX || !wap_is_ready()))
- #else
- mmi_frm_sms_get_sms_list_size(MMI_FRM_SMS_NOBOX) == MMI_FRM_SMS_INVALID_INDEX)
- #endif
- #else /* MMI_ON_HARDWARE_P */
- mmi_frm_sms_get_sms_list_size(MMI_FRM_SMS_NOBOX) == MMI_FRM_SMS_INVALID_INDEX)
- #endif /* MMI_ON_HARDWARE_P */
- gPowerOnWithFlightMode = MMI_TRUE;
- else
- {
- gPowerOnWithFlightMode = MMI_FALSE;
- }
- //if (mmi_bootup_get_active_flight_mode() == FLIGHTMODE_OFF) /* normal mode to flight mode */
- if ((g_pwr_context.PowerOnNWStatus & MMI_NW_STATUS_FLIGHT_MODE) == FLIGHTMODE_OFF)
- {
- lastNwStatus = MMI_RAC_NO_CELL; /* update last network status as no service */
- gSignalStrengthLevel = 0; /* avoid no signal level indication sent to MMI */
- PhnsetFlightModeSaveStatusIconFlags();
- RemoveStatusIconsForSimRemoved();
- UpdateStatusIcons();
- //mmi_flight_mode_hide_menu_items();
- }
- /* diamond, 2005/10/28 Need to update status icons first, then change mode */
- if (g_phnset_cntx.selFlightMode == FLIGHTMODE_SILENT)
- {
- g_pwr_context.PowerOnNWStatus |= MMI_NW_STATUS_FLIGHT_MODE; /* 0x04: Flight mode */
- }
- else
- {
- g_pwr_context.PowerOnNWStatus &= ~MMI_NW_STATUS_FLIGHT_MODE; /* 0x04: Flight mode */
- }
- //if (mmi_bootup_get_active_flight_mode() == FLIGHTMODE_OFF) /* flight mode to normal mode */
- if ((g_pwr_context.PowerOnNWStatus & MMI_NW_STATUS_FLIGHT_MODE) == FLIGHTMODE_OFF)
- {
- PhnsetFlightModeRestoreStatusIconFlags();
- UpdateStatusIcons();
- //mmi_flight_mode_unhide_menu_items();
- }
- /* diamond, 2005/11/17 Force to draw signal level because signal level indication comes before flight mode switch rsp */
- ChangeStatusIconLevel(STATUS_ICON_SIGNAL_STRENGTH, gSignalStrengthLevel);
- #ifdef __MMI_SUBLCD__
- ChangeStatusIconLevel(STATUS_ICON_SUBLCD_SIGNAL_STRENGTH, gSignalStrengthLevel);
- #endif
- /* diamond, 2006/02/22 If the camp on tone comes with next network attachment indication, it might be delayed for many seconds */
- g_pwr_context.IsCampOnTonePlayed = 1;
- g_pwr_context.InvalidSimShowed = 1;
- mmi_phnset_switch_flight_mode();
- #ifdef MMI_ON_HARDWARE_P
- }
- else
- {
- DisplayPopup(
- (U8*) GetString(STR_GLOBAL_NOT_DONE),
- IMG_GLOBAL_UNFINISHED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) ERROR_TONE);
- DeleteScreenIfPresent(SCR_FLIGHT_MODE_PROGRESS);
- }
- #endif /* MMI_ON_HARDWARE_P */
- }
- /*****************************************************************************
- * FUNCTION
- * PhnsetFlightModeSelectionReq
- * DESCRIPTION
- * Request of mode switch
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void PhnsetFlightModeSelectionReq(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MYQUEUE Message;
- mmi_nw_cfun_state_req_struct *cfun_state_req;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_phnset_cntx.selFlightMode == FLIGHTMODE_QUERY)
- {
- DisplayPopup(
- (U8*) GetString(STR_GLOBAL_DONE),
- IMG_GLOBAL_ACTIVATED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) SUCCESS_TONE);
- DeleteScreenIfPresent(SCR_FLIGHT_MODE_SELECTION); /* flight mode menu */
- /* save it to NVRAM only and not necessary to send request to L4C */
- g_phnset_cntx.curFlightMode = g_phnset_cntx.selFlightMode;
- PhnsetFlightModeSaveMode();
- DeleteScreenIfPresent(SCR_FLIGHT_MODE_PROGRESS);
- return;
- }
- if ((g_phnset_cntx.selFlightMode != FLIGHTMODE_QUERY) &&
- (g_phnset_cntx.curFlightMode == FLIGHTMODE_QUERY) &&
- (mmi_bootup_get_active_flight_mode() == g_phnset_cntx.selFlightMode))
- {
- DisplayPopup(
- (U8*) GetString(STR_GLOBAL_DONE),
- IMG_GLOBAL_ACTIVATED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) SUCCESS_TONE);
- DeleteScreenIfPresent(SCR_FLIGHT_MODE_SELECTION); /* flight mode menu */
- /* save it to NVRAM only and not necessary to send request to L4C */
- g_phnset_cntx.curFlightMode = g_phnset_cntx.selFlightMode;
- PhnsetFlightModeSaveMode();
- DeleteScreenIfPresent(SCR_FLIGHT_MODE_PROGRESS);
- return;
- }
- cfun_state_req = OslConstructDataPtr(sizeof(mmi_nw_cfun_state_req_struct));
- if (g_phnset_cntx.selFlightMode == FLIGHTMODE_OFF) /* normal mode */
- {
- cfun_state_req->cfun_state = 1;
- }
- else /* flight mode */
- {
- cfun_state_req->cfun_state = 4;
- }
- SetProtocolEventHandler(PhnsetFlightModeSelectionRsp, PRT_NW_CFUN_STATE_RSP);
- // EntryFlightModeProgress(); /* show searching screen */
- // gSetModeFromMenu = MMI_TRUE;
- Message.oslMsgId = PRT_NW_CFUN_STATE_REQ;
- Message.oslDataPtr = (oslParaType*) cfun_state_req;
- Message.oslPeerBuffPtr = NULL;
- Message.oslSrcId = MOD_MMI;
- Message.oslDestId = MOD_L4C;
- OslMsgSendExtQueue(&Message);
- }
- /*****************************************************************************
- * FUNCTION
- * EntryFlightModeSelectionCnf
- * DESCRIPTION
- * Confirmation screen of mode switch
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryFlightModeSelectionCnf(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- DisplayConfirm(
- STR_GLOBAL_YES,
- IMG_GLOBAL_YES,
- STR_GLOBAL_NO,
- IMG_GLOBAL_NO,
- get_string(STR_FLIGHT_MODE_CONFIRM),
- IMG_GLOBAL_QUESTION,
- WARNING_TONE);
- //SetLeftSoftkeyFunction(PhnsetFlightModeSelectionReq, KEY_EVENT_UP);
- SetLeftSoftkeyFunction(mmi_phnset_confirm_to_switch_mode, KEY_EVENT_UP);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- /* Play warning tone */
- playRequestedTone(WARNING_TONE);
- }
- /*****************************************************************************
- * FUNCTION
- * PhnsetFlightModeSelectionOK
- * DESCRIPTION
- * Handler for the mode selection by user
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void PhnsetFlightModeSelectionOK(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_phnset_cntx.selFlightMode == g_phnset_cntx.curFlightMode)
- {
- /* select mode is the same as current mode, so not necessary to send request to L4C */
- DisplayPopup(
- (U8*) GetString(STR_GLOBAL_DONE),
- IMG_GLOBAL_ACTIVATED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) SUCCESS_TONE);
- DeleteScreenIfPresent(SCR_FLIGHT_MODE_SELECTION); /* flight mode menu */
- }
- else
- {
- EntryFlightModeSelectionCnf();
- }
- }
- /*****************************************************************************
- * FUNCTION
- * EntryPhnsetFlightMode
- * DESCRIPTION
- * This function is Entry function for Phone Setup -> Flight Mode
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryPhnsetFlightMode(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 nNumofItem = 3;
- U8 *guiBuffer;
- U16 nStrItemList[3] = {STR_FLIGHT_MODE_NORMAL, STR_FLIGHT_MODE_SILENT, STR_FLIGHT_MODE_QUERY};
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_FLIGHT_MODE_SELECTION, NULL, EntryPhnsetFlightMode, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_FLIGHT_MODE_SELECTION);
- RegisterHighlightHandler(HiliteHandlerFlightMode);
- ShowCategory11Screen(
- STR_MENU_FLIGHT_MODE,
- MAIN_MENU_TITLE_SETTINGS_ICON,
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- nNumofItem,
- nStrItemList,
- g_phnset_cntx.curFlightMode,
- guiBuffer);
- SetLeftSoftkeyFunction(PhnsetFlightModeSelectionOK, KEY_EVENT_UP);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(0, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * PhnsetFlightModeSaveMode
- * DESCRIPTION
- * Save active mode to NVRAM
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void PhnsetFlightModeSaveMode(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 data[NVRAM_EF_SYS_CACHE_OCTET_SIZE];
- S16 error;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION(("@@@@@ Flight mode: save mode @@@@@"));
- data[0] = g_phnset_cntx.curFlightMode;
- data[1] = (U8) mmi_bootup_get_active_flight_mode();
- WriteRecord(NVRAM_EF_SYS_CACHE_OCTET_LID, 2, &data, NVRAM_EF_SYS_CACHE_OCTET_SIZE, &error);
- }
- /*****************************************************************************
- * FUNCTION
- * PowerOnFlightMode
- * DESCRIPTION
- * Process of power on in flight mode
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void PowerOnFlightMode(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MYQUEUE Message;
- mmi_nw_cfun_state_req_struct *cfun_state_req;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- cfun_state_req = OslConstructDataPtr(sizeof(mmi_nw_cfun_state_req_struct));
- PhnsetFlightModeSaveStatusIconFlags();
- RemoveStatusIconsForSimRemoved();
- UpdateStatusIcons();
- cfun_state_req->cfun_state = 4;
- g_pwr_context.PowerOnNWStatus |= MMI_NW_STATUS_FLIGHT_MODE; /* 0x04: Flight mode */
- if (g_phnset_cntx.curFlightMode != FLIGHTMODE_QUERY)
- {
- g_phnset_cntx.curFlightMode = FLIGHTMODE_SILENT;
- }
- Message.oslMsgId = PRT_NW_CFUN_STATE_REQ;
- Message.oslDataPtr = (oslParaType*) cfun_state_req;
- Message.oslPeerBuffPtr = NULL;
- Message.oslSrcId = MOD_MMI;
- Message.oslDestId = MOD_L4C;
- OslMsgSendExtQueue(&Message);
- ExitCategory165Screen(); /* StopTimer(POPUP_TIMER); */
- ClearInputEventHandler(MMI_DEVICE_ALL); /* prevent user press key after mode selection in qurey screen */
- /* apply to handphone only */
- #if defined(__MMI_BT_HP_SUPPORT__)
- mmi_bt_reset_hw_off();
- #endif
- gPowerOnWithFlightMode = MMI_TRUE;
- DeleteScreenIfPresent(GLOBAL_SCR_DUMMY);
- if (g_pwr_context.PowerOnMode == POWER_ON_KEYPAD) /* diamond, 2005/10/21 Do not play animation for exception power on */
- {
- PhnsetFlightModeSaveMode();
- mmi_bootup_exit_flight_mode_query();
- }
- }
- /*****************************************************************************
- * FUNCTION
- * PowerOnNormalMode
- * DESCRIPTION
- * Process of power on in normal mode
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void PowerOnNormalMode(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MYQUEUE Message;
- mmi_nw_cfun_state_req_struct *cfun_state_req;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- cfun_state_req = OslConstructDataPtr(sizeof(mmi_nw_cfun_state_req_struct));
- cfun_state_req->cfun_state = 1;
- g_pwr_context.PowerOnNWStatus &= ~MMI_NW_STATUS_FLIGHT_MODE; /* 0x04 Flight mode */
- if (g_phnset_cntx.curFlightMode != FLIGHTMODE_QUERY)
- {
- g_phnset_cntx.curFlightMode = FLIGHTMODE_OFF;
- }
- Message.oslMsgId = PRT_NW_CFUN_STATE_REQ;
- Message.oslDataPtr = (oslParaType*) cfun_state_req;
- Message.oslPeerBuffPtr = NULL;
- Message.oslSrcId = MOD_MMI;
- Message.oslDestId = MOD_L4C;
- OslMsgSendExtQueue(&Message);
- ExitCategory165Screen(); /* StopTimer(POPUP_TIMER); */
- ClearInputEventHandler(MMI_DEVICE_ALL); /* prevent user press key after mode selection in qurey screen */
- DeleteScreenIfPresent(GLOBAL_SCR_DUMMY);
- if (g_pwr_context.PowerOnMode == POWER_ON_KEYPAD) /* diamond, 2005/10/21 Do not play animation for exception power on */
- {
- PhnsetFlightModeSaveMode();
- mmi_bootup_exit_flight_mode_query();
- }
- }
- /*****************************************************************************
- * FUNCTION
- * EntryQueryFlightModeScreen
- * DESCRIPTION
- * Flight mode query screen before power on animation
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryQueryFlightModeScreen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_pwr_context.PowerOnMMIStatus = MMI_POWER_ON_FLIGHT_MODE_QUERY; /* 0x02: Flight mode screen */
- guiBuffer = GetCurrGuiBuffer(SCR_FLIGHT_MODE_QUERY);
- EntryNewScreen(SCR_FLIGHT_MODE_QUERY, NULL, EntryQueryFlightModeScreen, NULL);
- ShowCategory165Screen_ext(
- STR_GLOBAL_YES,
- IMG_GLOBAL_YES,
- STR_GLOBAL_NO,
- IMG_GLOBAL_NO,
- get_string(STR_MENU_FLIGHT_MODE),
- IMG_GLOBAL_QUESTION,
- 10,
- guiBuffer);
- SetCat165TimerExpireFunc(PowerOnNormalMode);
- playRequestedTone(WARNING_TONE);
- /* ShowSubLCDScreen(ShowIdleAppSubLcd); */
- /* no sub-lcd exit handler because of no interrupt in this screen */
- #ifdef __MMI_SUBLCD_SHOW_ANALOG_CLOCK__
- if (IsClamClose())
- {
- ShowSubLCDAnalogClockScreen();
- }
- else
- {
- ShowSubLCDLogoString();
- }
- #else /* __MMI_SUBLCD_SHOW_ANALOG_CLOCK__ */
- ShowCategory301Screen((PU8) GetString(STR_MENU_FLIGHT_MODE), 0, NULL);
- #endif /* __MMI_SUBLCD_SHOW_ANALOG_CLOCK__ */
- g_phnset_cntx.curFlightMode = FLIGHTMODE_QUERY;
- /* No history to go back */
- /* Always enter normal mode unless the flight mode is selected by pressing LSK (Yes) */
- SetKeyHandler(PowerOnNormalMode, KEY_END, KEY_EVENT_DOWN);
- #ifdef __MMI_WLAN_FEATURES__
- SetLeftSoftkeyFunction(mmi_phnset_power_on_query_with_flight_mode, KEY_EVENT_UP);
- SetRightSoftkeyFunction(mmi_phnset_power_on_query_with_normal_mode, KEY_EVENT_UP);
- #else
- SetLeftSoftkeyFunction(PowerOnFlightMode, KEY_EVENT_UP);
- SetRightSoftkeyFunction(PowerOnNormalMode, KEY_EVENT_UP);
- #endif
- }
- /*****************************************************************************
- * FUNCTION
- * PhnsetFlightModeGetLatestActionMode
- * DESCRIPTION
- * Get latest action mode for exception power on
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- U8 PhnsetFlightModeGetLatestActionMode(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 data[NVRAM_EF_SYS_CACHE_OCTET_SIZE];
- S16 error;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ReadRecord(NVRAM_EF_SYS_CACHE_OCTET_LID, 2, &data, NVRAM_EF_SYS_CACHE_OCTET_SIZE, &error);
- return data[1];
- }
- /*****************************************************************************
- * FUNCTION
- * PhnsetFlightModePowerOnException
- * DESCRIPTION
- * Process of exception power on mode switch
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void PhnsetFlightModePowerOnException(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (PhnsetFlightModeGetLatestActionMode() == FLIGHTMODE_OFF)
- {
- PowerOnNormalMode();
- }
- else
- {
- PowerOnFlightMode();
- }
- }
- #ifdef __MMI_ENGINEER_MODE__
- extern void EntryEmRFTestGSM(void);
- pBOOL gEnterEMWithFlightMode = MMI_FALSE;
- /*****************************************************************************
- * FUNCTION
- * mmi_em_enter_flight_mode_rsp
- * DESCRIPTION
- * Enter flight mode from engineering mode
- * PARAMETERS
- * info
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_em_enter_flight_mode_rsp(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- mmi_nw_cfun_state_rsp_struct *cfun_state_rsp;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- cfun_state_rsp = (mmi_nw_cfun_state_rsp_struct*) info;
- ClearProtocolEventHandler(PRT_NW_CFUN_STATE_RSP);
- #ifdef MMI_ON_HARDWARE_P
- if (cfun_state_rsp->result == KAL_TRUE)
- {
- #endif /* MMI_ON_HARDWARE_P */
- /* update flight mode if it is successfully changed */
- /* g_phnset_cntx.curFlightMode = 1; */
- g_pwr_context.PowerOnNWStatus |= MMI_NW_STATUS_FLIGHT_MODE; /* 0x04: Flight mode */
- /* refresh status icons */
- gSignalStrengthLevel = 0;
- PhnsetFlightModeSaveStatusIconFlags();
- RemoveStatusIconsForSimRemoved();
- UpdateStatusIcons();
- /* write current mode to nvram */
- PhnsetFlightModeSaveMode();
- /* force to draw signal level because signal level indication comes before flight mode switch rsp */
- ChangeStatusIconLevel(STATUS_ICON_SIGNAL_STRENGTH, gSignalStrengthLevel);
- #ifdef __MMI_SUBLCD__
- ChangeStatusIconLevel(STATUS_ICON_SUBLCD_SIGNAL_STRENGTH, gSignalStrengthLevel);
- #endif
- /* enter next menu */
- EntryEmRFTestGSM();
- DeleteScreenIfPresent(SCR_FLIGHT_MODE_PROGRESS);
- #ifdef MMI_ON_HARDWARE_P
- }
- else
- {
- DisplayPopup(
- (U8*) GetString(STR_GLOBAL_NOT_DONE),
- IMG_GLOBAL_UNFINISHED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) ERROR_TONE);
- DeleteScreenIfPresent(SCR_FLIGHT_MODE_PROGRESS);
- }
- #endif /* MMI_ON_HARDWARE_P */
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_em_enter_flight_mode
- * DESCRIPTION
- * Enter flight mode from engineering mode
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_em_enter_flight_mode(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MYQUEUE Message;
- mmi_nw_cfun_state_req_struct *cfun_state_req;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gEnterEMWithFlightMode = MMI_FALSE;
- if (mmi_bootup_get_active_flight_mode() == FLIGHTMODE_SILENT)
- {
- /* already in flight mode */
- gEnterEMWithFlightMode = MMI_TRUE;
- /* directly enter next menu */
- EntryEmRFTestGSM();
- return;
- }
- cfun_state_req = OslConstructDataPtr(sizeof(mmi_nw_cfun_state_req_struct));
- cfun_state_req->cfun_state = 4; /* flight mode */
- SetProtocolEventHandler(mmi_em_enter_flight_mode_rsp, PRT_NW_CFUN_STATE_RSP);
- EntryFlightModeProgress(); /* show searching screen */
- Message.oslMsgId = PRT_NW_CFUN_STATE_REQ;
- Message.oslDataPtr = (oslParaType*) cfun_state_req;
- Message.oslPeerBuffPtr = NULL;
- Message.oslSrcId = MOD_MMI;
- Message.oslDestId = MOD_L4C;
- OslMsgSendExtQueue(&Message);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_em_exit_flight_mode_rsp
- * DESCRIPTION
- * Exit flight mode from engineering mode
- * PARAMETERS
- * info
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_em_exit_flight_mode_rsp(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- mmi_nw_cfun_state_rsp_struct *cfun_state_rsp;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- cfun_state_rsp = (mmi_nw_cfun_state_rsp_struct*) info;
- ClearProtocolEventHandler(PRT_NW_CFUN_STATE_RSP);
- #ifdef MMI_ON_HARDWARE_P
- if (cfun_state_rsp->result == KAL_TRUE)
- {
- #endif /* MMI_ON_HARDWARE_P */
- /* update flight mode if it is successfully changed */
- /* g_phnset_cntx.curFlightMode = 0; */
- g_pwr_context.PowerOnNWStatus &= ~MMI_NW_STATUS_FLIGHT_MODE; /* 0x04: Flight mode */
- /* refresh status icons */
- PhnsetFlightModeRestoreStatusIconFlags();
- UpdateStatusIcons();
- /* write current mode to nvram */
- PhnsetFlightModeSaveMode();
- /* diamond, 2005/11/17 Force to draw signal level because signal level indication comes before flight mode switch rsp */
- ChangeStatusIconLevel(STATUS_ICON_SIGNAL_STRENGTH, gSignalStrengthLevel);
- #ifdef __MMI_SUBLCD__
- ChangeStatusIconLevel(STATUS_ICON_SUBLCD_SIGNAL_STRENGTH, gSignalStrengthLevel);
- #endif
- /* enter next menu */
- DeleteScreenIfPresent(SCR_FLIGHT_MODE_PROGRESS);
- GoBackToHistory(EM_RF_TEST_TOOL_SCR); /* the screen of RF test tool is already in the history */
- #ifdef MMI_ON_HARDWARE_P
- }
- else
- {
- DisplayPopup(
- (U8*) GetString(STR_GLOBAL_NOT_DONE),
- IMG_GLOBAL_UNFINISHED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) ERROR_TONE);
- DeleteScreenIfPresent(SCR_FLIGHT_MODE_PROGRESS);
- }
- #endif /* MMI_ON_HARDWARE_P */
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_em_exit_flight_mode
- * DESCRIPTION
- * Exit flight mode from engineering mode
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_em_exit_flight_mode(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MYQUEUE Message;
- mmi_nw_cfun_state_req_struct *cfun_state_req;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (gEnterEMWithFlightMode)
- {
- /* directly enter next menu */
- GoBackHistory();
- return;
- }
- cfun_state_req = OslConstructDataPtr(sizeof(mmi_nw_cfun_state_req_struct));
- cfun_state_req->cfun_state = 1; /* normal mode */
- SetProtocolEventHandler(mmi_em_exit_flight_mode_rsp, PRT_NW_CFUN_STATE_RSP);
- EntryFlightModeProgress(); /* show searching screen */
- Message.oslMsgId = PRT_NW_CFUN_STATE_REQ;
- Message.oslDataPtr = (oslParaType*) cfun_state_req;
- Message.oslPeerBuffPtr = NULL;
- Message.oslSrcId = MOD_MMI;
- Message.oslDestId = MOD_L4C;
- OslMsgSendExtQueue(&Message);
- }
- #endif /* __MMI_ENGINEER_MODE__ */
- /*****************************************************************************
- * FUNCTION
- * mmi_flight_mode_set_mode
- * DESCRIPTION
- * Set mode for power on
- * PARAMETERS
- * bFlightMode [IN] U8
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_flight_mode_set_mode(U8 bFlightMode)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MYQUEUE Message;
- mmi_nw_cfun_state_req_struct *cfun_state_req;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- cfun_state_req = OslConstructDataPtr(sizeof(mmi_nw_cfun_state_req_struct));
- if (bFlightMode)
- {
- #ifdef __FLIGHT_MODE_SUPPORT__
- PhnsetFlightModeSaveStatusIconFlags();
- RemoveStatusIconsForSimRemoved();
- UpdateStatusIcons();
- #endif /* __FLIGHT_MODE_SUPPORT__ */
- cfun_state_req->cfun_state = 4;
- g_pwr_context.PowerOnNWStatus |= MMI_NW_STATUS_FLIGHT_MODE; /* 0x04: Flight mode */
- #ifdef __MMI_WLAN_FEATURES__
- if (g_phnset_cntx.curFlightMode == FLIGHTMODE_OFF && mmi_netset_get_active_preferred_mode() == P_WLAN_ONLY)
- {
- /* Not update g_phnset_cntx.curFlightMode */
- }
- else
- #endif /* __MMI_WLAN_FEATURES__ */
- if (g_phnset_cntx.curFlightMode != FLIGHTMODE_QUERY)
- {
- g_phnset_cntx.curFlightMode = FLIGHTMODE_SILENT;
- }
- gPowerOnWithFlightMode = MMI_TRUE;
- #ifdef __MMI_WLAN_FEATURES__
- if (g_phnset_cntx.curFlightMode == FLIGHTMODE_SILENT)
- {
- g_phnset_cntx.curFlightMode2 = FLIGHTMODE_SILENT;
- }
- else
- {
- g_phnset_cntx.curFlightMode2 = FLIGHTMODE_OFF;
- }
- #endif
- }
- else
- {
- cfun_state_req->cfun_state = 1;
- g_pwr_context.PowerOnNWStatus &= ~MMI_NW_STATUS_FLIGHT_MODE; /* 0x04 Flight mode */
- if (g_phnset_cntx.curFlightMode != FLIGHTMODE_QUERY)
- {
- g_phnset_cntx.curFlightMode = FLIGHTMODE_OFF;
- }
- #ifdef __MMI_WLAN_FEATURES__
- if (mmi_netset_get_active_preferred_mode() == P_GSM_ONLY)
- {
- g_phnset_cntx.curFlightMode2 = FLIGHTMODE_SILENT;
- }
- else
- {
- g_phnset_cntx.curFlightMode2 = FLIGHTMODE_OFF;
- }
- #endif /* __MMI_WLAN_FEATURES__ */
- }
- Message.oslMsgId = PRT_NW_CFUN_STATE_REQ;
- Message.oslDataPtr = (oslParaType*) cfun_state_req;
- Message.oslPeerBuffPtr = NULL;
- Message.oslSrcId = MOD_MMI;
- Message.oslDestId = MOD_L4C;
- OslMsgSendExtQueue(&Message);
- if (g_pwr_context.PowerOnMode == POWER_ON_KEYPAD) /* diamond, 2005/10/21 Do not play animation for exception power on */
- {
- PhnsetFlightModeSaveMode();
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_flight_mode_hide_menu_items
- * DESCRIPTION
- * Hide some menus after entering flight mode
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_flight_mode_hide_menu_items(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (mmi_bootup_is_sim_valid())
- {
- mmi_frm_hide_menu_item(MENU_SETTING_SHOW_OWN_NUMBER);
- #if defined(__MMI_OPERATOR_NAME_MENU__)
- mmi_frm_hide_menu_item(MENU_SETTING_SHOW_OPN);
- #endif
- #ifdef __MMI_NITZ__
- mmi_frm_hide_menu_item(MENU9145_SETTIMEANDDATENITZ); /* Hide "Auto update of date and time" in flight mode */
- mmi_frm_hide_menu_item(MENU_SETTING_MENU_TREE);
- #endif /* __MMI_NITZ__ */
- mmi_frm_hide_menu_item(MENU_SETTING_DEDICATED_KEYS); /* Hide "Dedicated key" in flight mode */
- }
- #ifdef __MMI_WLAN_FEATURES__
- mmi_frm_hide_menu_item(MENU9185_NETWORK_SETUP); /* Hide "Network Setup" in flight mode if WLAN is activated */
- #endif
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_flight_mode_unhide_menu_items
- * DESCRIPTION
- * Recover some menus after leaving flight mode
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_flight_mode_unhide_menu_items(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (mmi_bootup_is_sim_valid())
- {
- mmi_frm_unhide_menu_item(MENU_SETTING_SHOW_OWN_NUMBER);
- #if defined(__MMI_OPERATOR_NAME_MENU__)
- mmi_frm_unhide_menu_item(MENU_SETTING_SHOW_OPN);
- #endif
- #ifdef __MMI_NITZ__
- mmi_frm_unhide_menu_item(MENU9145_SETTIMEANDDATENITZ); /* Hide "Auto update of date and time" in flight mode */
- mmi_frm_unhide_menu_item(MENU_SETTING_MENU_TREE);
- #endif /* __MMI_NITZ__ */
- mmi_frm_unhide_menu_item(MENU_SETTING_DEDICATED_KEYS); /* Hide "Dedicated key" in flight mode */
- }
- #ifdef __MMI_WLAN_FEATURES__
- mmi_frm_unhide_menu_item(MENU9185_NETWORK_SETUP); /* Hide "Network Setup" in flight mode if WLAN is activated */
- #endif
- }
- #ifdef __MMI_WLAN_FEATURES__
- /*****************************************************************************
- * FUNCTION
- * mmi_netset_entry_preferred_mode_progress
- * DESCRIPTION
- * Progressing screen for mode switch
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_netset_entry_preferred_mode_progress(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_FLIGHT_MODE_PROGRESS, NULL, mmi_netset_entry_preferred_mode_progress, NULL);
- SetKeyHandler(NULL, KEY_END, KEY_EVENT_DOWN);
- SetKeyHandler(NULL, KEY_END, KEY_EVENT_UP);
- ShowCategory66Screen(
- STR_ID_NETSET_PREFERRED_MODE,
- 0,
- 0,
- 0,
- 0,
- 0,
- (PU8) GetString(STR_FLIGHT_MODE_PROGRESS),
- IMG_FLIGHT_MODE_PROGRESS,
- NULL);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_phnset_enter_gsm_flight_mode_rsp
- * DESCRIPTION
- * Enter flight mode from WLAN preferred mode
- * PARAMETERS
- * info
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_phnset_enter_gsm_flight_mode_rsp(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- mmi_nw_cfun_state_rsp_struct *cfun_state_rsp;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- cfun_state_rsp = (mmi_nw_cfun_state_rsp_struct*) info;
- ClearProtocolEventHandler(PRT_NW_CFUN_STATE_RSP);
- #ifdef MMI_ON_HARDWARE_P
- if (cfun_state_rsp->result == KAL_TRUE)
- {
- #endif /* MMI_ON_HARDWARE_P */
- //g_phnset_cntx.curFlightMode = FLIGHTMODE_SILENT;
- g_pwr_context.PowerOnNWStatus |= MMI_NW_STATUS_FLIGHT_MODE; /* 0x04: Flight mode */
- /* refresh status icons */
- gSignalStrengthLevel = 0;
- PhnsetFlightModeSaveStatusIconFlags();
- RemoveStatusIconsForSimRemoved();
- UpdateStatusIcons();
- /* write current mode to nvram */
- PhnsetFlightModeSaveMode();
- /* force to draw signal level because signal level indication comes before flight mode switch rsp */
- ChangeStatusIconLevel(STATUS_ICON_SIGNAL_STRENGTH, gSignalStrengthLevel);
- #ifdef __MMI_SUBLCD__
- ChangeStatusIconLevel(STATUS_ICON_SUBLCD_SIGNAL_STRENGTH, gSignalStrengthLevel);
- #endif
- //DeleteScreenIfPresent(SCR_FLIGHT_MODE_PROGRESS);
- mmi_netset_switch_preferred_mode();
- #ifdef MMI_ON_HARDWARE_P
- }
- else
- {
- DisplayPopup(
- (U8*) GetString(STR_GLOBAL_NOT_DONE),
- IMG_GLOBAL_UNFINISHED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) ERROR_TONE);
- DeleteScreenIfPresent(SCR_FLIGHT_MODE_PROGRESS);
- }
- #endif /* MMI_ON_HARDWARE_P */
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_phnset_enter_gsm_flight_mode
- * DESCRIPTION
- * Enter flight mode from WLAN preferred mode
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_phnset_enter_gsm_flight_mode(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MYQUEUE Message;
- mmi_nw_cfun_state_req_struct *cfun_state_req;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- #if 0
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- #endif /* 0 */
- cfun_state_req = OslConstructDataPtr(sizeof(mmi_nw_cfun_state_req_struct));
- cfun_state_req->cfun_state = 4; /* flight mode */
- SetProtocolEventHandler(mmi_phnset_enter_gsm_flight_mode_rsp, PRT_NW_CFUN_STATE_RSP);
- mmi_netset_entry_preferred_mode_progress(); /* show searching screen */
- Message.oslMsgId = PRT_NW_CFUN_STATE_REQ;
- Message.oslDataPtr = (oslParaType*) cfun_state_req;
- Message.oslPeerBuffPtr = NULL;
- Message.oslSrcId = MOD_MMI;
- Message.oslDestId = MOD_L4C;
- OslMsgSendExtQueue(&Message);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_phnset_exit_gsm_flight_mode_rsp
- * DESCRIPTION
- * Exit flight mode from WLAN preferred mode
- * PARAMETERS
- * info
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_phnset_exit_gsm_flight_mode_rsp(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- mmi_nw_cfun_state_rsp_struct *cfun_state_rsp;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- cfun_state_rsp = (mmi_nw_cfun_state_rsp_struct*) info;
- ClearProtocolEventHandler(PRT_NW_CFUN_STATE_RSP);
- #ifdef MMI_ON_HARDWARE_P
- if (cfun_state_rsp->result == KAL_TRUE)
- {
- #endif /* MMI_ON_HARDWARE_P */
- //g_phnset_cntx.curFlightMode = FLIGHTMODE_OFF;
- g_pwr_context.PowerOnNWStatus &= ~MMI_NW_STATUS_FLIGHT_MODE; /* 0x04: Flight mode */
- /* refresh status icons */
- PhnsetFlightModeRestoreStatusIconFlags();
- UpdateStatusIcons();
- /* write current mode to nvram */
- PhnsetFlightModeSaveMode();
- /* diamond, 2005/11/17 Force to draw signal level because signal level indication comes before flight mode switch rsp */
- ChangeStatusIconLevel(STATUS_ICON_SIGNAL_STRENGTH, gSignalStrengthLevel);
- #ifdef __MMI_SUBLCD__
- ChangeStatusIconLevel(STATUS_ICON_SUBLCD_SIGNAL_STRENGTH, gSignalStrengthLevel);
- #endif
- //DeleteScreenIfPresent(SCR_FLIGHT_MODE_PROGRESS);
- mmi_netset_switch_preferred_mode();
- #ifdef MMI_ON_HARDWARE_P
- }
- else
- {
- DisplayPopup(
- (U8*) GetString(STR_GLOBAL_NOT_DONE),
- IMG_GLOBAL_UNFINISHED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) ERROR_TONE);
- DeleteScreenIfPresent(SCR_FLIGHT_MODE_PROGRESS);
- }
- #endif /* MMI_ON_HARDWARE_P */
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_phnset_exit_gsm_flight_mode
- * DESCRIPTION
- * Exit flight mode from WLAN preferred mode
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_phnset_exit_gsm_flight_mode(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MYQUEUE Message;
- mmi_nw_cfun_state_req_struct *cfun_state_req;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- #if 0
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- #endif /* 0 */
- cfun_state_req = OslConstructDataPtr(sizeof(mmi_nw_cfun_state_req_struct));
- cfun_state_req->cfun_state = 1; /* normal mode */
- SetProtocolEventHandler(mmi_phnset_exit_gsm_flight_mode_rsp, PRT_NW_CFUN_STATE_RSP);
- mmi_netset_entry_preferred_mode_progress(); /* show searching screen */
- Message.oslMsgId = PRT_NW_CFUN_STATE_REQ;
- Message.oslDataPtr = (oslParaType*) cfun_state_req;
- Message.oslPeerBuffPtr = NULL;
- Message.oslSrcId = MOD_MMI;
- Message.oslDestId = MOD_L4C;
- OslMsgSendExtQueue(&Message);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_flight_mode_switch_wlan
- * DESCRIPTION
- * Switch WLAN after flight mode switch
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_flight_mode_switch_wlan(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_phnset_cntx.curFlightMode2 == FLIGHTMODE_OFF)
- {
- PRINT_INFORMATION(("@@@@@ Flight mode: turn off WLAN @@@@@"));
- g_phnset_cntx.curFlightMode2 = FLIGHTMODE_SILENT;
- mmi_wlan_reset_hw_off(mmi_phnset_switch_flight_mode);
- }
- else
- {
- PRINT_INFORMATION(("@@@@@ Flight mode: turn on WLAN @@@@@"));
- g_phnset_cntx.curFlightMode2 = FLIGHTMODE_OFF;
- mmi_wlan_reset_hw_on(mmi_phnset_switch_flight_mode);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_phnset_power_on_query_with_flight_mode
- * DESCRIPTION
- * Query when power on and press No
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_phnset_power_on_query_with_normal_mode(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 mode = mmi_netset_get_active_preferred_mode();
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (mode == P_GSM_ONLY)
- {
- g_phnset_cntx.curFlightMode2 = FLIGHTMODE_SILENT;
- PowerOnNormalMode();
- }
- else if (mode == P_WLAN_ONLY)
- {
- g_phnset_cntx.curFlightMode2 = FLIGHTMODE_OFF;
- PowerOnFlightMode();
- }
- else
- {
- g_phnset_cntx.curFlightMode2 = FLIGHTMODE_OFF;
- PowerOnNormalMode();
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_phnset_power_on_query_with_flight_mode
- * DESCRIPTION
- * Query when power on and press Yes
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_phnset_power_on_query_with_flight_mode(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_phnset_cntx.curFlightMode2 = FLIGHTMODE_SILENT;
- PowerOnFlightMode();
- if (mmi_netset_get_active_preferred_mode() != P_GSM_ONLY)
- {
- PRINT_INFORMATION(("@@@@@ Flight mode: turn off WLAN @@@@@"));
- mmi_wlan_reset_hw_off(NULL);
- }
- }
- #endif /* __MMI_WLAN_FEATURES__ */
- /*****************************************************************************
- * FUNCTION
- * mmi_netset_switch_preferred_mode
- * DESCRIPTION
- * Switch flight mode beginning and callback function
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_phnset_switch_flight_mode(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 i;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION(("@@@@@ Flight mode: switch mode @@@@@"));
- for (i = 0; mmi_phnset_f_mode_req[i].phnset_flight_mode_req != NULL; i++)
- {
- if (mmi_phnset_f_mode_req[i].state)
- {
- mmi_phnset_f_mode_req[i].state = 0;
- (*mmi_phnset_f_mode_req[i].phnset_flight_mode_req)();
- return;
- }
- }
- PhnsetFlightModeSaveMode();
- if (mmi_bootup_get_active_flight_mode() == FLIGHTMODE_OFF)
- {
- mmi_flight_mode_unhide_menu_items();
- }
- else
- {
- mmi_flight_mode_hide_menu_items();
- }
- mmi_phnset_flight_mode_selection_finish();
- for (i = 0; mmi_phnset_f_mode_req[i].phnset_flight_mode_req != NULL; i++)
- {
- mmi_phnset_f_mode_req[i].state = 1;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_phnset_confirm_to_switch_mode
- * DESCRIPTION
- * Confirm to perform mode switch
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_phnset_confirm_to_switch_mode(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- #if defined(__MMI_BT_HP_SUPPORT__) || defined(__MMI_BT_SUPPORT__) || defined(__MMI_IRDA_SUPPORT__)
- U8 i;
- #endif
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_phnset_cntx.selFlightMode == FLIGHTMODE_QUERY)
- {
- PhnsetFlightModeSelectionReq();
- return;
- }
- if ((g_phnset_cntx.selFlightMode != FLIGHTMODE_QUERY) &&
- (g_phnset_cntx.curFlightMode == FLIGHTMODE_QUERY) &&
- (mmi_bootup_get_active_flight_mode() == g_phnset_cntx.selFlightMode))
- {
- PhnsetFlightModeSelectionReq();
- return;
- }
- #ifdef __MMI_WLAN_FEATURES__
- switch (mmi_netset_get_active_preferred_mode())
- {
- case P_GSM_ONLY:
- mmi_phnset_f_mode_req[0].state = 1;
- mmi_phnset_f_mode_req[1].state = 0;
- break;
- case P_WLAN_ONLY:
- mmi_phnset_f_mode_req[0].state = 0;
- mmi_phnset_f_mode_req[1].state = 1;
- break;
- default:
- mmi_phnset_f_mode_req[0].state = 1;
- mmi_phnset_f_mode_req[1].state = 1;
- break;
- }
- #else /* __MMI_WLAN_FEATURES__ */
- mmi_phnset_f_mode_req[0].state = 1; /* GSM always needs to switch */
- #endif /* __MMI_WLAN_FEATURES__ */
- #if defined(__MMI_BT_HP_SUPPORT__) || defined(__MMI_BT_SUPPORT__)
- for (i = 0; mmi_phnset_f_mode_req[i].phnset_flight_mode_req != NULL; i++)
- {
- if (mmi_phnset_f_mode_req[i].phnset_flight_mode_req == mmi_flight_mode_switch_bluetooth)
- {
- mmi_phnset_f_mode_req[i].state = 1;
- break;
- }
- }
- #endif
- #ifdef __MMI_IRDA_SUPPORT__
- for (i = 0; mmi_phnset_f_mode_req[i].phnset_flight_mode_req != NULL; i++)
- {
- if (mmi_phnset_f_mode_req[i].phnset_flight_mode_req == mmi_flight_mode_switch_irda)
- {
- mmi_phnset_f_mode_req[i].state = 1;
- break;
- }
- }
- #endif
- gSetModeFromMenu = MMI_TRUE;
- EntryFlightModeProgress(); /* show searching screen */
- #ifdef __MMI_WLAN_FEATURES__
- if (mmi_phnset_f_mode_req[0].state == 0)
- {
- g_phnset_cntx.curFlightMode = g_phnset_cntx.selFlightMode;
- }
- #endif /* __MMI_WLAN_FEATURES__ */
- mmi_phnset_switch_flight_mode();
- }
- #endif /* __FLIGHT_MODE_SUPPORT__ */