SecuritySetup.c
资源名称:mmi.rar [点击查看]
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:181k
源码类别:
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:
- * ---------
- * SecuritySetup.c
- *
- * Project:
- * --------
- * MAUI
- *
- * Description:
- * ------------
- * Security Setup related functions
- *
- * 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!
- *
- *------------------------------------------------------------------------------
- * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
- *==============================================================================
- *******************************************************************************/
- #include "StdC.h"
- #include "L4Dr1.h"
- #include "L4Dr.h"
- #include "MainMenuDef.h"
- #include "wgui_categories.h"
- #include "wgui_categories_inputs.h"
- #include "CallsDefs.h"
- #include "settingstructs.h"
- #include "settinggprots.h"
- #include "SimDetectionGprot.h"
- #include "ProtocolEvents.h"
- #include "CallFixedDial.h"
- #include "BarredDialList.h"
- #include "SettingProfile.h"
- #include "PhoneBookDef.h"
- #include "NVRAMType.h"
- #include "NVRAMProt.h"
- #include "NVRAMEnum.h"
- #include "CommonScreens.h"
- #include "MMI_features.h"
- #include "CallSetUpEnum.h"
- #include "SettingProt.h"
- #include "CallmanagementIdDef.h"
- #include "NetworkSetupGProt.h"
- #include "OrganizerGProt.h"
- #include "IdleAppDef.h"
- #include "SimDetectionGexdcl.h"
- #include "SettingsGexdcl.h"
- #include "SettingDefs.h"
- #include "SettingsGdcl.h"
- #include "PhoneBookGprot.h"
- /* micha0915 */
- #include "CallManagementGProt.h"
- #include "SecuritySetup.h"
- #include "DebugInitDef.h"
- #ifdef __MMI_TOUCH_SCREEN__
- #include "Wgui_touch_screen.h"
- #endif
- #ifdef __MMI_SML_MENU__
- #include "PersonalizationProt.h"
- #endif
- #ifdef MMI_ON_HARDWARE_P
- extern kal_bool smu_query_phone_lock_enabled(void);
- #endif
- extern void mmi_frm_add_history_before_cm_marker(U16 scrn_id, FuncPtr func_ptr);
- SecuritySetupContext gSecuritySetupContext;
- /*****************************************************************************
- * FUNCTION
- * InitSecuritySetupApp
- * DESCRIPTION
- * Initialize Security
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void InitSecuritySetupApp(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetHiliteHandler(MENU9101_SECURITY, HighlightSecurity);
- SetHiliteHandler(MENU9169_SIM_LOCK, HighlightSIMLock);
- SetHiliteHandler(MENU9165_PHONE_LOCK, HighlightPhoneLock);
- #ifdef __MMI_AUTO_KEYPAD_LOCK__
- SetHiliteHandler(MENU9178_AKPL_TIME, HighlightAutoKeyPadLock);
- #endif
- SetHiliteHandler(MENU9167_FIXED_DIAL, HighlightFixedDial);
- SetHiliteHandler(MENU_SETTING_FDL_MODE, HighlightFdlMode);
- SetHiliteHandler(MENU_SETTING_FDL_LIST, HighlightFdlList);
- SetHiliteHandler(MENU9168_BARRED_DAIL, HighlightBarredDial);
- SetHiliteHandler(MENU_SETTING_BDL_MODE, HighlightBdlMode);
- SetHiliteHandler(MENU_SETTING_BDL_LIST, HighlightBdlList);
- SetHiliteHandler(MENU9170_CHANGE_PASSWORD, HighlightChangePassword);
- SetHiliteHandler(MENU9174_CP_PIN1, HighlightPin1Passwd);
- SetHiliteHandler(MENU9175_CP_PIN2, HighlightPin2Passwd);
- SetHiliteHandler(MENU9173_CP_PHONE_LOCK, HighlightPhonePasswd);
- SetHintHandler(MENU9169_SIM_LOCK, HintSimLock);
- SetHintHandler(MENU9165_PHONE_LOCK, HintPhoneLock);
- #ifdef __MMI_AUTO_KEYPAD_LOCK__
- SetHintHandler(MENU9178_AKPL_TIME, HintAutoKeypadLock);
- #endif
- SetHintHandler(MENU9167_FIXED_DIAL, HintFdl);
- SetHintHandler(MENU9168_BARRED_DAIL, HintBdl);
- SetHintHandler(MENU_SETTING_FDL_MODE, HintFdlMode);
- SetHintHandler(MENU_SETTING_BDL_MODE, HintBdlMode);
- /*
- * gSecuritySetupContext.FdlStatus = 0;
- * gSecuritySetupContext.BdlStatus = 0;
- * gSecuritySetupContext.SimLockStatus = 0;
- * gSecuritySetupContext.PhoneLockStatus = 0;
- * gSecuritySetupContext.AutoKeyPadLockTime= 0;
- * gSecuritySetupContext.CurrentPassword= 0;
- * gSecuritySetupContext.PINBlocked = 0;
- * gSecuritySetupContext.CHV1Count = 0;
- * gSecuritySetupContext.CHV2Count = 0;
- * gSecuritySetupContext.UBCHV1Count = 0;
- * gSecuritySetupContext.UBCHV2Count = 0;
- */
- gSecuritySetupContext.SMULockSuccessCallBack = NULL;
- gSecuritySetupContext.SMULockFailCallBack = NULL;
- gSecuritySetupContext.VerifyPassSuccessCallBack = NULL;
- /* diamond, 2006/02/27 Move this function call to another timing */
- /* GetPhoneLock(); */
- #ifdef __MMI_SML_MENU__
- mmi_sml_init();
- #endif
- SetProtocolEventHandler(mmi_secset_at_cmd_update_chv, MSG_ID_MMI_SMU_VERIFY_PIN_RESULT_IND);
- }
- /*****************************************************************************
- * FUNCTION
- * HighlightSecurity
- * DESCRIPTION
- * HighLight Security-Setup
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void HighlightSecurity(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);
- /* 3 Register function for left soft key */
- SetLeftSoftkeyFunction(EntrySECSETMain, KEY_EVENT_UP);
- SetKeyHandler(EntrySECSETMain, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- /* 4 Register function for right soft key */
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * HighlightSIMLock
- * DESCRIPTION
- * Highlight fn for SimLock Option
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void HighlightSIMLock(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (gSecuritySetupContext.SimLockStatus != CHV_DISABLED)
- {
- ChangeLeftSoftkey(STR_GLOBAL_OFF, 0);
- }
- else
- {
- ChangeLeftSoftkey(STR_GLOBAL_ON, 0);
- }
- ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
- SetLeftSoftkeyFunction(EntrySECSETSIMLockPIN1, KEY_EVENT_UP);
- /* micha0529 */
- SetKeyHandler(EntrySECSETSIMLockPIN1, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * HighlightPhoneLock
- * DESCRIPTION
- * highlight phone lock option in security setup
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void HighlightPhoneLock(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (gSecuritySetupContext.PhoneLockStatus)
- {
- ChangeLeftSoftkey(STR_GLOBAL_OFF, 0);
- }
- else
- {
- ChangeLeftSoftkey(STR_GLOBAL_ON, 0);
- }
- ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
- SetLeftSoftkeyFunction(EntrySECSETPhoneLock, KEY_EVENT_UP);
- /* micha0529 */
- SetKeyHandler(EntrySECSETPhoneLock, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * HighlightAutoKeyPadLock
- * DESCRIPTION
- * Highlight handler for Autokeypadlock.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *
- * Author : Vanita Jain(?)
- *****************************************************************************/
- #ifdef __MMI_AUTO_KEYPAD_LOCK__
- void HighlightAutoKeyPadLock(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);
- /* 3 Register function for left soft key */
- SetLeftSoftkeyFunction(EntrySECSETAKPLTime, KEY_EVENT_UP);
- /* micha0529 */
- SetKeyHandler(EntrySECSETAKPLTime, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- /* 4 Register function for right soft key */
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- #endif /* __MMI_AUTO_KEYPAD_LOCK__ */
- /*****************************************************************************
- * FUNCTION
- * HighlightFixedDial
- * DESCRIPTION
- * Highlight handler for fixed dial.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void HighlightFixedDial(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 */
- SetLeftSoftkeyFunction(SECSETGetFdlStatusReq, KEY_EVENT_UP);
- SetKeyHandler(SECSETGetFdlStatusReq, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- /* 4 Register function for right soft key */
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * HighlightFdlMode
- * DESCRIPTION
- * Highlight handler for FDL mode
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void HighlightFdlMode(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (gSecuritySetupContext.FdlStatus)
- {
- ChangeLeftSoftkey(STR_GLOBAL_OFF, 0);
- }
- else
- {
- ChangeLeftSoftkey(STR_GLOBAL_ON, 0);
- }
- ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
- SetLeftSoftkeyFunction(mmi_secset_set_fixed_dial_mode, KEY_EVENT_UP);
- SetKeyHandler(mmi_secset_set_fixed_dial_mode, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * HighlightFdlList
- * DESCRIPTION
- * Highlight handler for FDL list
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void HighlightFdlList(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
- ChangeLeftSoftkey(STR_GLOBAL_OK, 0);
- SetLeftSoftkeyFunction(EntryFdlList, KEY_EVENT_UP);
- SetKeyHandler(EntryFdlList, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * HighlightBarredDial
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void HighlightBarredDial(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);
- /* 3 Register function for left soft key */
- SetLeftSoftkeyFunction(SECSETGetBdlStatusReq, KEY_EVENT_UP);
- SetKeyHandler(SECSETGetBdlStatusReq, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- /* 4 Register function for right soft key */
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * HighlightBdlMode
- * DESCRIPTION
- * Highlight handler for BDL mode.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void HighlightBdlMode(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (gSecuritySetupContext.BdlStatus)
- {
- ChangeLeftSoftkey(STR_GLOBAL_OFF, 0);
- }
- else
- {
- ChangeLeftSoftkey(STR_GLOBAL_ON, 0);
- }
- ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
- SetLeftSoftkeyFunction(mmi_secset_set_barred_dial_mode, KEY_EVENT_UP);
- SetKeyHandler(mmi_secset_set_barred_dial_mode, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * HighlightBdlList
- * DESCRIPTION
- * Highlight handler for BDL list
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void HighlightBdlList(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* 2 Change right soft key icon and label */
- ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
- ChangeLeftSoftkey(STR_GLOBAL_OK, 0);
- SetLeftSoftkeyFunction(EntryBdlList, KEY_EVENT_UP);
- SetKeyHandler(EntryBdlList, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- /* 4 Register function for right soft key */
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * HighlightChangePassword
- * DESCRIPTION
- * Highlight handler for Change password option.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void HighlightChangePassword(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);
- /* 3 Register function for left soft key */
- SetLeftSoftkeyFunction(EntrySECSETChangePassword, KEY_EVENT_UP);
- SetKeyHandler(EntrySECSETChangePassword, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- /* 4 Register function for right soft key */
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * HighlightPin1Passwd
- * DESCRIPTION
- * Highlight handler for Change Pin1 option in change pwd screen.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void HighlightPin1Passwd(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gSecuritySetupContext.CurrentPassword = 0;
- ChangeLeftSoftkey(STR_GLOBAL_OK, 0);
- ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
- /* micha0529 */
- SetKeyHandler(SECSETGetPIN1ForChangeReq, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetLeftSoftkeyFunction(SECSETGetPIN1ForChangeReq, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * HighlightPin2Passwd
- * DESCRIPTION
- * Highlight handler for Change Pin2 option in change pwd screen.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void HighlightPin2Passwd(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gSecuritySetupContext.CurrentPassword = 1;
- ChangeLeftSoftkey(STR_GLOBAL_OK, 0);
- ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
- /* micha0529 */
- SetKeyHandler(SECSETGetPIN2ForChangeReq, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetLeftSoftkeyFunction(SECSETGetPIN2ForChangeReq, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * HighlightPhonePasswd
- * DESCRIPTION
- * Highlight handler for Change phone lock option in change pwd screen.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void HighlightPhonePasswd(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gSecuritySetupContext.CurrentPassword = 2;
- ChangeLeftSoftkey(STR_GLOBAL_OK, 0);
- ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
- /* micha0529 */
- SetKeyHandler(EntrySECSETChangePWOldPWD, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetLeftSoftkeyFunction(EntrySECSETChangePWOldPWD, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * HintSimLock
- * DESCRIPTION
- * Hint Hnadler for Sim Lock.
- * PARAMETERS
- * index [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void HintSimLock(U16 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- memset((S8*) hintData[(index)], 0, MAX_SUB_MENU_SIZE);
- if (gSecuritySetupContext.SimLockStatus == CHV_DISABLED)
- {
- pfnUnicodeStrncpy((PS8) hintData[index], (PS8) GetString(STR_GLOBAL_OFF), MAX_SUBMENU_CHARACTERS);
- }
- else
- {
- pfnUnicodeStrncpy((PS8) hintData[index], (PS8) GetString(STR_GLOBAL_ON), MAX_SUBMENU_CHARACTERS);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * HintPhoneLock
- * DESCRIPTION
- * Hint handler for Phone lock.
- * PARAMETERS
- * index [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void HintPhoneLock(U16 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- memset((S8*) hintData[(index)], 0, MAX_SUB_MENU_SIZE);
- if (GetPhoneLock())
- {
- pfnUnicodeStrncpy((PS8) hintData[index], (PS8) GetString(STR_GLOBAL_ON), MAX_SUBMENU_CHARACTERS);
- }
- else
- {
- pfnUnicodeStrncpy((PS8) hintData[index], (PS8) GetString(STR_GLOBAL_OFF), MAX_SUBMENU_CHARACTERS);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * HintAutoKeypadLock
- * DESCRIPTION
- * Hint handler for AutoKeypad lock.
- * PARAMETERS
- * index [IN]
- * RETURNS
- * void
- *****************************************************************************/
- #ifdef __MMI_AUTO_KEYPAD_LOCK__
- void HintAutoKeypadLock(U16 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- memset((S8*) hintData[(index)], 0, MAX_SUB_MENU_SIZE);
- if (0 != GetAutoKeypadLockTime())
- {
- pfnUnicodeStrncpy((PS8) hintData[index], (PS8) GetString(STR_GLOBAL_ON), MAX_SUBMENU_CHARACTERS);
- }
- else
- {
- pfnUnicodeStrncpy((PS8) hintData[index], (PS8) GetString(STR_GLOBAL_OFF), MAX_SUBMENU_CHARACTERS);
- }
- }
- #endif /* __MMI_AUTO_KEYPAD_LOCK__ */
- /*****************************************************************************
- * FUNCTION
- * HintFdl
- * DESCRIPTION
- * Hint handler for FDL.
- * PARAMETERS
- * index [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void HintFdl(U16 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- memset((S8*) hintData[(index)], 0, MAX_SUB_MENU_SIZE);
- if (gSecuritySetupContext.FdlStatus)
- {
- pfnUnicodeStrncpy((PS8) hintData[index], (PS8) GetString(STR_GLOBAL_ON), MAX_SUBMENU_CHARACTERS);
- }
- else
- {
- pfnUnicodeStrncpy((PS8) hintData[index], (PS8) GetString(STR_GLOBAL_OFF), MAX_SUBMENU_CHARACTERS);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * HintBdl
- * DESCRIPTION
- * Hint handler for BDL
- * PARAMETERS
- * index [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void HintBdl(U16 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- memset((S8*) hintData[(index)], 0, MAX_SUB_MENU_SIZE);
- if (gSecuritySetupContext.BdlStatus)
- {
- pfnUnicodeStrncpy((PS8) hintData[index], (PS8) GetString(STR_GLOBAL_ON), MAX_SUBMENU_CHARACTERS);
- }
- else
- {
- pfnUnicodeStrncpy((PS8) hintData[index], (PS8) GetString(STR_GLOBAL_OFF), MAX_SUBMENU_CHARACTERS);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * HintFdlMode
- * DESCRIPTION
- * Hint handler for FDL mode.
- * PARAMETERS
- * index [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void HintFdlMode(U16 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- memset((S8*) hintData[(index)], 0, MAX_SUB_MENU_SIZE);
- if (gSecuritySetupContext.FdlStatus)
- {
- pfnUnicodeStrncpy((PS8) hintData[index], (PS8) GetString(STR_GLOBAL_ON), MAX_SUBMENU_CHARACTERS);
- }
- else
- {
- pfnUnicodeStrncpy((PS8) hintData[index], (PS8) GetString(STR_GLOBAL_OFF), MAX_SUBMENU_CHARACTERS);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * HintBdlMode
- * DESCRIPTION
- * Hint handler for BDL Mode.
- * PARAMETERS
- * index [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void HintBdlMode(U16 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- memset((S8*) hintData[(index)], 0, MAX_SUB_MENU_SIZE);
- if (gSecuritySetupContext.BdlStatus)
- {
- pfnUnicodeStrncpy((PS8) hintData[index], (PS8) GetString(STR_GLOBAL_ON), MAX_SUBMENU_CHARACTERS);
- }
- else
- {
- pfnUnicodeStrncpy((PS8) hintData[index], (PS8) GetString(STR_GLOBAL_OFF), MAX_SUBMENU_CHARACTERS);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * EntrySECSETMain
- * DESCRIPTION
- * enter security-setup menu screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntrySECSETMain(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 nStrItemList[MAX_SUB_MENUS]; /* Stores the strings id of submenus returned */
- U16 nNumofItem; /* Stores no of children in the submenu */
- //micha1229
- // U16 nDispAttribute; /* Stores display attribue */
- U8 *guiBuffer; /* Buffer holding history data */
- U8 *SecurityType[MAX_SUB_MENUS];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_SECSET_MAIN, NULL, EntrySECSETMain, NULL);
- /* 2 Get current screen to gui buffer for history purposes */
- guiBuffer = GetCurrGuiBuffer(SCR_ID_SECSET_MAIN);
- /* 3. Retrieve no of child of menu item to be displayed */
- nNumofItem = GetNumOfChild_Ext(MENU9101_SECURITY);
- /* 4. Get attribute of menu to be displayed */
- /* nDispAttribute = GetDispAttributeOfItem(MENU9101_SECURITY); */
- /* 5. Retrieve string ids in sequence of given menu item to be displayed */
- GetSequenceStringIds_Ext(MENU9101_SECURITY, nStrItemList);
- /* 6 Set current parent id */
- SetParentHandler(MENU9101_SECURITY);
- /* 7 Register highlight handler to be called in menu screen */
- RegisterHighlightHandler(ExecuteCurrHiliteHandler);
- /* 8 Construct the Hints List */
- ConstructHintsList(MENU9101_SECURITY, SecurityType);
- /* 8 Display Category52 Screen */
- ShowCategory52Screen(
- STR_SCR9002_SECURITY_CAPTION,
- MAIN_MENU_TITLE_SETTINGS_ICON,
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- nNumofItem,
- nStrItemList,
- (PU16) gIndexIconsImageList,
- SecurityType,
- 0,
- 0,
- guiBuffer);
- /* 9.Register function with right softkey */
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * EntrySECSETPhoneLock
- * DESCRIPTION
- * entry sceen to enter phonelock
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntrySECSETPhoneLock(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer; /* Buffer holding history data */
- U8 *inputBuffer;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_SECSET_PHONE_LOCK, ExitSECSETPhoneLock, NULL, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_SECSET_PHONE_LOCK);
- inputBuffer = GetCurrInputBuffer(SCR_ID_SECSET_PHONE_LOCK);
- if (inputBuffer == NULL)
- {
- memset(gSecuritySetupContext.Password, 0, (MAX_SIM_SETTING_PASSWD_LEN + 1) * ENCODING_LENGTH);
- }
- else
- {
- pfnUnicodeStrcpy((S8*) gSecuritySetupContext.Password, (S8*) inputBuffer);
- }
- RegisterInputBoxValidationFunction(RstrSettingPasswdScrSoftKeyFunc);
- /* START VIJAY PMT 20060103 */
- #if defined UI_SMALL_PIN_EDITOR_SCREEN
- enable_resized_small_screen();
- #endif
- /* END VIJAY PMT 20060103 */
- ShowCategory111Screen(
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- STR_RESTORE_PHONE,
- INPUT_TYPE_NUMERIC_PASSWORD,
- gSecuritySetupContext.Password,
- (MAX_SIM_SETTING_PASSWD_LEN + 1),
- NULL,
- guiBuffer);
- SetCategory111RightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(SECSETSetPhoneLockReq, KEY_POUND, KEY_EVENT_UP);
- SetLeftSoftkeyFunction(SECSETSetPhoneLockReq, KEY_EVENT_UP);
- /* micha0606 */
- gSecuritySetupContext.PasswdLenCheckCallBack = SECSETSetPhoneLockReq;
- if (pfnUnicodeStrlen((S8*) gSecuritySetupContext.Password) < MIN_PASSWORD_LENGTH)
- {
- ChangeLeftSoftkey(0, 0);
- ClearKeyHandler(KEY_POUND, KEY_EVENT_UP);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * ExitSECSETPhoneLock
- * DESCRIPTION
- * Exit screen for enter phone lock screen.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitSECSETPhoneLock(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- history Scr; /* * Variable to hold the history data */
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- Scr.scrnID = SCR_ID_SECSET_PHONE_LOCK;
- Scr.entryFuncPtr = EntrySECSETPhoneLock;
- pfnUnicodeStrcpy((S8*) Scr.inputBuffer, (S8*) gSecuritySetupContext.Password);
- GetCategoryHistory(Scr.guiBuffer);
- AddHistory(Scr);
- }
- /*****************************************************************************
- * FUNCTION
- * EntrySECSETAKPLTime
- * DESCRIPTION
- * Entry screen for Autokeypadlock Time.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- #ifdef __MMI_AUTO_KEYPAD_LOCK__
- void EntrySECSETAKPLTime(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 nStrItemList[MAX_SUB_MENUS]; /* Stores the strings id of submenus returned */
- U16 nNumofItem; /* Stores no of children in the submenu */
- //micha1229
- // U16 nDispAttribute; /* Stores display attribue */
- U8 *guiBuffer; /* Buffer holding history data */
- U8 data1 = 0;
- S16 error = 0, error1 = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_SECSET_AKPL_TIME, NULL, EntrySECSETAKPLTime, NULL);
- /* 2 Get current screen to gui buffer for history purposes */
- guiBuffer = GetCurrGuiBuffer(SCR_ID_SECSET_AKPL_TIME);
- /* 3. Retrieve no of child of menu item to be displayed */
- nNumofItem = GetNumOfChild(MENU9178_AKPL_TIME);
- /* 4. Get attribute of menu to be displayed */
- /* nDispAttribute = GetDispAttributeOfItem(MENU9178_AKPL_TIME); */
- /* 5. Retrieve string ids in sequence of given menu item to be displayed */
- GetSequenceStringIds(MENU9178_AKPL_TIME, nStrItemList);
- /* 6 Set current parent id */
- SetParentHandler(MENU9178_AKPL_TIME);
- /* 7 Register highlight handler to be called in menu screen */
- RegisterHighlightHandler(AutoKeyPadLockTimeHandler);
- ReadValue(NVRAM_SETTING_AUTOKEYPADLOCK_TIME, &data1, DS_BYTE, &error1);
- if (error != NVRAM_READ_SUCCESS)
- {
- }
- if (data1 == 0xff)
- {
- data1 = 0;
- WriteValue(NVRAM_SETTING_AUTOKEYPADLOCK_TIME, &data1, DS_BYTE, &error1);
- }
- gSecuritySetupContext.AutoKeyPadLockTime = data1;
- /* 8 Display Category11 Screen */
- ShowCategory11Screen(
- STR_MENU9166_AUTO_KEYPAD_LOCK,
- MAIN_MENU_TITLE_SETTINGS_ICON,
- STR_GLOBAL_OK,
- 0,
- STR_GLOBAL_BACK,
- 0,
- nNumofItem,
- nStrItemList,
- (U16) data1,
- guiBuffer);
- /* 9.Register function with right softkey */
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetLeftSoftkeyFunction(SendAKPLTimeMessageAndShowScreen, KEY_EVENT_UP);
- SetKeyHandler(0, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- #endif /* __MMI_AUTO_KEYPAD_LOCK__ */
- /*****************************************************************************
- * FUNCTION
- * AutoKeyPadLockTimeHandler
- * DESCRIPTION
- * Handler function when user select any of the given
- * options in autokeypad lock time screen.
- * PARAMETERS
- * index [IN]
- * RETURNS
- * void
- *
- * Author : Vanita Jain(?)
- *****************************************************************************/
- void AutoKeyPadLockTimeHandler(S32 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gCurrentOnOff = (U8) index;
- }
- /*****************************************************************************
- * FUNCTION
- * SendAKPLTimeMessageAndShowScreen
- * DESCRIPTION
- * Set hint handler as On or Off for autokeypad lock.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void SendAKPLTimeMessageAndShowScreen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 data;
- S16 error;
- U16 index;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- index = GetCurrHiliteID();
- data = gCurrentOnOff;
- memset((S8*) hintData[(index)], 0, MAX_SUB_MENU_SIZE);
- if (data)
- {
- pfnUnicodeStrncpy((PS8) hintData[index], (PS8) GetString(STR_GLOBAL_ON), MAX_SUBMENU_CHARACTERS);
- Category52ChangeItemDescription(2, hintData[index]);
- }
- else
- {
- pfnUnicodeStrncpy((PS8) hintData[index], (PS8) GetString(STR_GLOBAL_OFF), MAX_SUBMENU_CHARACTERS);
- Category52ChangeItemDescription(2, hintData[index]);
- }
- RedrawCategoryFunction();
- if (gSecuritySetupContext.AutoKeyPadLockTime != gCurrentOnOff)
- {
- WriteValue(NVRAM_SETTING_AUTOKEYPADLOCK_TIME, &data, DS_BYTE, &error);
- DisplayPopup((PU8) GetString(STR_GLOBAL_DONE), IMG_GLOBAL_ACTIVATED, 1, ST_NOTIFYDURATION, 0);
- DeleteNHistory(1);
- }
- else
- {
- GoBackHistory();
- }
- }
- /*****************************************************************************
- * FUNCTION
- * SECSETGetPIN2StatusReq
- * DESCRIPTION
- * Send request to L4 to get the status of PIN2.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *
- * Author : Vanita Jain(?)
- *****************************************************************************/
- void SECSETGetPIN2StatusReq(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MYQUEUE msgStruct;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ClearInputEventHandler(MMI_DEVICE_ALL);
- SetProtocolEventHandler(SECSETGetPIN2StatusRsp, PRT_MMI_SMU_CHECK_PIN_STATUS_RSP);
- msgStruct.oslSrcId = MOD_MMI;
- msgStruct.oslDestId = MOD_L4C;
- /* micha1229 */
- msgStruct.oslMsgId = PRT_MMI_SMU_CHECK_PIN_STATUS_REQ;
- msgStruct.oslSapId = INVALID_SAP;
- msgStruct.oslDataPtr = NULL;
- msgStruct.oslPeerBuffPtr = NULL;
- OslMsgSendExtQueue(&msgStruct);
- }
- /*****************************************************************************
- * FUNCTION
- * SECSETGetPIN2StatusRsp
- * DESCRIPTION
- * Response of request to get the status of PIN2.
- * PARAMETERS
- * info [?]
- * RETURNS
- * void
- *
- * Author : Vanita Jain(?)
- *****************************************************************************/
- void SECSETGetPIN2StatusRsp(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- SMUSTATUSRSP *resp;
- historyNode *History;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- resp = (SMUSTATUSRSP*) (info);
- FillCountDownNumber(resp->chv_info);
- if (resp->chv_status.chv2_status == CHV_BLOCKED)
- {
- DisplayPopup((PU8) GetString(STR_SETTING_PIN2_BLK2), IMG_GLOBAL_ERROR, 0, ST_NOTIFYDURATION, ERROR_TONE);
- ExitSECSETPUK2();
- if (GetHistoryScrID(SCR_ID_SECSET_PUK2, &History) == ST_SUCCESS)
- {
- if (History->inputBuffer != NULL)
- {
- memset(History->inputBuffer, 0, ENCODING_LENGTH);
- }
- if (History->guiBuffer != NULL)
- {
- memset(History->guiBuffer, 0, 2);
- }
- }
- DeleteUptoScrID(SCR_ID_SECSET_PUK2);
- }
- else if (resp->chv_status.chv2_status == CHV_RETRY_ALLOW || resp->chv_status.chv2_status == CHV_VERIFIED)
- {
- EntrySECSETPIN2();
- }
- else if (resp->chv_status.chv2_status == CHV_INVALID_TYPE || resp->chv_status.chv2_status == CHV_DEAD || resp->chv_status.chv2_status == CHV_NOTINITED)
- {
- DisplayPopup(
- (PU8) GetString(STR_ID_PIN2_NOT_SUPPORT),
- IMG_GLOBAL_ERROR,
- 0,
- ST_NOTIFYDURATION,
- ERROR_TONE);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * SECSETGetPIN1StatusReq
- * DESCRIPTION
- * Send request to L4 to get the status of PIN1.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *
- * Author : Vanita Jain(?)
- *****************************************************************************/
- void SECSETGetPIN1StatusReq(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MYQUEUE msgStruct;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetProtocolEventHandler(SECSETGetPIN1StatusRsp, PRT_MMI_SMU_CHECK_PIN_STATUS_RSP);
- msgStruct.oslSrcId = MOD_MMI;
- msgStruct.oslDestId = MOD_L4C;
- /* micha1229 */
- msgStruct.oslMsgId = PRT_MMI_SMU_CHECK_PIN_STATUS_REQ;
- msgStruct.oslSapId = INVALID_SAP;
- msgStruct.oslDataPtr = NULL;
- msgStruct.oslPeerBuffPtr = NULL;
- OslMsgSendExtQueue(&msgStruct);
- }
- /*****************************************************************************
- * FUNCTION
- * SECSETGetPIN1StatusRsp
- * DESCRIPTION
- * Response of request to get the status of PIN1.
- * PARAMETERS
- * info [?]
- * RETURNS
- * void
- *
- * Author : Vanita Jain(?)
- *****************************************************************************/
- void SECSETGetPIN1StatusRsp(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- SMUSTATUSRSP *resp;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- resp = (SMUSTATUSRSP*) (info);
- FillCountDownNumber(resp->chv_info);
- gSecuritySetupContext.SimLockStatus = resp->chv_status.chv1_status;
- }
- /*****************************************************************************
- * FUNCTION
- * EntrySECSETPIN2
- * DESCRIPTION
- * Entry fn to enter PIN2 for FDL.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntrySECSETPIN2(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer; /* Buffer holding history data */
- U8 *inputBuffer;
- U8 PassCountdownDisp[MAX_PASS_COUNTDOWN_DISP];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_SECSET_PIN2, ExitSECSETPIN2, NULL, NULL);
- /* 2 Get current screen to gui buffer for history purposes */
- guiBuffer = GetCurrGuiBuffer(SCR_ID_SECSET_PIN2);
- inputBuffer = GetCurrInputBuffer(SCR_ID_SECSET_PIN2);
- if (inputBuffer == NULL)
- {
- memset(gSecuritySetupContext.Password, 0, (MAX_SIM_SETTING_PASSWD_LEN + 1) * ENCODING_LENGTH);
- }
- else
- {
- pfnUnicodeStrcpy((S8*) gSecuritySetupContext.Password, (S8*) inputBuffer);
- }
- RegisterInputBoxValidationFunction(RstrSettingPasswdScrSoftKeyFunc);
- FillCountDownString(MMI_SETTING_TYPE_CHV2, PassCountdownDisp);
- ShowCategory111Screen(
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- STR_SCR9027_PIN2_CAPTION,
- INPUT_TYPE_NUMERIC_PASSWORD,
- gSecuritySetupContext.Password,
- (MAX_SIM_SETTING_PASSWD_LEN + 1),
- PassCountdownDisp,
- guiBuffer);
- SetCategory111RightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(VerifyPin2, KEY_POUND, KEY_EVENT_UP);
- SetLeftSoftkeyFunction(VerifyPin2, KEY_EVENT_UP);
- /* micha0606 */
- gSecuritySetupContext.PasswdLenCheckCallBack = VerifyPin2;
- if (pfnUnicodeStrlen((S8*) gSecuritySetupContext.Password) < MIN_PASSWORD_LENGTH)
- {
- ChangeLeftSoftkey(0, 0);
- ClearKeyHandler(KEY_POUND, KEY_EVENT_UP);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * ExitSECSETPIN2
- * DESCRIPTION
- * Exit Fixed dial menu item
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitSECSETPIN2(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- history Scr; /* Variable to hold the history data */
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- Scr.scrnID = SCR_ID_SECSET_PIN2;
- Scr.entryFuncPtr = EntrySECSETPIN2;
- pfnUnicodeStrcpy((S8*) Scr.inputBuffer, (S8*) gSecuritySetupContext.Password);
- GetCategoryHistory(Scr.guiBuffer);
- AddHistory(Scr);
- }
- /*****************************************************************************
- * FUNCTION
- * VerifyPin2
- * DESCRIPTION
- * Verify Pin2.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void VerifyPin2(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 tempBuffer[(MAX_SIM_SETTING_PASSWD_LEN + 1)];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- memset(tempBuffer, 0, (MAX_SIM_SETTING_PASSWD_LEN + 1));
- SECSETVerifyPINReq(MMI_SETTING_TYPE_CHV2, gSecuritySetupContext.Password, tempBuffer, NULL);
- }
- /*****************************************************************************
- * FUNCTION
- * EntrySECSETFixDial
- * DESCRIPTION
- * Entry screen for FDL option screen.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntrySECSETFixDial(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 nStrItemList[MAX_SUB_MENUS]; /* Stores the strings id of submenus returned */
- U16 nNumofItem; /* Stores no of children in the submenu */
- //micha1229
- // U16 nDispAttribute; /* Stores display attribue */
- U8 *guiBuffer; /* Buffer holding history data */
- U8 *FdlType[MAX_SUB_MENUS];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_SECSET_FIX_DIAL, NULL, EntrySECSETFixDial, NULL);
- /* 2 Get current screen to gui buffer for history purposes */
- guiBuffer = GetCurrGuiBuffer(SCR_ID_SECSET_FIX_DIAL);
- /* 3. Retrieve no of child of menu item to be displayed */
- nNumofItem = GetNumOfChild(MENU9167_FIXED_DIAL);
- /* 4. Get attribute of menu to be displayed */
- /* nDispAttribute = GetDispAttributeOfItem(MENU9167_FIXED_DIAL); */
- /* 5. Retrieve string ids in sequence of given menu item to be displayed */
- GetSequenceStringIds(MENU9167_FIXED_DIAL, nStrItemList);
- /* 6 Set current parent id */
- SetParentHandler(MENU9167_FIXED_DIAL);
- /* 7 Register highlight handler to be called in menu screen */
- RegisterHighlightHandler(ExecuteCurrHiliteHandler);
- /* 8 Construct the Hints List */
- ConstructHintsList(MENU9167_FIXED_DIAL, FdlType);
- /* 8 Display Category52 Screen */
- ShowCategory52Screen(
- STR_MENU9167_FIXED_DIAL,
- MAIN_MENU_TITLE_SETTINGS_ICON,
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- nNumofItem,
- nStrItemList,
- (PU16) gIndexIconsImageList,
- FdlType,
- 0,
- 0,
- guiBuffer);
- /* 9.Register function with right softkey */
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * EntrySECSETBarDial
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntrySECSETBarDial(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 nStrItemList[MAX_SUB_MENUS]; /* Stores the strings id of submenus returned */
- U16 nNumofItem; /* Stores no of children in the submenu */
- //micha1229
- // U16 nDispAttribute; /* Stores display attribue */
- U8 *guiBuffer; /* Buffer holding history data */
- U8 *BdlType[MAX_SUB_MENUS];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_SECSET_BAR_DIAL, NULL, EntrySECSETBarDial, NULL);
- /* 2 Get current screen to gui buffer for history purposes */
- guiBuffer = GetCurrGuiBuffer(SCR_ID_SECSET_BAR_DIAL);
- /* 3. Retrieve no of child of menu item to be displayed */
- nNumofItem = GetNumOfChild(MENU9168_BARRED_DAIL);
- /* 4. Get attribute of menu to be displayed */
- /* nDispAttribute = GetDispAttributeOfItem(MENU9168_BARRED_DAIL); */
- /* 5. Retrieve string ids in sequence of given menu item to be displayed */
- GetSequenceStringIds(MENU9168_BARRED_DAIL, nStrItemList);
- /* 6 Set current parent id */
- SetParentHandler(MENU9168_BARRED_DAIL);
- /* 7 Register highlight handler to be called in menu screen */
- RegisterHighlightHandler(ExecuteCurrHiliteHandler);
- ConstructHintsList(MENU9168_BARRED_DAIL, BdlType);
- /* 8 Display Category52 Screen */
- ShowCategory52Screen(
- STR_MENU9168_BARRED_DAIL,
- MAIN_MENU_TITLE_SETTINGS_ICON,
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- nNumofItem,
- nStrItemList,
- (PU16) gIndexIconsImageList,
- BdlType,
- 0,
- 0,
- guiBuffer);
- /* 9.Register function with right softkey */
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * SECSETSetSIMLockReq
- * DESCRIPTION
- * A general fn to make Req for all type of Security options.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void SECSETSetSIMLockReq(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MYQUEUE msgStruct;
- MMISMULOCKREQSTRUCT *smuLockReq;
- S8 pOutBuffer[(MAX_SIM_SETTING_PASSWD_LEN + 1) + 1];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ClearInputEventHandler(MMI_DEVICE_ALL);
- ClearKeyHandler(KEY_END, KEY_EVENT_DOWN);
- ClearKeyHandler(KEY_END, KEY_EVENT_UP);
- memset(pOutBuffer, 0, (MAX_SIM_SETTING_PASSWD_LEN + 1) + 1);
- smuLockReq = OslConstructDataPtr(sizeof(MMISMULOCKREQSTRUCT));
- if (gSecuritySetupContext.SimLockStatus != CHV_DISABLED)
- {
- smuLockReq->opcode = MMI_DISABLE;
- }
- else
- {
- smuLockReq->opcode = MMI_ENABLE;
- }
- smuLockReq->type = (U8) MMI_SETTING_TYPE_CHV1;
- memset(smuLockReq->passwd, 0, (MAX_SIM_SETTING_PASSWD_LEN + 1));
- UnicodeToAnsii(pOutBuffer, (PS8) gSecuritySetupContext.Password);
- memcpy(smuLockReq->passwd, pOutBuffer, (MAX_SIM_SETTING_PASSWD_LEN + 1));
- gSecuritySetupContext.SMULockSuccessCallBack = SECSETSetSIMLockSuccess;
- gSecuritySetupContext.SMULockFailCallBack = SECSETSetSIMLockFail;
- SetProtocolEventHandler(SECSETSMULockRsp, PRT_MMI_SMU_LOCK_RSP);
- msgStruct.oslSrcId = MOD_MMI;
- msgStruct.oslDestId = MOD_L4C;
- /* micha1229 */
- msgStruct.oslMsgId = PRT_MMI_SMU_LOCK_REQ;
- msgStruct.oslSapId = INVALID_SAP;
- msgStruct.oslDataPtr = (oslParaType*) smuLockReq;
- msgStruct.oslPeerBuffPtr = NULL;
- OslMsgSendExtQueue(&msgStruct);
- }
- /*****************************************************************************
- * FUNCTION
- * SECSETSetSIMLockSuccess
- * DESCRIPTION
- * A general fn to make Req for all type of Security options.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void SECSETSetSIMLockSuccess(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 index;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- index = GetCurrHiliteID();
- if (gSecuritySetupContext.SimLockStatus != CHV_DISABLED)
- {
- gSecuritySetupContext.SimLockStatus = CHV_DISABLED;
- pfnUnicodeStrncpy((PS8) hintData[index], (PS8) GetString(STR_GLOBAL_OFF), MAX_SUBMENU_CHARACTERS);
- Category52ChangeItemDescription(0, hintData[index]);
- change_left_softkey(STR_GLOBAL_ON, 0);
- DisplayPopup((PU8) GetString(STR_SETTING_SIM_UNLOCK), IMG_GLOBAL_ACTIVATED, 1, ST_NOTIFYDURATION, 0);
- }
- else
- {
- gSecuritySetupContext.SimLockStatus = CHV_VERIFIED;
- pfnUnicodeStrncpy((PS8) hintData[index], (PS8) GetString(STR_GLOBAL_ON), MAX_SUBMENU_CHARACTERS);
- Category52ChangeItemDescription(0, hintData[index]);
- change_left_softkey(STR_GLOBAL_OFF, 0);
- DisplayPopup((PU8) GetString(STR_SETTING_SIM_LOCK), IMG_GLOBAL_ACTIVATED, 1, ST_NOTIFYDURATION, 0);
- }
- DeleteScreenIfPresent(SCR_ID_SECSET_SIM_LOCK_PIN1);
- }
- /*****************************************************************************
- * FUNCTION
- * SECSETSetSIMLockFail
- * DESCRIPTION
- * A general fn to make Req for all type of Security options.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void SECSETSetSIMLockFail(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- historyNode *History;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- DisplayPopup((PU8) GetString(STR_WRONG_PIN), IMG_GLOBAL_ERROR, 0, ST_NOTIFYDURATION, ERROR_TONE);
- if (GetHistoryScrID(SCR_ID_SECSET_SIM_LOCK_PIN1, &History) == ST_SUCCESS)
- {
- if (History->inputBuffer != NULL)
- {
- memset(History->inputBuffer, 0, ENCODING_LENGTH);
- }
- if (History->guiBuffer != NULL)
- {
- memset(History->guiBuffer, 0, 2);
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * SECSETSetPhoneLockReq
- * DESCRIPTION
- * A general fn to make Req for all type of Security options.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void SECSETSetPhoneLockReq(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MYQUEUE msgStruct;
- MMISMULOCKREQSTRUCT *smuLockReq;
- S8 pOutBuffer[(MAX_SIM_SETTING_PASSWD_LEN + 1) + 1];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ClearInputEventHandler(MMI_DEVICE_ALL);
- ClearKeyHandler(KEY_END, KEY_EVENT_DOWN);
- ClearKeyHandler(KEY_END, KEY_EVENT_UP);
- memset(pOutBuffer, 0, (MAX_SIM_SETTING_PASSWD_LEN + 1) + 1);
- smuLockReq = OslConstructDataPtr(sizeof(MMISMULOCKREQSTRUCT));
- if (gSecuritySetupContext.PhoneLockStatus)
- {
- smuLockReq->opcode = MMI_DISABLE;
- }
- else
- {
- smuLockReq->opcode = MMI_ENABLE;
- }
- smuLockReq->type = (U8) MMI_SETTING_TYPE_PHONELOCK;
- memset(smuLockReq->passwd, 0, (MAX_SIM_SETTING_PASSWD_LEN + 1));
- UnicodeToAnsii(pOutBuffer, (PS8) gSecuritySetupContext.Password);
- memcpy(smuLockReq->passwd, pOutBuffer, (MAX_SIM_SETTING_PASSWD_LEN + 1));
- gSecuritySetupContext.SMULockSuccessCallBack = SECSETSetPhoneLockSuccess;
- gSecuritySetupContext.SMULockFailCallBack = SETSETSetPhoneLockFail;
- SetProtocolEventHandler(SECSETSMULockRsp, PRT_MMI_SMU_LOCK_RSP);
- msgStruct.oslSrcId = MOD_MMI;
- msgStruct.oslDestId = MOD_L4C;
- /* micha1229 */
- msgStruct.oslMsgId = PRT_MMI_SMU_LOCK_REQ;
- msgStruct.oslSapId = INVALID_SAP;
- msgStruct.oslDataPtr = (oslParaType*) smuLockReq;
- msgStruct.oslPeerBuffPtr = NULL;
- OslMsgSendExtQueue(&msgStruct);
- }
- /*****************************************************************************
- * FUNCTION
- * SECSETSetPhoneLockSuccess
- * DESCRIPTION
- * A general fn to make Req for all type of Security options.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void SECSETSetPhoneLockSuccess(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 index;
- #ifndef MMI_ON_HARDWARE_P
- U8 data;
- S16 error = 0;
- #endif /* MMI_ON_HARDWARE_P */
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- index = GetCurrHiliteID();
- gSecuritySetupContext.PhoneLockStatus = !gSecuritySetupContext.PhoneLockStatus;
- #ifndef MMI_ON_HARDWARE_P
- data = gSecuritySetupContext.PhoneLockStatus;
- WriteValue(NVRAM_SETTING_PHONELOCK, &data, DS_BYTE, &error);
- #endif /* MMI_ON_HARDWARE_P */
- if (gSecuritySetupContext.PhoneLockStatus == 0)
- {
- pfnUnicodeStrncpy((PS8) hintData[index], (PS8) GetString(STR_GLOBAL_OFF), MAX_SUBMENU_CHARACTERS);
- Category52ChangeItemDescription(1, hintData[index]);
- change_left_softkey(STR_GLOBAL_ON, 0);
- DisplayPopup((PU8) GetString(STR_SETTING_PHONE_UNLOCK), IMG_GLOBAL_ACTIVATED, 1, ST_NOTIFYDURATION, 0);
- }
- else
- {
- pfnUnicodeStrncpy((PS8) hintData[index], (PS8) GetString(STR_GLOBAL_ON), MAX_SUBMENU_CHARACTERS);
- Category52ChangeItemDescription(1, hintData[index]);
- change_left_softkey(STR_GLOBAL_OFF, 0);
- DisplayPopup((PU8) GetString(STR_SETTING_PHONE_LOCK), IMG_GLOBAL_ACTIVATED, 1, ST_NOTIFYDURATION, 0);
- }
- DeleteScreenIfPresent(SCR_ID_SECSET_PHONE_LOCK);
- }
- /*****************************************************************************
- * FUNCTION
- * SETSETSetPhoneLockFail
- * DESCRIPTION
- * A general fn to make Req for all type of Security options.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void SETSETSetPhoneLockFail(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- historyNode *History;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- DisplayPopup((PU8) GetString(STR_SETTING_WRONG), IMG_GLOBAL_ERROR, 0, ST_NOTIFYDURATION, ERROR_TONE);
- if (GetHistoryScrID(SCR_ID_SECSET_PHONE_LOCK, &History) == ST_SUCCESS)
- {
- if (History->inputBuffer != NULL)
- {
- memset(History->inputBuffer, 0, ENCODING_LENGTH);
- }
- if (History->guiBuffer != NULL)
- {
- memset(History->guiBuffer, 0, 2);
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * SETSETSMURspFailure
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void SETSETSMURspFailure(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- historyNode *History;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- DisplayPopup((PU8) GetString(STR_ID_SECSET_UNSPECIFIED_ERROR), IMG_GLOBAL_UNFINISHED, 1, ST_NOTIFYDURATION, ERROR_TONE);
- if (GetHistoryScrID(SCR_ID_SECSET_PHONE_LOCK, &History) == ST_SUCCESS ||
- GetHistoryScrID(SCR_ID_SECSET_SIM_LOCK_PIN1, &History) == ST_SUCCESS)
- {
- if (History->inputBuffer != NULL)
- {
- memset(History->inputBuffer, 0, ENCODING_LENGTH);
- }
- if (History->guiBuffer != NULL)
- {
- memset(History->guiBuffer, 0, ENCODING_LENGTH);
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * SECSETSMULockRsp
- * DESCRIPTION
- * A general fn to make Req for all type of Security options.
- * PARAMETERS
- * info [?]
- * RETURNS
- * void
- *****************************************************************************/
- void SECSETSMULockRsp(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- historyNode *History;
- SMULOCKRSP *resp;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- resp = (SMULOCKRSP*) (info);
- if (!(resp->result == 0 && resp->cause == MMI_SETTING_TYPE_UNSPECIFIED))
- {
- FillCountDownNumber(resp->chv_info);
- }
- if (resp->result == 1)
- {
- if (gSecuritySetupContext.SMULockSuccessCallBack != NULL)
- {
- (*gSecuritySetupContext.SMULockSuccessCallBack) ();
- gSecuritySetupContext.SMULockSuccessCallBack = NULL;
- }
- }
- else if (resp->result == 0 && resp->cause == MMI_SETTING_TYPE_UBCHV1)
- {
- ExitSECSETPUK1();
- DisplayPopup((PU8) GetString(STR_SETTING_PIN_BLK), IMG_GLOBAL_ERROR, 0, ST_NOTIFYDURATION, ERROR_TONE);
- DeleteUptoScrID(SCR_ID_SECSET_PUK1);
- if (GetHistoryScrID(SCR_ID_SECSET_PUK1, &History) == ST_SUCCESS)
- {
- if (History->inputBuffer != NULL)
- {
- memset(History->inputBuffer, 0, ENCODING_LENGTH);
- }
- if (History->guiBuffer != NULL)
- {
- memset(History->guiBuffer, 0, 2);
- }
- }
- gSecuritySetupContext.SMULockSuccessCallBack = NULL;
- gSecuritySetupContext.SMULockFailCallBack = NULL;
- }
- /* diamond, 2006/03/30 Handle the specific case of SMU busy for something */
- else if (resp->result == 0 && resp->cause == MMI_SETTING_TYPE_UNSPECIFIED)
- {
- SETSETSMURspFailure();
- gSecuritySetupContext.SMULockSuccessCallBack = NULL;
- gSecuritySetupContext.SMULockFailCallBack = NULL;
- }
- else
- {
- if (gSecuritySetupContext.SMULockFailCallBack != NULL)
- {
- (*gSecuritySetupContext.SMULockFailCallBack) ();
- gSecuritySetupContext.SMULockFailCallBack = NULL;
- }
- }
- pfnUnicodeStrcpy((S8*) gSecuritySetupContext.Password, (S8*) "");
- }
- /*****************************************************************************
- * FUNCTION
- * EntrySECSETChangePassword
- * DESCRIPTION
- * Entry fn for change password option menu.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntrySECSETChangePassword(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 nStrItemList[MAX_SUB_MENUS]; /* Stores the strings id of submenus returned */
- U16 nNumofItem; /* Stores no of children in the submenu */
- //micha1229
- // U16 nDispAttribute; /* Stores display attribue */
- U8 *guiBuffer; /* Buffer holding history data */
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_SECSET_CHANGE_PASSWORD, NULL, EntrySECSETChangePassword, NULL);
- /* 2 Get current screen to gui buffer for history purposes */
- guiBuffer = GetCurrGuiBuffer(SCR_ID_SECSET_CHANGE_PASSWORD);
- /* 3. Retrieve no of child of menu item to be displayed */
- nNumofItem = GetNumOfChild_Ext(MENU9170_CHANGE_PASSWORD);
- /* 4. Get attribute of menu to be displayed */
- /* nDispAttribute = GetDispAttributeOfItem(MENU9170_CHANGE_PASSWORD); */
- /* 5. Retrieve string ids in sequence of given menu item to be displayed */
- GetSequenceStringIds_Ext(MENU9170_CHANGE_PASSWORD, nStrItemList);
- /* 6 Set current parent id */
- SetParentHandler(MENU9170_CHANGE_PASSWORD);
- /* 7 Register highlight handler to be called in menu screen */
- RegisterHighlightHandler(ExecuteCurrHiliteHandler);
- /* 8 Display Category15 Screen */
- ShowCategory15Screen(
- STR_SCR9026_CHANGE_PASSWORD_CAPTION,
- MAIN_MENU_TITLE_SETTINGS_ICON,
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- nNumofItem,
- nStrItemList,
- (PU16) gIndexIconsImageList,
- LIST_MENU,
- 0,
- guiBuffer);
- /* 9.Register function with right softkey */
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * SECSETGetPIN1ForChangeReq
- * DESCRIPTION
- * To get the status of Pin1/Pin2.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void SECSETGetPIN1ForChangeReq(void)
- {
- #ifdef MMI_ON_HARDWARE_P
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MYQUEUE msgStruct;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ClearInputEventHandler(MMI_DEVICE_ALL);
- SetProtocolEventHandler(SECSETGetPIN1ForChangeRsp, PRT_MMI_SMU_CHECK_PIN_STATUS_RSP);
- msgStruct.oslSrcId = MOD_MMI;
- msgStruct.oslDestId = MOD_L4C;
- /* micha1229 */
- msgStruct.oslMsgId = PRT_MMI_SMU_CHECK_PIN_STATUS_REQ;
- msgStruct.oslSapId = INVALID_SAP;
- msgStruct.oslDataPtr = NULL;
- msgStruct.oslPeerBuffPtr = NULL;
- OslMsgSendExtQueue(&msgStruct);
- #else /* MMI_ON_HARDWARE_P */
- PopupNoSupport(); /* PC simulator doesn't support to access PIN1 from SIM card */
- #endif /* MMI_ON_HARDWARE_P */
- }
- /*****************************************************************************
- * FUNCTION
- * SECSETGetPIN2ForChangeReq
- * DESCRIPTION
- * To get the status of Pin1/Pin2.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void SECSETGetPIN2ForChangeReq(void)
- {
- #ifdef MMI_ON_HARDWARE_P
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MYQUEUE msgStruct;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ClearInputEventHandler(MMI_DEVICE_ALL);
- SetProtocolEventHandler(SECSETGetPIN2ForChangeRsp, PRT_MMI_SMU_CHECK_PIN_STATUS_RSP);
- msgStruct.oslSrcId = MOD_MMI;
- msgStruct.oslDestId = MOD_L4C;
- /* micha1229 */
- msgStruct.oslMsgId = PRT_MMI_SMU_CHECK_PIN_STATUS_REQ;
- msgStruct.oslSapId = INVALID_SAP;
- msgStruct.oslDataPtr = NULL;
- msgStruct.oslPeerBuffPtr = NULL;
- OslMsgSendExtQueue(&msgStruct);
- #else /* MMI_ON_HARDWARE_P */
- PopupNoSupport(); /* PC simulator doesn't support to access PIN2 from SIM card */
- #endif /* MMI_ON_HARDWARE_P */
- }
- /*****************************************************************************
- * FUNCTION
- * SECSETGetPIN1ForChangeRsp
- * DESCRIPTION
- * Handles response of req to get the status of PIN1/PIN2.
- * PARAMETERS
- * info [?]
- * RETURNS
- * void
- *****************************************************************************/
- void SECSETGetPIN1ForChangeRsp(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- SMUSTATUSRSP *resp;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- resp = (SMUSTATUSRSP*) (info);
- FillCountDownNumber(resp->chv_info);
- #if 0
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- #endif /* 0 */
- /* diamond, 2006/03/21 CHV1 enabled or not should be referred to mmi_smu_check_pin_status_rsp.chv_info.is_chv1_enabled */
- if (resp->chv_info.is_chv1_enabled)
- {
- EntrySECSETChangePWOldPWD();
- }
- else
- {
- DisplayPopup((PU8) GetString(STR_ENABLE_PIN), IMG_GLOBAL_ERROR, 0, ST_NOTIFYDURATION, ERROR_TONE);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * SECSETGetPIN2ForChangeRsp
- * DESCRIPTION
- * Handles response of req to get the status of PIN1/PIN2.
- * PARAMETERS
- * info [?]
- * RETURNS
- * void
- *****************************************************************************/
- void SECSETGetPIN2ForChangeRsp(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- SMUSTATUSRSP *resp;
- historyNode *History;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- resp = (SMUSTATUSRSP*) (info);
- FillCountDownNumber(resp->chv_info);
- switch (resp->chv_status.chv2_status)
- {
- case CHV_BLOCKED:
- DisplayPopup((PU8) GetString(STR_SETTING_PIN2_BLK2), IMG_GLOBAL_ERROR, 0, ST_NOTIFYDURATION, ERROR_TONE);
- ExitSECSETPUK2();
- if (GetHistoryScrID(SCR_ID_SECSET_PUK2, &History) == ST_SUCCESS)
- {
- if (History->inputBuffer != NULL)
- {
- memset(History->inputBuffer, 0, ENCODING_LENGTH);
- }
- if (History->guiBuffer != NULL)
- {
- memset(History->guiBuffer, 0, 2);
- }
- }
- DeleteUptoScrID(SCR_ID_SECSET_PUK2);
- break;
- case CHV_DEAD:
- case CHV_INVALID_TYPE:
- case CHV_NOTINITED:
- {
- DisplayPopup(
- (PU8) GetString(STR_ID_PIN2_NOT_SUPPORT),
- IMG_GLOBAL_ERROR,
- 0,
- ST_NOTIFYDURATION,
- ERROR_TONE);
- }
- break;
- default:
- EntrySECSETChangePWOldPWD();
- break;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * EntrySECSETChangePWOldPWD
- * DESCRIPTION
- * Entry screen to get old pwd of Phonelock/pin1/pin2 from user
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntrySECSETChangePWOldPWD(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer;
- U8 *inputBuffer;
- U8 PassCountdownDisp[MAX_PASS_COUNTDOWN_DISP];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_SECSET_CHANGEPW_OLD_PWD, ExitSECSETChangePWOldPWD, NULL, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_SECSET_CHANGEPW_OLD_PWD);
- inputBuffer = GetCurrInputBuffer(SCR_ID_SECSET_CHANGEPW_OLD_PWD);
- RegisterHighlightHandler(ExecuteCurrHiliteHandler);
- if (inputBuffer == NULL)
- {
- memset(gSecuritySetupContext.Password, 0, (MAX_SIM_SETTING_PASSWD_LEN + 1) * ENCODING_LENGTH);
- }
- else
- {
- pfnUnicodeStrcpy((S8*) gSecuritySetupContext.Password, (S8*) inputBuffer);
- }
- RegisterInputBoxValidationFunction(RstrSettingPasswdScrSoftKeyFunc);
- switch (gSecuritySetupContext.CurrentPassword)
- {
- case 0:
- FillCountDownString(MMI_SETTING_TYPE_CHV1, PassCountdownDisp);
- ShowCategory111Screen(
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- STR_SETTING_OLD_PIN,
- INPUT_TYPE_NUMERIC_PASSWORD,
- gSecuritySetupContext.Password,
- (MAX_SIM_SETTING_PASSWD_LEN + 1),
- PassCountdownDisp,
- guiBuffer);
- break;
- case 1:
- FillCountDownString(MMI_SETTING_TYPE_CHV2, PassCountdownDisp);
- ShowCategory111Screen(
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- STR_SETTING_OLD_PIN2,
- INPUT_TYPE_NUMERIC_PASSWORD,
- gSecuritySetupContext.Password,
- (MAX_SIM_SETTING_PASSWD_LEN + 1),
- PassCountdownDisp,
- guiBuffer);
- break;
- case 2:
- ShowCategory111Screen(
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- STR_SCR9029_CURRENT_PW_CAPTION,
- INPUT_TYPE_NUMERIC_PASSWORD,
- gSecuritySetupContext.Password,
- (MAX_SIM_SETTING_PASSWD_LEN + 1),
- NULL,
- guiBuffer);
- break;
- }
- SetLeftSoftkeyFunction(EntrySECSETChangePWNewPWD, KEY_EVENT_UP);
- SetKeyHandler(EntrySECSETChangePWNewPWD, KEY_POUND, KEY_EVENT_UP);
- SetCategory111RightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- /* micha0606 */
- gSecuritySetupContext.PasswdLenCheckCallBack = EntrySECSETChangePWNewPWD;
- if (pfnUnicodeStrlen((S8*) gSecuritySetupContext.Password) < MIN_PASSWORD_LENGTH)
- {
- ChangeLeftSoftkey(0, 0);
- ClearKeyHandler(KEY_POUND, KEY_EVENT_UP);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * ExitSECSETChangePWOldPWD
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS