IdleApp.c
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:269k
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_pwr_context.PowerOnNWStatus |= MMI_NW_STATUS_NETWORK_FLAG; /* 0x01: network attachment timeout */
- g_pwr_context.IsCampOnTonePlayed = 1; /* Camp on tone will not be played after the timeout */
- if (g_idle_context.IsOnIdleScreen)
- {
- mmi_bootup_exit_network_searching();
- }
- }
- /*****************************************************************************
- * FUNCTION
- * DisplayIdleScreen
- * DESCRIPTION
- * Shows the idle screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void DisplayIdleScreen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- extern U8 gCallCost;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* highlight indexes should be reset when press end key for the call history module */
- gCallCost = 0;
- CHISTResetCallLogIndex();
- /* Execute the root history */
- ExecuteRootMainHistoryScreen(NULL);
- OrgDeInit();
- /* JBRW Sandeep */
- #if defined (JATAAYU_SUPPORT) && defined (WAP_SUPPORT)
- mmi_brw_wap_deinit();
- #endif
- /* added by Manish for JMMS */
- #if (defined (JATAAYU_SUPPORT) && defined(MMS_SUPPORT))
- mmi_jmms_deinit();
- #endif
- #if (defined(__MMI_VCARD__) || defined(__MMI_VCALENDAR__)) && defined(MMI_ON_HARDWARE_P)
- mmi_vobj_deinit();
- #endif
- /* dara added to deinit profile handler data */
- #if defined (JATAAYU_SUPPORT) && (defined (WAP_SUPPORT) || (defined (MMS_SUPPORT)))
- mmi_ph_deinit_profiles();
- mmi_prov_deinit();
- #endif
- AlmEnableSPOF();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_idle_notify_bootup_ready_to_wap
- * DESCRIPTION
- * Send message to WAP for idle screen notification
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_idle_notify_bootup_ready_to_wap(void)
- {
- #ifdef WAP_SUPPORT
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MYQUEUE Message;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- Message.oslSrcId = MOD_MMI;
- Message.oslDestId = MOD_WAP;
- Message.oslMsgId = MSG_ID_MMI_READY_NOTIFY_REQ;
- Message.oslDataPtr = (oslParaType*) NULL;
- Message.oslPeerBuffPtr = NULL;
- OslMsgSendExtQueue(&Message);
- #endif /* WAP_SUPPORT */
- }
- /*****************************************************************************
- * FUNCTION
- * CheckAndStopAudioPlayer
- * DESCRIPTION
- * Stop audio player
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- #if defined(__DIRECT_ENTRY_FACTORY_MODE_ON_BOOTUP__)
- extern BOOL DirectMode;
- #endif
- extern void MMI_notify_bootup_ready(void);
- #ifdef __MMI_IDLE_CAMERA_KEY_TO_STOP_AUDIOPLAYER__
- static void CheckAndStopAudioPlayer(void)
- {
- #ifdef __MMI_AUDIO_PLAYER__
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (mmi_audply_is_playing())
- {
- mmi_audply_do_stop_action();
- }
- else
- #endif /* __MMI_AUDIO_PLAYER__ */
- #ifdef __MMI_FM_RADIO__
- if (mmi_fmrdo_is_power_on())
- {
- mmi_fmrdo_power_on(FALSE);
- }
- else
- #endif /* __MMI_FM_RADIO__ */
- #ifdef __MMI_SUBLCD_CAMERA__
- if (IsClamClose())
- mmi_sublcd_camera_entry_option_screen();
- else
- mmi_camera_entry_app_screen();
- #else
- mmi_camera_entry_app_screen();
- #endif
- }
- #endif /* __MMI_IDLE_CAMERA_KEY_TO_STOP_AUDIOPLAYER__ */
- /*****************************************************************************
- * FUNCTION
- * IdleScreenEmergencyCallCheckNKeypadLock
- * DESCRIPTION
- * Allow dial SOS number if keypad is locked in idle screen
- * PARAMETERS
- * eventKey [?]
- * RETURNS
- * void
- *****************************************************************************/
- U8 IdleScreenEmergencyCallCheckNKeypadLock(KEYBRD_MESSAGE *eventKey)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- //KP Jerry add on 2007-4-25 start
- #ifdef __MMI_SLIDE__
- if(!gMMIClamState)
- {
- #endif
- //KP Jerry add on 2007-4-25 end
-
- if (g_keylock_context.gKeyPadLockFlag)
- {
- EmergencyCallCheck(eventKey->nKeyCode, eventKey->nMsgType);
- }
- if ((g_idle_context.AutoLockTimeOut != 0) && (g_idle_context.IsOnIdleScreen || g_idle_context.IsOnSimErrorScreen))
- {
- MMI_TRACE((MMI_TRACE_G1_FRM, MMI_FRM_INFO_EVENT_EXECURKEY_HDLR, g_idle_context.AutoLockTimeOut));
- StopTimer(IDLE_APP_AUTO_LOCK_TIMER_ID);
- if (g_idle_context.IsOnIdleScreen)
- {
- StartTimer(IDLE_APP_AUTO_LOCK_TIMER_ID, g_idle_context.AutoLockTimeOut, IdleSetKeyPadLockFlag);
- }
- if (g_idle_context.IsOnSimErrorScreen) /* diamond, 2005/10/29, keypad lock in insert sim screen */
- {
- StartTimer(IDLE_APP_AUTO_LOCK_TIMER_ID, g_idle_context.AutoLockTimeOut, InsertSimSetKeyPadLockFlag);
- }
- }
- //KP Jerry add on 2007-4-25 start
- #ifdef __MMI_SLIDE__
- }
- #endif
- //KP Jerry add on 2007-4-25 end
- return TRUE;
- }
- /*****************************************************************************
- * FUNCTION
- * RedrawIdleScreen
- * DESCRIPTION
- * Entry idle screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void RedrawIdleScreen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- IdleRefreshServiceIndicationArea();
- #if ( (defined __MMI_WGUI_CSK_ENABLE__) && (defined __MMI_TOUCH_SCREEN__) && !(defined __MMI_TOUCH_IDLESCREEN_SHORTCUTS__))
- EnableCenterSoftkey(0, IMG_CSK_DIAL_ICON);
- #endif
- #ifdef __MMI_SWFLASH__
- if (dispchar_iswp_swflash())
- {
- ShowCategory34Screen(IDLE_SCREEN_LSK_TEXT, IDLE_SCREEN_LSK_ICON, idleLRStringtID, IDLE_SCREEN_RSK_ICON, PhnsetGetCurWallPaperIdx(), idle_screen_wallpaper_name, NULL);
- }
- else
- #endif /* _MMI_SWFLASH__ */
- #ifdef __MMI_SWAP_LSK_RSK_IN_IDLE_SCREEN__
- ShowCategory33Screen(IDLE_SCREEN_RSK_TEXT, IDLE_SCREEN_RSK_ICON, idleLRStringtID, IDLE_SCREEN_LSK_ICON, 0,NULL);
- #else
- ShowCategory33Screen(IDLE_SCREEN_LSK_TEXT, IDLE_SCREEN_LSK_ICON, idleLRStringtID, IDLE_SCREEN_RSK_ICON, 0,NULL);
- #endif
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_idle_generic_keypad_lock_screen_exit_hdlr
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_idle_generic_keypad_lock_screen_exit_hdlr(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* diamond, 2006/03/26 Generic exit function for keypad lock callback screens */
- mmi_frm_kbd_reg_pre_key_hdlr(NULL);
- #ifdef __MMI_TOUCH_SCREEN__
- ChangeStatusIconImage(STATUS_ICON_KEYPAD_LOCK, IMG_SI_KEYPAD_UNLOCK);
- #else
- HideStatusIcon(STATUS_ICON_KEYPAD_LOCK);
- #endif
- PRINT_INFORMATION(("[Keypad Lock] mmi_idle_generic_keypad_lock_screen_exit_hdlr"));
- #ifdef __MMI_TOUCH_SCREEN__
- mmi_pen_unblock(); /* diamond, 2006/06/06 unblock pen is generic keypad lock screen exit handler */
- #endif
- if (g_keylock_context.keypad_lock_screen_exit != NULL)
- {
- (*g_keylock_context.keypad_lock_screen_exit) ();
- }
- }
- /*****************************************************************************
- * FUNCTION
- * EntryIdleScreen
- * DESCRIPTION
- * Entry function for idle screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- static U8 gIsIdleScreenReentry = MMI_FALSE;
- void EntryIdleScreen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- static U8 gIsOnSearchingScreen = MMI_FALSE;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- #ifdef __MMI_WLAN_FEATURES__
- if (mmi_bootup_is_sim_valid() == MMI_FALSE && mmi_netset_get_active_preferred_mode() == P_GSM_ONLY && mmi_bootup_get_active_bt_access_profile_mode() == 0)
- {
- if (simErrorDisplayString == STR_SIM_BLOCK_MSG)
- {
- EntryScrnSimBlockRsp();
- }
- else
- {
- EntryScrnSimErrorScreen();
- }
- return;
- }
- #endif /* __MMI_WLAN_FEATURES__ */
- /* diamond, 2006/02/22 Avoid to restart keypad lock and screensaver timer if EntryIdleScreen is called again when active screen is still idle screen */
- gIsIdleScreenReentry = (GetActiveScreenId() == IDLE_SCREEN_ID &&
- gIsOnSearchingScreen == MMI_FALSE) ? MMI_TRUE : MMI_FALSE;
- //KP Jerry add for third sevice on 2007-03-26 start
- #ifndef __VALUE_ADDED_SERVICE_IN_MAINMENU__
- #ifdef __KONG_NET_SP__
- SetHiliteHandler(MAIN_MENU_DREAM_FAIRYLAND_ID, hi_light_EntryDreamFairylandHandler);
- #endif
- #endif
- //KP Jerry add for third sevice on 2007-03-26 end
- EntryNewScreen(IDLE_SCREEN_ID, ExitIdleScreen, NULL, NULL);
- /* START PMT NEERAJ 20051021 */
- #ifdef __MMI_UI_SMALL_SCREEN_SUPPORT__
- if (is_redrawing_old_screens()) /* 010706 small screen Calvin */
- {
- RedrawIdleScreen();
- gIsIdleScreenReentry = MMI_FALSE;
- return;
- }
- #endif /* __MMI_UI_SMALL_SCREEN_SUPPORT__ */
- /* END PMT NEERAJ 20051021 */
- g_pwr_context.PrevScreenIndicator = ENTER_IDLE_SCR;
- DinitHistory();
- DeInitSpecialMode(); /* EngineerMode/Factory Deinit */
- #ifdef __MMI_DOWNLOAD_AGENT__
- mmi_da_enter_idle_screen_notify();
- #endif
- #ifdef __J2ME__
- jvm_enter_idle_screen_notify();
- #endif
- #ifdef __MMI_SWFLASH__
- mmi_swflash_enter_idle_screen_notify();
- #endif
- #ifndef MMI_ON_WIN32
- mmiapi_enter_idle_screen_notify();
- #endif
- #if defined(__MMI_WEBCAM__) && defined(__MMI_USB_SUPPORT__)
- /* entry webcam if it is still active */
- if (mmi_usb_webcam_is_active())
- {
- mmi_usb_webcam_entry_app_scr();
- return;
- }
- #endif /* defined(__MMI_WEBCAM__) && defined(__MMI_USB_SUPPORT__) */
- #ifdef __MMI_SIMAP_SUPPORT__
- if (mmi_bootup_get_active_bt_access_profile_mode())
- {
- #if defined(OBIGO_SUPPORT) && defined(WAP_SUPPORT)
- widget_MMI_on_enter_idle_screen();
- #endif
- if (mmi_bootup_is_searching_or_idle_reached() == MMI_FALSE)
- {
- }
- if (!gIsIdleScreenReentry)
- {
- mmi_idle_start_keypad_lock(); /* keypad lock in flight mode */
- mmi_idle_start_screensaver(); /* screen saver in flight mode */
- }
- g_idle_context.IsOnIdleScreen = 1;
- g_idle_context.IsOnDialerScreen = 0;
- g_idle_context.LongPressEnable = 0;
-
- if (g_keylock_context.gKeyPadLockFlag == 0) /* keypad is not locked */
- {
- mmi_idle_entry_bt_access_profile_idle_screen();
- }
- else
- {
- EntryFlightModeKeypadLockScreen(); /* share with flight mode keypad lock screen */
- g_keylock_context.keypad_lock_screen_exit = GetCurrExitFuncPtr();
- SetCurrExitFuncPtr(mmi_idle_generic_keypad_lock_screen_exit_hdlr);
- }
- mmi_idle_dummy_key_in_screensaver();
- return;
- }
- #endif /* __MMI_SIMAP_SUPPORT__ */
- #ifdef __FLIGHT_MODE_SUPPORT__
- if (mmi_bootup_get_active_flight_mode() == FLIGHTMODE_SILENT)
- {
- if (mmi_bootup_is_searching_or_idle_reached() == MMI_FALSE)
- {
- g_pwr_context.PowerOnMMIStatus = MMI_POWER_ON_IDLE; /* 0x80: Flight mode idle screen */
- g_pwr_context.PowerOnNWStatus |= MMI_NW_STATUS_NETWORK_FLAG; /* 0x01: network attachment timeout */
- g_pwr_context.InvalidSimShowed = 1;
- TurnOffBacklight();
- StartLEDPatternBackGround();
- if (g_charbat_context.isChargerConnected)
- {
- StartTimer(BOOTUP_CHARGER_DETECT_TIMER, 3000, ChargerDetectTimeoutHdlr);
- }
- PendingAlarmReminder();
- mmi_idle_notify_bootup_ready_to_wap(); /* to WAP */
- mmi_idle_notify_bootup_ready_to_l4c(); /* to L4C */
- #ifdef __MMI_IMPS__
- mmi_imps_notify_idle_reached();
- #endif
- mmi_flight_mode_hide_menu_items();
- }
- if (!gIsIdleScreenReentry)
- {
- mmi_idle_start_keypad_lock(); /* keypad lock in flight mode */
- mmi_idle_start_screensaver(); /* screen saver in flight mode */
- }
- g_idle_context.IsOnIdleScreen = 1;
- g_idle_context.IsOnDialerScreen = 0;
- g_idle_context.LongPressEnable = 0;
- if (0)
- {
- }
- #ifdef __J2ME__
- else if (mmi_java_is_launch_after_install())
- {
- mmi_java_entry_mid_launch();
- }
- #endif /* __J2ME__ */
- #ifdef __MMI_DOWNLOAD_AGENT__
- else if (mmi_da_launch_ring_buffer_check())
- {
- mmi_da_entry_new_push_ind();
- }
- #endif /* __MMI_DOWNLOAD_AGENT__ */
- else
- {
- if (g_keylock_context.gKeyPadLockFlag == 0) /* keypad is not locked */
- {
- EntryFlightModeIdleScreen();
- }
- else
- {
- EntryFlightModeKeypadLockScreen();
- /* diamond, 2006/03/26 Generic exit function for keypad lock callback screens */
- g_keylock_context.keypad_lock_screen_exit = GetCurrExitFuncPtr();
- SetCurrExitFuncPtr(mmi_idle_generic_keypad_lock_screen_exit_hdlr);
- }
- mmi_idle_dummy_key_in_screensaver();
- }
- gIsIdleScreenReentry = MMI_FALSE;
- return;
- }
- #endif /* __FLIGHT_MODE_SUPPORT__ */
- /* end, diamond */
- mmi_phb_reset_scr_id();
- NETSETCheckAndRestoreNetwork();
- SATEVDLIdleScreenAvaliable();
- #ifdef __MMI_UNIFIED_MESSAGE__
- mmi_um_on_enter_idle_screen();
- #endif
- #if defined(OBIGO_SUPPORT) && defined(WAP_SUPPORT)
- widget_MMI_on_enter_idle_screen();
- #endif
- #if defined (JATAAYU_SUPPORT) && defined (WAP_SUPPORT)
- mmi_brw_unread_push_message_indication();
- #endif
- #ifdef __MOD_SMSAL__
- mmi_msg_on_enter_idle_screen();
- #endif /* __MOD_SMSAL__ */
- OslDumpDataInFile();
- /* This block carries all functions to be called when user enter idle screen first time. */
- if (mmi_bootup_is_searching_or_idle_reached() == MMI_FALSE)
- {
- TurnOffBacklight();
- g_pwr_context.PowerOnMMIStatus = MMI_POWER_ON_NW_SEARCHING; /* 0x40: Network searching screen */
- #if defined(__DIRECT_ENTRY_FACTORY_MODE_ON_BOOTUP__)
- DirectMode = FALSE;
- #endif
- PendingAlarmReminder();
- StartLEDPatternBackGround();
- if (!g_pwr_context.IsCampOnTonePlayed && g_pwr_context.CurrentServiceType == FULL_SERVICE) /* Robin 1128 Play camp on tone after enter idle screen */
- {
- g_pwr_context.IsCampOnTonePlayed = 1;
- playRequestedTone(CAMP_ON_TONE);
- }
- #ifdef __MMI_POC__
- if (g_pwr_context.CurrentServiceType == FULL_SERVICE)
- {
- mmi_poc_poweron_reg();
- }
- #endif /* __MMI_POC__ */
- if (g_charbat_context.isChargerConnected)
- {
- StartTimer(BOOTUP_CHARGER_DETECT_TIMER, 3000, ChargerDetectTimeoutHdlr);
- }
- #if defined(OBIGO_SUPPORT) && defined(WAP_SUPPORT)
- MMIProcessActionMsg();
- #endif
- mmi_idle_notify_bootup_ready_to_wap();
- mmi_idle_notify_bootup_ready_to_l4c();
- #ifdef __MMI_IMPS__
- mmi_imps_notify_idle_reached();
- #endif
- #ifdef __MMI_SML_MENU__
- mmi_sml_display_auto_locked_notification();
- #endif
- #ifdef __MMI_WLAN_FEATURES__
- if (mmi_netset_get_active_preferred_mode() == P_WLAN_ONLY)
- {
- g_pwr_context.PowerOnNWStatus |= MMI_NW_STATUS_NETWORK_FLAG; /* No need to show network searching screen */
- }
- #endif /* __MMI_WLAN_FEATURES__ */
- }
- g_idle_context.IsOnIdleScreen = 1;
- g_idle_context.IsOnDialerScreen = 0;
- /* This checks if network attach indication has been recieved once after bootup. */
- /* If yes, then go to idle screen otherwise show network srch animation. */
- if (mmi_bootup_is_network_searching_complete() == MMI_TRUE)
- {
- /* isIdleScreenReached=1; */
- g_pwr_context.PowerOnMMIStatus = MMI_POWER_ON_IDLE; /* 0x80: Idle screen */
- gIsOnSearchingScreen = MMI_FALSE;
- if (!gIsIdleScreenReentry)
- {
- mmi_idle_start_keypad_lock();
- mmi_idle_start_screensaver();
- }
- gIsIdleScreenReentry = MMI_FALSE;
- if (g_keylock_context.gKeyPadLockFlag == 0) /* keypad is not locked */
- {
- /* if g_msg_cntx.msg_status is not in idle state, need to help SMS to clear action queue */
- if (mmi_msg_need_clear_action_queue())
- {
- mmi_frm_sms_delete_action_pending();
- }
- if (mmi_idle_exe_callback() == MMI_FALSE) /* no pending message */
- {
- mmi_idle_entry_idle_screen(); /* idle screen */
- }
- }
- else /* Keyapd is locked */
- {
- /* U16 KeyLockLSKStringtID=0, KeyLockRSKStringID=0, KeyLockLSKIconID=0, KeyLockRSKIconID=0; */
- /* diamond, 2005/10/19 Prevent from re-entry idle screen after emergency call is dialed */
- #ifndef __MMI_KEYPADLOCK_WITH_KEYTONE__
- mmi_frm_kbd_set_tone_state(MMI_KEY_TONE_DISABLED);
- #endif
- mmi_idle_set_keypad_lock_string();
- /* if g_msg_cntx.msg_status is not in idle state, need to help SMS to clear action queue */
- if (mmi_msg_need_clear_action_queue())
- {
- mmi_frm_sms_delete_action_pending();
- }
- if (mmi_idle_exe_callback() == MMI_FALSE) /* no pending message */
- {
- /* keypad lock idle screen */
- IdleRefreshServiceIndicationArea();
- #ifdef __MMI_SWFLASH__
- if (dispchar_iswp_swflash())
- {
- ShowCategory34Screen(
- g_keylock_context.KeyLockLSKStringID,
- g_keylock_context.KeyLockLSKIconID,
- g_keylock_context.KeyLockRSKStringID,
- g_keylock_context.KeyLockRSKIconID,
- PhnsetGetCurWallPaperIdx(), idle_screen_wallpaper_name, NULL);
- }
- else
- #endif /* _MMI_SWFLASH__ */
- ShowCategory33Screen(
- g_keylock_context.KeyLockLSKStringID,
- g_keylock_context.KeyLockLSKIconID,
- g_keylock_context.KeyLockRSKStringID,
- g_keylock_context.KeyLockRSKIconID,
- 0,
- NULL);
- }
- #ifdef __MMI_TOUCH_SCREEN__
- mmi_idle_pen_block(); /* diamond, 2006/06/06 Block pen in all keypad lock screens */
- #endif
- /* diamond, 2006/03/26 Generic exit function for keypad lock callback screens */
- g_keylock_context.keypad_lock_screen_exit = GetCurrExitFuncPtr();
- SetCurrExitFuncPtr(mmi_idle_generic_keypad_lock_screen_exit_hdlr);
- #if defined(__MMI_KEYPAD_LOCK_PROMPT_TEXT__)
- SetGroupKeyHandler(
- EntryScrKeyPadLockOnPessingAnyKey,
- (PU16) PresentAllKeys,
- (U8) TOTAL_KEYS,
- (U16) KEY_EVENT_DOWN);
- #endif /* defined(__MMI_KEYPAD_LOCK_PROMPT_TEXT__) */
- #if defined(__MMI_TOUCH_SCREEN__) && (!defined(__MMI_TOUCH_SCREEN_WITH_NUMERIC_KEY__) || defined(__MMI_SLIDE__)) //KP Jerry add "!defined(__MMI_TOUCH_SCREEN_WITH_NUMERIC_KEY__)" on 2007-3-26
- #ifndef __MMI_KEYPAD_LOCK_PROMPT_TEXT__
- ClearKeyHandler(KEY_LSK, KEY_EVENT_DOWN);
- ClearKeyHandler(KEY_LSK, KEY_EVENT_UP);
- ClearKeyHandler(KEY_RSK, KEY_EVENT_DOWN);
- ClearKeyHandler(KEY_RSK, KEY_EVENT_UP);
- #endif /* __MMI_KEYPAD_LOCK_PROMPT_TEXT__ */
- SetKeyHandler(EntryScrAfterPessingRSK, KEY_SEND, KEY_EVENT_DOWN);
- #else /* __MMI_TOUCH_SCREEN__ || !__MMI_TOUCH_SCREEN_WITH_NUMERIC_KEY__ */ //KP Jerry add "!__MMI_TOUCH_SCREEN_WITH_NUMERIC_KEY__ " on 2007-3-27
- #if defined(__MMI_KEYPAD_LOCK_PATTERN_1__) || defined(__MMI_KEYPAD_LOCK_PATTERN_3__) || defined(__MMI_KEYPAD_LOCK_PATTERN_4__) //KP Jerry add "__MMI_KEYPAD_LOCK_PATTERN_3__" on 2007-3-27
- SetRightSoftkeyFunction(EntryScrAfterPessingRSK, KEY_EVENT_DOWN);
- #endif
- #ifdef __MMI_KEYPAD_LOCK_PATTERN_2__
- SetLeftSoftkeyFunction(EntryScrAfterPessingRSK, KEY_EVENT_DOWN);
- #endif
- #endif /* __MMI_TOUCH_SCREEN__ || !__MMI_TOUCH_SCREEN_WITH_NUMERIC_KEY__ */ //KP Jerry add "!__MMI_TOUCH_SCREEN_WITH_NUMERIC_KEY__ " on 2007-3-27
- IdleSetLRKey(); /* __MANUAL_MODE_NW_SEL__ */
- #ifdef __MMI_UNIFIED_MESSAGE__
- if (mmi_um_check_new_msg() && !mmi_um_is_sending_num_msg())
- {
- ClearInputEventHandler(MMI_DEVICE_ALL);
- }
- #endif /* __MMI_UNIFIED_MESSAGE__ */
- if (g_idle_context.IsRSKPressOnScreenSaver)
- {
- EntryScrAfterPessingRSK();
- g_idle_context.IsRSKPressOnScreenSaver = 0;
- }
- /*
- * Compensatory key handler registration for screen saver
- * The idea here is to set those keys which are not set with handlers to a dummy handler.
- * But note that END key is still being set a handler (DisplayIdleScreen) for KEY_EVENT_DOWN in PowerAndEndKeyHandler.
- */
- mmi_idle_dummy_key_in_screensaver();
- }
- mmi_idle_date_time_reminder();
- }
- else /* displays network seaching animation */
- {
- if (!gIsOnSearchingScreen)
- {
- StartTimer(SEARCHING_SCREEN_TIMER, 10000, SearchingSrceenTimeOutHandler);
- gIsOnSearchingScreen = MMI_TRUE;
- }
- mmi_idle_entry_searching_screen();
- mmi_idle_date_time_reminder();
- }
- mmi_frm_kbd_reg_pre_key_hdlr(IdleScreenEmergencyCallCheckNKeypadLock);
- if (GetPostponedSATScreen())
- {
- (*GetPostponedSATScreen())();
- ClearPostponedSATScreen();
- }
- //KP Jerry add for third sevice on 2007-03-26 start
- #if (defined(__KONG_NET_SP__) && defined(__VALUE_ADDED_SERVICE_QUICK_ENTER__))
- if (!g_keylock_context.gKeyPadLockFlag)
- SetKeyHandler(EntryDreamFairylandHandler,KEY_ENTER,KEY_EVENT_DOWN);
- #endif
- //KP Jerry add for third sevice on 2007-03-26 end
- gIsIdleScreenReentry = MMI_FALSE;
-
- #if (defined(MMI_ON_HARDWARE_P) && !defined(__MTK_TARGET__)) /* MoDIS only */
- mmi_netset_write_auto_test_result(MMI_TRUE);
- #endif
- }
- /*****************************************************************************
- * FUNCTION
- * ExitIdleScreen
- * DESCRIPTION
- * Exit function for idle screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitIdleScreen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- GenericExitScreen(IDLE_SCREEN_ID, EntryIdleScreen);
- g_idle_context.IsOnIdleScreen = 0;
- mmi_frm_kbd_reg_pre_key_hdlr(NULL);
- if (!g_idle_context.ScreenSaverRunFlag && !gIsIdleScreenReentry)
- {
- PRINT_INFORMATION(("[Keypad Lock] ExitIdleScreen: Timer %d Stop", g_idle_context.AutoLockTimeOut));
- StopTimer(IDLE_APP_AUTO_LOCK_TIMER_ID);
- }
- if (!gIsIdleScreenReentry)
- {
- StopTimer(SCREENSAVER_TIMER);
- }
- StopTimer(KEYPADUNLOCKEDMESSAGE_TIMER);
- #ifdef __MMI_TOUCH_SCREEN__
- if (g_keylock_context.gKeyPadLockFlag == 1)
- {
- mmi_pen_unblock(); /* diamond, 2005/12/22 Enable touch panel if exit idle keypad lock screen */
- }
- wgui_reset_status_icon_pen_event_hdlr();
- #endif /* __MMI_TOUCH_SCREEN__ */
- #if ( (defined __MMI_WGUI_CSK_ENABLE__) && defined (__MMI_TOUCH_SCREEN__) )
- ResetCenterSoftkey();
- #endif
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_idle_check_nw_provider_name_length
- * DESCRIPTION
- * Check if the input string length is larger than main lcd width
- * PARAMETERS
- * unicode_string [?]
- * U8*(?)
- * RETURNS
- * pBOOL
- *****************************************************************************/
- extern void UI_set_font(UI_font_type f);
- pBOOL mmi_idle_check_nw_provider_name_length(U8 *unicode_string)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- pBOOL rtn;
- S32 StringWidth, StringHeight;
- stFontAttribute prev_f;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* copy the system font to backup */
- memcpy(&prev_f, UI_font, sizeof(stFontAttribute));
- /* set default font for length calculation */
- UI_set_font(&UI_DEFAULT_FONT);
- Get_StringWidthHeight(unicode_string, &StringWidth, &StringHeight);
- /* check the string length if it is larger than main lcd width */
- if ((StringWidth + 1) >= MAIN_LCD_device_width - (ICON_WIDTH << 1))
- {
- rtn = MMI_FALSE;
- }
- else
- {
- rtn = MMI_TRUE;
- }
- /* restore the system font */
- UI_set_font(&prev_f);
- return rtn;
- }
- /*****************************************************************************
- * FUNCTION
- * IdleRefreshServiceIndicationArea
- * DESCRIPTION
- * To refresh Service indication Area
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- #define SetLine1Text SetIdleScreenNetworkName
- #define SetLine2Text SetIdleScreenNetworkStatus
- void IdleRefreshServiceIndicationArea(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- #ifdef __MMI_SWAP_LSK_RSK_IN_IDLE_SCREEN__
- idleLRStringtID = IDLE_SCREEN_LSK_TEXT;
- #else
- idleLRStringtID = IDLE_SCREEN_RSK_TEXT;
- #endif
- SetLine1Text((U8*) NULL);
- SetLine2Text((U8*) NULL);
- /* diamond, 2005/07/22 240x320 sync searching screen style with idle screen style */
- #ifdef __MMI_MAINLCD_240X320__
- if (mmi_bootup_is_network_searching_complete() == MMI_FALSE)
- {
- pfnUnicodeStrncpy(
- (PS8) gNWProviderName,
- (PS8) GetString(STR_IDLE_NETWORK_SRCH_SCR),
- MAX_LENGTH_DISPLAY_NAME - 1);
- SetLine1Text(gNWProviderName);
- return;
- }
- #endif /* __MMI_MAINLCD_240X320__ */
- /* end, diamond */
- if (g_pwr_context.CurrentServiceType == FULL_SERVICE)
- {
- /* MMI_BOOL SHOW_OPN = MMI_TRUE; */
- MMI_BOOL OPN_Exist;
- MMI_BOOL Short_OPN_Exist;
- MMI_BOOL SPN_Exist;
- MMI_BOOL MSISDN_Exist = PhnsetGetShowOwnerNumStatus() && (pfnUnicodeStrlen(gOwnerName) != 0);
- stFontAttribute IdleScr_Medium_font = {0, 0, 0, MEDIUM_FONT, 0, 0};
- U8 Scenario;
- #if defined(__MMI_OPERATOR_NAME_MENU__)
- /* SHOW_OPN = PhnsetGetShowOPNStatus(); */
- if (PhnsetGetShowOPNStatus() == 0) /* diamond, 2005/10/18 Hide the service area if this setting is off */
- {
- return;
- }
- #endif /* defined(__MMI_OPERATOR_NAME_MENU__) */
- /* Now the line1 string is temporarily set to "Searching" so clear line2 in this case */
- if (pfnUnicodeStrcmp((PS8) gNWProviderName, GetString(STR_ID_NETSET_SEARCHIN_NW)) == 0)
- {
- SetLine1Text(gNWProviderName);
- return;
- }
- /* OPN*4 + SPN*2+ b1*1 */
- Scenario = ((gOpNameValid || gShortOpnameValid) ? 4 : 0) +
- (gSpnValid ? 2 : 0) + (g_pwr_context.RequireRPLMN ? 1 : 0);
- PRINT_INFORMATION(("[Idle] display scenario: %d", Scenario));
- /* OPN_Exist means gOpNameValid and the string is not NULL */
- OPN_Exist = gOpNameValid && (pfnUnicodeStrlen(gOperatorName) != 0) /* && SHOW_OPN */ ;
- Short_OPN_Exist = gShortOpnameValid && (pfnUnicodeStrlen(gShortOperatorName) != 0) /* && SHOW_OPN */ ;
- SPN_Exist = gSpnValid && (pfnUnicodeStrlen(gServProvderName) != 0);
- SetFont(IdleScr_Medium_font, (U8) gCurrLangIndex);
- if (IsChineseSet()) /* Trad. Chinese and Simp. Chinese only */
- {
- SetLine1Text(gNWProviderName); /* Line 1 = PLMN */
- if (SPN_Exist && pfnUnicodeStrcmp((S8*) gServProvderName, (S8*) gNWProviderName) != 0)
- {
- SetLine2Text((U8*) gServProvderName); /* Line 2: SPN */
- }
- else if (MSISDN_Exist)
- {
- SetLine2Text((U8*) gOwnerName); /* Line 2: Owner Name */
- }
- else
- {
- SetLine2Text((U8*) NULL);
- }
- }
- else
- {
- switch (Scenario) /* OPN--SPN--b1 */
- {
- case 0: /* OPN=OFF, SPN=OFF, b1=0 */
- case 1: /* OPN=OFF, SPN=OFF, b1=1 */
- SetLine1Text(gNWProviderName); /* Line 1 = PLMN */
- if (MSISDN_Exist)
- {
- SetLine2Text((U8*) gOwnerName); /* Line 2: Owner Name */
- }
- break;
- case 2: /* OPN=OFF, SPN=ON, b1=0 */
- if (MSISDN_Exist)
- {
- if (mmi_bootup_is_roaming() == MMI_TRUE)
- {
- SetLine1Text(gNWProviderName); /* Line 1 = PLMN */
- if (SPN_Exist)
- {
- SetLine2Text((U8*) gServProvderName); /* Line 2 = SPN */
- }
- }
- else
- {
- SetLine2Text((U8*) gOwnerName); /* Line 2: Owner Name */
- if (SPN_Exist)
- {
- SetLine1Text((U8*) gServProvderName); /* Line 1 = SPN */
- }
- }
- }
- else
- {
- if (mmi_bootup_is_roaming() == MMI_TRUE)
- {
- SetLine1Text(gNWProviderName); /* Line 1 = PLMN */
- if (SPN_Exist)
- {
- SetLine2Text((U8*) gServProvderName); /* Line 2 = SPN */
- }
- }
- else
- {
- if (SPN_Exist)
- {
- SetLine1Text((U8*) gServProvderName); /* Line 1 = SPN */
- }
- else
- {
- SetLine1Text(gNWProviderName); /* Line 2 = NULL */
- }
- }
- }
- break;
- case 3: /* OPN=OFF, SPN=ON, b1=1 */
- SetLine1Text(gNWProviderName); /* Line 1 = PLMN */
- if (SPN_Exist)
- {
- SetLine2Text((U8*) gServProvderName); /* Line 2 = SPN */
- }
- else if (MSISDN_Exist)
- {
- SetLine2Text((U8*) gOwnerName); /* Line 2: Owner Name */
- }
- else
- {
- SetLine2Text((U8*) NULL);
- }
- break;
- case 4: /* OPN=ON, SPN=OFF, b1=0 */
- case 5: /* OPN=ON, SPN=OFF, b1=1 */
- if (mmi_bootup_is_roaming() == MMI_TRUE)
- {
- SetLine1Text(gNWProviderName); /* Line 1 = PLMN */
- if (OPN_Exist)
- {
- SetLine2Text((U8*) gOperatorName); /* Line 2 = OPN */
- }
- else if (Short_OPN_Exist)
- {
- SetLine2Text((U8*) gShortOperatorName);
- }
- else /* They are both valid but NULL */
- {
- SetLine2Text((U8*) NULL);
- }
- }
- else
- {
- if (OPN_Exist)
- {
- SetLine1Text((U8*) gOperatorName); /* Line 1 = OPN */
- }
- else if (Short_OPN_Exist)
- {
- SetLine1Text((U8*) gShortOperatorName);
- }
- else /* They are both valid but NULL */
- {
- SetLine1Text(gNWProviderName); /* Line 1 = PLMN */
- }
- if (MSISDN_Exist)
- {
- SetLine2Text((U8*) gOwnerName); /* Line 2 = Owner Name */
- }
- }
- break;
- case 6: /* OPN=ON, SPN=ON, b1=0 */
- case 7: /* OPN=ON, SPN=ON, b1=1 */
- if (mmi_bootup_is_roaming() == MMI_TRUE)
- {
- SetLine1Text(gNWProviderName); /* Line 1 = PLMN */
- if (SPN_Exist && pfnUnicodeStrcmp((S8*) gServProvderName, (S8*) gNWProviderName) != 0)
- {
- SetLine2Text((U8*) gServProvderName); /* Line 2 = SPN */
- }
- else if (MSISDN_Exist)
- {
- SetLine2Text((U8*) gOwnerName);
- }
- else
- {
- SetLine2Text((U8*) NULL);
- }
- }
- else
- {
- if (OPN_Exist)
- {
- SetLine1Text((U8*) gOperatorName); /* Line 1 = OPN */
- if (SPN_Exist && pfnUnicodeStrcmp((S8*) gServProvderName, (S8*) gOperatorName) != 0)
- {
- SetLine2Text((U8*) gServProvderName); /* Line 2 = SPN */
- }
- else if (MSISDN_Exist)
- {
- SetLine2Text((U8*) gOwnerName); /* Line 2 = MSISDN */
- }
- else
- {
- SetLine2Text((U8*) NULL);
- }
- }
- else if (Short_OPN_Exist)
- {
- SetLine1Text((U8*) gShortOperatorName); /* Line 1 = Short OPN */
- if (SPN_Exist && pfnUnicodeStrcmp((S8*) gServProvderName, (S8*) gShortOperatorName) != 0)
- {
- SetLine2Text((U8*) gServProvderName); /* Line 2 = SPN */
- }
- else if (MSISDN_Exist)
- {
- SetLine2Text((U8*) gOwnerName); /* Line 2 = MSISDN */
- }
- else
- {
- SetLine2Text((U8*) NULL);
- }
- }
- else /* They are both valid but NULL */
- {
- if (g_pwr_context.RequireRPLMN)
- {
- SetLine1Text(gNWProviderName); /* Line 1 = PLMN */
- if (SPN_Exist && pfnUnicodeStrcmp((S8*) gServProvderName, (S8*) gNWProviderName) != 0)
- {
- SetLine2Text((U8*) gServProvderName); /* Line 2 = SPN */
- }
- else if (MSISDN_Exist)
- {
- SetLine2Text((U8*) gOwnerName); /* Line 2 = MSISDN */
- }
- else
- {
- SetLine2Text((U8*) NULL);
- }
- }
- else
- {
- if (MSISDN_Exist)
- {
- SetLine2Text((U8*) gOwnerName); /* Line 2: Owner Name */
- if (SPN_Exist)
- {
- SetLine1Text((U8*) gServProvderName); /* Line 1: SPN */
- }
- }
- else
- {
- SetLine1Text((U8*) gServProvderName); /* Line 1: SPN */
- }
- }
- }
- }
- break;
- default:
- MMI_ASSERT(0);
- break;
- }
- }
- #ifdef __MMI_NITZ__
- mmi_idle_update_nitz_content();
- if (g_nitz_display.opname_from_nitz && mmi_idle_check_nitz_display_validation())
- {
- PRINT_INFORMATION(("[Idle] Network name from NITZ"));
- if (mmi_bootup_is_roaming())
- {
- /* Roaming and receive NITZ network name */
- SetLine1Text(g_nitz_display.display_name);
- }
- else if (OPN_Exist == 0 && g_pwr_context.RequireRPLMN == 1) /* not roaming but no OPN */
- {
- /* Network name from NITZ takes lower priority from OPN, but not replace SPN */
- SetLine1Text(g_nitz_display.display_name);
- }
- }
- #endif /* __MMI_NITZ__ */
- #ifdef __HOMEZONE_SUPPORT__
- if (gHomezoneText)
- {
- SetLine2Text((U8*) gHomezoneText);
- }
- #endif /* __HOMEZONE_SUPPORT__ */
- }
- #ifdef __MANUAL_MODE_NW_SEL__
- else if (g_pwr_context.CurrentServiceType == LIMITED_SERVICE)
- {
- #ifdef __MMI_SIMAP_SUPPORT__
- if (mmi_bootup_get_active_bt_access_profile_mode())
- {
- pfnUnicodeStrcpy((PS8) gNWProviderName, (PS8)L"SIM Access Profile");
- }
- else
- #endif /* __MMI_SIMAP_SUPPORT__ */
- #ifdef __MMI_WLAN_FEATURES__
- if (!mmi_bootup_is_sim_valid())
- {
- pfnUnicodeStrncpy((PS8) gNWProviderName, (PS8) GetString(simErrorDisplayString), MAX_LENGTH_DISPLAY_NAME - 1);
- }
- else
- #endif /* __MMI_WLAN_FEATURES__ */
- if (mmi_bootup_get_plmn_selection_mode() == AUTOMATIC_MODE)
- {
- if (mmi_bootup_is_nw_registration_ok() == MMI_FALSE)
- {
- pfnUnicodeStrcpy((PS8) gNWProviderName, (PS8) GetString(STR_SIM_INVALID_SIM_TITLE)); /* L1: "Invalid SIM" */
- }
- else
- {
- pfnUnicodeStrcpy((PS8) gNWProviderName, (PS8) GetString(STR_LIMITED_SERVICE)); /* L1: "Emergency" */
- }
- }
- else
- {
- /* L1: "Select Network" */
- /* diamond, 2005/12/18 Check if the input string length is larger than main lcd width */
- if (mmi_idle_check_nw_provider_name_length((PU8) GetString(STR_ID_NETSET_MANUAL_MODE_TITLE)))
- {
- pfnUnicodeStrcpy((PS8) gNWProviderName, (PS8) GetString(STR_ID_NETSET_MANUAL_MODE_TITLE));
- }
- else
- {
- pfnUnicodeStrcpy((PS8) gNWProviderName, (PS8) GetString(STR_ID_NETSET_MANUAL_MODE_SHORT));
- }
- #ifdef __MMI_WLAN_FEATURES__
- if (mmi_netset_get_active_preferred_mode() != P_WLAN_ONLY)
- #endif
- idleLRStringtID = STR_GLOBAL_SELECT;
- }
- SetLine1Text(gNWProviderName);
- }
- else if (g_pwr_context.CurrentServiceType == NO_SERVICE)
- {
- /* L1: "No Service" */
- #ifdef __FLIGHT_MODE_SUPPORT__
- if (mmi_bootup_get_active_flight_mode() == FLIGHTMODE_SILENT)
- pfnUnicodeStrncpy((PS8) gNWProviderName, (PS8) GetString(STR_MENU_FLIGHT_MODE), MAX_LENGTH_DISPLAY_NAME - 1);
- else
- #endif /* __FLIGHT_MODE_SUPPORT__ */
- pfnUnicodeStrncpy((PS8) gNWProviderName, (PS8) GetString(STR_NO_SERVICE), MAX_LENGTH_DISPLAY_NAME - 1);
- SetLine1Text(gNWProviderName);
- }
- else /* temporarily remove the string */
- {
- /* L1: "" */
- SetLine1Text((U8*) NULL);
- }
- #else /* __MANUAL_MODE_NW_SEL__ */
- else if (g_pwr_context.CurrentServiceType == LIMITED_SERVICE)
- {
- #ifdef __MMI_SIMAP_SUPPORT__
- if (mmi_bootup_get_active_bt_access_profile_mode())
- pfnUnicodeStrcpy((PS8) gNWProviderName, L"SIM Access Profile");
- else
- #endif /* __MMI_SIMAP_SUPPORT__ */
- /* L1: "Limited Service" */
- #ifdef __MMI_WLAN_FEATURES__
- if (!mmi_bootup_is_sim_valid())
- pfnUnicodeStrncpy((PS8) gNWProviderName, (PS8) GetString(simErrorDisplayString), MAX_LENGTH_DISPLAY_NAME - 1);
- else
- #endif /* __MMI_WLAN_FEATURES__ */
- pfnUnicodeStrcpy((PS8) gNWProviderName, (PS8) GetString(STR_LIMITED_SERVICE));
- SetLine1Text(gNWProviderName);
- }
- else /* if ( gNoService ) */
- {
- /* L1: "No Service" */
- #ifdef __FLIGHT_MODE_SUPPORT__
- if (mmi_bootup_get_active_flight_mode() == FLIGHTMODE_SILENT)
- pfnUnicodeStrncpy((PS8) gNWProviderName, (PS8) GetString(STR_MENU_FLIGHT_MODE), MAX_LENGTH_DISPLAY_NAME - 1);
- else
- #endif /* __FLIGHT_MODE_SUPPORT__ */
- pfnUnicodeStrncpy((PS8) gNWProviderName, (PS8) GetString(STR_NO_SERVICE), MAX_LENGTH_DISPLAY_NAME - 1);
- SetLine1Text(gNWProviderName);
- }
- #endif /* __MANUAL_MODE_NW_SEL__ */
- #ifdef __MMI_WLAN_FEATURES__
- if (mmi_bootup_get_active_flight_mode() != FLIGHTMODE_SILENT)
- {
- mmi_netset_update_preferred_mode_service_area();
- }
- #endif /* __MMI_WLAN_FEATURES__ */
- }
- #undef SetLine1Text
- #undef SetLine2Text
- //KP Jerry add on 2007-3-31 start
- #ifdef __MMI_PROFILE_POWER_SAVING__
- /*****************************************************************************
- * FUNCTION
- * IdleTogglePowerSavingProfile
- * DESCRIPTION
- * Toggles profiles between PowerSvaing mode and current activated profile on long press of CAM key.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void IdleTogglePowerSavingProfile(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MMI_ALERT_TYPE alert_type;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- #ifdef __MMI_BT_PROFILE__
- if( (gprofileheadset != 1) && (gactivatedprofile != MMI_PROFILE_BT) )
- #else
- if(gprofileheadset != 1)
- #endif
- {
- if (gactivatedprofile != MMI_PROFILE_POWER_SAVING)
- {
- mmi_profiles_power_saving_activate_profile();
- }
- else
- {
- mmi_profiles_power_saving_deactivate_profile();
- }
-
- alert_type = GetMtCallAlertTypeEnum();
- #ifdef __MMI_BT_PROFILE__
- if (alert_type == MMI_VIBRATION_ONLY && !isEarphonePlugged && ((gactivatedprofile != MMI_PROFILE_BT)))
- #else
- if (alert_type == MMI_VIBRATION_ONLY && !isEarphonePlugged)
- #endif
- {
- VibratorOn();
- StartTimer(TOGGLE_TIMER, TOGGLE_PROFILE_TIMEOUT, IdleStopToggleTimer);
- }
- /* diamond, 2005/10/21 disable long press if # is long pressed when earphone is plugged in */
- #ifdef __MMI_BT_PROFILE__
- if (isEarphonePlugged || mmi_profiles_bt_is_activated())
- #else
- if (isEarphonePlugged)
- #endif
- IdleDisableLongPress();
- }
- }
- #endif
- //KP Jerry add on 2007-3-31 end
- /*****************************************************************************
- * FUNCTION
- * IdleToggleProfile
- * DESCRIPTION
- * Toggles profiles between silent mode and current activated profile on long press of # key.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void IdleToggleProfile(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MMI_ALERT_TYPE alert_type;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (gactivatedprofile == MMI_PROFILE_SILENT) //Old:if (gactivatedprofile == 5) //KP Jerry modify on 2007-4-2
- {
- g_idle_context.ToggleProfile = SET_SILENT_PROFILE;
- }
- else
- {
- g_idle_context.ToggleProfile = SET_CURRENT_PROFILE;
- }
- if (g_idle_context.ToggleProfile == SET_CURRENT_PROFILE)
- {
- g_idle_context.ToggleProfile = SET_SILENT_PROFILE;
- ActivateSilentProfile();
- }
- else
- {
- g_idle_context.ToggleProfile = SET_CURRENT_PROFILE;
- DeactivateSilentProfile();
- }
- alert_type = GetMtCallAlertTypeEnum();
- //KP Jerry modify on 2007-4-3 start
- #ifdef __MMI_PROFILE_POWER_SAVING__
- #ifdef __MMI_BT_PROFILE__
- if (alert_type == MMI_VIBRATION_ONLY && !isEarphonePlugged && (gactivatedprofile != MMI_PROFILE_BT) && (gactivatedprofile != MMI_PROFILE_POWER_SAVING))
- #else
- if (alert_type == MMI_VIBRATION_ONLY && !isEarphonePlugged && (gactivatedprofile != MMI_PROFILE_POWER_SAVING))
- #endif
- #else/*!__MMI_PROFILE_POWER_SAVING__*/
- #ifdef __MMI_BT_PROFILE__
- if (alert_type == MMI_VIBRATION_ONLY && !isEarphonePlugged && (gactivatedprofile != MMI_PROFILE_BT))
- #else
- if (alert_type == MMI_VIBRATION_ONLY && !isEarphonePlugged)
- #endif
- #endif/*__MMI_PROFILE_POWER_SAVING__*/
- //KP Jerry modify on 2007-4-3 end
- {
- VibratorOn();
- StartTimer(TOGGLE_TIMER, TOGGLE_PROFILE_TIMEOUT, IdleStopToggleTimer);
- }
- /* diamond, 2005/10/21 disable long press if # is long pressed when earphone is plugged in */
- //KP Jerry modify on 2007-4-3 start
- #ifdef __MMI_PROFILE_POWER_SAVING__
- #ifdef __MMI_BT_PROFILE__
- if (isEarphonePlugged || mmi_profiles_bt_is_activated() || (gactivatedprofile == MMI_PROFILE_POWER_SAVING))
- #else
- if (isEarphonePlugged)
- #endif
- #else/*!__MMI_PROFILE_POWER_SAVING__*/
- #ifdef __MMI_BT_PROFILE__
- if (isEarphonePlugged || mmi_profiles_bt_is_activated())
- #else
- if (isEarphonePlugged)
- #endif
- #endif/*__MMI_PROFILE_POWER_SAVING__*/
- //KP Jerry modify on 2007-4-3 end
- IdleDisableLongPress();
- }
- /*****************************************************************************
- * FUNCTION
- * IdleStopToggleTimer
- * DESCRIPTION
- * Stop toggle Profile timer of # key..
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void IdleStopToggleTimer(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- StopTimer(TOGGLE_TIMER);
- VibratorOff();
- }
- /*****************************************************************************
- * FUNCTION
- * IdleCallSpeedDialOnLongPress
- * DESCRIPTION
- * Implements speed dial on idle screen.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void IdleCallSpeedDialOnLongPress(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 Keycode, Keytype;
- S8 *tempbuffer = NULL;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- GetkeyInfo(&Keycode, &Keytype);
- if ((Keycode >= 1) && (Keycode <= 9))
- {
- #ifdef __MMI_TOUCH_DIAL_SCREEN__
- g_idle_context.AvoidHistoryofDialerScreen = 1; /* Not save dialer screen to history for long press to speed dial */
- #endif
- if (!g_phb_cntx.phb_ready)
- {
- mmi_phb_entry_not_ready(STR_PROCESSING_PHONEBOOK);
- return;
- }
- tempbuffer = PhbGetSpeedDialNum(Keycode);
- if (tempbuffer != NULL)
- {
- pfnUnicodeStrcpy(g_idle_context.DialPadCallBuffer, tempbuffer);
- IdleDialPadCall();
- }
- else
- {
- IdleShowScrNoSpeedDialNumSaved();
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * IdleShowScrNoSpeedDialNumSaved
- * DESCRIPTION
- * Displays pop up: no speed dial number saved for this digit.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void IdleShowScrNoSpeedDialNumSaved(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION(("@@@@@@ NO SPEED DIAL NUMBER SAVED @@@@@@@@@"));
- DeleteUptoScrID(IDLE_SCREEN_ID);
- DisplayPopup((U8*) GetString(STR_NO_SPEED_DIAL_NUM_SAVED), IMG_GLOBAL_WARNING, 0, 2000, (U8) WARNING_TONE);
- }
- /*****************************************************************************
- * FUNCTION
- * IdleAbbrevDialling
- * DESCRIPTION
- * Quick acces to phonebook entries.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void IdleAbbrevDialling(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S8 tempbuffer[(MAX_LOCATION_DIGITS + 1) * ENCODING_LENGTH];
- U8 count, i = 0;
- U16 Location;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- memset(tempbuffer, 0, ((MAX_LOCATION_DIGITS + 1) * ENCODING_LENGTH));
- /* Don't do anything when shifting out digits */
- if (pfnUnicodeStrlen((PS8) g_idle_context.DialPadCallBuffer) >= (MAX_DIAL_PAD - 1))
- {
- return;
- }
- if ((g_idle_context.DialPadCallBuffer[0] >= '0') && (g_idle_context.DialPadCallBuffer[0] <= '9'))
- {
- /* This loop search for '#' in DialpadCallbuffer,if # is not found before MAX_LOCATION_DIGITS then return */
- for (count = 0; (g_idle_context.DialPadCallBuffer[count] != '#'); count++)
- {
- if (count > (MAX_LOCATION_DIGITS * ENCODING_LENGTH - 1) || g_idle_context.DialPadCallBuffer[count] == '*' || g_idle_context.DialPadCallBuffer[count] == '+')
- {
- return;
- }
- tempbuffer[i] = g_idle_context.DialPadCallBuffer[count];
- i++;
- }
- if (g_idle_context.DialPadCallBuffer[count + 2] == 0) /* no other digits after the first found # */
- {
- Location = (U16) gui_atoi((UI_string_type) tempbuffer);
- g_idle_context.AvoidHistoryofDialerScreen = 1;
- mmi_phb_get_sim_entry_by_location((U16) Location);
- }
- }
- else if (!SSCStringParsing3())
- {
- SSCStringParsing1();
- }
- }
- /*****************************************************************************
- * FUNCTION
- * IdleShowScrInvalidLocation
- * DESCRIPTION
- * Displays popup for Invalid location
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void IdleShowScrInvalidLocation(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION(("@@@@@@ INVALID LOCATION IN PHONE BOOK @@@@@@@@@"));
- DisplayPopup((U8*) GetString(STR_INVALID_LOCATION), IMG_GLOBAL_WARNING, 0, 2000, (U8) WARNING_TONE);
- }
- /*****************************************************************************
- * FUNCTION
- * IdleShowScrNoPhoneNumEntry
- * DESCRIPTION
- * Show pop up that no phone book entry saved on this location.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void IdleShowScrNoPhoneNumEntry(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION(("@@@@@@ NO PHONE NUMBER CORRESPONDING TO THIS LOCATION @@@@@@@@@"));
- DisplayPopup((U8*) GetString(STR_NO_PHONE_NUM), IMG_GLOBAL_WARNING, 0, 2000, (U8) WARNING_TONE);
- }
- /*****************************************************************************
- * FUNCTION
- * IdleDialPadSavePhoneBook
- * DESCRIPTION
- * Save entered number in phonebook on press of LSK on dialler screen.
- *
- * Temorary function
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void IdleDialPadSavePhoneBook(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- #ifdef __MMI_VOIP__
- if (IsScreenPresent(SCR_ID_VOIP_CALL_EDITOR)) /* save voip uri */
- {
- if (pfnUnicodeStrlen((S8*)g_idle_context.DialPadCallBuffer))
- {
- mmi_phb_save_entry_for_service_field((S8*)g_idle_context.DialPadCallBuffer, MMI_PHB_ENTER_FROM_VOIP);
- }
- else
- {
- DisplayPopup(
- (U8*)GetString(STR_ID_VOIP_EMPTY_USERNAME),
- IMG_GLOBAL_UNFINISHED,
- 1,
- UI_POPUP_NOTIFYDURATION_TIME,
- ERROR_TONE_IN_CALL);
- DeleteScreenIfPresent(IDLE_SCREEN_DIGIT_OPTIONS_ID); /* go back to call editor screen */
- }
- }
- else
- #endif /* __MMI_VOIP__ */
- {
- SaveNumberFromIdleScrn(g_idle_context.DialPadCallBuffer, 0);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * IdleDialPadCall
- * DESCRIPTION
- * Make a call from scratch pad
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void IdleDialPadCall(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* Call the API with collected digits(DialPadCallBuffer) to initiate MO call */
- g_idle_context.AvoidHistoryofDialerScreen = 1;
- #ifdef __IP_NUMBER__
- SetTempUseIPNumber(FALSE);
- #endif
- /* to disable the dialing if no digit is present */
- #ifdef __MMI_TOUCH_DIAL_SCREEN__
- if (!SSCStringParsing2() && g_idle_context.DialPadCallBuffer[0] != ' ')
- #else
- if (!SSCStringParsing2())
- #endif
- MakeCall(g_idle_context.DialPadCallBuffer);
- }
- /*****************************************************************************
- * FUNCTION
- * DialIPNumber
- * DESCRIPTION
- * Dial IP Number
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- #ifdef __IP_NUMBER__
- void DialIPNumber(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_idle_context.AvoidHistoryofDialerScreen = 1;
- SetTempUseIPNumber(TRUE);
- if (!SSCStringParsing2())
- {
- MakeCall(g_idle_context.DialPadCallBuffer);
- }
- }
- #endif /* __IP_NUMBER__ */
- /*****************************************************************************
- * FUNCTION
- * IdleScreenDigitHandler
- * DESCRIPTION
- * Inputs the digits of a phone number
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- //KP Jerry add on 2007-4-12 start
- #ifdef __MMI_MESSAGES_SENDMSG_QUICKLY__
- void IdleScreenDigit_Option(void);
- #endif
- //KP Jerry add on 2007-4-12 end
- void IdleScreenDigitHandler(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *history_buffer;
- U16 SpeedDialKeys[MAX_SPEED_DIAL_KEYS] = {KEY_2, KEY_3, KEY_4, KEY_5, KEY_6, KEY_7, KEY_8, KEY_9};
- #ifdef __MMI_TOUCH_DIAL_SCREEN__
- U16 TouchDialPadKeys[MAX_TOUCH_DIAL_PAD_KEYS] =
- {KEY_0, KEY_1, KEY_2, KEY_3, KEY_4, KEY_5, KEY_6, KEY_7, KEY_8, KEY_9, /*KEY_STAR,*/ KEY_POUND};
- #endif /* __MMI_TOUCH_DIAL_SCREEN__ */
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- #if defined(__MMI_WLAN_FEATURES__) && defined(__MMI_VOIP__)
- //if (mmi_netset_get_active_preferred_mode() == P_WLAN_ONLY || mmi_netset_get_active_preferred_mode() == P_WLAN_PREFERRED)
- if (mmi_netset_get_dial_mode())
- {
- mmi_frm_unhide_menu_item(MENU_ID_DIALER_SCREEN_OPTIONS_INPUT_METHOD);
- mmi_netset_enter_wlan_dialer_screen();
- return;
- }
- else
- {
- mmi_frm_hide_menu_item(MENU_ID_DIALER_SCREEN_OPTIONS_INPUT_METHOD);
- }
- #endif /* defined(__MMI_WLAN_FEATURES__) && defined(__MMI_VOIP__) */
- EntryNewScreen(IDLE_SCREEN_DIGIT_HANDLER_ID, ExitIdleScreenDigitHandler, NULL, NULL);
- DeInitSpecialMode();
- g_idle_context.IsOnDialerScreen = 1;
- g_idle_context.AvoidHistoryofDialerScreen = 0;
- history_buffer = GetCurrGuiBuffer(IDLE_SCREEN_DIGIT_HANDLER_ID);
- #if defined(__MMI_WLAN_FEATURES__) && defined(__MMI_VOIP__)
- if (mmi_netset_get_active_preferred_mode() == P_GSM_PREFERRED || mmi_netset_get_active_preferred_mode() == P_WLAN_PREFERRED)
- ShowCategory16Screen(
- STR_GLOBAL_OPTIONS,
- 0,
- STR_GLOBAL_BACK,
- 0,
- (U8*) g_idle_context.DialPadCallBuffer,
- MAX_DIAL_PAD,
- history_buffer);
- else
- #endif /* defined(__MMI_WLAN_FEATURES__) && defined(__MMI_VOIP__) */
- ShowCategory16Screen(
- //KP Jerry add on 2007-4-12 start
- #ifdef __MMI_MESSAGES_SENDMSG_QUICKLY__
- STR_GLOBAL_OPTIONS,
- #else
- STR_GLOBAL_SAVE,
- #endif
- //KP Jerry add on 2007-4-12 end
- 0,
- STR_GLOBAL_BACK,
- 0,
- (U8*) g_idle_context.DialPadCallBuffer,
- MAX_DIAL_PAD,
- history_buffer);
- /* 090605 Dialing Calvin Start */
- #if ( (defined __MMI_WGUI_CSK_ENABLE__) && defined (__MMI_TOUCH_SCREEN__))
- #if defined (__MMI_TOUCH_DIAL_SCREEN_WITH_FUNCTION__)
- SetDialingKeypadCallHandler(IdleDialPadCall);
- SetDialingKeypadIPCallHandler(DialIPNumber); //KP Jerry add on 2006-11-13
- #else
- SetCenterSoftkeyFunction(IdleDialPadCall, KEY_EVENT_UP);
- #endif
- #endif /* ( (defined __MMI_WGUI_CSK_ENABLE__) && defined (__MMI_TOUCH_SCREEN__)) */
- /* 090605 Dialing Calvin Start */
- if (g_idle_context.IdleScreenDigitKeyCode >= 0)
- {
- ExecuteCurrKeyHandler(g_idle_context.IdleScreenDigitKeyCode, KEY_EVENT_DOWN);
- }
- #if defined(__MMI_WLAN_FEATURES__) && defined(__MMI_VOIP__)
- if (mmi_netset_get_active_preferred_mode() == P_GSM_PREFERRED || mmi_netset_get_active_preferred_mode() == P_WLAN_PREFERRED)
- SetLeftSoftkeyFunction(mmi_netset_enter_wlan_dialer_option, KEY_EVENT_UP);
- else
- #endif /* defined(__MMI_WLAN_FEATURES__) && defined(__MMI_VOIP__) */
- //KP Jerry add on 2007-4-12 start
- #ifdef __MMI_MESSAGES_SENDMSG_QUICKLY__
- SetLeftSoftkeyFunction(IdleScreenDigit_Option, KEY_EVENT_UP);
- #else
- SetLeftSoftkeyFunction(IdleDialPadSavePhoneBook, KEY_EVENT_UP);
- #endif
- //KP Jerry add on 2007-4-12 end
- SetKeyHandler(IdleDialPadCall, KEY_SEND, KEY_EVENT_UP);
- SetKeyHandler(IdleAbbrevDialling, KEY_POUND, KEY_EVENT_UP);
- SetCategory16RightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- #ifdef __MMI_IP_KEY__
- /* under construction !*/
- #endif
- /* first press of any key on idle screen to enter dialer screen, gLongPressEnable will be 0;
- so following keyhandlers will b registered. On up event of anykey will call DisableLongPress
- which will make gLongPressEnable=1 and will enter this screen again and these key handlers will not register again. */
- #ifdef __MMI_STARKEY_TOGGLE_PROFILE__
- if ((g_idle_context.LongPressEnable == 0) && !history_buffer) /* Lisen (!history_buffer) to check if it is back from history, see Cannon+ SCR 1847 */
- #else /* __MMI_STARKEY_TOGGLE_PROFILE__ */
- #ifdef __MMI_TOUCH_DIAL_SCREEN__
- /* history buffer condition removed as to restore the key handlers after popup */
- /* g_idle_context.IdleScreenDigitKeyCode=-1 means dial screen shows when user click on CSK */
- /* MTK Leo start, last one condition is not needed */
- /* if((g_idle_context.LongPressEnable==0) && (g_idle_context.IdleScreenDigitKeyCode!=KEY_STAR) && (g_idle_context.IdleScreenDigitKeyCode!=-1) ) */
- if ((g_idle_context.LongPressEnable == 0) && (g_idle_context.IdleScreenDigitKeyCode != KEY_STAR))
- #else /* __MMI_TOUCH_DIAL_SCREEN__ */
- if ((g_idle_context.LongPressEnable == 0) && (g_idle_context.IdleScreenDigitKeyCode != KEY_STAR) && !history_buffer)
- #endif /* __MMI_TOUCH_DIAL_SCREEN__ */
- #endif /* __MMI_STARKEY_TOGGLE_PROFILE__ */
- {
- #ifndef __MMI_TOUCH_DIAL_SCREEN__
- g_idle_context.AvoidHistoryofDialerScreen = 1;
- #endif
- mmi_phb_call_set_dial_from_list(MMI_PHB_NONE); /* diamond, 2006/02/13 Reset dial from list flag */
- if (PhbGetSpeedDialStatus() == MMI_TRUE)
- {
- SetGroupKeyHandler(IdleCallSpeedDialOnLongPress, SpeedDialKeys, MAX_SPEED_DIAL_KEYS - 1, KEY_LONG_PRESS);
- }
- SetKeyHandler(DialVoiceMail, KEY_1, KEY_LONG_PRESS);
- #ifdef __MMI_STARKEY_TOGGLE_PROFILE__
- SetKeyHandler(IdleToggleProfile, KEY_STAR, KEY_LONG_PRESS);
- #else
- SetKeyHandler(IdleToggleProfile, KEY_POUND, KEY_LONG_PRESS);
- #endif
- #ifdef __MMI_POUNDKEY_ENTER_PROFILE__
- SetKeyHandler(EntryScrProfiles, KEY_POUND, KEY_LONG_PRESS);
- #endif
- #ifdef __MMI_TOUCH_DIAL_SCREEN__
- SetGroupKeyHandler(IdleDisableLongPress, TouchDialPadKeys, (U8) MAX_TOUCH_DIAL_PAD_KEYS, KEY_EVENT_UP);
- #else
- SetGroupKeyHandler(IdleDisableLongPress, (PU16) PresentAllKeys, (U8) TOTAL_KEYS, KEY_EVENT_UP);
- #endif
- }
- #ifdef __MMI_TOUCH_DIAL_SCREEN__
- else
- {
- DeleteScreenIfPresent(IDLE_SCREEN_DIGIT_HANDLER_ID);
- }
- #endif /* __MMI_TOUCH_DIAL_SCREEN__ */
- }
- /*****************************************************************************
- * FUNCTION
- * ExitIdleScreenDigitHandler
- * DESCRIPTION
- * Exit function for idle screen digit handle
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitIdleScreenDigitHandler(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (!g_idle_context.AvoidHistoryofDialerScreen)
- {
- #ifdef __FLIGHT_MODE_SUPPORT__
- if (mmi_bootup_get_active_flight_mode() == FLIGHTMODE_SILENT)
- {
- GenericExitScreen(IDLE_SCREEN_DIGIT_HANDLER_ID, FlightModeDigitHandler);
- }
- else
- #endif /* __FLIGHT_MODE_SUPPORT__ */
- GenericExitScreen(IDLE_SCREEN_DIGIT_HANDLER_ID, IdleScreenDigitHandler);
- }
- g_idle_context.IsOnDialerScreen = 0;
- g_idle_context.IdleScreenDigitKeyCode = -1;
- #if ( (defined __MMI_WGUI_CSK_ENABLE__) && defined (__MMI_TOUCH_SCREEN__) )
- ResetCenterSoftkey();
- #endif
- }
- /*****************************************************************************
- * FUNCTION
- * HandleIdleScreenDigitEntry
- * DESCRIPTION
- * This function is entered when a key is pressed at the Idle screen.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void HandleIdleScreenDigitEntry(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 Keycode, Keytype;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- GetkeyInfo(&Keycode, &Keytype);
- sprintf(g_idle_context.DialPadCallBuffer, "");
- g_idle_context.IdleScreenDigitKeyCode = Keycode;
- /* diamond, 2005/07/05 Flight mode */
- #ifdef __FLIGHT_MODE_SUPPORT__
- if (mmi_bootup_get_active_flight_mode() == FLIGHTMODE_SILENT)
- {
- FlightModeDigitHandler();
- }
- else
- #endif /* __FLIGHT_MODE_SUPPORT__ */
- /* end, diamond */
- IdleScreenDigitHandler();
- }
- /*****************************************************************************
- * FUNCTION
- * IdleDisableLongPress
- * DESCRIPTION
- * Disbale some long press handlers on up event of key
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void IdleDisableLongPress(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_idle_context.LongPressEnable = 1;
- #ifdef __FLIGHT_MODE_SUPPORT__
- if (mmi_bootup_get_active_flight_mode() == FLIGHTMODE_SILENT)
- {
- FlightModeDigitHandler();
- }
- else
- #endif /* __FLIGHT_MODE_SUPPORT__ */
- IdleScreenDigitHandler();
- }
- /*****************************************************************************
- * FUNCTION
- * IdleSetKeyPadLockFlag
- * DESCRIPTION
- * This function is called when time out occurs on idle screen to set key pad lock flag
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- //KP Jerry add on 2007-4-10 start
- #if defined(__MMI_PEN_BLOCK_WHEN_KAYPAD_LOCKED__)
- extern BOOL GetLCDSleepStatus(void);
- #endif
- //KP Jerry add on 2007-4-10 end
- void IdleSetKeyPadLockFlag(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION(("[Keypad Lock] SetKeyPadLockFlag: gKeyPadLockFlag ON"));
- g_keylock_context.gKeyPadLockFlag = 1;
- #if 0 /* diamond, 2006/03/07 Not necessary to block pen here because pen is blocked in EntryIdleScreen */
- #ifdef __MMI_TOUCH_SCREEN__
- /* under construction !*/
- #endif
- #endif /* 0 */
- #ifndef __MMI_KEYPADLOCK_WITH_KEYTONE__
- mmi_frm_kbd_set_tone_state(MMI_KEY_TONE_DISABLED);
- #endif
- if (g_idle_context.ScreenSaverRunFlag != 1)
- {
- /* Screen saver is not running, using SetRightSoftkeyFunction() for redrew softkey */
- EntryIdleScreen();
- #if defined(__MMI_TOUCH_SCREEN__) && (!defined(__MMI_TOUCH_SCREEN_WITH_NUMERIC_KEY__) || defined(__MMI_SLIDE__)) //KP Jerry add "!defined(__MMI_TOUCH_SCREEN_WITH_NUMERIC_KEY__)" on 2007-3-26
- SetKeyHandler(IdleRSKPressOnScreenSaver, KEY_SEND, KEY_EVENT_DOWN);
- #else /* __MMI_TOUCH_SCREEN__ || !__MMI_TOUCH_SCREEN_WITH_NUMERIC_KEY__ */ //KP Jerry add "!__MMI_TOUCH_SCREEN_WITH_NUMERIC_KEY__ " on 2007-3-27
- SetGroupKeyHandler(NULL, (PU16) PresentAllKeys, (U8) TOTAL_KEYS /* MAX_KEYS - 1 */ , KEY_EVENT_DOWN);
- #if defined(__MMI_KEYPAD_LOCK_PATTERN_1__) || defined(__MMI_KEYPAD_LOCK_PATTERN_3__) || defined(__MMI_KEYPAD_LOCK_PATTERN_4__) //KP Jerry add "__MMI_KEYPAD_LOCK_PATTERN_3__" on 2007-3-27 /* Robin 1223 */
- SetRightSoftkeyFunction(IdleRSKPressOnScreenSaver, KEY_EVENT_DOWN);
- #endif
- #ifdef __MMI_KEYPAD_LOCK_PATTERN_2__ /* Robin 1223 */
- SetLeftSoftkeyFunction(IdleRSKPressOnScreenSaver, KEY_EVENT_DOWN);
- #endif
- #endif /* __MMI_TOUCH_SCREEN__ || !__MMI_TOUCH_SCREEN_WITH_NUMERIC_KEY__ */ //KP Jerry add "!__MMI_TOUCH_SCREEN_WITH_NUMERIC_KEY__ " on 2007-3-27
- }
- else
- {
- /* Robin 1216, Screen saver is running, using SetKeyHandler() to prevent redrew softkey */
- #if defined(__MMI_TOUCH_SCREEN__) && (!defined(__MMI_TOUCH_SCREEN_WITH_NUMERIC_KEY__) || defined(__MMI_SLIDE__)) //KP Jerry add "!defined(__MMI_TOUCH_SCREEN_WITH_NUMERIC_KEY__)" on 2007-3-26
- SetKeyHandler(IdleRSKPressOnScreenSaver, KEY_SEND, KEY_EVENT_DOWN);
- #else /* __MMI_TOUCH_SCREEN__ || !__MMI_TOUCH_SCREEN_WITH_NUMERIC_KEY__ */ //KP Jerry add "!__MMI_TOUCH_SCREEN_WITH_NUMERIC_KEY__ " on 2007-3-27
- #if defined(__MMI_KEYPAD_LOCK_PATTERN_1__) || defined(__MMI_KEYPAD_LOCK_PATTERN_3__) || defined(__MMI_KEYPAD_LOCK_PATTERN_4__) //KP Jerry add "__MMI_KEYPAD_LOCK_PATTERN_3__" on 2007-3-27 /* Robin 1223 */
- SetKeyHandler(IdleRSKPressOnScreenSaver, KEY_RSK, KEY_EVENT_DOWN);
- #endif
- #ifdef __MMI_KEYPAD_LOCK_PATTERN_2__ /* Robin 1223 */
- SetKeyHandler(IdleRSKPressOnScreenSaver, KEY_LSK, KEY_EVENT_DOWN);
- #endif
- #endif /* __MMI_TOUCH_SCREEN__ || !__MMI_TOUCH_SCREEN_WITH_NUMERIC_KEY__ */ //KP Jerry add "!__MMI_TOUCH_SCREEN_WITH_NUMERIC_KEY__ " on 2007-3-27
- }
- #ifdef __MMI_TOUCH_SCREEN__
- ChangeStatusIconImage(STATUS_ICON_KEYPAD_LOCK, IMG_SI_KEYPAD_LOCK);
- UpdateStatusIcons(); /* 101805 ChangeStatusIconImage Calvin: ChangeStatusIconImage will not call UpdateStatusIcon */
- #else /* __MMI_TOUCH_SCREEN__ */
- IdleSetStatusIcon(STATUS_ICON_KEYPAD_LOCK);
- #endif /* __MMI_TOUCH_SCREEN__ */
- PRINT_INFORMATION(("[Keypad Lock] SetKeyPadLockFlag: Timer %d Expire", g_idle_context.AutoLockTimeOut));
- StopTimer(IDLE_APP_AUTO_LOCK_TIMER_ID);
- //KP Jerry add on 2007-4-10 start
- #if defined(__MMI_PEN_BLOCK_WHEN_KAYPAD_LOCKED__)
- if(GetLCDSleepStatus())
- {
- //touch_panel_enable(KAL_FALSE);
- //touch_panel_flush();
- //mmi_pen_forced_block();
- }
- #endif
- //KP Jerry add on 2007-4-10 end
- }
- /*****************************************************************************
- * FUNCTION
- * IdleSetStatusIcon
- * DESCRIPTION
- * Show Icon
- * PARAMETERS
- * index [IN]
- * U8(?) [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void IdleSetStatusIcon(S16 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ShowStatusIcon(index);
- UpdateStatusIcons();
- }
- /*****************************************************************************
- * FUNCTION
- * IdleResetStatusIcon
- * DESCRIPTION
- * Hide Icon
- * PARAMETERS
- * index [IN]
- * U8(?) [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void IdleResetStatusIcon(S16 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- HideStatusIcon(index);
- UpdateStatusIcons();
- }
- /*****************************************************************************
- * FUNCTION
- * IsChineseSet
- * DESCRIPTION
- * This function tells whether current lang is set as chinese or not
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- pBOOL IsChineseSet(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (strcmp((PS8) gLanguageArray[gCurrLangIndex].aLangSSC, SSC_TCHINESE) == 0)
- {
- return 1;
- }
- if (strcmp((PS8) gLanguageArray[gCurrLangIndex].aLangSSC, SSC_SCHINESE) == 0)
- {
- return 1;
- }
- return 0;
- }
- /*****************************************************************************
- * FUNCTION
- * IsTrChineseSet
- * DESCRIPTION
- * This fn tells whether traditional chinese is set or not
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- pBOOL IsTrChineseSet(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (strcmp((PS8) gLanguageArray[gCurrLangIndex].aLangSSC, SSC_TCHINESE) == 0)
- {
- return 1;
- }
- return 0;
- }
- /*****************************************************************************
- * FUNCTION
- * IsSmChineseSet
- * DESCRIPTION
- * This fn tells whether simplified chinese is set or not
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- pBOOL IsSmChineseSet(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (strcmp((PS8) gLanguageArray[gCurrLangIndex].aLangSSC, SSC_SCHINESE) == 0)
- {
- return 1;
- }
- return 0;
- }
- /*****************************************************************************
- * FUNCTION
- * ReadValueCityNVRAM
- * DESCRIPTION
- * Read city values from NVRAM
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ReadValueCityNVRAM(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 error;
- U8 city_chosen1;
- U8 city_chosen2;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ReadValue(NVRAM_DOWNLOAD_CITY1, &city_chosen1, DS_BYTE, &error);
- if (city_chosen1 == 0xff)
- {
- city_chosen1 = PhnsetGetHomeCity();
- city_chosen1++;
- WriteValue(NVRAM_DOWNLOAD_CITY1, &city_chosen1, DS_BYTE, &error);
- }
- ReadValue(NVRAM_DOWNLOAD_CITY2, &city_chosen2, DS_BYTE, &error);
- if (city_chosen2 == 0xff)
- {
- city_chosen2 = 0;
- WriteValue(NVRAM_DOWNLOAD_CITY2, &city_chosen2, DS_BYTE, &error);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * EntryIdleAppSubLcdWithErrorMsg
- * DESCRIPTION
- * Show Sub LCD idle screen with error message
- * PARAMETERS
- * message [?]
- * message_icon [IN]
- * history_buffer [?]
- * RETURNS
- * void
- *****************************************************************************/
- void EntryIdleAppSubLcdWithErrorMsg(U8 *message, U16 message_icon, U8 *history_buffer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ExecSubLCDCurrExitHandler();
- DinitSubLCDHistory();
- ShowCategory301Screen(message, message_icon, history_buffer);
- SetSubLCDExitHandler(ExitSubLCDIdleScr);
- }
- /*****************************************************************************
- * FUNCTION
- * ShowIdleAppSubLcd
- * DESCRIPTION
- * Show Sub LCD idle screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- #ifdef __MMI_SUBLCD_SHOW_ANALOG_CLOCK__
- extern U8 gMMIClamState;
- #endif
- void ShowIdleAppSubLcd(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S8 *CityAbbr1, *CityAbbr2;
- FLOAT time_difference;
- U8 city_chosen1;
- U8 city_chosen2;
- U8 home_city_sublcd;
- FLOAT diff1, diff2;
- S16 error = -1;
- BOOL show_category_333_screen = FALSE;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ExecSubLCDCurrExitHandler();
- DinitSubLCDHistory();
- g_idle_context.IsSubLcdOnIdleScreen = SUBLCD_ON_IDLE_NORMAL;
- #ifdef __MMI_SUBLCD_SHOW_ANALOG_CLOCK__
- if (gMMIClamState == 1)
- {
- ShowCategory310Screen((U8*) get_string(STR_GLOBAL_LOGO), 0, NULL);
- }
- else
- {
- ShowSubLCDAnalogClockScreen();
- }
- #else /* __MMI_SUBLCD_SHOW_ANALOG_CLOCK__ */
- #ifdef __MMI_AUDIO_PLAYER__
- if (mmi_audply_is_playing())
- {
- show_category_333_screen = TRUE;
- }
- #endif /* __MMI_AUDIO_PLAYER__ */
- #ifdef __MMI_FM_RADIO__
- if (mmi_fmrdo_is_power_on())
- {
- show_category_333_screen = TRUE;
- }
- #endif /* __MMI_FM_RADIO__ */
- if (show_category_333_screen)
- {
- ShowCategory333Screen();
- }
- else
- {
- ReadValue(NVRAM_DOWNLOAD_CITY1, &city_chosen1, DS_BYTE, &error);
- ReadValue(NVRAM_DOWNLOAD_CITY2, &city_chosen2, DS_BYTE, &error);
- home_city_sublcd = PhnsetGetHomeCity();
- home_city_sublcd++;
- if (city_chosen1 > 57)
- {
- city_chosen1 = 1;
- }
- if (city_chosen2 > 57)
- {
- city_chosen2 = 1;
- }
- if ((TimeZoneData[city_chosen1].CityAbbr != STR_WCLOCK_CITY_ABBRE_NONE) &&
- (TimeZoneData[city_chosen2].CityAbbr != STR_WCLOCK_CITY_ABBRE_NONE))
- {
- CityAbbr1 = GetString((U16) TimeZoneData[city_chosen1].CityAbbr);
- CityAbbr2 = GetString((U16) TimeZoneData[city_chosen2].CityAbbr);
- diff1 = TimeZoneData[city_chosen1].CityTimeZone - TimeZoneData[home_city_sublcd].CityTimeZone;
- diff2 = TimeZoneData[city_chosen2].CityTimeZone - TimeZoneData[home_city_sublcd].CityTimeZone;
- ShowCategory303Screen((U8*) CityAbbr1, (U8*) CityAbbr2, diff1, diff2, NULL);
- }
- else if (TimeZoneData[city_chosen1].CityAbbr != STR_WCLOCK_CITY_ABBRE_NONE)
- {
- CityAbbr1 = GetString((U16) TimeZoneData[city_chosen1].CityAbbr);
- time_difference = TimeZoneData[city_chosen1].CityTimeZone - TimeZoneData[home_city_sublcd].CityTimeZone;
- ShowCategory312Screen((U8*) CityAbbr1, time_difference, NULL);
- }
- else if (TimeZoneData[city_chosen2].CityAbbr != STR_WCLOCK_CITY_ABBRE_NONE)
- {
- CityAbbr2 = GetString((U16) TimeZoneData[city_chosen2].CityAbbr);
- time_difference = TimeZoneData[city_chosen2].CityTimeZone - TimeZoneData[home_city_sublcd].CityTimeZone;
- ShowCategory312Screen((U8*) CityAbbr2, time_difference, NULL);
- }
- else if ((TimeZoneData[city_chosen1].CityAbbr == STR_WCLOCK_CITY_ABBRE_NONE) &&
- (TimeZoneData[city_chosen2].CityAbbr == STR_WCLOCK_CITY_ABBRE_NONE))
- {
- city_chosen1 = home_city_sublcd;
- CityAbbr1 = GetString((U16) TimeZoneData[city_chosen1].CityAbbr);
- time_difference = TimeZoneData[city_chosen1].CityTimeZone - TimeZoneData[home_city_sublcd].CityTimeZone;
- ShowCategory312Screen((U8*) CityAbbr1, time_difference, NULL);
- }
- }
- #endif /* __MMI_SUBLCD_SHOW_ANALOG_CLOCK__ */
- #ifdef __MMI_SUBLCD_CAMERA__
- if (IsClamClose() && FALSE == isInCall())
- {
- SetKeyHandler(mmi_sublcd_camera_entry_option_screen, CAMERA_SHORTCUT_KEY, KEY_EVENT_DOWN);
- }
- #endif
- SetSubLCDExitHandler(ExitSubLCDIdleScr);
- }
- /*****************************************************************************
- * FUNCTION
- * SubLCDIdleScreen
- * DESCRIPTION
- * Displays the idle screen of sub-LCD
- * PARAMETERS
- * funcptr [?]
- * RETURNS
- * void
- *****************************************************************************/
- U8 SubLCDIdleScreen(void *funcptr)
- {
- #ifdef __MMI_SUBLCD__
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* MMI_TRACE( (MMI_TRACE_G1_FRM, MMI_FRM_INFO_SUBHIST_SUBLCD_IDLE_SCRN_HDLR)); */
- PRINT_INFORMATION(("SubLCDIdleScreen"));
- if (g_pwr_context.PrevScreenIndicator == ENTER_PIN_SCR)
- {
- EntryIdleAppSubLcdWithErrorMsg((PU8) GetString(STR_SUBLCD_ENTER_PIN_MSG), 0, NULL);
- }
- else if ((g_pwr_context.PrevScreenIndicator == ENTER_PUK_SCR) ||
- (g_pwr_context.PrevScreenIndicator == ENTER_CONFIRM_PIN) ||
- (g_pwr_context.PrevScreenIndicator == ENTER_NEW_PIN))
- {
- EntryIdleAppSubLcdWithErrorMsg((PU8) GetString(STR_SUBLCD_ENTER_PUK_MSG), 0, NULL);
- }
- else if (g_pwr_context.PrevScreenIndicator == ENTER_PHONELOCK)
- {
- EntryIdleAppSubLcdWithErrorMsg((PU8) GetString(STR_SUBLCD_ENTER_PHONELOCK_MSG), 0, NULL);
- }
- else if (g_pwr_context.PrevScreenIndicator == ENTER_SIM_INSERTION)
- {
- EntryIdleAppSubLcdWithErrorMsg((PU8) GetString(STR_SUBLCD_SIM_INSERTION_MSG), 0, NULL);
- }
- else if (g_pwr_context.PrevScreenIndicator == ENTER_SIM_BLOCK)
- {
- EntryIdleAppSubLcdWithErrorMsg((PU8) GetString(STR_SUBLCD_SIM_BLOCK_MSG), 0, NULL);
- }
- else if (g_pwr_context.PrevScreenIndicator == ENTER_IDLE_SCR)
- {
- /* City names and time difference need to be added here */
- ShowIdleAppSubLcd();
- }
- else
- {
- ExecSubLCDCurrExitHandler();
- DinitSubLCDHistory();
- ShowCategory302Screen(NULL);
- SetSubLCDExitHandler(ExitSubLCDIdleScr);
- }
- #endif /* __MMI_SUBLCD__ */
- return 0;
- }
- /*****************************************************************************
- * FUNCTION
- * ExitSubLCDIdleScr
- * DESCRIPTION
- * Exit sublcd idle screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitSubLCDIdleScr(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- SubLCDHistoryNode SubLCDHistory;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_idle_context.IsSubLcdOnIdleScreen = SUBLCD_NOT_ON_IDLE;
- SubLCDHistory.entryFuncPtr = ShowIdleAppSubLcd;
- AddSubLCDHistory(&SubLCDHistory);
- }
- /*****************************************************************************
- * FUNCTION
- * IdleHandleKeypadLockProcess
- * DESCRIPTION
- * This fn handle the press of star key , when LSK is pressed first
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void IdleHandleKeypadLockProcess(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- StopTimer(KEYPAD_LOCK_TIMER);
- g_idle_context.RskPressedFromIdleApp = 0;
- #ifdef __MMI_KEYPAD_LOCK_PATTERN_2__
- g_idle_context.ToMainMenuScrFromIdleApp = 0;
- #endif
- }
- /*****************************************************************************
- * FUNCTION
- * IdleHandlePoundKeyForKeypadLock
- * DESCRIPTION
- * This fn handle the press of star key , when LSK is pressed first
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void IdleHandlePoundKeyForKeypadLock(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- #if defined(__MMI_KEYPAD_LOCK_PATTERN_1__) || defined(__MMI_KEYPAD_LOCK_PATTERN_3__) || defined(__MMI_KEYPAD_LOCK_PATTERN_4__) //KP Jerry add "__MMI_KEYPAD_LOCK_PATTERN_3__" on 2007-3-27
- if (g_idle_context.RskPressedFromIdleApp == 0)
- {
- return;
- }
- g_idle_context.RskPressedFromIdleApp = 0;
- #endif /* __MMI_KEYPAD_LOCK_PATTERN_1__ || __MMI_KEYPAD_LOCK_PATTERN_3__ || __MMI_KEYPAD_LOCK_PATTERN_4__ */ //KP Jerry add "__MMI_KEYPAD_LOCK_PATTERN_3__" on 2007-3-27
- #ifdef __MMI_KEYPAD_LOCK_PATTERN_2__
- if (g_idle_context.ToMainMenuScrFromIdleApp == 0)
- {
- return;
- }
- g_idle_context.ToMainMenuScrFromIdleApp = 0;
- #endif /* __MMI_KEYPAD_LOCK_PATTERN_2__ */
- StopTimer(KEYPAD_LOCK_TIMER);
- g_keylock_context.gKeyPadLockFlag = 1;
- /* Lisen 02182005 */
- #ifndef __MMI_KEYPADLOCK_WITH_KEYTONE__
- mmi_frm_kbd_set_tone_state(MMI_KEY_TONE_DISABLED);
- #endif
- #ifdef __MMI_TOUCH_SCREEN__
- ChangeStatusIconImage(STATUS_ICON_KEYPAD_LOCK, IMG_SI_KEYPAD_LOCK);
- UpdateStatusIcons(); /* 101805 ChangeStatusIconImage Calvin: ChangeStatusIconImage will not call UpdateStatusIcon */
- #else /* __MMI_TOUCH_SCREEN__ */
- IdleSetStatusIcon(STATUS_ICON_KEYPAD_LOCK);
- #endif /* __MMI_TOUCH_SCREEN__ */
- DisplayIdleScreen();
- }
- /* Cylen, for __MANUAL_MODE_NW_SEL__ */
- /*****************************************************************************
- * FUNCTION
- * IdleSetLRKey
- * DESCRIPTION
- * Change Idlescreen's L or RSK according to network status
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void IdleSetLRKey(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_keylock_context.gKeyPadLockFlag)
- {
- #if defined(__MMI_TOUCH_SCREEN__) && (!defined(__MMI_TOUCH_SCREEN_WITH_NUMERIC_KEY__) || defined(__MMI_SLIDE__)) //KP Jerry add "!defined(__MMI_TOUCH_SCREEN_WITH_NUMERIC_KEY__)" on 2007-3-26
- #ifdef __MMI_KEYPAD_LOCK_PROMPT_TEXT__
- #if defined(__MMI_KEYPAD_LOCK_PATTERN_1__) || defined(__MMI_KEYPAD_LOCK_PATTERN_3__) || defined(__MMI_KEYPAD_LOCK_PATTERN_4__) //KP Jerry add "__MMI_KEYPAD_LOCK_PATTERN_3__" on 2007-3-27 /* Robin 1223 */
- SetRightSoftkeyFunction(EntryScrKeyPadLockOnPessingAnyKey, KEY_EVENT_DOWN);
- #endif
- #ifdef __MMI_KEYPAD_LOCK_PATTERN_2__ /* Robin 1223 */
- SetLeftSoftkeyFunction(EntryScrKeyPadLockOnPessingAnyKey, KEY_EVENT_DOWN);
- #endif
- #endif /* __MMI_KEYPAD_LOCK_PROMPT_TEXT__ */
- #endif /* __MMI_TOUCH_SCREEN__ */
- }
- else /* keypad unlocked */
- {
- #if defined (__MANUAL_MODE_NW_SEL__) && !defined (__MMI_TOUCH_IDLESCREEN_SHORTCUTS__)
- #ifdef __MMI_WLAN_FEATURES__
- if (g_pwr_context.CurrentServiceType == LIMITED_SERVICE && mmi_bootup_get_plmn_selection_mode() == MANUAL_MODE && mmi_netset_get_active_preferred_mode() != P_WLAN_ONLY)