SecuritySetup.c
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:181k
源码类别:

MTK

开发平台:

C/C++

  1. /*****************************************************************************
  2. *  Copyright Statement:
  3. *  --------------------
  4. *  This software is protected by Copyright and the information contained
  5. *  herein is confidential. The software may not be copied and the information
  6. *  contained herein may not be used or disclosed except with the written
  7. *  permission of MediaTek Inc. (C) 2005
  8. *
  9. *  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
  10. *  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
  11. *  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
  12. *  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
  13. *  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
  14. *  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
  15. *  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
  16. *  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
  17. *  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
  18. *  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
  19. *  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
  20. *  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
  21. *
  22. *  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
  23. *  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
  24. *  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
  25. *  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
  26. *  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. 
  27. *
  28. *  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
  29. *  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
  30. *  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
  31. *  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
  32. *  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
  33. *
  34. *****************************************************************************/
  35. /*******************************************************************************
  36.  * Filename:
  37.  * ---------
  38.  * SecuritySetup.c
  39.  *
  40.  * Project:
  41.  * --------
  42.  *   MAUI
  43.  *
  44.  * Description:
  45.  * ------------
  46.  *   Security Setup related functions
  47.  *
  48.  * Author:
  49.  * -------
  50.  * -------
  51.  *
  52. *==============================================================================
  53.  *             HISTORY
  54.  * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!! 
  55.  *------------------------------------------------------------------------------
  56.  * removed!
  57.  *
  58.  * removed!
  59.  * removed!
  60.  * removed!
  61.  *
  62.  * removed!
  63.  * removed!
  64.  * removed!
  65.  *
  66.  * removed!
  67.  * removed!
  68.  * removed!
  69.  *
  70.  * removed!
  71.  * removed!
  72.  * removed!
  73.  *
  74.  * removed!
  75.  * removed!
  76.  * removed!
  77.  *
  78.  * removed!
  79.  * removed!
  80.  * removed!
  81.  *
  82.  * removed!
  83.  * removed!
  84.  * removed!
  85.  *
  86.  * removed!
  87.  * removed!
  88.  * removed!
  89.  *
  90.  * removed!
  91.  * removed!
  92.  * removed!
  93.  *
  94.  * removed!
  95.  * removed!
  96.  * removed!
  97.  *
  98.  * removed!
  99.  * removed!
  100.  * removed!
  101.  *
  102.  * removed!
  103.  * removed!
  104.  * removed!
  105.  *
  106.  * removed!
  107.  * removed!
  108.  * removed!
  109.  *
  110.  * removed!
  111.  * removed!
  112.  * removed!
  113.  *
  114.  * removed!
  115.  * removed!
  116.  * removed!
  117.  *
  118.  * removed!
  119.  * removed!
  120.  * removed!
  121.  *
  122.  * removed!
  123.  * removed!
  124.  * removed!
  125.  *
  126.  * removed!
  127.  * removed!
  128.  * removed!
  129.  *
  130.  * removed!
  131.  * removed!
  132.  * removed!
  133.  *
  134.  * removed!
  135.  * removed!
  136.  * removed!
  137.  *
  138.  * removed!
  139.  * removed!
  140.  * removed!
  141.  *
  142.  * removed!
  143.  * removed!
  144.  * removed!
  145.  *
  146.  * removed!
  147.  * removed!
  148.  * removed!
  149.  *
  150.  * removed!
  151.  * removed!
  152.  * removed!
  153.  *
  154.  * removed!
  155.  * removed!
  156.  * removed!
  157.  *
  158.  * removed!
  159.  * removed!
  160.  * removed!
  161.  *
  162.  * removed!
  163.  * removed!
  164.  * removed!
  165.  *
  166.  * removed!
  167.  * removed!
  168.  * removed!
  169.  *
  170.  * removed!
  171.  * removed!
  172.  * removed!
  173.  *
  174.  * removed!
  175.  * removed!
  176.  * removed!
  177.  *
  178.  * removed!
  179.  * removed!
  180.  * removed!
  181.  *
  182.  * removed!
  183.  * removed!
  184.  * removed!
  185.  *
  186.  * removed!
  187.  * removed!
  188.  * removed!
  189.  *
  190.  * removed!
  191.  * removed!
  192.  * removed!
  193.  *
  194.  * removed!
  195.  * removed!
  196.  * removed!
  197.  *
  198.  * removed!
  199.  * removed!
  200.  * removed!
  201.  *
  202.  * removed!
  203.  * removed!
  204.  * removed!
  205.  *
  206.  *------------------------------------------------------------------------------
  207.  * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!! 
  208.  *============================================================================== 
  209.  *******************************************************************************/
  210. #include "StdC.h"
  211. #include "L4Dr1.h"
  212. #include "L4Dr.h"
  213. #include "MainMenuDef.h"
  214. #include "wgui_categories.h"
  215. #include "wgui_categories_inputs.h"
  216. #include "CallsDefs.h"
  217. #include "settingstructs.h"
  218. #include "settinggprots.h"
  219. #include "SimDetectionGprot.h"
  220. #include "ProtocolEvents.h"
  221. #include "CallFixedDial.h"
  222. #include "BarredDialList.h"
  223. #include "SettingProfile.h"
  224. #include "PhoneBookDef.h"
  225. #include "NVRAMType.h"
  226. #include "NVRAMProt.h"
  227. #include "NVRAMEnum.h"
  228. #include "CommonScreens.h"
  229. #include "MMI_features.h"
  230. #include "CallSetUpEnum.h"
  231. #include "SettingProt.h"
  232. #include "CallmanagementIdDef.h"
  233. #include "NetworkSetupGProt.h"
  234. #include "OrganizerGProt.h"
  235. #include "IdleAppDef.h"
  236. #include "SimDetectionGexdcl.h"
  237. #include "SettingsGexdcl.h"
  238. #include "SettingDefs.h"
  239. #include "SettingsGdcl.h"
  240. #include "PhoneBookGprot.h"
  241. /* micha0915 */
  242. #include "CallManagementGProt.h"
  243. #include "SecuritySetup.h"
  244. #include "DebugInitDef.h"
  245. #ifdef __MMI_TOUCH_SCREEN__
  246. #include "Wgui_touch_screen.h"
  247. #endif
  248. #ifdef __MMI_SML_MENU__
  249. #include "PersonalizationProt.h"
  250. #endif
  251. #ifdef MMI_ON_HARDWARE_P
  252. extern kal_bool smu_query_phone_lock_enabled(void);
  253. #endif 
  254. extern void mmi_frm_add_history_before_cm_marker(U16 scrn_id, FuncPtr func_ptr);
  255. SecuritySetupContext gSecuritySetupContext;
  256. /*****************************************************************************
  257.  * FUNCTION
  258.  *  InitSecuritySetupApp
  259.  * DESCRIPTION
  260.  *  Initialize Security
  261.  * PARAMETERS
  262.  *  void
  263.  * RETURNS
  264.  *  void
  265.  *****************************************************************************/
  266. void InitSecuritySetupApp(void)
  267. {
  268.     /*----------------------------------------------------------------*/
  269.     /* Local Variables                                                */
  270.     /*----------------------------------------------------------------*/
  271.     /*----------------------------------------------------------------*/
  272.     /* Code Body                                                      */
  273.     /*----------------------------------------------------------------*/
  274.     SetHiliteHandler(MENU9101_SECURITY, HighlightSecurity);
  275.     SetHiliteHandler(MENU9169_SIM_LOCK, HighlightSIMLock);
  276.     SetHiliteHandler(MENU9165_PHONE_LOCK, HighlightPhoneLock);
  277. #ifdef __MMI_AUTO_KEYPAD_LOCK__
  278.     SetHiliteHandler(MENU9178_AKPL_TIME, HighlightAutoKeyPadLock);
  279. #endif 
  280.     SetHiliteHandler(MENU9167_FIXED_DIAL, HighlightFixedDial);
  281.     SetHiliteHandler(MENU_SETTING_FDL_MODE, HighlightFdlMode);
  282.     SetHiliteHandler(MENU_SETTING_FDL_LIST, HighlightFdlList);
  283.     SetHiliteHandler(MENU9168_BARRED_DAIL, HighlightBarredDial);
  284.     SetHiliteHandler(MENU_SETTING_BDL_MODE, HighlightBdlMode);
  285.     SetHiliteHandler(MENU_SETTING_BDL_LIST, HighlightBdlList);
  286.     SetHiliteHandler(MENU9170_CHANGE_PASSWORD, HighlightChangePassword);
  287.     SetHiliteHandler(MENU9174_CP_PIN1, HighlightPin1Passwd);
  288.     SetHiliteHandler(MENU9175_CP_PIN2, HighlightPin2Passwd);
  289.     SetHiliteHandler(MENU9173_CP_PHONE_LOCK, HighlightPhonePasswd);
  290.     SetHintHandler(MENU9169_SIM_LOCK, HintSimLock);
  291.     SetHintHandler(MENU9165_PHONE_LOCK, HintPhoneLock);
  292. #ifdef __MMI_AUTO_KEYPAD_LOCK__
  293.     SetHintHandler(MENU9178_AKPL_TIME, HintAutoKeypadLock);
  294. #endif 
  295.     SetHintHandler(MENU9167_FIXED_DIAL, HintFdl);
  296.     SetHintHandler(MENU9168_BARRED_DAIL, HintBdl);
  297.     SetHintHandler(MENU_SETTING_FDL_MODE, HintFdlMode);
  298.     SetHintHandler(MENU_SETTING_BDL_MODE, HintBdlMode);
  299.     /*
  300.      * gSecuritySetupContext.FdlStatus = 0;
  301.      * gSecuritySetupContext.BdlStatus = 0;
  302.      * gSecuritySetupContext.SimLockStatus = 0;
  303.      * gSecuritySetupContext.PhoneLockStatus = 0;
  304.      * gSecuritySetupContext.AutoKeyPadLockTime= 0;
  305.      * gSecuritySetupContext.CurrentPassword= 0; 
  306.      * gSecuritySetupContext.PINBlocked = 0;
  307.      * gSecuritySetupContext.CHV1Count = 0;
  308.      * gSecuritySetupContext.CHV2Count = 0;   
  309.      * gSecuritySetupContext.UBCHV1Count = 0; 
  310.      * gSecuritySetupContext.UBCHV2Count = 0; 
  311.      */
  312.     gSecuritySetupContext.SMULockSuccessCallBack = NULL;
  313.     gSecuritySetupContext.SMULockFailCallBack = NULL;
  314.     gSecuritySetupContext.VerifyPassSuccessCallBack = NULL;
  315.     /* diamond, 2006/02/27 Move this function call to another timing */
  316.     /* GetPhoneLock(); */
  317. #ifdef __MMI_SML_MENU__
  318.     mmi_sml_init();
  319. #endif
  320.     SetProtocolEventHandler(mmi_secset_at_cmd_update_chv, MSG_ID_MMI_SMU_VERIFY_PIN_RESULT_IND);
  321. }
  322. /*****************************************************************************
  323.  * FUNCTION
  324.  *  HighlightSecurity
  325.  * DESCRIPTION
  326.  *  HighLight Security-Setup
  327.  * PARAMETERS
  328.  *  void
  329.  * RETURNS
  330.  *  void
  331.  *****************************************************************************/
  332. void HighlightSecurity(void)
  333. {
  334.     /*----------------------------------------------------------------*/
  335.     /* Local Variables                                                */
  336.     /*----------------------------------------------------------------*/
  337.     /*----------------------------------------------------------------*/
  338.     /* Code Body                                                      */
  339.     /*----------------------------------------------------------------*/
  340.     /* 1 Change left soft key icon and label */
  341.     ChangeLeftSoftkey(STR_GLOBAL_OK, 0);
  342.     /* 2 Change right soft key icon and label */
  343.     ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
  344.     /* 3 Register function for left soft key */
  345.     SetLeftSoftkeyFunction(EntrySECSETMain, KEY_EVENT_UP);
  346.     SetKeyHandler(EntrySECSETMain, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  347.     /* 4 Register function for right soft key */
  348.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  349.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  350. }
  351. /*****************************************************************************
  352.  * FUNCTION
  353.  *  HighlightSIMLock
  354.  * DESCRIPTION
  355.  *  Highlight fn for SimLock Option
  356.  * PARAMETERS
  357.  *  void
  358.  * RETURNS
  359.  *  void
  360.  *****************************************************************************/
  361. void HighlightSIMLock(void)
  362. {
  363.     /*----------------------------------------------------------------*/
  364.     /* Local Variables                                                */
  365.     /*----------------------------------------------------------------*/
  366.     /*----------------------------------------------------------------*/
  367.     /* Code Body                                                      */
  368.     /*----------------------------------------------------------------*/
  369.     if (gSecuritySetupContext.SimLockStatus != CHV_DISABLED)
  370.     {
  371.         ChangeLeftSoftkey(STR_GLOBAL_OFF, 0);
  372.     }
  373.     else
  374.     {
  375.         ChangeLeftSoftkey(STR_GLOBAL_ON, 0);
  376.     }
  377.     ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
  378.     SetLeftSoftkeyFunction(EntrySECSETSIMLockPIN1, KEY_EVENT_UP);
  379.     /* micha0529 */
  380.     SetKeyHandler(EntrySECSETSIMLockPIN1, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  381.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  382.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  383. }
  384. /*****************************************************************************
  385.  * FUNCTION
  386.  *  HighlightPhoneLock
  387.  * DESCRIPTION
  388.  *  highlight phone lock option in security setup
  389.  * PARAMETERS
  390.  *  void
  391.  * RETURNS
  392.  *  void
  393.  *****************************************************************************/
  394. void HighlightPhoneLock(void)
  395. {
  396.     /*----------------------------------------------------------------*/
  397.     /* Local Variables                                                */
  398.     /*----------------------------------------------------------------*/
  399.     /*----------------------------------------------------------------*/
  400.     /* Code Body                                                      */
  401.     /*----------------------------------------------------------------*/
  402.     if (gSecuritySetupContext.PhoneLockStatus)
  403.     {
  404.         ChangeLeftSoftkey(STR_GLOBAL_OFF, 0);
  405.     }
  406.     else
  407.     {
  408.         ChangeLeftSoftkey(STR_GLOBAL_ON, 0);
  409.     }
  410.     ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
  411.     SetLeftSoftkeyFunction(EntrySECSETPhoneLock, KEY_EVENT_UP);
  412.     /* micha0529 */
  413.     SetKeyHandler(EntrySECSETPhoneLock, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  414.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  415.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  416. }
  417. /*****************************************************************************
  418.  * FUNCTION
  419.  *  HighlightAutoKeyPadLock
  420.  * DESCRIPTION
  421.  *  Highlight handler for Autokeypadlock.
  422.  * PARAMETERS
  423.  *  void
  424.  * RETURNS
  425.  *  void
  426.  *  
  427.  *  Author            : Vanita Jain(?)
  428.  *****************************************************************************/
  429. #ifdef __MMI_AUTO_KEYPAD_LOCK__
  430. void HighlightAutoKeyPadLock(void)
  431. {
  432.     /*----------------------------------------------------------------*/
  433.     /* Local Variables                                                */
  434.     /*----------------------------------------------------------------*/
  435.     /*----------------------------------------------------------------*/
  436.     /* Code Body                                                      */
  437.     /*----------------------------------------------------------------*/
  438.     /* 1 Change left soft key icon and label */
  439.     ChangeLeftSoftkey(STR_GLOBAL_OK, 0);
  440.     /* 2 Change right soft key icon and label */
  441.     ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
  442.     /* 3 Register function for left soft key */
  443.     SetLeftSoftkeyFunction(EntrySECSETAKPLTime, KEY_EVENT_UP);
  444.     /* micha0529 */
  445.     SetKeyHandler(EntrySECSETAKPLTime, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  446.     /* 4 Register function for right soft key */
  447.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  448.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  449. }
  450. #endif /* __MMI_AUTO_KEYPAD_LOCK__ */ 
  451. /*****************************************************************************
  452.  * FUNCTION
  453.  *  HighlightFixedDial
  454.  * DESCRIPTION
  455.  *  Highlight handler for fixed dial.
  456.  * PARAMETERS
  457.  *  void
  458.  * RETURNS
  459.  *  void
  460.  *****************************************************************************/
  461. void HighlightFixedDial(void)
  462. {
  463.     /*----------------------------------------------------------------*/
  464.     /* Local Variables                                                */
  465.     /*----------------------------------------------------------------*/
  466.     /*----------------------------------------------------------------*/
  467.     /* Code Body                                                      */
  468.     /*----------------------------------------------------------------*/
  469.     /* 1 Change left soft key icon and label */
  470.     ChangeLeftSoftkey(STR_GLOBAL_OK, 0);
  471.     /* 2 Change right soft key icon and label */
  472.     SetLeftSoftkeyFunction(SECSETGetFdlStatusReq, KEY_EVENT_UP);
  473.     SetKeyHandler(SECSETGetFdlStatusReq, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  474.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  475.     /* 4 Register function for right soft key */
  476.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  477. }
  478. /*****************************************************************************
  479.  * FUNCTION
  480.  *  HighlightFdlMode
  481.  * DESCRIPTION
  482.  *  Highlight handler for FDL mode
  483.  * PARAMETERS
  484.  *  void
  485.  * RETURNS
  486.  *  void
  487.  *****************************************************************************/
  488. void HighlightFdlMode(void)
  489. {
  490.     /*----------------------------------------------------------------*/
  491.     /* Local Variables                                                */
  492.     /*----------------------------------------------------------------*/
  493.     /*----------------------------------------------------------------*/
  494.     /* Code Body                                                      */
  495.     /*----------------------------------------------------------------*/
  496.     if (gSecuritySetupContext.FdlStatus)
  497.     {
  498.         ChangeLeftSoftkey(STR_GLOBAL_OFF, 0);
  499.     }
  500.     else
  501.     {
  502.         ChangeLeftSoftkey(STR_GLOBAL_ON, 0);
  503.     }
  504.     ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
  505.     SetLeftSoftkeyFunction(mmi_secset_set_fixed_dial_mode, KEY_EVENT_UP);
  506.     SetKeyHandler(mmi_secset_set_fixed_dial_mode, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  507.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  508.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  509. }
  510. /*****************************************************************************
  511.  * FUNCTION
  512.  *  HighlightFdlList
  513.  * DESCRIPTION
  514.  *  Highlight handler for FDL list
  515.  * PARAMETERS
  516.  *  void
  517.  * RETURNS
  518.  *  void
  519.  *****************************************************************************/
  520. void HighlightFdlList(void)
  521. {
  522.     /*----------------------------------------------------------------*/
  523.     /* Local Variables                                                */
  524.     /*----------------------------------------------------------------*/
  525.     /*----------------------------------------------------------------*/
  526.     /* Code Body                                                      */
  527.     /*----------------------------------------------------------------*/
  528.     ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
  529.     ChangeLeftSoftkey(STR_GLOBAL_OK, 0);
  530.     SetLeftSoftkeyFunction(EntryFdlList, KEY_EVENT_UP);
  531.     SetKeyHandler(EntryFdlList, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  532.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  533.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  534. }
  535. /*****************************************************************************
  536.  * FUNCTION
  537.  *  HighlightBarredDial
  538.  * DESCRIPTION
  539.  *  
  540.  * PARAMETERS
  541.  *  void
  542.  * RETURNS
  543.  *  void
  544.  *****************************************************************************/
  545. void HighlightBarredDial(void)
  546. {
  547.     /*----------------------------------------------------------------*/
  548.     /* Local Variables                                                */
  549.     /*----------------------------------------------------------------*/
  550.     /*----------------------------------------------------------------*/
  551.     /* Code Body                                                      */
  552.     /*----------------------------------------------------------------*/
  553.     /* 1 Change left soft key icon and label */
  554.     ChangeLeftSoftkey(STR_GLOBAL_OK, 0);
  555.     /* 2 Change right soft key icon and label */
  556.     ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
  557.     /* 3 Register function for left soft key */
  558.     SetLeftSoftkeyFunction(SECSETGetBdlStatusReq, KEY_EVENT_UP);
  559.     SetKeyHandler(SECSETGetBdlStatusReq, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  560.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  561.     /* 4 Register function for right soft key */
  562.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  563. }
  564. /*****************************************************************************
  565.  * FUNCTION
  566.  *  HighlightBdlMode
  567.  * DESCRIPTION
  568.  *  Highlight handler for BDL mode.
  569.  * PARAMETERS
  570.  *  void
  571.  * RETURNS
  572.  *  void
  573.  *****************************************************************************/
  574. void HighlightBdlMode(void)
  575. {
  576.     /*----------------------------------------------------------------*/
  577.     /* Local Variables                                                */
  578.     /*----------------------------------------------------------------*/
  579.     /*----------------------------------------------------------------*/
  580.     /* Code Body                                                      */
  581.     /*----------------------------------------------------------------*/
  582.     if (gSecuritySetupContext.BdlStatus)
  583.     {
  584.         ChangeLeftSoftkey(STR_GLOBAL_OFF, 0);
  585.     }
  586.     else
  587.     {
  588.         ChangeLeftSoftkey(STR_GLOBAL_ON, 0);
  589.     }
  590.     ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
  591.     SetLeftSoftkeyFunction(mmi_secset_set_barred_dial_mode, KEY_EVENT_UP);
  592.     SetKeyHandler(mmi_secset_set_barred_dial_mode, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  593.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  594.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  595. }
  596. /*****************************************************************************
  597.  * FUNCTION
  598.  *  HighlightBdlList
  599.  * DESCRIPTION
  600.  *  Highlight handler for BDL list
  601.  * PARAMETERS
  602.  *  void
  603.  * RETURNS
  604.  *  void
  605.  *****************************************************************************/
  606. void HighlightBdlList(void)
  607. {
  608.     /*----------------------------------------------------------------*/
  609.     /* Local Variables                                                */
  610.     /*----------------------------------------------------------------*/
  611.     /*----------------------------------------------------------------*/
  612.     /* Code Body                                                      */
  613.     /*----------------------------------------------------------------*/
  614.     /* 2 Change right soft key icon and label */
  615.     ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
  616.     ChangeLeftSoftkey(STR_GLOBAL_OK, 0);
  617.     SetLeftSoftkeyFunction(EntryBdlList, KEY_EVENT_UP);
  618.     SetKeyHandler(EntryBdlList, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  619.     /* 4 Register function for right soft key */
  620.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  621.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  622. }
  623. /*****************************************************************************
  624.  * FUNCTION
  625.  *  HighlightChangePassword
  626.  * DESCRIPTION
  627.  *  Highlight handler for Change password option.
  628.  * PARAMETERS
  629.  *  void
  630.  * RETURNS
  631.  *  void
  632.  *****************************************************************************/
  633. void HighlightChangePassword(void)
  634. {
  635.     /*----------------------------------------------------------------*/
  636.     /* Local Variables                                                */
  637.     /*----------------------------------------------------------------*/
  638.     /*----------------------------------------------------------------*/
  639.     /* Code Body                                                      */
  640.     /*----------------------------------------------------------------*/
  641.     /* 1 Change left soft key icon and label */
  642.     ChangeLeftSoftkey(STR_GLOBAL_OK, 0);
  643.     /* 2 Change right soft key icon and label */
  644.     ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
  645.     /* 3 Register function for left soft key */
  646.     SetLeftSoftkeyFunction(EntrySECSETChangePassword, KEY_EVENT_UP);
  647.     SetKeyHandler(EntrySECSETChangePassword, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  648.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  649.     /* 4 Register function for right soft key */
  650.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  651. }
  652. /*****************************************************************************
  653.  * FUNCTION
  654.  *  HighlightPin1Passwd
  655.  * DESCRIPTION
  656.  *  Highlight handler for Change Pin1 option in change pwd screen.
  657.  * PARAMETERS
  658.  *  void
  659.  * RETURNS
  660.  *  void
  661.  *****************************************************************************/
  662. void HighlightPin1Passwd(void)
  663. {
  664.     /*----------------------------------------------------------------*/
  665.     /* Local Variables                                                */
  666.     /*----------------------------------------------------------------*/
  667.     /*----------------------------------------------------------------*/
  668.     /* Code Body                                                      */
  669.     /*----------------------------------------------------------------*/
  670.     gSecuritySetupContext.CurrentPassword = 0;
  671.     ChangeLeftSoftkey(STR_GLOBAL_OK, 0);
  672.     ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
  673.     /* micha0529 */
  674.     SetKeyHandler(SECSETGetPIN1ForChangeReq, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  675.     SetLeftSoftkeyFunction(SECSETGetPIN1ForChangeReq, KEY_EVENT_UP);
  676.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  677.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  678. }
  679. /*****************************************************************************
  680.  * FUNCTION
  681.  *  HighlightPin2Passwd
  682.  * DESCRIPTION
  683.  *  Highlight handler for Change Pin2 option in change pwd screen.
  684.  * PARAMETERS
  685.  *  void
  686.  * RETURNS
  687.  *  void
  688.  *****************************************************************************/
  689. void HighlightPin2Passwd(void)
  690. {
  691.     /*----------------------------------------------------------------*/
  692.     /* Local Variables                                                */
  693.     /*----------------------------------------------------------------*/
  694.     /*----------------------------------------------------------------*/
  695.     /* Code Body                                                      */
  696.     /*----------------------------------------------------------------*/
  697.     gSecuritySetupContext.CurrentPassword = 1;
  698.     ChangeLeftSoftkey(STR_GLOBAL_OK, 0);
  699.     ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
  700.     /* micha0529 */
  701.     SetKeyHandler(SECSETGetPIN2ForChangeReq, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  702.     SetLeftSoftkeyFunction(SECSETGetPIN2ForChangeReq, KEY_EVENT_UP);
  703.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  704.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  705. }
  706. /*****************************************************************************
  707.  * FUNCTION
  708.  *  HighlightPhonePasswd
  709.  * DESCRIPTION
  710.  *  Highlight handler for Change phone lock option in change pwd screen.
  711.  * PARAMETERS
  712.  *  void
  713.  * RETURNS
  714.  *  void
  715.  *****************************************************************************/
  716. void HighlightPhonePasswd(void)
  717. {
  718.     /*----------------------------------------------------------------*/
  719.     /* Local Variables                                                */
  720.     /*----------------------------------------------------------------*/
  721.     /*----------------------------------------------------------------*/
  722.     /* Code Body                                                      */
  723.     /*----------------------------------------------------------------*/
  724.     gSecuritySetupContext.CurrentPassword = 2;
  725.     ChangeLeftSoftkey(STR_GLOBAL_OK, 0);
  726.     ChangeRightSoftkey(STR_GLOBAL_BACK, 0);
  727.     /* micha0529 */
  728.     SetKeyHandler(EntrySECSETChangePWOldPWD, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  729.     SetLeftSoftkeyFunction(EntrySECSETChangePWOldPWD, KEY_EVENT_UP);
  730.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  731.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  732. }
  733. /*****************************************************************************
  734.  * FUNCTION
  735.  *  HintSimLock
  736.  * DESCRIPTION
  737.  *  Hint Hnadler for Sim Lock.
  738.  * PARAMETERS
  739.  *  index       [IN]        
  740.  * RETURNS
  741.  *  void
  742.  *****************************************************************************/
  743. void HintSimLock(U16 index)
  744. {
  745.     /*----------------------------------------------------------------*/
  746.     /* Local Variables                                                */
  747.     /*----------------------------------------------------------------*/
  748.     /*----------------------------------------------------------------*/
  749.     /* Code Body                                                      */
  750.     /*----------------------------------------------------------------*/
  751.     memset((S8*) hintData[(index)], 0, MAX_SUB_MENU_SIZE);
  752.     if (gSecuritySetupContext.SimLockStatus == CHV_DISABLED)
  753.     {
  754.         pfnUnicodeStrncpy((PS8) hintData[index], (PS8) GetString(STR_GLOBAL_OFF), MAX_SUBMENU_CHARACTERS);
  755.     }
  756.     else
  757.     {
  758.         pfnUnicodeStrncpy((PS8) hintData[index], (PS8) GetString(STR_GLOBAL_ON), MAX_SUBMENU_CHARACTERS);
  759.     }
  760. }
  761. /*****************************************************************************
  762.  * FUNCTION
  763.  *  HintPhoneLock
  764.  * DESCRIPTION
  765.  *  Hint handler for Phone lock.
  766.  * PARAMETERS
  767.  *  index       [IN]        
  768.  * RETURNS
  769.  *  void
  770.  *****************************************************************************/
  771. void HintPhoneLock(U16 index)
  772. {
  773.     /*----------------------------------------------------------------*/
  774.     /* Local Variables                                                */
  775.     /*----------------------------------------------------------------*/
  776.     /*----------------------------------------------------------------*/
  777.     /* Code Body                                                      */
  778.     /*----------------------------------------------------------------*/
  779.     memset((S8*) hintData[(index)], 0, MAX_SUB_MENU_SIZE);
  780.     if (GetPhoneLock())
  781.     {
  782.         pfnUnicodeStrncpy((PS8) hintData[index], (PS8) GetString(STR_GLOBAL_ON), MAX_SUBMENU_CHARACTERS);
  783.     }
  784.     else
  785.     {
  786.         pfnUnicodeStrncpy((PS8) hintData[index], (PS8) GetString(STR_GLOBAL_OFF), MAX_SUBMENU_CHARACTERS);
  787.     }
  788. }
  789. /*****************************************************************************
  790.  * FUNCTION
  791.  *  HintAutoKeypadLock
  792.  * DESCRIPTION
  793.  *  Hint handler for AutoKeypad lock.
  794.  * PARAMETERS
  795.  *  index       [IN]        
  796.  * RETURNS
  797.  *  void
  798.  *****************************************************************************/
  799. #ifdef __MMI_AUTO_KEYPAD_LOCK__
  800. void HintAutoKeypadLock(U16 index)
  801. {
  802.     /*----------------------------------------------------------------*/
  803.     /* Local Variables                                                */
  804.     /*----------------------------------------------------------------*/
  805.     /*----------------------------------------------------------------*/
  806.     /* Code Body                                                      */
  807.     /*----------------------------------------------------------------*/
  808.     memset((S8*) hintData[(index)], 0, MAX_SUB_MENU_SIZE);
  809.     if (0 != GetAutoKeypadLockTime())
  810.     {
  811.         pfnUnicodeStrncpy((PS8) hintData[index], (PS8) GetString(STR_GLOBAL_ON), MAX_SUBMENU_CHARACTERS);
  812.     }
  813.     else
  814.     {
  815.         pfnUnicodeStrncpy((PS8) hintData[index], (PS8) GetString(STR_GLOBAL_OFF), MAX_SUBMENU_CHARACTERS);
  816.     }
  817. }
  818. #endif /* __MMI_AUTO_KEYPAD_LOCK__ */ 
  819. /*****************************************************************************
  820.  * FUNCTION
  821.  *  HintFdl
  822.  * DESCRIPTION
  823.  *  Hint handler for FDL.
  824.  * PARAMETERS
  825.  *  index       [IN]        
  826.  * RETURNS
  827.  *  void
  828.  *****************************************************************************/
  829. void HintFdl(U16 index)
  830. {
  831.     /*----------------------------------------------------------------*/
  832.     /* Local Variables                                                */
  833.     /*----------------------------------------------------------------*/
  834.     /*----------------------------------------------------------------*/
  835.     /* Code Body                                                      */
  836.     /*----------------------------------------------------------------*/
  837.     memset((S8*) hintData[(index)], 0, MAX_SUB_MENU_SIZE);
  838.     if (gSecuritySetupContext.FdlStatus)
  839.     {
  840.         pfnUnicodeStrncpy((PS8) hintData[index], (PS8) GetString(STR_GLOBAL_ON), MAX_SUBMENU_CHARACTERS);
  841.     }
  842.     else
  843.     {
  844.         pfnUnicodeStrncpy((PS8) hintData[index], (PS8) GetString(STR_GLOBAL_OFF), MAX_SUBMENU_CHARACTERS);
  845.     }
  846. }
  847. /*****************************************************************************
  848.  * FUNCTION
  849.  *  HintBdl
  850.  * DESCRIPTION
  851.  *  Hint handler for BDL
  852.  * PARAMETERS
  853.  *  index       [IN]        
  854.  * RETURNS
  855.  *  void
  856.  *****************************************************************************/
  857. void HintBdl(U16 index)
  858. {
  859.     /*----------------------------------------------------------------*/
  860.     /* Local Variables                                                */
  861.     /*----------------------------------------------------------------*/
  862.     /*----------------------------------------------------------------*/
  863.     /* Code Body                                                      */
  864.     /*----------------------------------------------------------------*/
  865.     memset((S8*) hintData[(index)], 0, MAX_SUB_MENU_SIZE);
  866.     if (gSecuritySetupContext.BdlStatus)
  867.     {
  868.         pfnUnicodeStrncpy((PS8) hintData[index], (PS8) GetString(STR_GLOBAL_ON), MAX_SUBMENU_CHARACTERS);
  869.     }
  870.     else
  871.     {
  872.         pfnUnicodeStrncpy((PS8) hintData[index], (PS8) GetString(STR_GLOBAL_OFF), MAX_SUBMENU_CHARACTERS);
  873.     }
  874. }
  875. /*****************************************************************************
  876.  * FUNCTION
  877.  *  HintFdlMode
  878.  * DESCRIPTION
  879.  *  Hint handler for FDL mode.
  880.  * PARAMETERS
  881.  *  index       [IN]        
  882.  * RETURNS
  883.  *  void
  884.  *****************************************************************************/
  885. void HintFdlMode(U16 index)
  886. {
  887.     /*----------------------------------------------------------------*/
  888.     /* Local Variables                                                */
  889.     /*----------------------------------------------------------------*/
  890.     /*----------------------------------------------------------------*/
  891.     /* Code Body                                                      */
  892.     /*----------------------------------------------------------------*/
  893.     memset((S8*) hintData[(index)], 0, MAX_SUB_MENU_SIZE);
  894.     if (gSecuritySetupContext.FdlStatus)
  895.     {
  896.         pfnUnicodeStrncpy((PS8) hintData[index], (PS8) GetString(STR_GLOBAL_ON), MAX_SUBMENU_CHARACTERS);
  897.     }
  898.     else
  899.     {
  900.         pfnUnicodeStrncpy((PS8) hintData[index], (PS8) GetString(STR_GLOBAL_OFF), MAX_SUBMENU_CHARACTERS);
  901.     }
  902. }
  903. /*****************************************************************************
  904.  * FUNCTION
  905.  *  HintBdlMode
  906.  * DESCRIPTION
  907.  *  Hint handler for BDL Mode.
  908.  * PARAMETERS
  909.  *  index       [IN]        
  910.  * RETURNS
  911.  *  void
  912.  *****************************************************************************/
  913. void HintBdlMode(U16 index)
  914. {
  915.     /*----------------------------------------------------------------*/
  916.     /* Local Variables                                                */
  917.     /*----------------------------------------------------------------*/
  918.     /*----------------------------------------------------------------*/
  919.     /* Code Body                                                      */
  920.     /*----------------------------------------------------------------*/
  921.     memset((S8*) hintData[(index)], 0, MAX_SUB_MENU_SIZE);
  922.     if (gSecuritySetupContext.BdlStatus)
  923.     {
  924.         pfnUnicodeStrncpy((PS8) hintData[index], (PS8) GetString(STR_GLOBAL_ON), MAX_SUBMENU_CHARACTERS);
  925.     }
  926.     else
  927.     {
  928.         pfnUnicodeStrncpy((PS8) hintData[index], (PS8) GetString(STR_GLOBAL_OFF), MAX_SUBMENU_CHARACTERS);
  929.     }
  930. }
  931. /*****************************************************************************
  932.  * FUNCTION
  933.  *  EntrySECSETMain
  934.  * DESCRIPTION
  935.  *  enter security-setup menu screen
  936.  * PARAMETERS
  937.  *  void
  938.  * RETURNS
  939.  *  void
  940.  *****************************************************************************/
  941. void EntrySECSETMain(void)
  942. {
  943.     /*----------------------------------------------------------------*/
  944.     /* Local Variables                                                */
  945.     /*----------------------------------------------------------------*/
  946.     U16 nStrItemList[MAX_SUB_MENUS];    /* Stores the strings id of submenus returned */
  947.     U16 nNumofItem;                     /* Stores no of children in the submenu */
  948.     //micha1229
  949.     //      U16 nDispAttribute; /* Stores display attribue */
  950.     U8 *guiBuffer;              /* Buffer holding history data */
  951.     U8 *SecurityType[MAX_SUB_MENUS];
  952.     /*----------------------------------------------------------------*/
  953.     /* Code Body                                                      */
  954.     /*----------------------------------------------------------------*/
  955.     EntryNewScreen(SCR_ID_SECSET_MAIN, NULL, EntrySECSETMain, NULL);
  956.     /* 2 Get current screen to gui buffer  for history purposes */
  957.     guiBuffer = GetCurrGuiBuffer(SCR_ID_SECSET_MAIN);
  958.     /* 3. Retrieve no of child of menu item to be displayed */
  959.     nNumofItem = GetNumOfChild_Ext(MENU9101_SECURITY);
  960.     /* 4. Get attribute of menu to be displayed */
  961.     /* nDispAttribute = GetDispAttributeOfItem(MENU9101_SECURITY); */
  962.     /* 5. Retrieve string ids in sequence of given menu item to be displayed */
  963.     GetSequenceStringIds_Ext(MENU9101_SECURITY, nStrItemList);
  964.     /* 6 Set current parent id */
  965.     SetParentHandler(MENU9101_SECURITY);
  966.     /* 7 Register highlight handler to be called in menu screen */
  967.     RegisterHighlightHandler(ExecuteCurrHiliteHandler);
  968.     /* 8 Construct the Hints List */
  969.     ConstructHintsList(MENU9101_SECURITY, SecurityType);
  970.     /* 8 Display Category52 Screen */
  971.     ShowCategory52Screen(
  972.         STR_SCR9002_SECURITY_CAPTION,
  973.         MAIN_MENU_TITLE_SETTINGS_ICON,
  974.         STR_GLOBAL_OK,
  975.         IMG_GLOBAL_OK,
  976.         STR_GLOBAL_BACK,
  977.         IMG_GLOBAL_BACK,
  978.         nNumofItem,
  979.         nStrItemList,
  980.         (PU16) gIndexIconsImageList,
  981.         SecurityType,
  982.         0,
  983.         0,
  984.         guiBuffer);
  985.     /* 9.Register function with right softkey */
  986.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  987.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  988. }
  989. /*****************************************************************************
  990.  * FUNCTION
  991.  *  EntrySECSETPhoneLock
  992.  * DESCRIPTION
  993.  *  entry sceen to enter phonelock
  994.  * PARAMETERS
  995.  *  void
  996.  * RETURNS
  997.  *  void
  998.  *****************************************************************************/
  999. void EntrySECSETPhoneLock(void)
  1000. {
  1001.     /*----------------------------------------------------------------*/
  1002.     /* Local Variables                                                */
  1003.     /*----------------------------------------------------------------*/
  1004.     U8 *guiBuffer;  /* Buffer holding history data */
  1005.     U8 *inputBuffer;
  1006.     /*----------------------------------------------------------------*/
  1007.     /* Code Body                                                      */
  1008.     /*----------------------------------------------------------------*/
  1009.     EntryNewScreen(SCR_ID_SECSET_PHONE_LOCK, ExitSECSETPhoneLock, NULL, NULL);
  1010.     guiBuffer = GetCurrGuiBuffer(SCR_ID_SECSET_PHONE_LOCK);
  1011.     inputBuffer = GetCurrInputBuffer(SCR_ID_SECSET_PHONE_LOCK);
  1012.     if (inputBuffer == NULL)
  1013.     {
  1014.         memset(gSecuritySetupContext.Password, 0, (MAX_SIM_SETTING_PASSWD_LEN + 1) * ENCODING_LENGTH);
  1015.     }
  1016.     else
  1017.     {
  1018.         pfnUnicodeStrcpy((S8*) gSecuritySetupContext.Password, (S8*) inputBuffer);
  1019.     }
  1020.     RegisterInputBoxValidationFunction(RstrSettingPasswdScrSoftKeyFunc);
  1021.     /* START VIJAY PMT 20060103 */
  1022. #if defined UI_SMALL_PIN_EDITOR_SCREEN
  1023.     enable_resized_small_screen();
  1024. #endif 
  1025.     /* END VIJAY PMT 20060103 */
  1026.     ShowCategory111Screen(
  1027.         STR_GLOBAL_OK,
  1028.         IMG_GLOBAL_OK,
  1029.         STR_GLOBAL_BACK,
  1030.         IMG_GLOBAL_BACK,
  1031.         STR_RESTORE_PHONE,
  1032.         INPUT_TYPE_NUMERIC_PASSWORD,
  1033.         gSecuritySetupContext.Password,
  1034.         (MAX_SIM_SETTING_PASSWD_LEN + 1),
  1035.         NULL,
  1036.         guiBuffer);
  1037.     SetCategory111RightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1038.     SetKeyHandler(SECSETSetPhoneLockReq, KEY_POUND, KEY_EVENT_UP);
  1039.     SetLeftSoftkeyFunction(SECSETSetPhoneLockReq, KEY_EVENT_UP);
  1040.     /* micha0606 */
  1041.     gSecuritySetupContext.PasswdLenCheckCallBack = SECSETSetPhoneLockReq;
  1042.     if (pfnUnicodeStrlen((S8*) gSecuritySetupContext.Password) < MIN_PASSWORD_LENGTH)
  1043.     {
  1044.         ChangeLeftSoftkey(0, 0);
  1045.         ClearKeyHandler(KEY_POUND, KEY_EVENT_UP);
  1046.     }
  1047. }
  1048. /*****************************************************************************
  1049.  * FUNCTION
  1050.  *  ExitSECSETPhoneLock
  1051.  * DESCRIPTION
  1052.  *  Exit screen for enter phone lock screen.
  1053.  * PARAMETERS
  1054.  *  void
  1055.  * RETURNS
  1056.  *  void
  1057.  *****************************************************************************/
  1058. void ExitSECSETPhoneLock(void)
  1059. {
  1060.     /*----------------------------------------------------------------*/
  1061.     /* Local Variables                                                */
  1062.     /*----------------------------------------------------------------*/
  1063.     history Scr;    /* * Variable to hold the history data */
  1064.     /*----------------------------------------------------------------*/
  1065.     /* Code Body                                                      */
  1066.     /*----------------------------------------------------------------*/
  1067.     Scr.scrnID = SCR_ID_SECSET_PHONE_LOCK;
  1068.     Scr.entryFuncPtr = EntrySECSETPhoneLock;
  1069.     pfnUnicodeStrcpy((S8*) Scr.inputBuffer, (S8*) gSecuritySetupContext.Password);
  1070.     GetCategoryHistory(Scr.guiBuffer);
  1071.     AddHistory(Scr);
  1072. }
  1073. /*****************************************************************************
  1074.  * FUNCTION
  1075.  *  EntrySECSETAKPLTime
  1076.  * DESCRIPTION
  1077.  *  Entry screen for Autokeypadlock Time.
  1078.  * PARAMETERS
  1079.  *  void
  1080.  * RETURNS
  1081.  *  void
  1082.  *****************************************************************************/
  1083. #ifdef __MMI_AUTO_KEYPAD_LOCK__
  1084. void EntrySECSETAKPLTime(void)
  1085. {
  1086.     /*----------------------------------------------------------------*/
  1087.     /* Local Variables                                                */
  1088.     /*----------------------------------------------------------------*/
  1089.     U16 nStrItemList[MAX_SUB_MENUS];    /* Stores the strings id of submenus returned */
  1090.     U16 nNumofItem;                     /* Stores no of children in the submenu */
  1091.     //micha1229
  1092.     //      U16 nDispAttribute; /* Stores display attribue */
  1093.     U8 *guiBuffer;              /* Buffer holding history data */
  1094.     U8 data1 = 0;
  1095.     S16 error = 0, error1 = 0;
  1096.     /*----------------------------------------------------------------*/
  1097.     /* Code Body                                                      */
  1098.     /*----------------------------------------------------------------*/
  1099.     EntryNewScreen(SCR_ID_SECSET_AKPL_TIME, NULL, EntrySECSETAKPLTime, NULL);
  1100.     /* 2 Get current screen to gui buffer  for history purposes */
  1101.     guiBuffer = GetCurrGuiBuffer(SCR_ID_SECSET_AKPL_TIME);
  1102.     /* 3. Retrieve no of child of menu item to be displayed */
  1103.     nNumofItem = GetNumOfChild(MENU9178_AKPL_TIME);
  1104.     /* 4. Get attribute of menu to be displayed */
  1105.     /* nDispAttribute = GetDispAttributeOfItem(MENU9178_AKPL_TIME); */
  1106.     /* 5. Retrieve string ids in sequence of given menu item to be displayed */
  1107.     GetSequenceStringIds(MENU9178_AKPL_TIME, nStrItemList);
  1108.     /* 6 Set current parent id */
  1109.     SetParentHandler(MENU9178_AKPL_TIME);
  1110.     /* 7 Register highlight handler to be called in menu screen */
  1111.     RegisterHighlightHandler(AutoKeyPadLockTimeHandler);
  1112.     ReadValue(NVRAM_SETTING_AUTOKEYPADLOCK_TIME, &data1, DS_BYTE, &error1);
  1113.     if (error != NVRAM_READ_SUCCESS)
  1114.     {
  1115.     }
  1116.     if (data1 == 0xff)
  1117.     {
  1118.         data1 = 0;
  1119.         WriteValue(NVRAM_SETTING_AUTOKEYPADLOCK_TIME, &data1, DS_BYTE, &error1);
  1120.     }
  1121.     gSecuritySetupContext.AutoKeyPadLockTime = data1;
  1122.     /* 8 Display Category11 Screen */
  1123.     ShowCategory11Screen(
  1124.         STR_MENU9166_AUTO_KEYPAD_LOCK,
  1125.         MAIN_MENU_TITLE_SETTINGS_ICON,
  1126.         STR_GLOBAL_OK,
  1127.         0,
  1128.         STR_GLOBAL_BACK,
  1129.         0,
  1130.         nNumofItem,
  1131.         nStrItemList,
  1132.         (U16) data1,
  1133.         guiBuffer);
  1134.     /* 9.Register function with right softkey */
  1135.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1136.     SetLeftSoftkeyFunction(SendAKPLTimeMessageAndShowScreen, KEY_EVENT_UP);
  1137.     SetKeyHandler(0, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
  1138.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  1139. }
  1140. #endif /* __MMI_AUTO_KEYPAD_LOCK__ */ 
  1141. /*****************************************************************************
  1142.  * FUNCTION
  1143.  *  AutoKeyPadLockTimeHandler
  1144.  * DESCRIPTION
  1145.  *  Handler function when user select any of the given
  1146.  *  options in autokeypad lock time screen.
  1147.  * PARAMETERS
  1148.  *  index       [IN]        
  1149.  * RETURNS
  1150.  *  void
  1151.  *  
  1152.  *  Author            : Vanita Jain(?)
  1153.  *****************************************************************************/
  1154. void AutoKeyPadLockTimeHandler(S32 index)
  1155. {
  1156.     /*----------------------------------------------------------------*/
  1157.     /* Local Variables                                                */
  1158.     /*----------------------------------------------------------------*/
  1159.     /*----------------------------------------------------------------*/
  1160.     /* Code Body                                                      */
  1161.     /*----------------------------------------------------------------*/
  1162.     gCurrentOnOff = (U8) index;
  1163. }
  1164. /*****************************************************************************
  1165.  * FUNCTION
  1166.  *  SendAKPLTimeMessageAndShowScreen
  1167.  * DESCRIPTION
  1168.  *  Set hint handler as On or Off for autokeypad lock.
  1169.  * PARAMETERS
  1170.  *  void
  1171.  * RETURNS
  1172.  *  void
  1173.  *****************************************************************************/
  1174. void SendAKPLTimeMessageAndShowScreen(void)
  1175. {
  1176.     /*----------------------------------------------------------------*/
  1177.     /* Local Variables                                                */
  1178.     /*----------------------------------------------------------------*/
  1179.     U8 data;
  1180.     S16 error;
  1181.     U16 index;
  1182.     /*----------------------------------------------------------------*/
  1183.     /* Code Body                                                      */
  1184.     /*----------------------------------------------------------------*/
  1185.     index = GetCurrHiliteID();
  1186.     data = gCurrentOnOff;
  1187.     memset((S8*) hintData[(index)], 0, MAX_SUB_MENU_SIZE);
  1188.     if (data)
  1189.     {
  1190.         pfnUnicodeStrncpy((PS8) hintData[index], (PS8) GetString(STR_GLOBAL_ON), MAX_SUBMENU_CHARACTERS);
  1191.         Category52ChangeItemDescription(2, hintData[index]);
  1192.     }
  1193.     else
  1194.     {
  1195.         pfnUnicodeStrncpy((PS8) hintData[index], (PS8) GetString(STR_GLOBAL_OFF), MAX_SUBMENU_CHARACTERS);
  1196.         Category52ChangeItemDescription(2, hintData[index]);
  1197.     }
  1198.     RedrawCategoryFunction();
  1199.     if (gSecuritySetupContext.AutoKeyPadLockTime != gCurrentOnOff)
  1200.     {
  1201.         WriteValue(NVRAM_SETTING_AUTOKEYPADLOCK_TIME, &data, DS_BYTE, &error);
  1202.         DisplayPopup((PU8) GetString(STR_GLOBAL_DONE), IMG_GLOBAL_ACTIVATED, 1, ST_NOTIFYDURATION, 0);
  1203.         DeleteNHistory(1);
  1204.     }
  1205.     else
  1206.     {
  1207.         GoBackHistory();
  1208.     }
  1209. }
  1210. /*****************************************************************************
  1211.  * FUNCTION
  1212.  *  SECSETGetPIN2StatusReq
  1213.  * DESCRIPTION
  1214.  *  Send request to L4 to get the status of PIN2.
  1215.  * PARAMETERS
  1216.  *  void
  1217.  * RETURNS
  1218.  *  void
  1219.  *  
  1220.  *  Author            : Vanita Jain(?)
  1221.  *****************************************************************************/
  1222. void SECSETGetPIN2StatusReq(void)
  1223. {
  1224.     /*----------------------------------------------------------------*/
  1225.     /* Local Variables                                                */
  1226.     /*----------------------------------------------------------------*/
  1227.     MYQUEUE msgStruct;
  1228.     /*----------------------------------------------------------------*/
  1229.     /* Code Body                                                      */
  1230.     /*----------------------------------------------------------------*/
  1231.     ClearInputEventHandler(MMI_DEVICE_ALL);
  1232.     SetProtocolEventHandler(SECSETGetPIN2StatusRsp, PRT_MMI_SMU_CHECK_PIN_STATUS_RSP);
  1233.     msgStruct.oslSrcId = MOD_MMI;
  1234.     msgStruct.oslDestId = MOD_L4C;
  1235.     /* micha1229 */
  1236.     msgStruct.oslMsgId = PRT_MMI_SMU_CHECK_PIN_STATUS_REQ;
  1237.     msgStruct.oslSapId = INVALID_SAP;
  1238.     msgStruct.oslDataPtr = NULL;
  1239.     msgStruct.oslPeerBuffPtr = NULL;
  1240.     OslMsgSendExtQueue(&msgStruct);
  1241. }
  1242. /*****************************************************************************
  1243.  * FUNCTION
  1244.  *  SECSETGetPIN2StatusRsp
  1245.  * DESCRIPTION
  1246.  *  Response of request to get the status of PIN2.
  1247.  * PARAMETERS
  1248.  *  info        [?]     
  1249.  * RETURNS
  1250.  *  void
  1251.  *  
  1252.  *  Author            : Vanita Jain(?)
  1253.  *****************************************************************************/
  1254. void SECSETGetPIN2StatusRsp(void *info)
  1255. {
  1256.     /*----------------------------------------------------------------*/
  1257.     /* Local Variables                                                */
  1258.     /*----------------------------------------------------------------*/
  1259.     SMUSTATUSRSP *resp;
  1260.     historyNode *History;
  1261.     /*----------------------------------------------------------------*/
  1262.     /* Code Body                                                      */
  1263.     /*----------------------------------------------------------------*/
  1264.     resp = (SMUSTATUSRSP*) (info);
  1265.     FillCountDownNumber(resp->chv_info);
  1266.     if (resp->chv_status.chv2_status == CHV_BLOCKED)
  1267.     {
  1268.         DisplayPopup((PU8) GetString(STR_SETTING_PIN2_BLK2), IMG_GLOBAL_ERROR, 0, ST_NOTIFYDURATION, ERROR_TONE);
  1269.         ExitSECSETPUK2();
  1270.         if (GetHistoryScrID(SCR_ID_SECSET_PUK2, &History) == ST_SUCCESS)
  1271.         {
  1272.             if (History->inputBuffer != NULL)
  1273.             {
  1274.                 memset(History->inputBuffer, 0, ENCODING_LENGTH);
  1275.             }
  1276.             if (History->guiBuffer != NULL)
  1277.             {
  1278.                 memset(History->guiBuffer, 0, 2);
  1279.             }
  1280.         }
  1281.         DeleteUptoScrID(SCR_ID_SECSET_PUK2);
  1282.     }
  1283.     else if (resp->chv_status.chv2_status == CHV_RETRY_ALLOW || resp->chv_status.chv2_status == CHV_VERIFIED)
  1284.     {
  1285.         EntrySECSETPIN2();
  1286.     }
  1287.     else if (resp->chv_status.chv2_status == CHV_INVALID_TYPE || resp->chv_status.chv2_status == CHV_DEAD || resp->chv_status.chv2_status == CHV_NOTINITED)
  1288.     {
  1289.         DisplayPopup(
  1290.             (PU8) GetString(STR_ID_PIN2_NOT_SUPPORT),
  1291.             IMG_GLOBAL_ERROR,
  1292.             0,
  1293.             ST_NOTIFYDURATION,
  1294.             ERROR_TONE);
  1295.     }
  1296. }
  1297. /*****************************************************************************
  1298.  * FUNCTION
  1299.  *  SECSETGetPIN1StatusReq
  1300.  * DESCRIPTION
  1301.  *  Send request to L4 to get the status of PIN1.
  1302.  * PARAMETERS
  1303.  *  void
  1304.  * RETURNS
  1305.  *  void
  1306.  *  
  1307.  *  Author            : Vanita Jain(?)
  1308.  *****************************************************************************/
  1309. void SECSETGetPIN1StatusReq(void)
  1310. {
  1311.     /*----------------------------------------------------------------*/
  1312.     /* Local Variables                                                */
  1313.     /*----------------------------------------------------------------*/
  1314.     MYQUEUE msgStruct;
  1315.     /*----------------------------------------------------------------*/
  1316.     /* Code Body                                                      */
  1317.     /*----------------------------------------------------------------*/
  1318.     SetProtocolEventHandler(SECSETGetPIN1StatusRsp, PRT_MMI_SMU_CHECK_PIN_STATUS_RSP);
  1319.     msgStruct.oslSrcId = MOD_MMI;
  1320.     msgStruct.oslDestId = MOD_L4C;
  1321.     /* micha1229 */
  1322.     msgStruct.oslMsgId = PRT_MMI_SMU_CHECK_PIN_STATUS_REQ;
  1323.     msgStruct.oslSapId = INVALID_SAP;
  1324.     msgStruct.oslDataPtr = NULL;
  1325.     msgStruct.oslPeerBuffPtr = NULL;
  1326.     OslMsgSendExtQueue(&msgStruct);
  1327. }
  1328. /*****************************************************************************
  1329.  * FUNCTION
  1330.  *  SECSETGetPIN1StatusRsp
  1331.  * DESCRIPTION
  1332.  *  Response of request to get the status of PIN1.
  1333.  * PARAMETERS
  1334.  *  info        [?]     
  1335.  * RETURNS
  1336.  *  void
  1337.  *  
  1338.  *  Author            : Vanita Jain(?)
  1339.  *****************************************************************************/
  1340. void SECSETGetPIN1StatusRsp(void *info)
  1341. {
  1342.     /*----------------------------------------------------------------*/
  1343.     /* Local Variables                                                */
  1344.     /*----------------------------------------------------------------*/
  1345.     SMUSTATUSRSP *resp;
  1346.     /*----------------------------------------------------------------*/
  1347.     /* Code Body                                                      */
  1348.     /*----------------------------------------------------------------*/
  1349.     resp = (SMUSTATUSRSP*) (info);
  1350.     FillCountDownNumber(resp->chv_info);
  1351.     gSecuritySetupContext.SimLockStatus = resp->chv_status.chv1_status;
  1352. }
  1353. /*****************************************************************************
  1354.  * FUNCTION
  1355.  *  EntrySECSETPIN2
  1356.  * DESCRIPTION
  1357.  *  Entry fn to enter PIN2 for FDL.
  1358.  * PARAMETERS
  1359.  *  void
  1360.  * RETURNS
  1361.  *  void
  1362.  *****************************************************************************/
  1363. void EntrySECSETPIN2(void)
  1364. {
  1365.     /*----------------------------------------------------------------*/
  1366.     /* Local Variables                                                */
  1367.     /*----------------------------------------------------------------*/
  1368.     U8 *guiBuffer;  /* Buffer holding history data */
  1369.     U8 *inputBuffer;
  1370.     U8 PassCountdownDisp[MAX_PASS_COUNTDOWN_DISP];
  1371.     /*----------------------------------------------------------------*/
  1372.     /* Code Body                                                      */
  1373.     /*----------------------------------------------------------------*/
  1374.     EntryNewScreen(SCR_ID_SECSET_PIN2, ExitSECSETPIN2, NULL, NULL);
  1375.     /* 2 Get current screen to gui buffer  for history purposes */
  1376.     guiBuffer = GetCurrGuiBuffer(SCR_ID_SECSET_PIN2);
  1377.     inputBuffer = GetCurrInputBuffer(SCR_ID_SECSET_PIN2);
  1378.     if (inputBuffer == NULL)
  1379.     {
  1380.         memset(gSecuritySetupContext.Password, 0, (MAX_SIM_SETTING_PASSWD_LEN + 1) * ENCODING_LENGTH);
  1381.     }
  1382.     else
  1383.     {
  1384.         pfnUnicodeStrcpy((S8*) gSecuritySetupContext.Password, (S8*) inputBuffer);
  1385.     }
  1386.     RegisterInputBoxValidationFunction(RstrSettingPasswdScrSoftKeyFunc);
  1387.     FillCountDownString(MMI_SETTING_TYPE_CHV2, PassCountdownDisp);
  1388.     ShowCategory111Screen(
  1389.         STR_GLOBAL_OK,
  1390.         IMG_GLOBAL_OK,
  1391.         STR_GLOBAL_BACK,
  1392.         IMG_GLOBAL_BACK,
  1393.         STR_SCR9027_PIN2_CAPTION,
  1394.         INPUT_TYPE_NUMERIC_PASSWORD,
  1395.         gSecuritySetupContext.Password,
  1396.         (MAX_SIM_SETTING_PASSWD_LEN + 1),
  1397.         PassCountdownDisp,
  1398.         guiBuffer);
  1399.     SetCategory111RightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1400.     SetKeyHandler(VerifyPin2, KEY_POUND, KEY_EVENT_UP);
  1401.     SetLeftSoftkeyFunction(VerifyPin2, KEY_EVENT_UP);
  1402.     /* micha0606 */
  1403.     gSecuritySetupContext.PasswdLenCheckCallBack = VerifyPin2;
  1404.     if (pfnUnicodeStrlen((S8*) gSecuritySetupContext.Password) < MIN_PASSWORD_LENGTH)
  1405.     {
  1406.         ChangeLeftSoftkey(0, 0);
  1407.         ClearKeyHandler(KEY_POUND, KEY_EVENT_UP);
  1408.     }
  1409. }
  1410. /*****************************************************************************
  1411.  * FUNCTION
  1412.  *  ExitSECSETPIN2
  1413.  * DESCRIPTION
  1414.  *  Exit Fixed dial menu item
  1415.  * PARAMETERS
  1416.  *  void
  1417.  * RETURNS
  1418.  *  void
  1419.  *****************************************************************************/
  1420. void ExitSECSETPIN2(void)
  1421. {
  1422.     /*----------------------------------------------------------------*/
  1423.     /* Local Variables                                                */
  1424.     /*----------------------------------------------------------------*/
  1425.     history Scr;    /* Variable to hold the history data */
  1426.     /*----------------------------------------------------------------*/
  1427.     /* Code Body                                                      */
  1428.     /*----------------------------------------------------------------*/
  1429.     Scr.scrnID = SCR_ID_SECSET_PIN2;
  1430.     Scr.entryFuncPtr = EntrySECSETPIN2;
  1431.     pfnUnicodeStrcpy((S8*) Scr.inputBuffer, (S8*) gSecuritySetupContext.Password);
  1432.     GetCategoryHistory(Scr.guiBuffer);
  1433.     AddHistory(Scr);
  1434. }
  1435. /*****************************************************************************
  1436.  * FUNCTION
  1437.  *  VerifyPin2
  1438.  * DESCRIPTION
  1439.  *  Verify Pin2.
  1440.  * PARAMETERS
  1441.  *  void
  1442.  * RETURNS
  1443.  *  void
  1444.  *****************************************************************************/
  1445. void VerifyPin2(void)
  1446. {
  1447.     /*----------------------------------------------------------------*/
  1448.     /* Local Variables                                                */
  1449.     /*----------------------------------------------------------------*/
  1450.     U8 tempBuffer[(MAX_SIM_SETTING_PASSWD_LEN + 1)];
  1451.     /*----------------------------------------------------------------*/
  1452.     /* Code Body                                                      */
  1453.     /*----------------------------------------------------------------*/
  1454.     memset(tempBuffer, 0, (MAX_SIM_SETTING_PASSWD_LEN + 1));
  1455.     SECSETVerifyPINReq(MMI_SETTING_TYPE_CHV2, gSecuritySetupContext.Password, tempBuffer, NULL);
  1456. }
  1457. /*****************************************************************************
  1458.  * FUNCTION
  1459.  *  EntrySECSETFixDial
  1460.  * DESCRIPTION
  1461.  *  Entry screen for FDL option screen.
  1462.  * PARAMETERS
  1463.  *  void
  1464.  * RETURNS
  1465.  *  void
  1466.  *****************************************************************************/
  1467. void EntrySECSETFixDial(void)
  1468. {
  1469.     /*----------------------------------------------------------------*/
  1470.     /* Local Variables                                                */
  1471.     /*----------------------------------------------------------------*/
  1472.     U16 nStrItemList[MAX_SUB_MENUS];    /* Stores the strings id of submenus returned */
  1473.     U16 nNumofItem;                     /* Stores no of children in the submenu */
  1474.     //micha1229
  1475.     //      U16 nDispAttribute; /* Stores display attribue */
  1476.     U8 *guiBuffer;              /* Buffer holding history data */
  1477.     U8 *FdlType[MAX_SUB_MENUS];
  1478.     /*----------------------------------------------------------------*/
  1479.     /* Code Body                                                      */
  1480.     /*----------------------------------------------------------------*/
  1481.     EntryNewScreen(SCR_ID_SECSET_FIX_DIAL, NULL, EntrySECSETFixDial, NULL);
  1482.     /* 2 Get current screen to gui buffer  for history purposes */
  1483.     guiBuffer = GetCurrGuiBuffer(SCR_ID_SECSET_FIX_DIAL);
  1484.     /* 3. Retrieve no of child of menu item to be displayed */
  1485.     nNumofItem = GetNumOfChild(MENU9167_FIXED_DIAL);
  1486.     /* 4. Get attribute of menu to be displayed */
  1487.     /* nDispAttribute = GetDispAttributeOfItem(MENU9167_FIXED_DIAL); */
  1488.     /* 5. Retrieve string ids in sequence of given menu item to be displayed */
  1489.     GetSequenceStringIds(MENU9167_FIXED_DIAL, nStrItemList);
  1490.     /* 6 Set current parent id */
  1491.     SetParentHandler(MENU9167_FIXED_DIAL);
  1492.     /* 7 Register highlight handler to be called in menu screen */
  1493.     RegisterHighlightHandler(ExecuteCurrHiliteHandler);
  1494.     /* 8 Construct the Hints List */
  1495.     ConstructHintsList(MENU9167_FIXED_DIAL, FdlType);
  1496.     /* 8 Display Category52 Screen */
  1497.     ShowCategory52Screen(
  1498.         STR_MENU9167_FIXED_DIAL,
  1499.         MAIN_MENU_TITLE_SETTINGS_ICON,
  1500.         STR_GLOBAL_OK,
  1501.         IMG_GLOBAL_OK,
  1502.         STR_GLOBAL_BACK,
  1503.         IMG_GLOBAL_BACK,
  1504.         nNumofItem,
  1505.         nStrItemList,
  1506.         (PU16) gIndexIconsImageList,
  1507.         FdlType,
  1508.         0,
  1509.         0,
  1510.         guiBuffer);
  1511.     /* 9.Register function with right softkey */
  1512.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1513.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  1514. }
  1515. /*****************************************************************************
  1516.  * FUNCTION
  1517.  *  EntrySECSETBarDial
  1518.  * DESCRIPTION
  1519.  *  
  1520.  * PARAMETERS
  1521.  *  void
  1522.  * RETURNS
  1523.  *  void
  1524.  *****************************************************************************/
  1525. void EntrySECSETBarDial(void)
  1526. {
  1527.     /*----------------------------------------------------------------*/
  1528.     /* Local Variables                                                */
  1529.     /*----------------------------------------------------------------*/
  1530.     U16 nStrItemList[MAX_SUB_MENUS];    /* Stores the strings id of submenus returned */
  1531.     U16 nNumofItem;                     /* Stores no of children in the submenu */
  1532.     //micha1229
  1533.     //      U16 nDispAttribute; /* Stores display attribue */
  1534.     U8 *guiBuffer;              /* Buffer holding history data */
  1535.     U8 *BdlType[MAX_SUB_MENUS];
  1536.     /*----------------------------------------------------------------*/
  1537.     /* Code Body                                                      */
  1538.     /*----------------------------------------------------------------*/
  1539.     EntryNewScreen(SCR_ID_SECSET_BAR_DIAL, NULL, EntrySECSETBarDial, NULL);
  1540.     /* 2 Get current screen to gui buffer  for history purposes */
  1541.     guiBuffer = GetCurrGuiBuffer(SCR_ID_SECSET_BAR_DIAL);
  1542.     /* 3. Retrieve no of child of menu item to be displayed */
  1543.     nNumofItem = GetNumOfChild(MENU9168_BARRED_DAIL);
  1544.     /* 4. Get attribute of menu to be displayed */
  1545.     /* nDispAttribute = GetDispAttributeOfItem(MENU9168_BARRED_DAIL); */
  1546.     /* 5. Retrieve string ids in sequence of given menu item to be displayed */
  1547.     GetSequenceStringIds(MENU9168_BARRED_DAIL, nStrItemList);
  1548.     /* 6 Set current parent id */
  1549.     SetParentHandler(MENU9168_BARRED_DAIL);
  1550.     /* 7 Register highlight handler to be called in menu screen */
  1551.     RegisterHighlightHandler(ExecuteCurrHiliteHandler);
  1552.     ConstructHintsList(MENU9168_BARRED_DAIL, BdlType);
  1553.     /* 8 Display Category52 Screen */
  1554.     ShowCategory52Screen(
  1555.         STR_MENU9168_BARRED_DAIL,
  1556.         MAIN_MENU_TITLE_SETTINGS_ICON,
  1557.         STR_GLOBAL_OK,
  1558.         IMG_GLOBAL_OK,
  1559.         STR_GLOBAL_BACK,
  1560.         IMG_GLOBAL_BACK,
  1561.         nNumofItem,
  1562.         nStrItemList,
  1563.         (PU16) gIndexIconsImageList,
  1564.         BdlType,
  1565.         0,
  1566.         0,
  1567.         guiBuffer);
  1568.     /* 9.Register function with right softkey */
  1569.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1570.     SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
  1571. }
  1572. /*****************************************************************************
  1573.  * FUNCTION
  1574.  *  SECSETSetSIMLockReq
  1575.  * DESCRIPTION
  1576.  *  A general fn to make Req for all type of Security options.
  1577.  * PARAMETERS
  1578.  *  void
  1579.  * RETURNS
  1580.  *  void
  1581.  *****************************************************************************/
  1582. void SECSETSetSIMLockReq(void)
  1583. {
  1584.     /*----------------------------------------------------------------*/
  1585.     /* Local Variables                                                */
  1586.     /*----------------------------------------------------------------*/
  1587.     MYQUEUE msgStruct;
  1588.     MMISMULOCKREQSTRUCT *smuLockReq;
  1589.     S8 pOutBuffer[(MAX_SIM_SETTING_PASSWD_LEN + 1) + 1];
  1590.     /*----------------------------------------------------------------*/
  1591.     /* Code Body                                                      */
  1592.     /*----------------------------------------------------------------*/
  1593.     ClearInputEventHandler(MMI_DEVICE_ALL);
  1594.     ClearKeyHandler(KEY_END, KEY_EVENT_DOWN);
  1595.     ClearKeyHandler(KEY_END, KEY_EVENT_UP);
  1596.     memset(pOutBuffer, 0, (MAX_SIM_SETTING_PASSWD_LEN + 1) + 1);
  1597.     smuLockReq = OslConstructDataPtr(sizeof(MMISMULOCKREQSTRUCT));
  1598.     if (gSecuritySetupContext.SimLockStatus != CHV_DISABLED)
  1599.     {
  1600.         smuLockReq->opcode = MMI_DISABLE;
  1601.     }
  1602.     else
  1603.     {
  1604.         smuLockReq->opcode = MMI_ENABLE;
  1605.     }
  1606.     smuLockReq->type = (U8) MMI_SETTING_TYPE_CHV1;
  1607.     memset(smuLockReq->passwd, 0, (MAX_SIM_SETTING_PASSWD_LEN + 1));
  1608.     UnicodeToAnsii(pOutBuffer, (PS8) gSecuritySetupContext.Password);
  1609.     memcpy(smuLockReq->passwd, pOutBuffer, (MAX_SIM_SETTING_PASSWD_LEN + 1));
  1610.     gSecuritySetupContext.SMULockSuccessCallBack = SECSETSetSIMLockSuccess;
  1611.     gSecuritySetupContext.SMULockFailCallBack = SECSETSetSIMLockFail;
  1612.     SetProtocolEventHandler(SECSETSMULockRsp, PRT_MMI_SMU_LOCK_RSP);
  1613.     msgStruct.oslSrcId = MOD_MMI;
  1614.     msgStruct.oslDestId = MOD_L4C;
  1615.     /* micha1229 */
  1616.     msgStruct.oslMsgId = PRT_MMI_SMU_LOCK_REQ;
  1617.     msgStruct.oslSapId = INVALID_SAP;
  1618.     msgStruct.oslDataPtr = (oslParaType*) smuLockReq;
  1619.     msgStruct.oslPeerBuffPtr = NULL;
  1620.     OslMsgSendExtQueue(&msgStruct);
  1621. }
  1622. /*****************************************************************************
  1623.  * FUNCTION
  1624.  *  SECSETSetSIMLockSuccess
  1625.  * DESCRIPTION
  1626.  *  A general fn to make Req for all type of Security options.
  1627.  * PARAMETERS
  1628.  *  void
  1629.  * RETURNS
  1630.  *  void
  1631.  *****************************************************************************/
  1632. void SECSETSetSIMLockSuccess(void)
  1633. {
  1634.     /*----------------------------------------------------------------*/
  1635.     /* Local Variables                                                */
  1636.     /*----------------------------------------------------------------*/
  1637.     U16 index;
  1638.     /*----------------------------------------------------------------*/
  1639.     /* Code Body                                                      */
  1640.     /*----------------------------------------------------------------*/
  1641.     index = GetCurrHiliteID();
  1642.     if (gSecuritySetupContext.SimLockStatus != CHV_DISABLED)
  1643.     {
  1644.         gSecuritySetupContext.SimLockStatus = CHV_DISABLED;
  1645.         pfnUnicodeStrncpy((PS8) hintData[index], (PS8) GetString(STR_GLOBAL_OFF), MAX_SUBMENU_CHARACTERS);
  1646.         Category52ChangeItemDescription(0, hintData[index]);
  1647.         change_left_softkey(STR_GLOBAL_ON, 0);
  1648.         DisplayPopup((PU8) GetString(STR_SETTING_SIM_UNLOCK), IMG_GLOBAL_ACTIVATED, 1, ST_NOTIFYDURATION, 0);
  1649.     }
  1650.     else
  1651.     {
  1652.         gSecuritySetupContext.SimLockStatus = CHV_VERIFIED;
  1653.         pfnUnicodeStrncpy((PS8) hintData[index], (PS8) GetString(STR_GLOBAL_ON), MAX_SUBMENU_CHARACTERS);
  1654.         Category52ChangeItemDescription(0, hintData[index]);
  1655.         change_left_softkey(STR_GLOBAL_OFF, 0);
  1656.         DisplayPopup((PU8) GetString(STR_SETTING_SIM_LOCK), IMG_GLOBAL_ACTIVATED, 1, ST_NOTIFYDURATION, 0);
  1657.     }
  1658.     DeleteScreenIfPresent(SCR_ID_SECSET_SIM_LOCK_PIN1);
  1659. }
  1660. /*****************************************************************************
  1661.  * FUNCTION
  1662.  *  SECSETSetSIMLockFail
  1663.  * DESCRIPTION
  1664.  *  A general fn to make Req for all type of Security options.
  1665.  * PARAMETERS
  1666.  *  void
  1667.  * RETURNS
  1668.  *  void
  1669.  *****************************************************************************/
  1670. void SECSETSetSIMLockFail(void)
  1671. {
  1672.     /*----------------------------------------------------------------*/
  1673.     /* Local Variables                                                */
  1674.     /*----------------------------------------------------------------*/
  1675.     historyNode *History;
  1676.     /*----------------------------------------------------------------*/
  1677.     /* Code Body                                                      */
  1678.     /*----------------------------------------------------------------*/
  1679.     DisplayPopup((PU8) GetString(STR_WRONG_PIN), IMG_GLOBAL_ERROR, 0, ST_NOTIFYDURATION, ERROR_TONE);
  1680.     if (GetHistoryScrID(SCR_ID_SECSET_SIM_LOCK_PIN1, &History) == ST_SUCCESS)
  1681.     {
  1682.         if (History->inputBuffer != NULL)
  1683.         {
  1684.             memset(History->inputBuffer, 0, ENCODING_LENGTH);
  1685.         }
  1686.         if (History->guiBuffer != NULL)
  1687.         {
  1688.             memset(History->guiBuffer, 0, 2);
  1689.         }
  1690.     }
  1691. }
  1692. /*****************************************************************************
  1693.  * FUNCTION
  1694.  *  SECSETSetPhoneLockReq
  1695.  * DESCRIPTION
  1696.  *  A general fn to make Req for all type of Security options.
  1697.  * PARAMETERS
  1698.  *  void
  1699.  * RETURNS
  1700.  *  void
  1701.  *****************************************************************************/
  1702. void SECSETSetPhoneLockReq(void)
  1703. {
  1704.     /*----------------------------------------------------------------*/
  1705.     /* Local Variables                                                */
  1706.     /*----------------------------------------------------------------*/
  1707.     MYQUEUE msgStruct;
  1708.     MMISMULOCKREQSTRUCT *smuLockReq;
  1709.     S8 pOutBuffer[(MAX_SIM_SETTING_PASSWD_LEN + 1) + 1];
  1710.     /*----------------------------------------------------------------*/
  1711.     /* Code Body                                                      */
  1712.     /*----------------------------------------------------------------*/
  1713.     ClearInputEventHandler(MMI_DEVICE_ALL);
  1714.     ClearKeyHandler(KEY_END, KEY_EVENT_DOWN);
  1715.     ClearKeyHandler(KEY_END, KEY_EVENT_UP);
  1716.     memset(pOutBuffer, 0, (MAX_SIM_SETTING_PASSWD_LEN + 1) + 1);
  1717.     smuLockReq = OslConstructDataPtr(sizeof(MMISMULOCKREQSTRUCT));
  1718.     if (gSecuritySetupContext.PhoneLockStatus)
  1719.     {
  1720.         smuLockReq->opcode = MMI_DISABLE;
  1721.     }
  1722.     else
  1723.     {
  1724.         smuLockReq->opcode = MMI_ENABLE;
  1725.     }
  1726.     smuLockReq->type = (U8) MMI_SETTING_TYPE_PHONELOCK;
  1727.     memset(smuLockReq->passwd, 0, (MAX_SIM_SETTING_PASSWD_LEN + 1));
  1728.     UnicodeToAnsii(pOutBuffer, (PS8) gSecuritySetupContext.Password);
  1729.     memcpy(smuLockReq->passwd, pOutBuffer, (MAX_SIM_SETTING_PASSWD_LEN + 1));
  1730.     gSecuritySetupContext.SMULockSuccessCallBack = SECSETSetPhoneLockSuccess;
  1731.     gSecuritySetupContext.SMULockFailCallBack = SETSETSetPhoneLockFail;
  1732.     SetProtocolEventHandler(SECSETSMULockRsp, PRT_MMI_SMU_LOCK_RSP);
  1733.     msgStruct.oslSrcId = MOD_MMI;
  1734.     msgStruct.oslDestId = MOD_L4C;
  1735.     /* micha1229 */
  1736.     msgStruct.oslMsgId = PRT_MMI_SMU_LOCK_REQ;
  1737.     msgStruct.oslSapId = INVALID_SAP;
  1738.     msgStruct.oslDataPtr = (oslParaType*) smuLockReq;
  1739.     msgStruct.oslPeerBuffPtr = NULL;
  1740.     OslMsgSendExtQueue(&msgStruct);
  1741. }
  1742. /*****************************************************************************
  1743.  * FUNCTION
  1744.  *  SECSETSetPhoneLockSuccess
  1745.  * DESCRIPTION
  1746.  *  A general fn to make Req for all type of Security options.
  1747.  * PARAMETERS
  1748.  *  void
  1749.  * RETURNS
  1750.  *  void
  1751.  *****************************************************************************/
  1752. void SECSETSetPhoneLockSuccess(void)
  1753. {
  1754.     /*----------------------------------------------------------------*/
  1755.     /* Local Variables                                                */
  1756.     /*----------------------------------------------------------------*/
  1757.     U16 index;
  1758. #ifndef MMI_ON_HARDWARE_P
  1759.     U8 data;
  1760.     S16 error = 0;
  1761. #endif /* MMI_ON_HARDWARE_P */ 
  1762.     /*----------------------------------------------------------------*/
  1763.     /* Code Body                                                      */
  1764.     /*----------------------------------------------------------------*/
  1765.     index = GetCurrHiliteID();
  1766.     gSecuritySetupContext.PhoneLockStatus = !gSecuritySetupContext.PhoneLockStatus;
  1767. #ifndef MMI_ON_HARDWARE_P
  1768.     data = gSecuritySetupContext.PhoneLockStatus;
  1769.     WriteValue(NVRAM_SETTING_PHONELOCK, &data, DS_BYTE, &error);
  1770. #endif /* MMI_ON_HARDWARE_P */ 
  1771.     if (gSecuritySetupContext.PhoneLockStatus == 0)
  1772.     {
  1773.         pfnUnicodeStrncpy((PS8) hintData[index], (PS8) GetString(STR_GLOBAL_OFF), MAX_SUBMENU_CHARACTERS);
  1774.         Category52ChangeItemDescription(1, hintData[index]);
  1775.         change_left_softkey(STR_GLOBAL_ON, 0);
  1776.         DisplayPopup((PU8) GetString(STR_SETTING_PHONE_UNLOCK), IMG_GLOBAL_ACTIVATED, 1, ST_NOTIFYDURATION, 0);
  1777.     }
  1778.     else
  1779.     {
  1780.         pfnUnicodeStrncpy((PS8) hintData[index], (PS8) GetString(STR_GLOBAL_ON), MAX_SUBMENU_CHARACTERS);
  1781.         Category52ChangeItemDescription(1, hintData[index]);
  1782.         change_left_softkey(STR_GLOBAL_OFF, 0);
  1783.         DisplayPopup((PU8) GetString(STR_SETTING_PHONE_LOCK), IMG_GLOBAL_ACTIVATED, 1, ST_NOTIFYDURATION, 0);
  1784.     }
  1785.     DeleteScreenIfPresent(SCR_ID_SECSET_PHONE_LOCK);
  1786. }
  1787. /*****************************************************************************
  1788.  * FUNCTION
  1789.  *  SETSETSetPhoneLockFail
  1790.  * DESCRIPTION
  1791.  *  A general fn to make Req for all type of Security options.
  1792.  * PARAMETERS
  1793.  *  void
  1794.  * RETURNS
  1795.  *  void
  1796.  *****************************************************************************/
  1797. void SETSETSetPhoneLockFail(void)
  1798. {
  1799.     /*----------------------------------------------------------------*/
  1800.     /* Local Variables                                                */
  1801.     /*----------------------------------------------------------------*/
  1802.     historyNode *History;
  1803.     /*----------------------------------------------------------------*/
  1804.     /* Code Body                                                      */
  1805.     /*----------------------------------------------------------------*/
  1806.     DisplayPopup((PU8) GetString(STR_SETTING_WRONG), IMG_GLOBAL_ERROR, 0, ST_NOTIFYDURATION, ERROR_TONE);
  1807.     if (GetHistoryScrID(SCR_ID_SECSET_PHONE_LOCK, &History) == ST_SUCCESS)
  1808.     {
  1809.         if (History->inputBuffer != NULL)
  1810.         {
  1811.             memset(History->inputBuffer, 0, ENCODING_LENGTH);
  1812.         }
  1813.         if (History->guiBuffer != NULL)
  1814.         {
  1815.             memset(History->guiBuffer, 0, 2);
  1816.         }
  1817.     }
  1818. }
  1819. /*****************************************************************************
  1820.  * FUNCTION
  1821.  *  SETSETSMURspFailure
  1822.  * DESCRIPTION
  1823.  *  
  1824.  * PARAMETERS
  1825.  *  void
  1826.  * RETURNS
  1827.  *  void
  1828.  *****************************************************************************/
  1829. void SETSETSMURspFailure(void)
  1830. {
  1831.     /*----------------------------------------------------------------*/
  1832.     /* Local Variables                                                */
  1833.     /*----------------------------------------------------------------*/
  1834.     historyNode *History;
  1835.     /*----------------------------------------------------------------*/
  1836.     /* Code Body                                                      */
  1837.     /*----------------------------------------------------------------*/
  1838.     DisplayPopup((PU8) GetString(STR_ID_SECSET_UNSPECIFIED_ERROR), IMG_GLOBAL_UNFINISHED, 1, ST_NOTIFYDURATION, ERROR_TONE);
  1839.     if (GetHistoryScrID(SCR_ID_SECSET_PHONE_LOCK, &History) == ST_SUCCESS ||
  1840.         GetHistoryScrID(SCR_ID_SECSET_SIM_LOCK_PIN1, &History) == ST_SUCCESS)
  1841.     {
  1842.         if (History->inputBuffer != NULL)
  1843.         {
  1844.             memset(History->inputBuffer, 0, ENCODING_LENGTH);
  1845.         }
  1846.         if (History->guiBuffer != NULL)
  1847.         {
  1848.             memset(History->guiBuffer, 0, ENCODING_LENGTH);
  1849.         }
  1850.     }
  1851. }
  1852. /*****************************************************************************
  1853.  * FUNCTION
  1854.  *  SECSETSMULockRsp
  1855.  * DESCRIPTION
  1856.  *  A general fn to make Req for all type of Security options.
  1857.  * PARAMETERS
  1858.  *  info        [?]     
  1859.  * RETURNS
  1860.  *  void
  1861.  *****************************************************************************/
  1862. void SECSETSMULockRsp(void *info)
  1863. {
  1864.     /*----------------------------------------------------------------*/
  1865.     /* Local Variables                                                */
  1866.     /*----------------------------------------------------------------*/
  1867.     historyNode *History;
  1868.     SMULOCKRSP *resp;
  1869.     /*----------------------------------------------------------------*/
  1870.     /* Code Body                                                      */
  1871.     /*----------------------------------------------------------------*/
  1872.     resp = (SMULOCKRSP*) (info);
  1873.     if (!(resp->result == 0 && resp->cause == MMI_SETTING_TYPE_UNSPECIFIED))
  1874.     {
  1875.         FillCountDownNumber(resp->chv_info);
  1876.     }
  1877.     if (resp->result == 1)
  1878.     {
  1879.         if (gSecuritySetupContext.SMULockSuccessCallBack != NULL)
  1880.         {
  1881.             (*gSecuritySetupContext.SMULockSuccessCallBack) ();
  1882.             gSecuritySetupContext.SMULockSuccessCallBack = NULL;
  1883.         }
  1884.     }
  1885.     else if (resp->result == 0 && resp->cause == MMI_SETTING_TYPE_UBCHV1)
  1886.     {
  1887.         ExitSECSETPUK1();
  1888.         DisplayPopup((PU8) GetString(STR_SETTING_PIN_BLK), IMG_GLOBAL_ERROR, 0, ST_NOTIFYDURATION, ERROR_TONE);
  1889.         DeleteUptoScrID(SCR_ID_SECSET_PUK1);
  1890.         if (GetHistoryScrID(SCR_ID_SECSET_PUK1, &History) == ST_SUCCESS)
  1891.         {
  1892.             if (History->inputBuffer != NULL)
  1893.             {
  1894.                 memset(History->inputBuffer, 0, ENCODING_LENGTH);
  1895.             }
  1896.             if (History->guiBuffer != NULL)
  1897.             {
  1898.                 memset(History->guiBuffer, 0, 2);
  1899.             }
  1900.         }
  1901.         gSecuritySetupContext.SMULockSuccessCallBack = NULL;
  1902.         gSecuritySetupContext.SMULockFailCallBack = NULL;
  1903.     }
  1904.     /* diamond, 2006/03/30 Handle the specific case of SMU busy for something */
  1905.     else if (resp->result == 0 && resp->cause == MMI_SETTING_TYPE_UNSPECIFIED)
  1906.     {
  1907.         SETSETSMURspFailure();
  1908.         gSecuritySetupContext.SMULockSuccessCallBack = NULL;
  1909.         gSecuritySetupContext.SMULockFailCallBack = NULL;
  1910.     }
  1911.     else
  1912.     {
  1913.         if (gSecuritySetupContext.SMULockFailCallBack != NULL)
  1914.         {
  1915.             (*gSecuritySetupContext.SMULockFailCallBack) ();
  1916.             gSecuritySetupContext.SMULockFailCallBack = NULL;
  1917.         }
  1918.     }
  1919.     pfnUnicodeStrcpy((S8*) gSecuritySetupContext.Password, (S8*) "");
  1920. }
  1921. /*****************************************************************************
  1922.  * FUNCTION
  1923.  *  EntrySECSETChangePassword
  1924.  * DESCRIPTION
  1925.  *  Entry fn for change password option menu.
  1926.  * PARAMETERS
  1927.  *  void
  1928.  * RETURNS
  1929.  *  void
  1930.  *****************************************************************************/
  1931. void EntrySECSETChangePassword(void)
  1932. {
  1933.     /*----------------------------------------------------------------*/
  1934.     /* Local Variables                                                */
  1935.     /*----------------------------------------------------------------*/
  1936.     U16 nStrItemList[MAX_SUB_MENUS];    /* Stores the strings id of submenus returned */
  1937.     U16 nNumofItem;                     /* Stores no of children in the submenu */
  1938.     //micha1229
  1939.     //      U16 nDispAttribute; /* Stores display attribue */
  1940.     U8 *guiBuffer;              /* Buffer holding history data */
  1941.     /*----------------------------------------------------------------*/
  1942.     /* Code Body                                                      */
  1943.     /*----------------------------------------------------------------*/
  1944.     EntryNewScreen(SCR_ID_SECSET_CHANGE_PASSWORD, NULL, EntrySECSETChangePassword, NULL);
  1945.     /* 2 Get current screen to gui buffer  for history purposes */
  1946.     guiBuffer = GetCurrGuiBuffer(SCR_ID_SECSET_CHANGE_PASSWORD);
  1947.     /* 3. Retrieve no of child of menu item to be displayed */
  1948.     nNumofItem = GetNumOfChild_Ext(MENU9170_CHANGE_PASSWORD);
  1949.     /* 4. Get attribute of menu to be displayed */
  1950.     /* nDispAttribute = GetDispAttributeOfItem(MENU9170_CHANGE_PASSWORD); */
  1951.     /* 5. Retrieve string ids in sequence of given menu item to be displayed */
  1952.     GetSequenceStringIds_Ext(MENU9170_CHANGE_PASSWORD, nStrItemList);
  1953.     /* 6 Set current parent id */
  1954.     SetParentHandler(MENU9170_CHANGE_PASSWORD);
  1955.     /* 7 Register highlight handler to be called in menu screen */
  1956.     RegisterHighlightHandler(ExecuteCurrHiliteHandler);
  1957.     /* 8 Display Category15 Screen */
  1958.     ShowCategory15Screen(
  1959.         STR_SCR9026_CHANGE_PASSWORD_CAPTION,
  1960.         MAIN_MENU_TITLE_SETTINGS_ICON,
  1961.         STR_GLOBAL_OK,
  1962.         IMG_GLOBAL_OK,
  1963.         STR_GLOBAL_BACK,
  1964.         IMG_GLOBAL_BACK,
  1965.         nNumofItem,
  1966.         nStrItemList,
  1967.         (PU16) gIndexIconsImageList,
  1968.         LIST_MENU,
  1969.         0,
  1970.         guiBuffer);
  1971.     /* 9.Register function with right softkey */
  1972.     SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  1973. }
  1974. /*****************************************************************************
  1975.  * FUNCTION
  1976.  *  SECSETGetPIN1ForChangeReq
  1977.  * DESCRIPTION
  1978.  *  To get the status of Pin1/Pin2.
  1979.  * PARAMETERS
  1980.  *  void
  1981.  * RETURNS
  1982.  *  void
  1983.  *****************************************************************************/
  1984. void SECSETGetPIN1ForChangeReq(void)
  1985. {
  1986. #ifdef MMI_ON_HARDWARE_P
  1987.     /*----------------------------------------------------------------*/
  1988.     /* Local Variables                                                */
  1989.     /*----------------------------------------------------------------*/
  1990.     MYQUEUE msgStruct;
  1991.     /*----------------------------------------------------------------*/
  1992.     /* Code Body                                                      */
  1993.     /*----------------------------------------------------------------*/
  1994.     ClearInputEventHandler(MMI_DEVICE_ALL);
  1995.     SetProtocolEventHandler(SECSETGetPIN1ForChangeRsp, PRT_MMI_SMU_CHECK_PIN_STATUS_RSP);
  1996.     msgStruct.oslSrcId = MOD_MMI;
  1997.     msgStruct.oslDestId = MOD_L4C;
  1998.     /* micha1229 */
  1999.     msgStruct.oslMsgId = PRT_MMI_SMU_CHECK_PIN_STATUS_REQ;
  2000.     msgStruct.oslSapId = INVALID_SAP;
  2001.     msgStruct.oslDataPtr = NULL;
  2002.     msgStruct.oslPeerBuffPtr = NULL;
  2003.     OslMsgSendExtQueue(&msgStruct);
  2004. #else /* MMI_ON_HARDWARE_P */ 
  2005.     PopupNoSupport();   /* PC simulator doesn't support to access PIN1 from SIM card */
  2006. #endif /* MMI_ON_HARDWARE_P */ 
  2007. }
  2008. /*****************************************************************************
  2009.  * FUNCTION
  2010.  *  SECSETGetPIN2ForChangeReq
  2011.  * DESCRIPTION
  2012.  *  To get the status of Pin1/Pin2.
  2013.  * PARAMETERS
  2014.  *  void
  2015.  * RETURNS
  2016.  *  void
  2017.  *****************************************************************************/
  2018. void SECSETGetPIN2ForChangeReq(void)
  2019. {
  2020. #ifdef MMI_ON_HARDWARE_P
  2021.     /*----------------------------------------------------------------*/
  2022.     /* Local Variables                                                */
  2023.     /*----------------------------------------------------------------*/
  2024.     MYQUEUE msgStruct;
  2025.     /*----------------------------------------------------------------*/
  2026.     /* Code Body                                                      */
  2027.     /*----------------------------------------------------------------*/
  2028.     ClearInputEventHandler(MMI_DEVICE_ALL);
  2029.     SetProtocolEventHandler(SECSETGetPIN2ForChangeRsp, PRT_MMI_SMU_CHECK_PIN_STATUS_RSP);
  2030.     msgStruct.oslSrcId = MOD_MMI;
  2031.     msgStruct.oslDestId = MOD_L4C;
  2032.     /* micha1229 */
  2033.     msgStruct.oslMsgId = PRT_MMI_SMU_CHECK_PIN_STATUS_REQ;
  2034.     msgStruct.oslSapId = INVALID_SAP;
  2035.     msgStruct.oslDataPtr = NULL;
  2036.     msgStruct.oslPeerBuffPtr = NULL;
  2037.     OslMsgSendExtQueue(&msgStruct);
  2038. #else /* MMI_ON_HARDWARE_P */ 
  2039.     PopupNoSupport();   /* PC simulator doesn't support to access PIN2 from SIM card */
  2040. #endif /* MMI_ON_HARDWARE_P */ 
  2041. }
  2042. /*****************************************************************************
  2043.  * FUNCTION
  2044.  *  SECSETGetPIN1ForChangeRsp
  2045.  * DESCRIPTION
  2046.  *  Handles response of req to get the status of PIN1/PIN2.
  2047.  * PARAMETERS
  2048.  *  info        [?]     
  2049.  * RETURNS
  2050.  *  void
  2051.  *****************************************************************************/
  2052. void SECSETGetPIN1ForChangeRsp(void *info)
  2053. {
  2054.     /*----------------------------------------------------------------*/
  2055.     /* Local Variables                                                */
  2056.     /*----------------------------------------------------------------*/
  2057.     SMUSTATUSRSP *resp;
  2058.     /*----------------------------------------------------------------*/
  2059.     /* Code Body                                                      */
  2060.     /*----------------------------------------------------------------*/
  2061.     resp = (SMUSTATUSRSP*) (info);
  2062.     FillCountDownNumber(resp->chv_info);
  2063. #if 0
  2064. /* under construction !*/
  2065. /* under construction !*/
  2066. /* under construction !*/
  2067. /* under construction !*/
  2068. /* under construction !*/
  2069. /* under construction !*/
  2070. /* under construction !*/
  2071. /* under construction !*/
  2072. /* under construction !*/
  2073. #endif /* 0 */ 
  2074.     /* diamond, 2006/03/21 CHV1 enabled or not should be referred to mmi_smu_check_pin_status_rsp.chv_info.is_chv1_enabled */
  2075.     if (resp->chv_info.is_chv1_enabled)
  2076.     {
  2077.         EntrySECSETChangePWOldPWD();
  2078.     }
  2079.     else
  2080.     {
  2081.         DisplayPopup((PU8) GetString(STR_ENABLE_PIN), IMG_GLOBAL_ERROR, 0, ST_NOTIFYDURATION, ERROR_TONE);
  2082.     }
  2083. }
  2084. /*****************************************************************************
  2085.  * FUNCTION
  2086.  *  SECSETGetPIN2ForChangeRsp
  2087.  * DESCRIPTION
  2088.  *  Handles response of req to get the status of PIN1/PIN2.
  2089.  * PARAMETERS
  2090.  *  info        [?]     
  2091.  * RETURNS
  2092.  *  void
  2093.  *****************************************************************************/
  2094. void SECSETGetPIN2ForChangeRsp(void *info)
  2095. {
  2096.     /*----------------------------------------------------------------*/
  2097.     /* Local Variables                                                */
  2098.     /*----------------------------------------------------------------*/
  2099.     SMUSTATUSRSP *resp;
  2100.     historyNode *History;
  2101.     /*----------------------------------------------------------------*/
  2102.     /* Code Body                                                      */
  2103.     /*----------------------------------------------------------------*/
  2104.     resp = (SMUSTATUSRSP*) (info);
  2105.     FillCountDownNumber(resp->chv_info);
  2106.     switch (resp->chv_status.chv2_status)
  2107.     {
  2108.         case CHV_BLOCKED:
  2109.             DisplayPopup((PU8) GetString(STR_SETTING_PIN2_BLK2), IMG_GLOBAL_ERROR, 0, ST_NOTIFYDURATION, ERROR_TONE);
  2110.             ExitSECSETPUK2();
  2111.             if (GetHistoryScrID(SCR_ID_SECSET_PUK2, &History) == ST_SUCCESS)
  2112.             {
  2113.                 if (History->inputBuffer != NULL)
  2114.                 {
  2115.                     memset(History->inputBuffer, 0, ENCODING_LENGTH);
  2116.                 }
  2117.                 if (History->guiBuffer != NULL)
  2118.                 {
  2119.                     memset(History->guiBuffer, 0, 2);
  2120.                 }
  2121.             }
  2122.             DeleteUptoScrID(SCR_ID_SECSET_PUK2);
  2123.             break;
  2124.         case CHV_DEAD:
  2125.         case CHV_INVALID_TYPE:
  2126.         case CHV_NOTINITED:
  2127.         {
  2128.             DisplayPopup(
  2129.                 (PU8) GetString(STR_ID_PIN2_NOT_SUPPORT),
  2130.                 IMG_GLOBAL_ERROR,
  2131.                 0,
  2132.                 ST_NOTIFYDURATION,
  2133.                 ERROR_TONE);
  2134.         }
  2135.             break;
  2136.         default:
  2137.             EntrySECSETChangePWOldPWD();
  2138.             break;
  2139.     }
  2140. }
  2141. /*****************************************************************************
  2142.  * FUNCTION
  2143.  *  EntrySECSETChangePWOldPWD
  2144.  * DESCRIPTION
  2145.  *  Entry screen to get old pwd of Phonelock/pin1/pin2 from user
  2146.  * PARAMETERS
  2147.  *  void
  2148.  * RETURNS
  2149.  *  void
  2150.  *****************************************************************************/
  2151. void EntrySECSETChangePWOldPWD(void)
  2152. {
  2153.     /*----------------------------------------------------------------*/
  2154.     /* Local Variables                                                */
  2155.     /*----------------------------------------------------------------*/
  2156.     U8 *guiBuffer;
  2157.     U8 *inputBuffer;
  2158.     U8 PassCountdownDisp[MAX_PASS_COUNTDOWN_DISP];
  2159.     /*----------------------------------------------------------------*/
  2160.     /* Code Body                                                      */
  2161.     /*----------------------------------------------------------------*/
  2162.     EntryNewScreen(SCR_ID_SECSET_CHANGEPW_OLD_PWD, ExitSECSETChangePWOldPWD, NULL, NULL);
  2163.     guiBuffer = GetCurrGuiBuffer(SCR_ID_SECSET_CHANGEPW_OLD_PWD);
  2164.     inputBuffer = GetCurrInputBuffer(SCR_ID_SECSET_CHANGEPW_OLD_PWD);
  2165.     RegisterHighlightHandler(ExecuteCurrHiliteHandler);
  2166.     if (inputBuffer == NULL)
  2167.     {
  2168.         memset(gSecuritySetupContext.Password, 0, (MAX_SIM_SETTING_PASSWD_LEN + 1) * ENCODING_LENGTH);
  2169.     }
  2170.     else
  2171.     {
  2172.         pfnUnicodeStrcpy((S8*) gSecuritySetupContext.Password, (S8*) inputBuffer);
  2173.     }
  2174.     RegisterInputBoxValidationFunction(RstrSettingPasswdScrSoftKeyFunc);
  2175.     switch (gSecuritySetupContext.CurrentPassword)
  2176.     {
  2177.         case 0:
  2178.             FillCountDownString(MMI_SETTING_TYPE_CHV1, PassCountdownDisp);
  2179.             ShowCategory111Screen(
  2180.                 STR_GLOBAL_OK,
  2181.                 IMG_GLOBAL_OK,
  2182.                 STR_GLOBAL_BACK,
  2183.                 IMG_GLOBAL_BACK,
  2184.                 STR_SETTING_OLD_PIN,
  2185.                 INPUT_TYPE_NUMERIC_PASSWORD,
  2186.                 gSecuritySetupContext.Password,
  2187.                 (MAX_SIM_SETTING_PASSWD_LEN + 1),
  2188.                 PassCountdownDisp,
  2189.                 guiBuffer);
  2190.             break;
  2191.         case 1:
  2192.             FillCountDownString(MMI_SETTING_TYPE_CHV2, PassCountdownDisp);
  2193.             ShowCategory111Screen(
  2194.                 STR_GLOBAL_OK,
  2195.                 IMG_GLOBAL_OK,
  2196.                 STR_GLOBAL_BACK,
  2197.                 IMG_GLOBAL_BACK,
  2198.                 STR_SETTING_OLD_PIN2,
  2199.                 INPUT_TYPE_NUMERIC_PASSWORD,
  2200.                 gSecuritySetupContext.Password,
  2201.                 (MAX_SIM_SETTING_PASSWD_LEN + 1),
  2202.                 PassCountdownDisp,
  2203.                 guiBuffer);
  2204.             break;
  2205.         case 2:
  2206.             ShowCategory111Screen(
  2207.                 STR_GLOBAL_OK,
  2208.                 IMG_GLOBAL_OK,
  2209.                 STR_GLOBAL_BACK,
  2210.                 IMG_GLOBAL_BACK,
  2211.                 STR_SCR9029_CURRENT_PW_CAPTION,
  2212.                 INPUT_TYPE_NUMERIC_PASSWORD,
  2213.                 gSecuritySetupContext.Password,
  2214.                 (MAX_SIM_SETTING_PASSWD_LEN + 1),
  2215.                 NULL,
  2216.                 guiBuffer);
  2217.             break;
  2218.     }
  2219.     SetLeftSoftkeyFunction(EntrySECSETChangePWNewPWD, KEY_EVENT_UP);
  2220.     SetKeyHandler(EntrySECSETChangePWNewPWD, KEY_POUND, KEY_EVENT_UP);
  2221.     SetCategory111RightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
  2222.     /* micha0606 */
  2223.     gSecuritySetupContext.PasswdLenCheckCallBack = EntrySECSETChangePWNewPWD;
  2224.     if (pfnUnicodeStrlen((S8*) gSecuritySetupContext.Password) < MIN_PASSWORD_LENGTH)
  2225.     {
  2226.         ChangeLeftSoftkey(0, 0);
  2227.         ClearKeyHandler(KEY_POUND, KEY_EVENT_UP);
  2228.     }
  2229. }
  2230. /*****************************************************************************
  2231.  * FUNCTION
  2232.  *  ExitSECSETChangePWOldPWD
  2233.  * DESCRIPTION
  2234.  *  
  2235.  * PARAMETERS
  2236.  *  void
  2237.  * RETURNS