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

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.  *  CSP.c
  39.  *
  40.  * Project:
  41.  * --------
  42.  *  MAUI
  43.  *
  44.  * Description:
  45.  * ------------
  46.  *  
  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.  *------------------------------------------------------------------------------
  91.  * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!! 
  92.  *==============================================================================
  93.  *******************************************************************************/
  94. /**
  95.  * Copyright Notice
  96.  * ?2002 - 2003, Pixtel Communications, Inc., 1489 43rd Ave. W.,
  97.  * Vancouver, B.C. V6M 4K8 Canada. All Rights Reserved.
  98.  *  (It is illegal to remove this copyright notice from this software or any
  99.  *  portion of it)
  100.  */
  101. /**************************************************************
  102.    FILENAME : CSP.c
  103.    PURPOSE     : Customer Service Profile
  104.    REMARKS     : nil
  105.    AUTHOR      : NEERAJ SHARMA
  106.    DATE     : Aug 6,03
  107. **************************************************************/
  108. #include "stdC.h"
  109. #include "MMI_Features.h"
  110. #include "L4Dr.h"
  111. #include "L4Dr1.h"
  112. #include "PixtelDataTypes.h"
  113. /* MTK Leo add */
  114. #include "GlobalMenuItems.h"
  115. /* MTK Leo end */
  116. #include "CSP.h"
  117. #include "EventsGprot.h"
  118. #include "DebugInitDef.h"
  119. #include "CustMenuRes.h"
  120. #include "l4Dr.h"
  121. #ifdef __MOD_SMSAL__
  122. #include "MessagesExDcl.h"
  123. #endif 
  124. U8 cpsInfoArray[CSP_TOTAL_SERVICE_GROUP];
  125. U8 isCSPPresent = 0;
  126. U8 bootupOver = 0;
  127. /*****************************************************************************
  128.  * FUNCTION
  129.  *  SetCSPGroupService
  130.  * DESCRIPTION
  131.  *  Sets Bit in CSP Array about CSP Service as per
  132.  *  service group & sevice
  133.  * PARAMETERS
  134.  *  serviceGroup        [IN]        Service Group of CSP
  135.  *  service             [IN]        Service in the group
  136.  * RETURNS
  137.  *  void
  138.  *****************************************************************************/
  139. void SetCSPGroupService(U8 serviceGroup, U8 service)
  140. {
  141.     /*----------------------------------------------------------------*/
  142.     /* Local Variables                                                */
  143.     /*----------------------------------------------------------------*/
  144.     /*----------------------------------------------------------------*/
  145.     /* Code Body                                                      */
  146.     /*----------------------------------------------------------------*/
  147.     SetBit(cpsInfoArray[serviceGroup], service);
  148. }
  149. /*****************************************************************************
  150.  * FUNCTION
  151.  *  ResetCSPGroupService
  152.  * DESCRIPTION
  153.  *  Resets Bit in CSP Array about CSP Service as per
  154.  *  service group & sevice
  155.  * PARAMETERS
  156.  *  serviceGroup        [IN]        Service Group of CSP
  157.  *  service             [IN]        Service in the group
  158.  * RETURNS
  159.  *  void
  160.  *****************************************************************************/
  161. void ResetCSPGroupService(U8 serviceGroup, U8 service)
  162. {
  163.     /*----------------------------------------------------------------*/
  164.     /* Local Variables                                                */
  165.     /*----------------------------------------------------------------*/
  166.     /*----------------------------------------------------------------*/
  167.     /* Code Body                                                      */
  168.     /*----------------------------------------------------------------*/
  169.     ResetBit(cpsInfoArray[serviceGroup], service);
  170. }
  171. /*****************************************************************************
  172.  * FUNCTION
  173.  *  IsSetCSPGroupService
  174.  * DESCRIPTION
  175.  *  Checks if Bit ise set in CSP Array about CSP Service
  176.  *  as per service group & sevice
  177.  * PARAMETERS
  178.  *  serviceGroup        [IN]        Service Group of CSP
  179.  *  service             [IN]        Service in the group
  180.  * RETURNS
  181.  *  void
  182.  *****************************************************************************/
  183. U8 IsSetCSPGroupService(U8 serviceGroup, U8 service)
  184. {
  185.     /*----------------------------------------------------------------*/
  186.     /* Local Variables                                                */
  187.     /*----------------------------------------------------------------*/
  188.     /*----------------------------------------------------------------*/
  189.     /* Code Body                                                      */
  190.     /*----------------------------------------------------------------*/
  191.     return (IsBitSet(cpsInfoArray[serviceGroup], service));
  192. }
  193. /*****************************************************************************
  194.  * FUNCTION
  195.  *  IsResetCSPGroupService
  196.  * DESCRIPTION
  197.  *  Checks if Bit is reset in CSP Array about CSP Service
  198.  *  as per service group & sevice
  199.  * PARAMETERS
  200.  *  serviceGroup        [IN]        Service Group of CSP
  201.  *  service             [IN]        Service in the group
  202.  * RETURNS
  203.  *  void
  204.  *****************************************************************************/
  205. U8 IsResetCSPGroupService(U8 serviceGroup, U8 service)
  206. {
  207.     /*----------------------------------------------------------------*/
  208.     /* Local Variables                                                */
  209.     /*----------------------------------------------------------------*/
  210.     /*----------------------------------------------------------------*/
  211.     /* Code Body                                                      */
  212.     /*----------------------------------------------------------------*/
  213.     return (IsBitReset(cpsInfoArray[serviceGroup], service));
  214. }
  215. /*****************************************************************************
  216.  * FUNCTION
  217.  *  IsInformationNumberAlowed
  218.  * DESCRIPTION
  219.  *  Checks if Information Number is allowed
  220.  * PARAMETERS
  221.  *  void
  222.  * RETURNS
  223.  *  TRUE/FALSE
  224.  *****************************************************************************/
  225. U8 IsInformationNumberAlowed(void)
  226. {
  227.     /*----------------------------------------------------------------*/
  228.     /* Local Variables                                                */
  229.     /*----------------------------------------------------------------*/
  230.     /*----------------------------------------------------------------*/
  231.     /* Code Body                                                      */
  232.     /*----------------------------------------------------------------*/
  233.     if (cpsInfoArray[CSP_INFORMATION_NO_SERVICE_GROUP] == 0xFF)
  234.     {
  235.         return 1;
  236.     }
  237.     else
  238.     {
  239.         return 0;
  240.     }
  241. }
  242. /*****************************************************************************
  243.  * FUNCTION
  244.  *  ClearCSPArray
  245.  * DESCRIPTION
  246.  *  Clears Information in CSP Array
  247.  * PARAMETERS
  248.  *  void
  249.  * RETURNS
  250.  *  TRUE/FALSE(?)
  251.  *****************************************************************************/
  252. void ClearCSPArray(void)
  253. {
  254.     /*----------------------------------------------------------------*/
  255.     /* Local Variables                                                */
  256.     /*----------------------------------------------------------------*/
  257.     /*----------------------------------------------------------------*/
  258.     /* Code Body                                                      */
  259.     /*----------------------------------------------------------------*/
  260.     memset((void*)cpsInfoArray, 0xFF, CSP_TOTAL_SERVICE_GROUP);
  261. }
  262. /*****************************************************************************
  263.  * FUNCTION
  264.  *  InitialiseCSPInfoArray
  265.  * DESCRIPTION
  266.  *  Initialises CSP Infor
  267.  * PARAMETERS
  268.  *  cspInfo     [?]     
  269.  * RETURNS
  270.  *  TRUE/FALSE(?)
  271.  *****************************************************************************/
  272. void InitialiseCSPInfoArray(U8 *cspInfo)
  273. {
  274.     /*----------------------------------------------------------------*/
  275.     /* Local Variables                                                */
  276.     /*----------------------------------------------------------------*/
  277.     U8 i;
  278.     /*----------------------------------------------------------------*/
  279.     /* Code Body                                                      */
  280.     /*----------------------------------------------------------------*/
  281.     PRINT_INFORMATION(("<<CPHS>>In InitialiseCSPInfoArray"));
  282.     for (i = 0; i < 22; i++)
  283.     {
  284.         switch (cspInfo[i])
  285.         {
  286.             case 0x01:
  287.                 cpsInfoArray[CSP_CALL_OFFERING_SERVICE_GROUP] = cspInfo[++i];
  288.                 break;
  289.             case 0x02:
  290.                 cpsInfoArray[CSP_CALL_RESTRICTION_SERVICE_GROUP] = cspInfo[++i];
  291.                 break;
  292.             case 0x03:
  293.                 cpsInfoArray[CSP_OTHER_SS_SERVICE_GROUP] = cspInfo[++i];
  294.                 break;
  295.             case 0x04:
  296.                 cpsInfoArray[CSP_CALL_COMPLETION_SERVICE_GROUP] = cspInfo[++i];
  297.                 break;
  298.             case 0x05:
  299.                 cpsInfoArray[CSP_TELESERVICES_SERVICE_GROUP] = cspInfo[++i];
  300.         #ifdef __MMI_CSP_SMS_COMMON_SETTING_ALWAYS_ON__
  301.                 cpsInfoArray[CSP_TELESERVICES_SERVICE_GROUP] |= 0x18; /* Always turn on SMS common setting */
  302.         #endif
  303.                 break;
  304.             case 0x06:
  305.                 cpsInfoArray[CSP_CPHS_TELESERVICES_SERVICE_GROUP] = cspInfo[++i];
  306.                 break;
  307.             case 0x07:
  308.                 cpsInfoArray[CSP_CPHS_FEATURES_SERVICE_GROUP] = cspInfo[++i];
  309.                 break;
  310.             case 0x08:
  311.                 cpsInfoArray[CSP_NUMBER_IDENTIFICATION_SERVICE_GROUP] = cspInfo[++i];
  312.                 break;
  313.             case 0x09:
  314.                 cpsInfoArray[CSP_PHASE_2_SERVICE_GROUP] = cspInfo[++i];
  315.                 break;
  316.             case 0xC0:
  317.                 cpsInfoArray[CSP_VALUE_ADDED_SERVICES_SERVICE_GROUP] = cspInfo[++i];
  318.                 /* micha1217 */
  319.         #ifdef __MMI_CSP_LANG_SEL_MENU_ALWAYS_ON__
  320.                 cpsInfoArray[CSP_VALUE_ADDED_SERVICES_SERVICE_GROUP] |= 0x01; /* Always turn on language selection */
  321.         #endif
  322.                 break;
  323.             case 0xD5:
  324.                 cpsInfoArray[CSP_INFORMATION_NO_SERVICE_GROUP] = cspInfo[++i];
  325.                 break;
  326.         }
  327.     }
  328.     isCSPPresent = 1;
  329.     if (bootupOver)
  330.     {
  331.         CSPModifyHiliteHandlers();
  332.     }
  333. }
  334. /*****************************************************************************
  335.  * FUNCTION
  336.  *  CSPCallMain
  337.  * DESCRIPTION
  338.  *  Changes Hilite Handlers of CM in Framework as per CSP Info
  339.  * PARAMETERS
  340.  *  void
  341.  * RETURNS
  342.  *  TRUE/FALSE(?)
  343.  *****************************************************************************/
  344. void CSPCallMain(void)
  345. {
  346.     /*----------------------------------------------------------------*/
  347.     /* Local Variables                                                */
  348.     /*----------------------------------------------------------------*/
  349.     /*----------------------------------------------------------------*/
  350.     /* Code Body                                                      */
  351.     /*----------------------------------------------------------------*/
  352.     /* diamond, 2005/07/01 new menu item architecture */
  353.     if (IsResetCSPGroupService(CSP_CALL_RESTRICTION_SERVICE_GROUP, CSP_BOAC) &&
  354.         IsResetCSPGroupService(CSP_CALL_RESTRICTION_SERVICE_GROUP, CSP_BOIC) &&
  355.         IsResetCSPGroupService(CSP_CALL_RESTRICTION_SERVICE_GROUP, CSP_BOIC_exHC) &&
  356.         IsResetCSPGroupService(CSP_CALL_RESTRICTION_SERVICE_GROUP, CSP_BAIC) &&
  357.         IsResetCSPGroupService(CSP_CALL_RESTRICTION_SERVICE_GROUP, CSP_BIC_Roam))
  358.     {
  359.         mmi_frm_hide_menu_item(MENU8237_SCR8093_MNGCALL_MENU_BARRING);
  360.     }
  361.     if (IsResetCSPGroupService(CSP_OTHER_SS_SERVICE_GROUP, CSP_CUG))
  362.     {
  363.         mmi_frm_hide_menu_item(MENU_SETTING_CALL_CLOSED_GP);
  364.     }
  365.     if (IsResetCSPGroupService(CSP_CALL_COMPLETION_SERVICE_GROUP, CSP_CW))
  366.     {
  367.         mmi_frm_hide_menu_item(MENU8237_SCR8093_MNGCALL_MENU_WAIT);
  368.     }
  369. #ifdef __CPHS_FEATURE_DEFAULT_OFF__
  370.     if (IsResetCSPGroupService(CSP_CPHS_TELESERVICES_SERVICE_GROUP, ALS) == 0)
  371.     {
  372.         mmi_frm_unhide_menu_item(MENU_LINE_SWCH);
  373.     }
  374. #else /* __CPHS_FEATURE_DEFAULT_OFF__ */
  375.     if (IsResetCSPGroupService(CSP_CPHS_TELESERVICES_SERVICE_GROUP, ALS))
  376.     {
  377.         mmi_frm_hide_menu_item(MENU_LINE_SWCH);
  378.     }
  379. #endif /* __CPHS_FEATURE_DEFAULT_OFF__ */
  380. }
  381. /*****************************************************************************
  382.  * FUNCTION
  383.  *  CSPPhoneSetup
  384.  * DESCRIPTION
  385.  *  Changes Hilite Handlers of Phone Setup in Framework as per CSP Info
  386.  * PARAMETERS
  387.  *  void
  388.  * RETURNS
  389.  *  TRUE/FALSE(?)
  390.  *****************************************************************************/
  391. void CSPPhoneSetup(void)
  392. {
  393.     /*----------------------------------------------------------------*/
  394.     /* Local Variables                                                */
  395.     /*----------------------------------------------------------------*/
  396.     /*----------------------------------------------------------------*/
  397.     /* Code Body                                                      */
  398.     /*----------------------------------------------------------------*/
  399.     /* diamond, 2005/07/01 new menu item architecture */
  400.     if (IsResetCSPGroupService(CSP_VALUE_ADDED_SERVICES_SERVICE_GROUP, CSP_Language))
  401.     {
  402.         mmi_frm_hide_menu_item(MENU_SETTING_LANGUAGE);
  403.     }
  404. }
  405. /*****************************************************************************
  406.  * FUNCTION
  407.  *  CSPCallBarringMainMenu
  408.  * DESCRIPTION
  409.  *  Changes Hilite Handlers of Call Barring Main Screen
  410.  *  in Framework as per CSP Info
  411.  * PARAMETERS
  412.  *  void
  413.  * RETURNS
  414.  *  TRUE/FALSE(?)
  415.  *****************************************************************************/
  416. void CSPCallBarringMainMenu(void)
  417. {
  418.     /*----------------------------------------------------------------*/
  419.     /* Local Variables                                                */
  420.     /*----------------------------------------------------------------*/
  421.     /*----------------------------------------------------------------*/
  422.     /* Code Body                                                      */
  423.     /*----------------------------------------------------------------*/
  424.     /* diamond, 2005/07/01 new menu item architecture */
  425.     if (IsResetCSPGroupService(CSP_CALL_RESTRICTION_SERVICE_GROUP, CSP_BOAC) &&
  426.         IsResetCSPGroupService(CSP_CALL_RESTRICTION_SERVICE_GROUP, CSP_BOIC) &&
  427.         IsResetCSPGroupService(CSP_CALL_RESTRICTION_SERVICE_GROUP, CSP_BOIC_exHC))
  428.     {
  429.         mmi_frm_hide_menu_item(MENU_CALL_BARRING_OUTGOING);
  430.     }
  431.     if (IsResetCSPGroupService(CSP_CALL_RESTRICTION_SERVICE_GROUP, CSP_BAIC) &&
  432.         IsResetCSPGroupService(CSP_CALL_RESTRICTION_SERVICE_GROUP, CSP_BIC_Roam))
  433.     {
  434.         mmi_frm_hide_menu_item(MENU_CALL_BARRING_INCOMING);
  435.     }
  436. }
  437. /*****************************************************************************
  438.  * FUNCTION
  439.  *  CSPCallBarringOutgoingMenu
  440.  * DESCRIPTION
  441.  *  Changes Hilite Handlers of Call Barring Outgoing Screen
  442.  *  in Framework as per CSP Info
  443.  * PARAMETERS
  444.  *  void
  445.  * RETURNS
  446.  *  TRUE/FALSE(?)
  447.  *****************************************************************************/
  448. void CSPCallBarringOutgoingMenu(void)
  449. {
  450.     /*----------------------------------------------------------------*/
  451.     /* Local Variables                                                */
  452.     /*----------------------------------------------------------------*/
  453.     /*----------------------------------------------------------------*/
  454.     /* Code Body                                                      */
  455.     /*----------------------------------------------------------------*/
  456.     /* diamond, 2005/07/01 new menu item architecture */
  457.     if (IsResetCSPGroupService(CSP_CALL_RESTRICTION_SERVICE_GROUP, CSP_BOAC))
  458.     {
  459.         mmi_frm_hide_menu_item(MENU_BARRING_OUTGOING_ALLCALLS);
  460.     }
  461.     if (IsResetCSPGroupService(CSP_CALL_RESTRICTION_SERVICE_GROUP, CSP_BOIC))
  462.     {
  463.         mmi_frm_hide_menu_item(MENU_BARRING_OUTGOING_INTERCALL);
  464.     }
  465.     if (IsResetCSPGroupService(CSP_CALL_RESTRICTION_SERVICE_GROUP, CSP_BOIC_exHC))
  466.     {
  467.         mmi_frm_hide_menu_item(MENU_BARRING_OUTGOING_INTEREXCEPTHOME);
  468.     }
  469. }
  470. /*****************************************************************************
  471.  * FUNCTION
  472.  *  CSPCallBarringIncomingMenu
  473.  * DESCRIPTION
  474.  *  Changes Hilite Handlers of Call Barring Incoming Screen
  475.  *  in Framework as per CSP Info
  476.  * PARAMETERS
  477.  *  void
  478.  * RETURNS
  479.  *  TRUE/FALSE(?)
  480.  *****************************************************************************/
  481. void CSPCallBarringIncomingMenu(void)
  482. {
  483.     /*----------------------------------------------------------------*/
  484.     /* Local Variables                                                */
  485.     /*----------------------------------------------------------------*/
  486.     /*----------------------------------------------------------------*/
  487.     /* Code Body                                                      */
  488.     /*----------------------------------------------------------------*/
  489.     /* diamond, 2005/07/01 new menu item architecture */
  490.     if (IsResetCSPGroupService(CSP_CALL_RESTRICTION_SERVICE_GROUP, CSP_BAIC))
  491.     {
  492.         mmi_frm_hide_menu_item(MENU_BARRING_INCOMING_ALLCALLS);
  493.     }
  494.     if (IsResetCSPGroupService(CSP_CALL_RESTRICTION_SERVICE_GROUP, CSP_BIC_Roam))
  495.     {
  496.         mmi_frm_hide_menu_item(MENU_BARRING_INCOMING_ROAMING);
  497.     }
  498. }
  499. /*****************************************************************************
  500.  * FUNCTION
  501.  *  CSPCallForwardingMenu
  502.  * DESCRIPTION
  503.  *  Changes Hilite Handlers of Call Fwd. Screen
  504.  *  in Framework as per CSP Info
  505.  * PARAMETERS
  506.  *  void
  507.  * RETURNS
  508.  *  TRUE/FALSE(?)
  509.  *****************************************************************************/
  510. void CSPCallForwardingMenu(void)
  511. {
  512.     /*----------------------------------------------------------------*/
  513.     /* Local Variables                                                */
  514.     /*----------------------------------------------------------------*/
  515. #ifdef __MMI_SS_CF_ALLCOND_MENU__
  516.     U8 cfu_cnt = 0;
  517. #endif
  518.     /*----------------------------------------------------------------*/
  519.     /* Code Body                                                      */
  520.     /*----------------------------------------------------------------*/
  521.     /* diamond, 2005/07/01 new menu item architecture */
  522.     if (IsResetCSPGroupService(CSP_CALL_OFFERING_SERVICE_GROUP, CSP_CFU))
  523.     {
  524.         mmi_frm_hide_menu_item(MENU8238_MNGCALL_CALFWD_VOICECALL);
  525.     }
  526.     if (IsResetCSPGroupService(CSP_CALL_OFFERING_SERVICE_GROUP, CSP_CFNRc))
  527.     {
  528.         mmi_frm_hide_menu_item(MENU8239_CALFWD_VOICECALL_UNREACHABLE);
  529.     }
  530. #ifdef __MMI_SS_CF_ALLCOND_MENU__
  531.     else
  532.     {
  533.         cfu_cnt++;
  534.     }
  535. #endif /* __MMI_SS_CF_ALLCOND_MENU__ */
  536.     if (IsResetCSPGroupService(CSP_CALL_OFFERING_SERVICE_GROUP, CSP_CFNRy))
  537.     {
  538.         mmi_frm_hide_menu_item(MENU8239_CALFWD_VOICECALL_NOANSWER);
  539.     }
  540. #ifdef __MMI_SS_CF_ALLCOND_MENU__
  541.     else
  542.     {
  543.         cfu_cnt++;
  544.     }
  545. #endif /* __MMI_SS_CF_ALLCOND_MENU__ */
  546.     if (IsResetCSPGroupService(CSP_CALL_OFFERING_SERVICE_GROUP, CSP_CFB))
  547.     {
  548.         mmi_frm_hide_menu_item(MENU8239_CALFWD_VOICECALL_BUSY);
  549.     }
  550. #ifdef __MMI_SS_CF_ALLCOND_MENU__
  551.     else
  552.     {
  553.         cfu_cnt++;
  554.     }
  555. #endif /* __MMI_SS_CF_ALLCOND_MENU__ */
  556.     if (IsResetCSPGroupService(CSP_VALUE_ADDED_SERVICES_SERVICE_GROUP, CSP_Data))
  557.     {
  558.         mmi_frm_hide_menu_item(MENU8238_MNGCALL_CALFWD_DATACALL);
  559.     }
  560. #ifdef __MMI_SS_CF_ALLCOND_MENU__
  561.     if (cfu_cnt == 3)
  562.     {
  563.         /* CPHS: if bit 5, 6, 7 are set as 1 for this group, a conditional forwarding menu is used to replace these 3 menus */
  564.         mmi_frm_hide_menu_item(MENU8239_CALFWD_VOICECALL_UNREACHABLE);
  565.         mmi_frm_hide_menu_item(MENU8239_CALFWD_VOICECALL_NOANSWER);
  566.         mmi_frm_hide_menu_item(MENU8239_CALFWD_VOICECALL_BUSY);
  567.         mmi_frm_unhide_menu_item(MENU8239_CALFWD_VOICECALL_ALLCOND);
  568.     }
  569. #endif /* __MMI_SS_CF_ALLCOND_MENU__ */
  570. }
  571. /*****************************************************************************
  572.  * FUNCTION
  573.  *  CSPCallerIdMenu
  574.  * DESCRIPTION
  575.  *  Changes Hilite Handlers of Caller ID Screen
  576.  *  in Framework as per CSP Info
  577.  * PARAMETERS
  578.  *  void
  579.  * RETURNS
  580.  *  TRUE/FALSE(?)
  581.  *****************************************************************************/
  582. void CSPCallerIdMenu(void)
  583. {
  584.     /*----------------------------------------------------------------*/
  585.     /* Local Variables                                                */
  586.     /*----------------------------------------------------------------*/
  587.     /*----------------------------------------------------------------*/
  588.     /* Code Body                                                      */
  589.     /*----------------------------------------------------------------*/
  590.     /* diamond, 2005/07/01 new menu item architecture */
  591.     if (IsResetCSPGroupService(CSP_NUMBER_IDENTIFICATION_SERVICE_GROUP, CSP_CLI_block))
  592.     {
  593.         mmi_frm_hide_menu_item(MENU_CID_HIDE_ID);
  594.     }
  595.     if (IsResetCSPGroupService(CSP_NUMBER_IDENTIFICATION_SERVICE_GROUP, CSP_CLI_send))
  596.     {
  597.         mmi_frm_hide_menu_item(MENU_CID_SHOW_ID);
  598.     }
  599. }
  600. /*****************************************************************************
  601.  * FUNCTION
  602.  *  CSPCallHistoryMenu
  603.  * DESCRIPTION
  604.  *  Changes Hilite Handlers of Call History Screen
  605.  *  in Framework as per CSP Info
  606.  * PARAMETERS
  607.  *  void
  608.  * RETURNS
  609.  *  TRUE/FALSE(?)
  610.  *****************************************************************************/
  611. void CSPCallHistoryMenu(void)
  612. {
  613.     /*----------------------------------------------------------------*/
  614.     /* Local Variables                                                */
  615.     /*----------------------------------------------------------------*/
  616.     /*----------------------------------------------------------------*/
  617.     /* Code Body                                                      */
  618.     /*----------------------------------------------------------------*/
  619.     /* diamond, 2005/07/01 new menu item architecture */
  620.     if (IsResetCSPGroupService(CSP_OTHER_SS_SERVICE_GROUP, CSP_AoC))
  621.     {
  622.         mmi_frm_hide_menu_item(MENU_CALL_HISTORY_CALLCOST);
  623.     }
  624. }
  625. /*****************************************************************************
  626.  * FUNCTION
  627.  *  CSPNetworkSelectionMenu
  628.  * DESCRIPTION
  629.  *  Changes Hilite Handlers of Network Selection Screen
  630.  *  in Framework as per CSP Info
  631.  * PARAMETERS
  632.  *  void
  633.  * RETURNS
  634.  *  TRUE/FALSE(?)
  635.  *****************************************************************************/
  636. void CSPNetworkSelectionMenu(void)
  637. {
  638.     /*----------------------------------------------------------------*/
  639.     /* Local Variables                                                */
  640.     /*----------------------------------------------------------------*/
  641.     /*----------------------------------------------------------------*/
  642.     /* Code Body                                                      */
  643.     /*----------------------------------------------------------------*/
  644.     /* diamond, 2005/07/01 new menu item architecture */
  645.     if (IsResetCSPGroupService(CSP_VALUE_ADDED_SERVICES_SERVICE_GROUP, CSP_PLMN_MODE))
  646.     {
  647.         mmi_frm_hide_menu_item(MENU9186_SELECTION_MODE);
  648.     }
  649.     if (IsResetCSPGroupService(CSP_PHASE_2_SERVICE_GROUP, CSP_Multiple_Band))
  650.     {
  651.         mmi_frm_hide_menu_item(MENU9188_BAND_SELECTION);
  652.     }
  653. }
  654. /*****************************************************************************
  655.  * FUNCTION
  656.  *  CSPMesagesMainMenu
  657.  * DESCRIPTION
  658.  *  Changes Hilite Handlers of Messages Main Menu Screen
  659.  *  in Framework as per CSP Info
  660.  * PARAMETERS
  661.  *  void
  662.  * RETURNS
  663.  *  TRUE/FALSE(?)
  664.  *****************************************************************************/
  665. void CSPMesagesMainMenu(void)
  666. {
  667.     /*----------------------------------------------------------------*/
  668.     /* Local Variables                                                */
  669.     /*----------------------------------------------------------------*/
  670.     /*----------------------------------------------------------------*/
  671.     /* Code Body                                                      */
  672.     /*----------------------------------------------------------------*/
  673.     /* diamond, 2005/07/01 new menu item architecture */
  674.     if (IsResetCSPGroupService(CSP_TELESERVICES_SERVICE_GROUP, CSP_SM_MT))
  675.     {
  676.         mmi_frm_hide_menu_item(MESSAGES_MENU_INBOX_MENUID);
  677.     }
  678.     if (IsResetCSPGroupService(CSP_TELESERVICES_SERVICE_GROUP, CSP_SM_MO))
  679.     {
  680.         mmi_frm_hide_menu_item(MESSAGES_MENU_WMESSAGE_MENU_ID);
  681.         mmi_frm_hide_menu_item(MESSAGES_MENU_OUTBOX_MENUID);
  682.     }
  683.     if (IsResetCSPGroupService(CSP_TELESERVICES_SERVICE_GROUP, CSP_SM_CB))
  684.     {
  685.         mmi_frm_hide_menu_item(MESSAGES_MENU_CB_MENUID);
  686.     }
  687.     if (IsResetCSPGroupService(CSP_VALUE_ADDED_SERVICES_SERVICE_GROUP, CSP_VPS))
  688.     {
  689.         mmi_frm_hide_menu_item(MESSAGES_MENU_VMAIL_MENUID);
  690.     }
  691. }
  692. /*****************************************************************************
  693.  * FUNCTION
  694.  *  CSPMessageSettingMenu
  695.  * DESCRIPTION
  696.  *  Changes Hilite Handlers of Message Setting Menu Screen
  697.  *  in Framework as per CSP Info
  698.  * PARAMETERS
  699.  *  void
  700.  * RETURNS
  701.  *  TRUE/FALSE(?)
  702.  *****************************************************************************/
  703. void CSPMessageSettingMenu(void)
  704. {
  705.     /*----------------------------------------------------------------*/
  706.     /* Local Variables                                                */
  707.     /*----------------------------------------------------------------*/
  708.     /*----------------------------------------------------------------*/
  709.     /* Code Body                                                      */
  710.     /*----------------------------------------------------------------*/
  711.     /* diamond, 2005/07/01 new menu item architecture */
  712.     if (IsResetCSPGroupService(CSP_TELESERVICES_SERVICE_GROUP, CSP_Del_Conf) &&
  713.         IsResetCSPGroupService(CSP_TELESERVICES_SERVICE_GROUP, CSP_Reply_path))
  714.     {
  715.         mmi_frm_hide_menu_item(SETUP_MENU_COMMONSETTING_MENUID);
  716.     }
  717. }
  718. /* diamond, 2005/07/01 new menu item architecture */
  719. /*****************************************************************************
  720.  * FUNCTION
  721.  *  CSPOutgoingCallManagement
  722.  * DESCRIPTION
  723.  *  Changes Hilite Handlers of Outgoing Call Management Menu Screen
  724.  *  in Framework as per CSP Info
  725.  * PARAMETERS
  726.  *  void
  727.  * RETURNS
  728.  *  TRUE/FALSE(?)
  729.  *****************************************************************************/
  730. void CSPOutgoingCallManagement(void)
  731. {
  732.     /*----------------------------------------------------------------*/
  733.     /* Local Variables                                                */
  734.     /*----------------------------------------------------------------*/
  735.     /*----------------------------------------------------------------*/
  736.     /* Code Body                                                      */
  737.     /*----------------------------------------------------------------*/
  738.     if (IsResetCSPGroupService(CSP_OTHER_SS_SERVICE_GROUP, CSP_MPTY))
  739.     {
  740.         mmi_frm_hide_menu_item(MITEM2015_CM_CALL_CONFER);
  741.     }
  742.     if (IsResetCSPGroupService(CSP_CALL_COMPLETION_SERVICE_GROUP, CSP_HOLD))
  743.     {
  744.         mmi_frm_hide_menu_item(MITEM2010_CM_ACTIVE_HOLD);
  745.     }
  746. }
  747. /* end, diamond */
  748. /*****************************************************************************
  749.  * FUNCTION
  750.  *  mmi_cphs_puct_check
  751.  * DESCRIPTION
  752.  *  
  753.  * PARAMETERS
  754.  *  puct        [IN]        
  755.  * RETURNS
  756.  *  void
  757.  *****************************************************************************/
  758. void mmi_cphs_puct_check(U8 puct)
  759. {
  760. #ifdef MMI_ON_HARDWARE_P
  761.     /*----------------------------------------------------------------*/
  762.     /* Local Variables                                                */
  763.     /*----------------------------------------------------------------*/
  764.     /*----------------------------------------------------------------*/
  765.     /* Code Body                                                      */
  766.     /*----------------------------------------------------------------*/
  767.     if (puct == 0 || sim_service_table_query(SERVICE_AOC) == SERVICE_NOT_SUPPORT)
  768.     {
  769.         mmi_frm_hide_menu_item(MENU_CALL_HISTORY_CALLCOST);
  770.     }
  771. #endif /* MMI_ON_HARDWARE_P */ 
  772. }
  773. /*****************************************************************************
  774.  * FUNCTION
  775.  *  mmi_cphs_sim_lock_check
  776.  * DESCRIPTION
  777.  *  
  778.  * PARAMETERS
  779.  *  void
  780.  * RETURNS
  781.  *  void
  782.  *****************************************************************************/
  783. void mmi_cphs_sim_lock_check(void)
  784. {
  785. #ifdef MMI_ON_HARDWARE_P
  786.     /*----------------------------------------------------------------*/
  787.     /* Local Variables                                                */
  788.     /*----------------------------------------------------------------*/
  789.     /*----------------------------------------------------------------*/
  790.     /* Code Body                                                      */
  791.     /*----------------------------------------------------------------*/
  792.     /* diamond, 2005/12/09 Hide "SIM Lock" menu if it is not support by SIM */
  793.     if (sim_service_table_query(SERVICE_CHV_DISABLE_FUNCTION) == SERVICE_NOT_SUPPORT)
  794.     {
  795.         mmi_frm_hide_menu_item(MENU9169_SIM_LOCK);
  796.     }
  797. #endif /* MMI_ON_HARDWARE_P */ 
  798. }
  799. /*****************************************************************************
  800.  * FUNCTION
  801.  *  CSPModifyHiliteHandlers
  802.  * DESCRIPTION
  803.  *  Modifies Hilite Handlers of all applications
  804.  *  in Framework as per CSP Info
  805.  * PARAMETERS
  806.  *  void
  807.  * RETURNS
  808.  *  TRUE/FALSE(?)
  809.  *****************************************************************************/
  810. void CSPModifyHiliteHandlers(void)
  811. {
  812.     /*----------------------------------------------------------------*/
  813.     /* Local Variables                                                */
  814.     /*----------------------------------------------------------------*/
  815.     /*----------------------------------------------------------------*/
  816.     /* Code Body                                                      */
  817.     /*----------------------------------------------------------------*/
  818.     bootupOver = 1;
  819.     if (isCSPPresent)
  820.     {
  821.         PRINT_INFORMATION(("<<CPHS>>CSP Present and Modifying Hilite Handlers"));
  822.         CSPCallBarringMainMenu();
  823.         CSPCallBarringIncomingMenu();
  824.         CSPCallBarringOutgoingMenu();
  825.         CSPCallForwardingMenu();
  826.         CSPCallerIdMenu();
  827.         CSPCallMain();
  828.         CSPPhoneSetup();
  829.         CSPCallHistoryMenu();
  830.         CSPNetworkSelectionMenu();
  831.         CSPMesagesMainMenu();
  832.         CSPMessageSettingMenu();
  833.         CSPOutgoingCallManagement();    /* diamond, 2005/07/01 new menu item architecture */
  834.     }
  835. }
  836. static FuncPtr CMHiliteHandlersArray[32];
  837. static U16 CMHiliteHandlersId[32];
  838. static U8 itemsToBeRestored;
  839. extern hiliteInfo maxHiliteInfo[MAX_HILITE_HANDLER];    /* available hilite func ptrs  */
  840. /*****************************************************************************
  841.  * FUNCTION
  842.  *  RestorePreviousHiliteHandlers
  843.  * DESCRIPTION
  844.  *  Restores Previous Hilite Handlers as per the parent,
  845.  *  used only in CM
  846.  * PARAMETERS
  847.  *  parentId        [IN]        
  848.  * RETURNS
  849.  *  TRUE/FALSE(?)
  850.  *****************************************************************************/
  851. void RestorePreviousHiliteHandlers(U16 parentId)
  852. {
  853.     /*----------------------------------------------------------------*/
  854.     /* Local Variables                                                */
  855.     /*----------------------------------------------------------------*/
  856.     static U8 count = 0;
  857.     U8 i;
  858.     /*----------------------------------------------------------------*/
  859.     /* Code Body                                                      */
  860.     /*----------------------------------------------------------------*/
  861.     if (count)
  862.     {
  863.         for (i = 0; i < itemsToBeRestored; i++)
  864.         {
  865.             maxHiliteInfo[CMHiliteHandlersId[i]].entryFuncPtr = CMHiliteHandlersArray[i];
  866.         }
  867.     }
  868.     if (count == 0)
  869.     {
  870.         count = 1;
  871.     }
  872.     itemsToBeRestored = (U8) GetNumOfChild(parentId);
  873.     for (i = 0; i < itemsToBeRestored; i++)
  874.     {
  875.         CMHiliteHandlersId[i] = GetSeqItemId((U16) parentId, (S16) i);
  876.         CMHiliteHandlersArray[i] = maxHiliteInfo[CMHiliteHandlersId[i]].entryFuncPtr;
  877.     }
  878. }