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

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.  *
  37.  * Filename:
  38.  * ---------
  39.  * Personalization.c
  40.  *
  41.  * Project:
  42.  * --------
  43.  *   MAUI
  44.  *
  45.  * Description:
  46.  * ------------
  47.  *   This file is intends for Personalization check
  48.  *
  49.  * Author:
  50.  * -------
  51.  * -------
  52.  *
  53.  *============================================================================
  54.  *             HISTORY
  55.  * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
  56.  *------------------------------------------------------------------------------
  57.  * removed!
  58.  *
  59.  * removed!
  60.  * removed!
  61.  * removed!
  62.  *
  63.  * removed!
  64.  * removed!
  65.  * removed!
  66.  *
  67.  * removed!
  68.  * removed!
  69.  * removed!
  70.  *
  71.  * removed!
  72.  * removed!
  73.  * removed!
  74.  *
  75.  * removed!
  76.  * removed!
  77.  * removed!
  78.  * removed!
  79.  * removed!
  80.  * removed!
  81.  * removed!
  82.  *
  83.  * removed!
  84.  * removed!
  85.  * removed!
  86.  *
  87.  * removed!
  88.  * removed!
  89.  * removed!
  90.  *
  91.  * removed!
  92.  * removed!
  93.  * removed!
  94.  *
  95.  * removed!
  96.  * removed!
  97.  * removed!
  98.  *
  99.  *------------------------------------------------------------------------------
  100.  * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
  101.  *============================================================================
  102.  ****************************************************************************/
  103. /**
  104.  * Copyright Notice
  105.  * ?2002 - 2003, Pixtel Communications, Inc., 1489 43rd Ave. W.,
  106.  * Vancouver, B.C. V6M 4K8 Canada. All Rights Reserved.
  107.  *  (It is illegal to remove this copyright notice from this software or any
  108.  *  portion of it)
  109.  */
  110. /**************************************************************
  111.    FILENAME : Personalization.c
  112.    PURPOSE     : Does Personalization check
  113.    REMARKS     : nil
  114.    AUTHOR      : Deepali Gupta
  115.    DATE     : 12/03/03
  116. **************************************************************/
  117. #include "StdC.h"
  118. #include "L4Dr1.h"
  119. #include "HistoryGprot.h"
  120. #include "wgui_categories.h"
  121. #include "wgui_categories_inputs.h"
  122. #include "CommonScreens.h"
  123. #include "CustDataRes.h"
  124. #include "ProtocolEvents.h"
  125. #include "TimerEvents.h"
  126. #include "DebugInitDef.h"
  127. #include "UCS2prot.h"
  128. #include "TaskInit.h"
  129. #include "wgui_status_icons.h"
  130. #include "CustMenuRes.h"
  131. #include "Globaldefs.h"
  132. #include "Unicodexdcl.h"
  133. #include "SimDetectionHwMapFile.h"
  134. // #include "SimDetectionType.h"
  135. #include "SimDetectionDef.h"
  136. #include "SimDetectionGprot.h"
  137. #include "SimDetectionGexdcl.h"
  138. #include "audioinc.h"
  139. #include "SimDetectionDef.h"
  140. #include "PersonalizationDef.h"
  141. // #include "PersonalizationGdcl.h"
  142. #include "PersonalizationProt.h"
  143. #include "SettingProfile.h"
  144. #include "ProfileGprots.h"
  145. #include "L4Dr.h"
  146. #include "custom_util.h"
  147. /* micha1230 */
  148. #include "SettingDefs.h"
  149. #include "SettingGprots.h"
  150. #include "SettingsGdcl.h"
  151. #include "FlightModeGProt.h"
  152. #ifdef __MMI_TOUCH_SCREEN__
  153. #include "Wgui_touch_screen.h"
  154. #endif 
  155. #ifdef __MMI_SML_UNLOCK_RETRY_TIMER__
  156. extern void mmi_sml_set_next_attempt_function(FuncPtr func, S32 countdown);
  157. #endif
  158. /* micha1230 */
  159. extern U8 gCPHSRetryCount;
  160. //extern U8 idleScreenFirst;
  161. //extern U8 gPowerOnPeriod;
  162. /*****************************************************************************
  163.  * FUNCTION
  164.  *  EntryScrEnterNP
  165.  * DESCRIPTION
  166.  *  Function inputs NP from the user
  167.  * PARAMETERS
  168.  *  void
  169.  * RETURNS
  170.  *  void
  171.  *****************************************************************************/
  172. void EntryScrEnterNP(void)
  173. {
  174.     /*----------------------------------------------------------------*/
  175.     /* Local Variables                                                */
  176.     /*----------------------------------------------------------------*/
  177.     /* micha1230 */
  178.     S8 temp1[MAX_PASS_COUNTDOWN_DISP];
  179.     S8 temp2[MAX_PASS_COUNTDOWN_DISP];
  180.     /*----------------------------------------------------------------*/
  181.     /* Code Body                                                      */
  182.     /*----------------------------------------------------------------*/
  183.     sprintf(temp1, "%d", gCPHSRetryCount);
  184.     AnsiiToUnicodeString(temp2, temp1);
  185.     pfnUnicodeStrcpy((S8*) temp1, (S8*) GetString(STR_PASS_TRIALS_REMAIN));
  186.     pfnUnicodeStrcat((S8*) temp1, (S8*) temp2);
  187.     EntryNewScreen(SCR_ENTER_NP, NULL, EntryScrEnterNP, NULL);
  188.     DinitHistory();
  189.     g_pwr_context.PrevScreenIndicator = ENTER_NP;
  190.     g_pwr_context.PowerOnMMIStatus = MMI_POWER_ON_SECURITY_PERSONALIZATION;     /* 0x14: Personalization lock */
  191.     RegisterInputBoxValidationFunction(RstrSettingPasswdScrSoftKeyFunc);
  192.     ShowCategory111Screen(
  193.         STR_GLOBAL_OK,
  194.         IMG_GLOBAL_OK,
  195.         STR_RSK_SOS,
  196.         0,
  197.         STR_ENTER_NP_MSG,
  198.         INPUT_TYPE_NUMERIC_PASSWORD,
  199.         (U8*) gInputPwdBuffer,
  200.         /* micha1230 */ MAX_PWD_LENGTH_MMI,
  201.         (U8*) temp1,
  202.         NULL);
  203.     SetLeftSoftkeyFunction(ValidateNP, KEY_EVENT_UP);
  204.     SetKeyHandler(ValidateNP, KEY_POUND, KEY_EVENT_UP);
  205.     if (mmi_bootup_get_active_flight_mode() == 1)
  206.     {
  207.         SetCategory111RightSoftkeyFunction(mmi_flight_mode_popup_in_dialing_sos, KEY_EVENT_UP);
  208.     }
  209.     else
  210.     {
  211.         SetCategory111RightSoftkeyFunction(ShowMakeSOSCallScr, KEY_EVENT_UP);
  212.         SetKeyHandler(GoToSOSDialScr,KEY_SEND,KEY_EVENT_UP);
  213.     }
  214.     /* Disable LSK if the input password length isn't enough */
  215.     gSecuritySetupContext.PasswdLenCheckCallBack = ValidateNP;
  216.     if (pfnUnicodeStrlen((S8*) gInputPwdBuffer)  < MMI_MIN_PASSWORD_LENGTH)
  217.     {
  218.         ChangeLeftSoftkey(0, 0);
  219.         ClearKeyHandler(KEY_POUND, KEY_EVENT_UP);
  220.     }
  221. }
  222. /*****************************************************************************
  223.  * FUNCTION
  224.  *  EntryScrEnterNSP
  225.  * DESCRIPTION
  226.  *  Function inputs NSP from the user
  227.  * PARAMETERS
  228.  *  void
  229.  * RETURNS
  230.  *  void
  231.  *****************************************************************************/
  232. void EntryScrEnterNSP(void)
  233. {
  234.     /*----------------------------------------------------------------*/
  235.     /* Local Variables                                                */
  236.     /*----------------------------------------------------------------*/
  237.     /* micha1230 */
  238.     S8 temp1[MAX_PASS_COUNTDOWN_DISP];
  239.     S8 temp2[MAX_PASS_COUNTDOWN_DISP];
  240.     /*----------------------------------------------------------------*/
  241.     /* Code Body                                                      */
  242.     /*----------------------------------------------------------------*/
  243.     sprintf(temp1, "%d", gCPHSRetryCount);
  244.     AnsiiToUnicodeString((S8*) temp2, (S8*) temp1);
  245.     pfnUnicodeStrcpy((S8*) temp1, (S8*) GetString(STR_PASS_TRIALS_REMAIN));
  246.     pfnUnicodeStrcat((S8*) temp1, (S8*) temp2);
  247.     EntryNewScreen(SCR_ENTER_NP, NULL, EntryScrEnterNSP, NULL);
  248.     DinitHistory();
  249.     g_pwr_context.PrevScreenIndicator = ENTER_NSP;
  250.     g_pwr_context.PowerOnMMIStatus = MMI_POWER_ON_SECURITY_PERSONALIZATION;     /* 0x14: Personalization lock */
  251.     RegisterInputBoxValidationFunction(RstrSettingPasswdScrSoftKeyFunc);
  252.     ShowCategory111Screen(
  253.         STR_GLOBAL_OK,
  254.         IMG_GLOBAL_OK,
  255.         STR_RSK_SOS,
  256.         0,
  257.         STR_ENTER_NSP_MSG,
  258.         INPUT_TYPE_NUMERIC_PASSWORD,
  259.         (U8*) gInputPwdBuffer,
  260.         /* micha1230 */ MAX_PWD_LENGTH_MMI,
  261.         (U8*) temp1,
  262.         NULL);
  263.     SetLeftSoftkeyFunction(ValidateNSP, KEY_EVENT_UP);
  264.     SetKeyHandler(ValidateNSP, KEY_POUND, KEY_EVENT_UP);
  265.     if (mmi_bootup_get_active_flight_mode() == 1)
  266.     {
  267.         SetCategory111RightSoftkeyFunction(mmi_flight_mode_popup_in_dialing_sos, KEY_EVENT_UP);
  268.     }
  269.     else
  270.     {
  271.         SetCategory111RightSoftkeyFunction(ShowMakeSOSCallScr, KEY_EVENT_UP);
  272.         SetKeyHandler(GoToSOSDialScr,KEY_SEND,KEY_EVENT_UP);
  273.     }
  274.     /* Disable LSK if the input password length isn't enough */
  275.     gSecuritySetupContext.PasswdLenCheckCallBack = ValidateNSP;
  276.     if (pfnUnicodeStrlen((S8*) gInputPwdBuffer)  < MMI_MIN_PASSWORD_LENGTH)
  277.     {
  278.         ChangeLeftSoftkey(0, 0);
  279.         ClearKeyHandler(KEY_POUND, KEY_EVENT_UP);
  280.     }
  281. }
  282. /*****************************************************************************
  283.  * FUNCTION
  284.  *  EntryScrEnterSP
  285.  * DESCRIPTION
  286.  *  Function inputs SP from the user
  287.  * PARAMETERS
  288.  *  void
  289.  * RETURNS
  290.  *  void
  291.  *****************************************************************************/
  292. void EntryScrEnterSP(void)
  293. {
  294.     /*----------------------------------------------------------------*/
  295.     /* Local Variables                                                */
  296.     /*----------------------------------------------------------------*/
  297.     /* micha1230 */
  298.     S8 temp1[MAX_PASS_COUNTDOWN_DISP];
  299.     S8 temp2[MAX_PASS_COUNTDOWN_DISP];
  300.     /*----------------------------------------------------------------*/
  301.     /* Code Body                                                      */
  302.     /*----------------------------------------------------------------*/
  303.     sprintf(temp1, "%d", gCPHSRetryCount);
  304.     AnsiiToUnicodeString((S8*) temp2, (S8*) temp1);
  305.     pfnUnicodeStrcpy((S8*) temp1, (S8*) GetString(STR_PASS_TRIALS_REMAIN));
  306.     pfnUnicodeStrcat((S8*) temp1, (S8*) temp2);
  307.     EntryNewScreen(SCR_ENTER_SP, NULL, EntryScrEnterSP, NULL);
  308.     DinitHistory();
  309.     g_pwr_context.PrevScreenIndicator = ENTER_SP;
  310.     g_pwr_context.PowerOnMMIStatus = MMI_POWER_ON_SECURITY_PERSONALIZATION;     /* 0x14: Personalization lock */
  311.     RegisterInputBoxValidationFunction(RstrSettingPasswdScrSoftKeyFunc);
  312.     ShowCategory111Screen(
  313.         STR_GLOBAL_OK,
  314.         IMG_GLOBAL_OK,
  315.         STR_RSK_SOS,
  316.         0,
  317.         STR_ENTER_SP_MSG,
  318.         INPUT_TYPE_NUMERIC_PASSWORD,
  319.         (U8*) gInputPwdBuffer,
  320.         /* micha1230 */ MAX_PWD_LENGTH_MMI,
  321.         (U8*) temp1,
  322.         NULL);
  323.     SetLeftSoftkeyFunction(ValidateSP, KEY_EVENT_UP);
  324.     SetKeyHandler(ValidateSP, KEY_POUND, KEY_EVENT_UP);
  325.     if (mmi_bootup_get_active_flight_mode() == 1)
  326.     {
  327.         SetCategory111RightSoftkeyFunction(mmi_flight_mode_popup_in_dialing_sos, KEY_EVENT_UP);
  328.     }
  329.     else
  330.     {
  331.         SetCategory111RightSoftkeyFunction(ShowMakeSOSCallScr, KEY_EVENT_UP);
  332.         SetKeyHandler(GoToSOSDialScr,KEY_SEND,KEY_EVENT_UP);
  333.     }
  334.     /* Disable LSK if the input password length isn't enough */
  335.     gSecuritySetupContext.PasswdLenCheckCallBack = ValidateSP;
  336.     if (pfnUnicodeStrlen((S8*) gInputPwdBuffer)  < MMI_MIN_PASSWORD_LENGTH)
  337.     {
  338.         ChangeLeftSoftkey(0, 0);
  339.         ClearKeyHandler(KEY_POUND, KEY_EVENT_UP);
  340.     }
  341. }
  342. /*****************************************************************************
  343.  * FUNCTION
  344.  *  EntryScrEnterCP
  345.  * DESCRIPTION
  346.  *  Function inputs CP from the user
  347.  * PARAMETERS
  348.  *  void
  349.  * RETURNS
  350.  *  void
  351.  *****************************************************************************/
  352. void EntryScrEnterCP(void)
  353. {
  354.     /*----------------------------------------------------------------*/
  355.     /* Local Variables                                                */
  356.     /*----------------------------------------------------------------*/
  357.     /* micha1230 */
  358.     S8 temp1[MAX_PASS_COUNTDOWN_DISP];
  359.     S8 temp2[MAX_PASS_COUNTDOWN_DISP];
  360.     /*----------------------------------------------------------------*/
  361.     /* Code Body                                                      */
  362.     /*----------------------------------------------------------------*/
  363.     sprintf(temp1, "%d", gCPHSRetryCount);
  364.     AnsiiToUnicodeString((S8*) temp2, (S8*) temp1);
  365.     pfnUnicodeStrcpy((S8*) temp1, (S8*) GetString(STR_PASS_TRIALS_REMAIN));
  366.     pfnUnicodeStrcat((S8*) temp1, (S8*) temp2);
  367.     EntryNewScreen(SCR_ENTER_CP, NULL, EntryScrEnterCP, NULL);
  368.     DinitHistory();
  369.     g_pwr_context.PrevScreenIndicator = ENTER_CP;
  370.     g_pwr_context.PowerOnMMIStatus = MMI_POWER_ON_SECURITY_PERSONALIZATION;     /* 0x14: Personalization lock */
  371.     RegisterInputBoxValidationFunction(RstrSettingPasswdScrSoftKeyFunc);
  372.     ShowCategory111Screen(
  373.         STR_GLOBAL_OK,
  374.         IMG_GLOBAL_OK,
  375.         STR_RSK_SOS,
  376.         0,
  377.         STR_ENTER_CP_MSG,
  378.         INPUT_TYPE_NUMERIC_PASSWORD,
  379.         (U8*) gInputPwdBuffer,
  380.         /* micha1230 */ MAX_PWD_LENGTH_MMI,
  381.         (U8*) temp1,
  382.         NULL);
  383.     SetLeftSoftkeyFunction(ValidateCP, KEY_EVENT_UP);
  384.     SetKeyHandler(ValidateCP, KEY_POUND, KEY_EVENT_UP);
  385.     if (mmi_bootup_get_active_flight_mode() == 1)
  386.     {
  387.         SetCategory111RightSoftkeyFunction(mmi_flight_mode_popup_in_dialing_sos, KEY_EVENT_UP);
  388.     }
  389.     else
  390.     {
  391.         SetCategory111RightSoftkeyFunction(ShowMakeSOSCallScr, KEY_EVENT_UP);
  392.         SetKeyHandler(GoToSOSDialScr,KEY_SEND,KEY_EVENT_UP);
  393.     }
  394.     /* Disable LSK if the input password length isn't enough */
  395.     gSecuritySetupContext.PasswdLenCheckCallBack = ValidateCP;
  396.     if (pfnUnicodeStrlen((S8*) gInputPwdBuffer)  < MMI_MIN_PASSWORD_LENGTH)
  397.     {
  398.         ChangeLeftSoftkey(0, 0);
  399.         ClearKeyHandler(KEY_POUND, KEY_EVENT_UP);
  400.     }
  401. }
  402. /*****************************************************************************
  403.  * FUNCTION
  404.  *  EntryScrEnterSIMP
  405.  * DESCRIPTION
  406.  *  Function inputs SIMP from the user
  407.  * PARAMETERS
  408.  *  void
  409.  * RETURNS
  410.  *  void
  411.  *****************************************************************************/
  412. void EntryScrEnterSIMP(void)
  413. {
  414.     /*----------------------------------------------------------------*/
  415.     /* Local Variables                                                */
  416.     /*----------------------------------------------------------------*/
  417.     /* micha1230 */
  418.     S8 temp1[MAX_PASS_COUNTDOWN_DISP];
  419.     S8 temp2[MAX_PASS_COUNTDOWN_DISP];
  420.     /*----------------------------------------------------------------*/
  421.     /* Code Body                                                      */
  422.     /*----------------------------------------------------------------*/
  423.     sprintf(temp1, "%d", gCPHSRetryCount);
  424.     AnsiiToUnicodeString((S8*) temp2, (S8*) temp1);
  425.     pfnUnicodeStrcpy((S8*) temp1, (S8*) GetString(STR_PASS_TRIALS_REMAIN));
  426.     pfnUnicodeStrcat((S8*) temp1, (S8*) temp2);
  427.     EntryNewScreen(SCR_ENTER_SIMP, NULL, EntryScrEnterSIMP, NULL);
  428.     DinitHistory();
  429.     g_pwr_context.PrevScreenIndicator = ENTER_SIMP;
  430.     g_pwr_context.PowerOnMMIStatus = MMI_POWER_ON_SECURITY_PERSONALIZATION;     /* 0x14: Personalization lock */
  431.     RegisterInputBoxValidationFunction(RstrSettingPasswdScrSoftKeyFunc);
  432.     ShowCategory111Screen(
  433.         STR_GLOBAL_OK,
  434.         IMG_GLOBAL_OK,
  435.         STR_RSK_SOS,
  436.         0,
  437.         STR_ENTER_SIMP_MSG,
  438.         INPUT_TYPE_NUMERIC_PASSWORD,
  439.         (U8*) gInputPwdBuffer,
  440.         /* micha1230 */ MAX_PWD_LENGTH_MMI,
  441.         (U8*) temp1,
  442.         NULL);
  443.     SetLeftSoftkeyFunction(ValidateSIMP, KEY_EVENT_UP);
  444.     SetKeyHandler(ValidateSIMP, KEY_POUND, KEY_EVENT_UP);
  445.     if (mmi_bootup_get_active_flight_mode() == 1)
  446.     {
  447.         SetCategory111RightSoftkeyFunction(mmi_flight_mode_popup_in_dialing_sos, KEY_EVENT_UP);
  448.     }
  449.     else
  450.     {
  451.         SetCategory111RightSoftkeyFunction(ShowMakeSOSCallScr, KEY_EVENT_UP);
  452.         SetKeyHandler(GoToSOSDialScr,KEY_SEND,KEY_EVENT_UP);
  453.     }
  454.     /* Disable LSK if the input password length isn't enough */
  455.     gSecuritySetupContext.PasswdLenCheckCallBack = ValidateSIMP;
  456.     if (pfnUnicodeStrlen((S8*) gInputPwdBuffer)  < MMI_MIN_PASSWORD_LENGTH)
  457.     {
  458.         ChangeLeftSoftkey(0, 0);
  459.         ClearKeyHandler(KEY_POUND, KEY_EVENT_UP);
  460.     }
  461. }
  462. /*****************************************************************************
  463.  * FUNCTION
  464.  *  EntryScrIncorrectNP
  465.  * DESCRIPTION
  466.  *  Flash Message Incorrect NP try again
  467.  * PARAMETERS
  468.  *  void
  469.  * RETURNS
  470.  *  void
  471.  *****************************************************************************/
  472. void EntryScrIncorrectNP(void)
  473. {
  474.     /*----------------------------------------------------------------*/
  475.     /* Local Variables                                                */
  476.     /*----------------------------------------------------------------*/
  477.     /*----------------------------------------------------------------*/
  478.     /* Code Body                                                      */
  479.     /*----------------------------------------------------------------*/
  480. #ifdef __MMI_SML_UNLOCK_RETRY_TIMER__
  481.     mmi_sml_popup_error_msg(gCPHSRetryCount);
  482.     mmi_sml_set_next_attempt_function(EntryScrEnterNP, mmi_sml_count_retry_interval(gCPHSRetryCount, SML_RETRY_COUNT_N_CAT - 1));
  483.     GenericExitScreen(SCR_ID_SML_WAIT_ATTEMPT, mmi_sml_entry_please_wait_next_attempt);
  484. #else /* __MMI_SML_UNLOCK_RETRY_TIMER__ */
  485.     DisplayPopup((U8*) GetString(STR_WRONG_NP_MSG), IMG_GLOBAL_ERROR, 0, 2000, (U8) ERROR_TONE);
  486. #endif /* __MMI_SML_UNLOCK_RETRY_TIMER__ */
  487. }
  488. /*****************************************************************************
  489.  * FUNCTION
  490.  *  EntryScrIncorrectSP
  491.  * DESCRIPTION
  492.  *  Flash Message Incorrect SP try again
  493.  *  
  494.  *  For h/w this fn will be called in response of L4
  495.  * PARAMETERS
  496.  *  void
  497.  * RETURNS
  498.  *  void
  499.  *****************************************************************************/
  500. void EntryScrIncorrectSP(void)
  501. {
  502.     /*----------------------------------------------------------------*/
  503.     /* Local Variables                                                */
  504.     /*----------------------------------------------------------------*/
  505.     /*----------------------------------------------------------------*/
  506.     /* Code Body                                                      */
  507.     /*----------------------------------------------------------------*/
  508. #ifdef __MMI_SML_UNLOCK_RETRY_TIMER__
  509.     mmi_sml_popup_error_msg(gCPHSRetryCount);
  510.     mmi_sml_set_next_attempt_function(EntryScrEnterSP, mmi_sml_count_retry_interval(gCPHSRetryCount, SML_RETRY_COUNT_SP_CAT - 1));
  511.     GenericExitScreen(SCR_ID_SML_WAIT_ATTEMPT, mmi_sml_entry_please_wait_next_attempt);
  512. #else /* __MMI_SML_UNLOCK_RETRY_TIMER__ */
  513.     DisplayPopup((U8*) GetString(STR_WRONG_SP_MSG), IMG_GLOBAL_ERROR, 0, 2000, (U8) ERROR_TONE);
  514. #endif /* __MMI_SML_UNLOCK_RETRY_TIMER__ */
  515. }
  516. /*****************************************************************************
  517.  * FUNCTION
  518.  *  EntryScrIncorrectCP
  519.  * DESCRIPTION
  520.  *  Flash Message Incorrect CP try again
  521.  *  
  522.  *  For h/w this fn will be called in response of L4
  523.  * PARAMETERS
  524.  *  void
  525.  * RETURNS
  526.  *  void
  527.  *****************************************************************************/
  528. void EntryScrIncorrectCP(void)
  529. {
  530.     /*----------------------------------------------------------------*/
  531.     /* Local Variables                                                */
  532.     /*----------------------------------------------------------------*/
  533.     /*----------------------------------------------------------------*/
  534.     /* Code Body                                                      */
  535.     /*----------------------------------------------------------------*/
  536. #ifdef __MMI_SML_UNLOCK_RETRY_TIMER__
  537.     mmi_sml_popup_error_msg(gCPHSRetryCount);
  538.     mmi_sml_set_next_attempt_function(EntryScrEnterCP, mmi_sml_count_retry_interval(gCPHSRetryCount, SML_RETRY_COUNT_C_CAT - 1));
  539.     GenericExitScreen(SCR_ID_SML_WAIT_ATTEMPT, mmi_sml_entry_please_wait_next_attempt);
  540. #else /* __MMI_SML_UNLOCK_RETRY_TIMER__ */
  541.     DisplayPopup((U8*) GetString(STR_WRONG_CP_MSG), IMG_GLOBAL_ERROR, 0, 2000, (U8) ERROR_TONE);
  542. #endif /* __MMI_SML_UNLOCK_RETRY_TIMER__ */
  543. }
  544. /*****************************************************************************
  545.  * FUNCTION
  546.  *  EntryScrIncorrectNSP
  547.  * DESCRIPTION
  548.  *  Flash Message Incorrect NSP try again
  549.  *  
  550.  *  For h/w this fn will be called in response of L4
  551.  * PARAMETERS
  552.  *  void
  553.  * RETURNS
  554.  *  void
  555.  *****************************************************************************/
  556. void EntryScrIncorrectNSP(void)
  557. {
  558.     /*----------------------------------------------------------------*/
  559.     /* Local Variables                                                */
  560.     /*----------------------------------------------------------------*/
  561.     /*----------------------------------------------------------------*/
  562.     /* Code Body                                                      */
  563.     /*----------------------------------------------------------------*/
  564. #ifdef __MMI_SML_UNLOCK_RETRY_TIMER__
  565.     mmi_sml_popup_error_msg(gCPHSRetryCount);
  566.     mmi_sml_set_next_attempt_function(EntryScrEnterNSP, mmi_sml_count_retry_interval(gCPHSRetryCount, SML_RETRY_COUNT_NS_CAT - 1));
  567.     GenericExitScreen(SCR_ID_SML_WAIT_ATTEMPT, mmi_sml_entry_please_wait_next_attempt);
  568. #else /* __MMI_SML_UNLOCK_RETRY_TIMER__ */
  569.     DisplayPopup((U8*) GetString(STR_WRONG_NSP_MSG), IMG_GLOBAL_ERROR, 0, 2000, (U8) ERROR_TONE);
  570. #endif /* __MMI_SML_UNLOCK_RETRY_TIMER__ */
  571. }
  572. /*****************************************************************************
  573.  * FUNCTION
  574.  *  EntryScrIncorrectSIMP
  575.  * DESCRIPTION
  576.  *  Flash Message Incorrect SIMP try again
  577.  *  
  578.  *  For h/w this fn will be called in response of L4
  579.  * PARAMETERS
  580.  *  void
  581.  * RETURNS
  582.  *  void
  583.  *****************************************************************************/
  584. void EntryScrIncorrectSIMP(void)
  585. {
  586.     /*----------------------------------------------------------------*/
  587.     /* Local Variables                                                */
  588.     /*----------------------------------------------------------------*/
  589.     /*----------------------------------------------------------------*/
  590.     /* Code Body                                                      */
  591.     /*----------------------------------------------------------------*/
  592. #ifdef __MMI_SML_UNLOCK_RETRY_TIMER__
  593.     mmi_sml_popup_error_msg(gCPHSRetryCount);
  594.     mmi_sml_set_next_attempt_function(EntryScrEnterSIMP, mmi_sml_count_retry_interval(gCPHSRetryCount, SML_RETRY_COUNT_SIM_CAT - 1));
  595.     GenericExitScreen(SCR_ID_SML_WAIT_ATTEMPT, mmi_sml_entry_please_wait_next_attempt);
  596. #else /* __MMI_SML_UNLOCK_RETRY_TIMER__ */
  597.     DisplayPopup((U8*) GetString(STR_WRONG_SIMP_MSG), IMG_GLOBAL_ERROR, 0, 2000, (U8) ERROR_TONE);
  598. #endif /* __MMI_SML_UNLOCK_RETRY_TIMER__ */
  599. }
  600. /*****************************************************************************
  601.  * FUNCTION
  602.  *  ValidateNP
  603.  * DESCRIPTION
  604.  *  Function to validate password
  605.  * PARAMETERS
  606.  *  void
  607.  * RETURNS
  608.  *  void
  609.  *****************************************************************************/
  610. void ValidateNP(void)
  611. {
  612.     /*----------------------------------------------------------------*/
  613.     /* Local Variables                                                */
  614.     /*----------------------------------------------------------------*/
  615.     /* Validate password send message to L4  MSG_ID_MMI_VERIFY_PIN_REQ */
  616.     MYQUEUE Message;
  617.     MMISMUVERIFYPINREQ *local_data;
  618.     /*----------------------------------------------------------------*/
  619.     /* Code Body                                                      */
  620.     /*----------------------------------------------------------------*/
  621.     if (pfnUnicodeStrlen((S8*) gInputPwdBuffer) < MMI_MIN_PASSWORD_LENGTH)
  622.     {
  623.         memset((S8*) gInputPwdBuffer, 0, MAX_PWD_LENGTH_MMI * ENCODING_LENGTH);
  624.         EntryScrInvalidPINPUKPLOCKLength();
  625.         return;
  626.     }
  627.     ClearInputEventHandler(MMI_DEVICE_ALL); /* send message and wait response in the same screen and no input can be accepted */
  628.     PRINT_INFORMATION(("@@@@@ Sending request for verifying NP  @@@@@"));
  629.     Message.oslSrcId = MOD_MMI;
  630.     Message.oslDestId = MOD_L4C;
  631.     /* micha0420 */
  632.     Message.oslMsgId = PRT_MMI_SMU_VERIFY_PIN_REQ;
  633.     local_data = (MMISMUVERIFYPINREQ*) OslConstructDataPtr(sizeof(MMISMUVERIFYPINREQ));
  634.     local_data->pin_type = MMI_TYPE_NP;
  635.     /* 1. Change gInputPwdBuffer to ASCII then copy local_data->pin */
  636.     UnicodeToAnsii((S8*) local_data->pin, (S8*) gInputPwdBuffer);
  637.     Message.oslDataPtr = (oslParaType*) local_data;
  638.     Message.oslPeerBuffPtr = NULL;
  639.     OslMsgSendExtQueue(&Message);
  640. }
  641. /*****************************************************************************
  642.  * FUNCTION
  643.  *  ValidateSIMP
  644.  * DESCRIPTION
  645.  *  Function to validate password
  646.  * PARAMETERS
  647.  *  void
  648.  * RETURNS
  649.  *  void
  650.  *****************************************************************************/
  651. void ValidateSIMP(void)
  652. {
  653.     /*----------------------------------------------------------------*/
  654.     /* Local Variables                                                */
  655.     /*----------------------------------------------------------------*/
  656.     /* Validate password send message to L4  MSG_ID_MMI_VERIFY_PIN_REQ */
  657.     MYQUEUE Message;
  658.     MMISMUVERIFYPINREQ *local_data;
  659.     /*----------------------------------------------------------------*/
  660.     /* Code Body                                                      */
  661.     /*----------------------------------------------------------------*/
  662.     if (pfnUnicodeStrlen((S8*) gInputPwdBuffer) < MMI_MIN_PASSWORD_LENGTH)
  663.     {
  664.         memset((S8*) gInputPwdBuffer, 0, MAX_PWD_LENGTH_MMI * ENCODING_LENGTH);
  665.         EntryScrInvalidPINPUKPLOCKLength();
  666.         return;
  667.     }
  668.     ClearInputEventHandler(MMI_DEVICE_ALL); /* send message and wait response in the same screen and no input can be accepted */
  669.     PRINT_INFORMATION(("@@@@@ Sending request for verifying SIMP  @@@@@"));
  670.     Message.oslSrcId = MOD_MMI;
  671.     Message.oslDestId = MOD_L4C;
  672.     /* micha0420 */
  673.     Message.oslMsgId = PRT_MMI_SMU_VERIFY_PIN_REQ;
  674.     local_data = (MMISMUVERIFYPINREQ*) OslConstructDataPtr(sizeof(MMISMUVERIFYPINREQ));
  675.     local_data->pin_type = MMI_TYPE_IMSI_LOCK;
  676.     /* 1. Change gInputSIMPBuffer to ASCII then copy local_data->pin */
  677.     UnicodeToAnsii((S8*) local_data->pin, (S8*) gInputPwdBuffer);
  678.     Message.oslDataPtr = (oslParaType*) local_data;
  679.     Message.oslPeerBuffPtr = NULL;
  680.     OslMsgSendExtQueue(&Message);
  681. }
  682. /*****************************************************************************
  683.  * FUNCTION
  684.  *  ValidateSP
  685.  * DESCRIPTION
  686.  *  Function to validate password
  687.  * PARAMETERS
  688.  *  void
  689.  * RETURNS
  690.  *  void
  691.  *****************************************************************************/
  692. void ValidateSP(void)
  693. {
  694.     /*----------------------------------------------------------------*/
  695.     /* Local Variables                                                */
  696.     /*----------------------------------------------------------------*/
  697.     /* Validate password send message to L4  MSG_ID_MMI_VERIFY_PIN_REQ */
  698.     MYQUEUE Message;
  699.     MMISMUVERIFYPINREQ *local_data;
  700.     /*----------------------------------------------------------------*/
  701.     /* Code Body                                                      */
  702.     /*----------------------------------------------------------------*/
  703.     if (pfnUnicodeStrlen((S8*) gInputPwdBuffer) < MMI_MIN_PASSWORD_LENGTH)
  704.     {
  705.         memset((S8*) gInputPwdBuffer, 0, MAX_PWD_LENGTH_MMI * ENCODING_LENGTH);
  706.         EntryScrInvalidPINPUKPLOCKLength();
  707.         return;
  708.     }
  709.     ClearInputEventHandler(MMI_DEVICE_ALL); /* send message and wait response in the same screen and no input can be accepted */
  710.     PRINT_INFORMATION(("@@@@@ Sending request for verifying SP  @@@@@"));
  711.     Message.oslSrcId = MOD_MMI;
  712.     Message.oslDestId = MOD_L4C;
  713.     /* micha0420 */
  714.     Message.oslMsgId = PRT_MMI_SMU_VERIFY_PIN_REQ;
  715.     local_data = (MMISMUVERIFYPINREQ*) OslConstructDataPtr(sizeof(MMISMUVERIFYPINREQ));
  716.     local_data->pin_type = MMI_TYPE_SP;
  717.     /* 1. Change gInputPwdBuffer to ASCII then copy local_data->pin */
  718.     UnicodeToAnsii((S8*) local_data->pin, (S8*) gInputPwdBuffer);
  719.     Message.oslDataPtr = (oslParaType*) local_data;
  720.     Message.oslPeerBuffPtr = NULL;
  721.     OslMsgSendExtQueue(&Message);
  722. }
  723. /*****************************************************************************
  724.  * FUNCTION
  725.  *  ValidateCP
  726.  * DESCRIPTION
  727.  *  Function to validate password
  728.  * PARAMETERS
  729.  *  void
  730.  * RETURNS
  731.  *  void
  732.  *****************************************************************************/
  733. void ValidateCP(void)
  734. {
  735.     /*----------------------------------------------------------------*/
  736.     /* Local Variables                                                */
  737.     /*----------------------------------------------------------------*/
  738.     /* Validate password send message to L4  MSG_ID_MMI_VERIFY_PIN_REQ */
  739.     MYQUEUE Message;
  740.     MMISMUVERIFYPINREQ *local_data;
  741.     /*----------------------------------------------------------------*/
  742.     /* Code Body                                                      */
  743.     /*----------------------------------------------------------------*/
  744.     if (pfnUnicodeStrlen((S8*) gInputPwdBuffer) < MMI_MIN_PASSWORD_LENGTH)
  745.     {
  746.         memset((S8*) gInputPwdBuffer, 0, MAX_PWD_LENGTH_MMI * ENCODING_LENGTH);
  747.         EntryScrInvalidPINPUKPLOCKLength();
  748.         return;
  749.     }
  750.     ClearInputEventHandler(MMI_DEVICE_ALL); /* send message and wait response in the same screen and no input can be accepted */
  751.     PRINT_INFORMATION(("@@@@@ Sending request for verifying CP  @@@@@"));
  752.     Message.oslSrcId = MOD_MMI;
  753.     Message.oslDestId = MOD_L4C;
  754.     /* micha0420 */
  755.     Message.oslMsgId = PRT_MMI_SMU_VERIFY_PIN_REQ;
  756.     local_data = (MMISMUVERIFYPINREQ*) OslConstructDataPtr(sizeof(MMISMUVERIFYPINREQ));
  757.     local_data->pin_type = MMI_TYPE_CP;
  758.     /* 1. Change gInputPwdBuffer to ASCII then copy local_data->pin */
  759.     UnicodeToAnsii((S8*) local_data->pin, (S8*) gInputPwdBuffer);
  760.     Message.oslDataPtr = (oslParaType*) local_data;
  761.     Message.oslPeerBuffPtr = NULL;
  762.     OslMsgSendExtQueue(&Message);
  763. }
  764. /*****************************************************************************
  765.  * FUNCTION
  766.  *  ValidateNSP
  767.  * DESCRIPTION
  768.  *  Function to validate password
  769.  * PARAMETERS
  770.  *  void
  771.  * RETURNS
  772.  *  void
  773.  *****************************************************************************/
  774. void ValidateNSP(void)
  775. {
  776.     /*----------------------------------------------------------------*/
  777.     /* Local Variables                                                */
  778.     /*----------------------------------------------------------------*/
  779.     /* Validate password send message to L4  MSG_ID_MMI_VERIFY_PIN_REQ */
  780.     MYQUEUE Message;
  781.     MMISMUVERIFYPINREQ *local_data;
  782.     /*----------------------------------------------------------------*/
  783.     /* Code Body                                                      */
  784.     /*----------------------------------------------------------------*/
  785.     if (pfnUnicodeStrlen((S8*) gInputPwdBuffer) < MMI_MIN_PASSWORD_LENGTH)
  786.     {
  787.         memset((S8*) gInputPwdBuffer, 0, MAX_PWD_LENGTH_MMI * ENCODING_LENGTH);
  788.         EntryScrInvalidPINPUKPLOCKLength();
  789.         return;
  790.     }
  791.     ClearInputEventHandler(MMI_DEVICE_ALL); /* send message and wait response in the same screen and no input can be accepted */
  792.     PRINT_INFORMATION(("@@@@@ Sending request for verifying NSP  @@@@@"));
  793.     Message.oslSrcId = MOD_MMI;
  794.     Message.oslDestId = MOD_L4C;
  795.     /* micha0420 */
  796.     Message.oslMsgId = PRT_MMI_SMU_VERIFY_PIN_REQ;
  797.     local_data = (MMISMUVERIFYPINREQ*) OslConstructDataPtr(sizeof(MMISMUVERIFYPINREQ));
  798.     local_data->pin_type = MMI_TYPE_NSP;
  799.     /* 1. Change gInputNSPBuffer to ASCII then copy local_data->pin */
  800.     UnicodeToAnsii((S8*) local_data->pin, (S8*) gInputPwdBuffer);
  801.     Message.oslDataPtr = (oslParaType*) local_data;
  802.     Message.oslPeerBuffPtr = NULL;
  803.     OslMsgSendExtQueue(&Message);
  804. }
  805. #ifdef __MMI_SML_MENU__
  806. /*****************************************************************************
  807.  * FUNCTION
  808.  *  ValidateNSP
  809.  * DESCRIPTION
  810.  *  Function to validate password
  811.  * PARAMETERS
  812.  *  void
  813.  * RETURNS
  814.  *  void
  815.  *****************************************************************************/
  816. void ValidateNSSP(void)
  817. {
  818.     /*----------------------------------------------------------------*/
  819.     /* Local Variables                                                */
  820.     /*----------------------------------------------------------------*/
  821.     /* Validate password send message to L4  MSG_ID_MMI_VERIFY_PIN_REQ */
  822.     MYQUEUE Message;
  823.     MMISMUVERIFYPINREQ *local_data;
  824.     /*----------------------------------------------------------------*/
  825.     /* Code Body                                                      */
  826.     /*----------------------------------------------------------------*/
  827.     if (pfnUnicodeStrlen((S8*) gInputPwdBuffer) < MMI_MIN_PASSWORD_LENGTH)
  828.     {
  829.         memset((S8*) gInputPwdBuffer, 0, MAX_PWD_LENGTH_MMI * ENCODING_LENGTH);
  830.         EntryScrInvalidPINPUKPLOCKLength();
  831.         return;
  832.     }
  833.     ClearInputEventHandler(MMI_DEVICE_ALL);
  834.     PRINT_INFORMATION(("@@@@@ Sending request for verifying NSSP  @@@@@"));
  835.     Message.oslSrcId = MOD_MMI;
  836.     Message.oslDestId = MOD_L4C;
  837.     /* micha0420 */
  838.     Message.oslMsgId = PRT_MMI_SMU_VERIFY_PIN_REQ;
  839.     local_data = (MMISMUVERIFYPINREQ*) OslConstructDataPtr(sizeof(MMISMUVERIFYPINREQ));
  840.     local_data->pin_type = MMI_TYPE_LINK_NS_SP;
  841.     /* 1. Change gInputPwdBuffer to ASCII then copy local_data->pin */
  842.     UnicodeToAnsii((S8*) local_data->pin, (S8*) gInputPwdBuffer);
  843.     Message.oslDataPtr = (oslParaType*) local_data;
  844.     Message.oslPeerBuffPtr = NULL;
  845.     OslMsgSendExtQueue(&Message);
  846. }
  847. /*****************************************************************************
  848.  * FUNCTION
  849.  *  EntryScrEnterNSP
  850.  * DESCRIPTION
  851.  *  Function inputs NS-SP from the user
  852.  * PARAMETERS
  853.  *  void
  854.  * RETURNS
  855.  *  void
  856.  *****************************************************************************/
  857. void EntryScrEnterNSSP(void)
  858. {
  859.     /*----------------------------------------------------------------*/
  860.     /* Local Variables                                                */
  861.     /*----------------------------------------------------------------*/
  862.     /* micha1230 */
  863.     S8 temp1[MAX_PASS_COUNTDOWN_DISP];
  864.     S8 temp2[MAX_PASS_COUNTDOWN_DISP];
  865.     /*----------------------------------------------------------------*/
  866.     /* Code Body                                                      */
  867.     /*----------------------------------------------------------------*/
  868.     sprintf(temp1, "%d", gCPHSRetryCount);
  869.     AnsiiToUnicodeString((S8*) temp2, (S8*) temp1);
  870.     pfnUnicodeStrcpy((S8*) temp1, (S8*) GetString(STR_PASS_TRIALS_REMAIN));
  871.     pfnUnicodeStrcat((S8*) temp1, (S8*) temp2);
  872.     EntryNewScreen(SCR_ENTER_NS_SP, NULL, EntryScrEnterNSSP, NULL);
  873.     DinitHistory();
  874.     g_pwr_context.PrevScreenIndicator = ENTER_NS_SP;
  875.     g_pwr_context.PowerOnMMIStatus = MMI_POWER_ON_SECURITY_PERSONALIZATION;     /* 0x14: Personalization lock */
  876.     RegisterInputBoxValidationFunction(RstrSettingPasswdScrSoftKeyFunc);
  877.     ShowCategory111Screen(
  878.         STR_GLOBAL_OK,
  879.         IMG_GLOBAL_OK,
  880.         STR_RSK_SOS,
  881.         0,
  882.         STR_ENTER_NSSP_MSG,
  883.         INPUT_TYPE_NUMERIC_PASSWORD,
  884.         (U8*) gInputPwdBuffer,
  885.         /* micha1230 */ MAX_PWD_LENGTH_MMI,
  886.         (U8*) temp1,
  887.         NULL);
  888.     SetLeftSoftkeyFunction(ValidateNSSP, KEY_EVENT_UP);
  889.     SetKeyHandler(ValidateNSSP, KEY_POUND, KEY_EVENT_UP);
  890.     if (mmi_bootup_get_active_flight_mode() == 1)
  891.     {
  892.         SetCategory111RightSoftkeyFunction(mmi_flight_mode_popup_in_dialing_sos, KEY_EVENT_UP);
  893.     }
  894.     else
  895.     {
  896.         SetCategory111RightSoftkeyFunction(ShowMakeSOSCallScr, KEY_EVENT_UP);
  897.         SetKeyHandler(GoToSOSDialScr,KEY_SEND,KEY_EVENT_UP);
  898.     }
  899.     /* Disable LSK if the input password length isn't enough */
  900.     gSecuritySetupContext.PasswdLenCheckCallBack = ValidateNSSP;
  901.     if (pfnUnicodeStrlen((S8*) gInputPwdBuffer)  < MMI_MIN_PASSWORD_LENGTH)
  902.     {
  903.         ChangeLeftSoftkey(0, 0);
  904.         ClearKeyHandler(KEY_POUND, KEY_EVENT_UP);
  905.     }
  906. }
  907. /*****************************************************************************
  908.  * FUNCTION
  909.  *  EntryScrIncorrectSP
  910.  * DESCRIPTION
  911.  *  Flash Message Incorrect NS-SP try again
  912.  *  
  913.  *  For h/w this fn will be called in response of L4
  914.  * PARAMETERS
  915.  *  void
  916.  * RETURNS
  917.  *  void
  918.  *****************************************************************************/
  919. void EntryScrIncorrectNSSP(void)
  920. {
  921.     /*----------------------------------------------------------------*/
  922.     /* Local Variables                                                */
  923.     /*----------------------------------------------------------------*/
  924.     /*----------------------------------------------------------------*/
  925.     /* Code Body                                                      */
  926.     /*----------------------------------------------------------------*/
  927. #ifdef __MMI_SML_UNLOCK_RETRY_TIMER__
  928.     mmi_sml_popup_error_msg(gCPHSRetryCount);
  929.     mmi_sml_set_next_attempt_function(EntryScrEnterNSSP, mmi_sml_count_retry_interval(gCPHSRetryCount, SML_RETRY_COUNT_NS_CAT - 1));
  930.     GenericExitScreen(SCR_ID_SML_WAIT_ATTEMPT, mmi_sml_entry_please_wait_next_attempt);
  931. #else /* __MMI_SML_UNLOCK_RETRY_TIMER__ */
  932.     DisplayPopup((U8*) GetString(STR_WRONG_NSSP_MSG), IMG_GLOBAL_ERROR, 0, 2000, (U8) ERROR_TONE);
  933. #endif /* __MMI_SML_UNLOCK_RETRY_TIMER__ */
  934. }
  935. /*****************************************************************************
  936.  * FUNCTION
  937.  *  ValidateNSP
  938.  * DESCRIPTION
  939.  *  Function to validate password
  940.  * PARAMETERS
  941.  *  void
  942.  * RETURNS
  943.  *  void
  944.  *****************************************************************************/
  945. void ValidateSIMC(void)
  946. {
  947.     /*----------------------------------------------------------------*/
  948.     /* Local Variables                                                */
  949.     /*----------------------------------------------------------------*/
  950.     /* Validate password send message to L4  MSG_ID_MMI_VERIFY_PIN_REQ */
  951.     MYQUEUE Message;
  952.     MMISMUVERIFYPINREQ *local_data;
  953.     /*----------------------------------------------------------------*/
  954.     /* Code Body                                                      */
  955.     /*----------------------------------------------------------------*/
  956.     if (pfnUnicodeStrlen((S8*) gInputPwdBuffer) < MMI_MIN_PASSWORD_LENGTH)
  957.     {
  958.         memset((S8*) gInputPwdBuffer, 0, MAX_PWD_LENGTH_MMI * ENCODING_LENGTH);
  959.         EntryScrInvalidPINPUKPLOCKLength();
  960.         return;
  961.     }
  962.     ClearInputEventHandler(MMI_DEVICE_ALL);
  963.     PRINT_INFORMATION(("@@@@@ Sending request for verifying SIMC  @@@@@"));
  964.     Message.oslSrcId = MOD_MMI;
  965.     Message.oslDestId = MOD_L4C;
  966.     /* micha0420 */
  967.     Message.oslMsgId = PRT_MMI_SMU_VERIFY_PIN_REQ;
  968.     local_data = (MMISMUVERIFYPINREQ*) OslConstructDataPtr(sizeof(MMISMUVERIFYPINREQ));
  969.     local_data->pin_type = MMI_TYPE_LINK_SIM_C;
  970.     /* 1. Change gInputPwdBuffer to ASCII then copy local_data->pin */
  971.     UnicodeToAnsii((S8*) local_data->pin, (S8*) gInputPwdBuffer);
  972.     Message.oslDataPtr = (oslParaType*) local_data;
  973.     Message.oslPeerBuffPtr = NULL;
  974.     OslMsgSendExtQueue(&Message);
  975. }
  976. /*****************************************************************************
  977.  * FUNCTION
  978.  *  EntryScrEnterNSP
  979.  * DESCRIPTION
  980.  *  Function inputs SIM-C from the user
  981.  * PARAMETERS
  982.  *  void
  983.  * RETURNS
  984.  *  void
  985.  *****************************************************************************/
  986. void EntryScrEnterSIMC(void)
  987. {
  988.     /*----------------------------------------------------------------*/
  989.     /* Local Variables                                                */
  990.     /*----------------------------------------------------------------*/
  991.     /* micha1230 */
  992.     S8 temp1[MAX_PASS_COUNTDOWN_DISP];
  993.     S8 temp2[MAX_PASS_COUNTDOWN_DISP];
  994.     /*----------------------------------------------------------------*/
  995.     /* Code Body                                                      */
  996.     /*----------------------------------------------------------------*/
  997.     sprintf(temp1, "%d", gCPHSRetryCount);
  998.     AnsiiToUnicodeString((S8*) temp2, (S8*) temp1);
  999.     pfnUnicodeStrcpy((S8*) temp1, (S8*) GetString(STR_PASS_TRIALS_REMAIN));
  1000.     pfnUnicodeStrcat((S8*) temp1, (S8*) temp2);
  1001.     EntryNewScreen(SCR_ENTER_SIM_C, NULL, EntryScrEnterSIMC, NULL);
  1002.     DinitHistory();
  1003.     g_pwr_context.PrevScreenIndicator = ENTER_SIM_C;
  1004.     g_pwr_context.PowerOnMMIStatus = MMI_POWER_ON_SECURITY_PERSONALIZATION;     /* 0x14: Personalization lock */
  1005.     RegisterInputBoxValidationFunction(RstrSettingPasswdScrSoftKeyFunc);
  1006.     ShowCategory111Screen(
  1007.         STR_GLOBAL_OK,
  1008.         IMG_GLOBAL_OK,
  1009.         STR_RSK_SOS,
  1010.         0,
  1011.         STR_ENTER_SIMC_MSG,
  1012.         INPUT_TYPE_NUMERIC_PASSWORD,
  1013.         (U8*) gInputPwdBuffer,
  1014.         /* micha1230 */ MAX_PWD_LENGTH_MMI,
  1015.         (U8*) temp1,
  1016.         NULL);
  1017.     SetLeftSoftkeyFunction(ValidateSIMC, KEY_EVENT_UP);
  1018.     SetKeyHandler(ValidateSIMC, KEY_POUND, KEY_EVENT_UP);
  1019.     if (mmi_bootup_get_active_flight_mode() == 1)
  1020.     {
  1021.         SetCategory111RightSoftkeyFunction(mmi_flight_mode_popup_in_dialing_sos, KEY_EVENT_UP);
  1022.     }
  1023.     else
  1024.     {
  1025.         SetCategory111RightSoftkeyFunction(ShowMakeSOSCallScr, KEY_EVENT_UP);
  1026.         SetKeyHandler(GoToSOSDialScr,KEY_SEND,KEY_EVENT_UP);
  1027.     }
  1028.     /* Disable LSK if the input password length isn't enough */
  1029.     gSecuritySetupContext.PasswdLenCheckCallBack = ValidateSIMC;
  1030.     if (pfnUnicodeStrlen((S8*) gInputPwdBuffer)  < MMI_MIN_PASSWORD_LENGTH)
  1031.     {
  1032.         ChangeLeftSoftkey(0, 0);
  1033.         ClearKeyHandler(KEY_POUND, KEY_EVENT_UP);
  1034.     }
  1035. }
  1036. /*****************************************************************************
  1037.  * FUNCTION
  1038.  *  EntryScrIncorrectSP
  1039.  * DESCRIPTION
  1040.  *  Flash Message Incorrect SIM-C try again
  1041.  *  
  1042.  *  For h/w this fn will be called in response of L4
  1043.  * PARAMETERS
  1044.  *  void
  1045.  * RETURNS
  1046.  *  void
  1047.  *****************************************************************************/
  1048. void EntryScrIncorrectSIMC(void)
  1049. {
  1050.     /*----------------------------------------------------------------*/
  1051.     /* Local Variables                                                */
  1052.     /*----------------------------------------------------------------*/
  1053.     /*----------------------------------------------------------------*/
  1054.     /* Code Body                                                      */
  1055.     /*----------------------------------------------------------------*/
  1056. #ifdef __MMI_SML_UNLOCK_RETRY_TIMER__
  1057.     mmi_sml_popup_error_msg(gCPHSRetryCount);
  1058.     mmi_sml_set_next_attempt_function(EntryScrEnterSIMC, mmi_sml_count_retry_interval(gCPHSRetryCount, SML_RETRY_COUNT_C_CAT - 1));
  1059.     GenericExitScreen(SCR_ID_SML_WAIT_ATTEMPT, mmi_sml_entry_please_wait_next_attempt);
  1060. #else /* __MMI_SML_UNLOCK_RETRY_TIMER__ */
  1061.     DisplayPopup((U8*) GetString(STR_WRONG_SIMC_MSG), IMG_GLOBAL_ERROR, 0, 2000, (U8) ERROR_TONE);
  1062. #endif /* __MMI_SML_UNLOCK_RETRY_TIMER__ */
  1063. }
  1064. #endif /* __MMI_SML_MENU__ */