SAT.c
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:425k
- /*****************************************************************************
- * Copyright Statement:
- * --------------------
- * This software is protected by Copyright and the information contained
- * herein is confidential. The software may not be copied and the information
- * contained herein may not be used or disclosed except with the written
- * permission of MediaTek Inc. (C) 2005
- *
- * BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
- * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
- * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
- * AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
- * NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
- * SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
- * SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
- * THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
- * NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
- * SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
- *
- * BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
- * LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
- * AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
- * OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
- * MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
- *
- * THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
- * WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
- * LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
- * RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
- * THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
- *
- *****************************************************************************/
- /*******************************************************************************
- * Filename:
- * ---------
- * SAT.c
- *
- * Project:
- * --------
- * MAUI
- *
- * Description:
- * ------------
- * SIM application toolkit related functions
- *
- * Author:
- * -------
- * -------
- *
- *==============================================================================
- * HISTORY
- * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
- *------------------------------------------------------------------------------
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- * removed!
- * removed!
- * removed!
- *
- *------------------------------------------------------------------------------
- * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
- *==============================================================================
- *******************************************************************************/
- /**
- * Copyright Notice
- * ?2002 - 2003, Pixtel Communications, Inc., 1489 43rd Ave. W.,
- * Vancouver, B.C. V6M 4K8 Canada. All Rights Reserved.
- * (It is illegal to remove this copyright notice from this software or any
- * portion of it)
- */
- /**************************************************************
- FILENAME : SAT.c
- PURPOSE : SAT Application
- REMARKS : nil
- AUTHOR : NEERAJ SHARMA
- DATE : Mar 24,03
- **************************************************************/
- #ifndef __SAT_MMI_UNIT_TEST__
- // #define __SAT_MMI_UNIT_TEST__ // for icon debug
- #endif
- #include "stdC.h"
- #include "L4Dr1.h"
- #include "L4Dr.h"
- #include "MMI_features.h"
- #include "FrameworkStruct.h"
- /* micha0125, modify key event handler, change on all IsInSATScreen. */
- #include"KeyBrd.h"
- #include "SATDefs.h"
- #include "SATStruct.h"
- #include "SATGProts.h"
- #include "SATProts.h"
- #include "ProtocolEvents.h"
- #include "TimerEvents.h"
- #include "CallManagementStruct.h"
- #include "CallManagementGprot.h"
- #include "GSM7BitDefaultAlphabet.h"
- #include "CommonScreens.h"
- #include "NVRAMType.h"
- #include "NVRAMProt.h"
- #include "NVRAMEnum.h"
- #include "SSCStringHandle.h"
- #include "gdi_include.h"
- #include "lcd_sw_rnd.h"
- #include "QueueGprot.h"
- #include "BootUp.h"
- #include "PowerOnChargerProt.h"
- #include "SimDetectionDef.h"
- #include "SimDetectionGexdcl.h"
- #include "SimDetectionGprot.h"
- #include "sat_def.h"
- #include "wgui_categories_inputs.h"
- /* micha0901 */
- #include "wgui_categories_popup.h"
- #include "CallManagementStruct.h"
- #include "CallStructureManagementProt.h"
- /* micha1012 */
- #include "AlarmFrameworkProt.h"
- #include "gpioInc.h"
- #include "DebugInitDef.h"
- #include "CallHistoryGProts.h"
- #include "CallManagementIdDef.h" /* CM_SCR_MARKER */
- #include "PhoneBookGprot.h"
- #include "ProfileGprots.h"
- #include "SettingGenum.h"
- #include "SecuritySetup.h" /* SECSETGetFdlBdlModeReq */
- #include "Service.h" /* GoToServicesMenu */
- #include "ServiceDefs.h" /* SERVICES_MAIN_MENU_SCREEN_ID */
- #include "wapadp.h"
- #ifdef __USAT__
- #include "DateTimeGprot.h"
- #endif
- #ifdef __MMI_WLAN_FEATURES__
- #include "NetworkSetupDefs.h"
- #endif
- SATSETUPMENU gSATMainMenu;
- SATSUBMENU gSATSubMenu;
- SATDISPLAYTEXT gSATDisplayText;
- SATGETINPUT gSATGetInput;
- SATGETINKEY gSATGetInkey;
- SATSENDSMS gSATSendSMS;
- SATSENDSS gSATSendSS;
- SATSENDUSSD gSATSendUSSD;
- SATPLAYTONE gSATPlayTone;
- SATCALLSETUP gSATCallSetup;
- SATIMAGERECORD gSATImageRecord;
- SATRUNATCOMMAND gSATRunATCommand;
- SATLAUNCHBROWSER gSATLaunchBrowser;
- SATSENDDTMF gSATSendDTMF;
- /* micha1016 */
- SATDISPLAYIDLETEXT gSATDisplayIdleText;
- SATCONTEXT gSATContext;
- /* extern U8 isIdleScreenReached; */
- extern S16 MMI_current_input_ext_type; /* diamond, 2005/07/22 GET INPUT numeric input without 'p' and 'w' */
- #ifdef __SATCE__
- SATOPENCHANNEL satOpenChannel;
- SATCLOSECHANNEL satCloseChannel;
- SATSENDDATA satSendData;
- SATRECVDATA satRecvData;
- #endif /* __SATCE__ */
- #ifdef __SAT_MMI_UNIT_TEST__
- mmi_smu_read_sim_rsp_struct EFback1a = {0, 0, {L4C_OK, 0},
- 10,
- {0x01, 0x08, 0x08, 0x11, 0x4F, 0x04, 0x00, 0x00, 0x00, 0x0A}
- };
- mmi_smu_read_sim_rsp_struct EFback2a = {0, 0, {L4C_OK, 0},
- 10,
- {0x08, 0x08, 0xFF, 0x03, 0xA5, 0x99, 0x99, 0xA5, 0xC3, 0xFF}
- };
- mmi_smu_read_sim_rsp_struct EFback1 = {0, 0, {L4C_OK, 0},
- 10,
- {0x01, 0x08, 0x08, 0x21, 0x4F, 0x02, 0x00, 0x00, 0x00, 0x1F}
- };
- mmi_smu_read_sim_rsp_struct EFback2 = {0, 0, {L4C_OK, 0},
- 31,
- {0x08, 0x08, 0x02, 0x03, 0x00, 0x16, 0xAA, 0xAA, 0x80, 0x02, 0x85, 0x42,
- 0x81, 0x42, 0x81, 0x42, 0x81, 0x52, 0x80, 0x02, 0xAA, 0xAA, 0xFF, 0x00,
- 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0xFF}
- };
- #endif /* __SAT_MMI_UNIT_TEST__ */
- extern void mmi_frm_sms_sim_refresh_ind(U16);
- extern void mmi_frm_add_history_before_cm_marker(U16 scrn_id, FuncPtr func_ptr);
- #ifdef __SAT_MMI_UNIT_TEST__
- void SATSetupIdleDisplayTest(void);
- #endif
- void (*SATGetIconCompleteCallBack) (void);
- /*****************************************************************************
- * FUNCTION
- * InitSimAppToolkit
- * DESCRIPTION
- * Initialises variables & Protocol Handlers for SAT
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void InitSimAppToolkit(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- #ifdef __SAT_MMI_UNIT_TEST__
- SATSetupIdleDisplayTest();
- #endif
- SetProtocolEventHandler(SATSetupMenuInd, PRT_MMI_SAT_SETUP_MENU_IND);
- SetProtocolEventHandler(SATSetupMenuRsp, PRT_MMI_SAT_SETUP_MENU_RES_RSP);
- /* micha0216 */
- SetProtocolEventHandler(SATMenuSelectRsp, PRT_MMI_SAT_MENU_SELECT_RSP);
- SetProtocolEventHandler(SATSelectItemInd, PRT_MMI_SAT_SELECT_ITEM_IND);
- SetProtocolEventHandler(SATSelectItemRsp, PRT_MMI_SAT_SELECT_ITEM_RES_RSP);
- SetProtocolEventHandler(SATDisplayTextInd, PRT_MMI_SAT_DISPLAY_TEXT_IND);
- SetProtocolEventHandler(SATDisplayTextRsp, PRT_MMI_SAT_DISPLAY_TEXT_RES_RSP);
- SetProtocolEventHandler(SATGetInputInd, PRT_MMI_SAT_GET_INPUT_IND);
- SetProtocolEventHandler(SATGetInputRsp, PRT_MMI_SAT_GET_INPUT_RES_RSP);
- SetProtocolEventHandler(SATGetInkeyInd, PRT_MMI_SAT_GET_INKEY_IND);
- SetProtocolEventHandler(SATGetInkeyRsp, PRT_MMI_SAT_GET_INKEY_RES_RSP);
- SetProtocolEventHandler(SATCallSetupInd, PRT_MMI_SAT_CALL_SETUP_IND);
- SetProtocolEventHandler(SATCallSetupStage1Rsp, PRT_MMI_SAT_CALL_SETUP_STAGE1_RSP);
- SetProtocolEventHandler(SATCallSetupStage2Rsp, PRT_MMI_SAT_CALL_SETUP_STAGE2_RSP);
- SetProtocolEventHandler(SATSendSMSInd, PRT_MMI_SAT_SEND_SMS_IND);
- SetProtocolEventHandler(SATSendSMSStage1Rsp, PRT_MMI_SAT_SEND_SMS_STAGE1_RSP);
- SetProtocolEventHandler(SATSendSMSStage2Rsp, PRT_MMI_SAT_SEND_SMS_STAGE2_RSP);
- SetProtocolEventHandler(SATSendSSInd, PRT_MMI_SAT_SEND_SS_IND);
- SetProtocolEventHandler(SATSendSSStage1Rsp, PRT_MMI_SAT_SEND_SS_STAGE1_RSP);
- SetProtocolEventHandler(SATSendSSStage2Rsp, PRT_MMI_SAT_SEND_SS_STAGE2_RSP);
- SetProtocolEventHandler(SATSendUSSDInd, PRT_MMI_SAT_SEND_USSD_IND);
- SetProtocolEventHandler(SATSendUSSDStage1Rsp, PRT_MMI_SAT_SEND_USSD_STAGE1_RSP);
- SetProtocolEventHandler(SATSendUSSDStage2Rsp, PRT_MMI_SAT_SEND_USSD_STAGE2_RSP);
- SetProtocolEventHandler(SATMMIInfoInd, PRT_MMI_SAT_MMI_INFO_IND);
- SetProtocolEventHandler(SATPlayToneInd, PRT_MMI_SAT_PLAY_TONE_IND);
- SetProtocolEventHandler(SATPlayToneRsp, PRT_MMI_SAT_PLAY_TONE_RES_RSP);
- SetProtocolEventHandler(SATLangNotifyInd, PRT_MMI_SAT_LANG_NOTIFY_IND);
- SetProtocolEventHandler(SATLaunchBrowserInd, PRT_MMI_SAT_LAUNCH_BROWSER_IND);
- SetProtocolEventHandler(WAPLaunchBrowserRsp, PRT_WAP_MMI_LAUNCH_BROWSER_RSP);
- SetProtocolEventHandler(SATLaunchBrowserRsp, PRT_MMI_SAT_LAUNCH_BROWSER_RES_RSP);
- SetProtocolEventHandler(SATEVDLBrowserTerminationInd, PRT_WAP_MMI_BROWSER_TERMINATION_IND);
- SetProtocolEventHandler(SATSendDTMFInd, PRT_MMI_SAT_SEND_DTMF_IND);
- SetProtocolEventHandler(SATSendDTMFStage1Rsp, PRT_MMI_SAT_SEND_DTMF_STAGE1_RSP);
- SetProtocolEventHandler(SATSendDTMFStage2Rsp, PRT_MMI_SAT_SEND_DTMF_STAGE2_RSP);
- SetProtocolEventHandler(SATSetupIdleDisplayInd, PRT_MMI_SAT_SETUP_IDLE_DISPLAY_IND);
- SetProtocolEventHandler(SATRunATCommandInd, PRT_MMI_SAT_RUN_AT_COMMAND_IND);
- /* micha0714 */
- SetProtocolEventHandler(SATNoFurtherCommandInd, PRT_MMI_SAT_NO_OTHER_CMD_IND);
- /* micha0201 */
- SetProtocolEventHandler(SATSIMFileChangeInd, PRT_MMI_SAT_SIM_FILE_CHANGE_IND);
- #ifdef __SATCE__
- SetProtocolEventHandler(SATOpenChannelInd, MSG_ID_MMI_SAT_OPEN_CHANNEL_IND);
- SetProtocolEventHandler(SATOpenChannelRes, MSG_ID_MMI_SAT_OPEN_CHANNEL_RSP);
- SetProtocolEventHandler(SATCloseChannelInd, MSG_ID_MMI_SAT_CLOSE_CHANNEL_IND);
- SetProtocolEventHandler(SATSendDataInd, MSG_ID_MMI_SAT_SEND_DATA_IND);
- SetProtocolEventHandler(SATSendDataRes, MSG_ID_MMI_SAT_SEND_DATA_RSP);
- SetProtocolEventHandler(SATRecvDataInd, MSG_ID_MMI_SAT_RECV_DATA_IND);
- SetProtocolEventHandler(SATRecvDataRes, MSG_ID_MMI_SAT_RECV_DATA_RSP);
- #endif /* __SATCE__ */
- gSATContext.getImageStage = (U16) SAT_IMAGE_IDLE_CMD;
- gSATContext.gotStage1Rsp = 1;
- gSATContext.lastSATCmd = SAT_NONE_CMD;
- gSATContext.simFuncPtr[0] = mmi_sat_clear_idle_display_text; /* max 3 callbacks for SIM file changed indication */
- gSATContext.simFuncPtr[1] = mmi_sat_refresh_to_update_imsi;
- }
- /* micha0714 */
- /*****************************************************************************
- * FUNCTION
- * SATNoFurtherCommandInd
- * DESCRIPTION
- *
- * PARAMETERS
- * msgPtr [?]
- * RETURNS
- * void
- *****************************************************************************/
- void SATNoFurtherCommandInd(void *msgPtr)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (!gSATContext.waitTimeExpired)
- {
- gSATMainMenu.isSentRsp = 1; /* diamond, 2006/04/06 Avoid to add SAT main menu to history if no furthur command comes in SAT screen more than 1 times */
- SATMessageWaitTimer();
- }
- }
- /*****************************************************************************
- * FUNCTION
- * SATFileChangePhbCheck
- * DESCRIPTION
- *
- * PARAMETERS
- * simChange [?]
- * RETURNS
- * void
- *****************************************************************************/
- static pBOOL SATFileChangePhbCheck(mmi_sat_sim_file_change_ind_struct *simChange)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 i;
- pBOOL rtn = MMI_FALSE;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (simChange->is_full_changed)
- {
- return MMI_TRUE;
- }
- for (i = 0; i < simChange->num_of_file; i++)
- {
- if (simChange->file_list[i] == FILE_ADN_IDX
- || simChange->file_list[i] == FILE_FDN_IDX
- || simChange->file_list[i] == FILE_LND_IDX
- || simChange->file_list[i] == FILE_SDN_IDX
- || simChange->file_list[i] == FILE_EXT1_IDX
- || simChange->file_list[i] == FILE_EXT2_IDX
- || simChange->file_list[i] == FILE_EXT3_IDX
- || simChange->file_list[i] == FILE_BDN_IDX
- || simChange->file_list[i] == FILE_EXT4_IDX)
- {
- rtn = MMI_TRUE;
- break;
- }
- }
- return rtn;
- }
- /*****************************************************************************
- * FUNCTION
- * SATFileChangeSmsCheck
- * DESCRIPTION
- *
- * PARAMETERS
- * simChange [?]
- * RETURNS
- * void
- *****************************************************************************/
- static pBOOL SATFileChangeSmsCheck(mmi_sat_sim_file_change_ind_struct *simChange)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 i;
- pBOOL rtn = MMI_FALSE;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (simChange->is_full_changed)
- {
- return MMI_TRUE;
- }
- for (i = 0; i < simChange->num_of_file; i++)
- {
- if (simChange->file_list[i] == FILE_SMSS_IDX
- || simChange->file_list[i] == FILE_SMSP_IDX
- || simChange->file_list[i] == FILE_SMS_IDX
- || simChange->file_list[i] == FILE_CBMI_IDX
- || simChange->file_list[i] == FILE_CBMID_IDX || simChange->file_list[i] == FILE_CBMIR_IDX
- #ifdef __CPHS__
- || simChange->file_list[i] == FILE_VM_WAIT_IDX || simChange->file_list[i] == FILE_MAILBOX_NUM_IDX
- #endif
- || simChange->file_list[i] == FILE_ELP_IDX || simChange->file_list[i] == FILE_LP_IDX)
- {
- rtn = MMI_TRUE;
- break;
- }
- }
- return rtn;
- }
- /* micha0201 */
- /*****************************************************************************
- * FUNCTION
- * SATSIMFileChangeInd
- * DESCRIPTION
- *
- * PARAMETERS
- * msgPtr [?]
- * RETURNS
- * void
- *****************************************************************************/
- void SATSIMFileChangeInd(void *msgPtr)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 i;
- mmi_sat_sim_file_change_ind_struct *simChange;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- simChange = (mmi_sat_sim_file_change_ind_struct*) msgPtr;
- if (simChange->refresh_type == TYPE_SIM_RESET)
- {
- GoToSATRebootScreen();
- return;
- }
- /* diamond, 2005/05/31 sim file change notification */
- else
- {
- for (i = 0; i < MAX_FILE_CHANGE_NOTIFY_CALLBACK; i++)
- {
- if (gSATContext.simFuncPtr[i] != NULL)
- {
- gSATContext.simFuncPtr[i] (simChange->refresh_type);
- }
- }
- }
- /* diamond, 2006/01/06 sim file change for sms */
- if (SATFileChangeSmsCheck(simChange))
- {
- mmi_frm_sms_sim_refresh_ind(simChange->refresh_type); /* SMS */
- }
-
- /* PHB & Call Log */
- if (SATFileChangePhbCheck(simChange))
- {
- CHISTSatHandler();
- mmi_phb_sat_handler(TRUE);
- SECSETGetFdlBdlModeReq();
- }
- /* single file refresh */
- if (simChange->refresh_type == TYPE_FILE_CHANGE)
- {
- for (i = 0; i < simChange->num_of_file; i++)
- {
- switch (simChange->file_list[i])
- {
- case FILE_MSISDN_IDX:
- mmi_sat_get_msisdn_info(); /* linear fixed EF, need to get file info and then get data */
- break;
- case FILE_SPN_IDX:
- mmi_sat_get_spn_data(); /* transparent EF, read data directly */
- break;
- default:
- break;
- }
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * GoToSATRebootScreen
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void GoToSATRebootScreen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_SAT_WAITSCREEN, NULL, GoToSATRebootScreen, NULL);
- /* ShowCategory65Screen((PU8)GetString(STR_ID_SIM_REFRESH), SAT_WAIT_IMAGE_ID, NULL); */
- DisplayPopup(
- (U8*) GetString(STR_ID_SIM_REFRESH),
- IMG_GLOBAL_WARNING,
- 0,
- UI_POPUP_NOTIFYDURATION_TIME * 2,
- (U8) ERROR_TONE);
- ClearInputEventHandler(MMI_DEVICE_ALL); /* go to reboot now and no input can be accepted*/
- SetKeyHandler(0, KEY_END, KEY_EVENT_DOWN);
- SetKeyHandler(0, KEY_END, KEY_EVENT_UP);
- mmi_sat_nw_detach_before_reboot();
- StartTimer(SAT_REFRESH_REBOOT_TIMER, 3000, SATRefreshRebootTimeOut);
- }
- /*****************************************************************************
- * FUNCTION
- * SATRefreshRebootTimeOut
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void SATRefreshRebootTimeOut(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- #ifdef MMI_ON_HARDWARE_P
- ClearProtocolEventHandler(MSG_ID_MMI_NW_PWROFF_DETACH_RSP);
- #endif
- AlmATPowerReset(0, 0);
- }
- /*****************************************************************************
- * FUNCTION
- * IsSATPresent
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- U8 IsSATPresent(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- #ifdef __MMI_WLAN_FEATURES__
- if (mmi_netset_get_active_preferred_mode() == P_WLAN_ONLY)
- return 0;
- else
- #endif /* __MMI_WLAN_FEATURES__ */
- return (gSATContext.isSATPresent);
- }
- /*****************************************************************************
- * FUNCTION
- * IsInSATScreen
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- U8 IsInSATScreen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return (gSATContext.isInSATScreen);
- }
- /*****************************************************************************
- * FUNCTION
- * IsInSATCall
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- U8 IsInSATCall(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return (gSATContext.isInSATCall);
- }
- /* micha0831 */
- /*****************************************************************************
- * FUNCTION
- * SATCallTerminate
- * DESCRIPTION
- * Called by Call Manage
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void SATCallTerminate(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (gSATContext.isInSATCall)
- {
- gSATContext.isInSATCall = 0;
- if (!gSATCallSetup.isSentRsp)
- {
- if (gSATCallSetup.exitCause == SAT_CALL_DISCONNECT_BEFORE_CONNECT)
- {
- TerminalResponseCallSetup(
- SAT_USER_CLEAR_DOWN_CALL_BEFORE_CONNECTION_RELEASE,
- 0,
- gSATCallSetup.cmdDetail);
- }
- else
- {
- TerminalResponseCallSetup(SAT_ME_CURRENTLY_UNABLE_TO_PROCESS_CMD, 0, gSATCallSetup.cmdDetail);
- }
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * GetSATIdleText
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- U8 *GetSATIdleText(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return (gSATContext.idleTextPtr);
- }
- /*****************************************************************************
- * FUNCTION
- * GetSATIdleIcon
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- U8 *GetSATIdleIcon(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return (gSATContext.idleIconPtr);
- }
- /*****************************************************************************
- * FUNCTION
- * GetPostponedSATScreen
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- FuncPtr GetPostponedSATScreen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return (gSATContext.postponedSATScreen);
- }
- /*****************************************************************************
- * FUNCTION
- * ClearPostponedSATScreen
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ClearPostponedSATScreen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gSATContext.postponedSATScreen = NULL;
- }
- /*****************************************************************************
- * FUNCTION
- * GetSATMainMenuAlphaID
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- U8 *GetSATMainMenuAlphaID(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return (gSATMainMenu.alphaId);
- }
- /*****************************************************************************
- * FUNCTION
- * SATHistoryHandler
- * DESCRIPTION
- * Calls Corresponding Function in History
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void SATHistoryHandler(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetIsInSATScreen();
- gSATContext.guiBufferPointer = GetCurrGuiBuffer(SCR_ID_SAT_HISTORY);
- (*gSATContext.historyFuncPtr) ();
- }
- /*****************************************************************************
- * FUNCTION
- * SATSaveHistory
- * DESCRIPTION
- * Saves SAT in History
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void SATSaveHistory(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- GenericExitScreen(SCR_ID_SAT_HISTORY, SATHistoryHandler);
- ClearIsInSATScreen();
- }
- /*****************************************************************************
- * FUNCTION
- * SATMessageWaitTimer
- * DESCRIPTION
- * Timer CallBack Function called by when the SAT dows not recieve any
- * command from SIM for 3 secs
- * PARAMETERS
- * void
- * ptr(?) [IN] (Timer Id is returned in this)
- * RETURNS
- * void
- *****************************************************************************/
- void SATMessageWaitTimer(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SATStopWaitTimer();
- PRINT_INFORMATION(("[SAT] please wait timer expires: isInSATScreen = %d, isInSATMenu = %d", gSATContext.isInSATScreen, gSATContext.isInSATMenu));
- if (gSATContext.isInSATScreen)
- {
- #ifdef __MMI_CLAMCLOSE_BACK2IDLE__
- if (IsClamClose())
- {
- DisplayIdleScreen();
- return;
- }
- #endif /* __MMI_CLAMCLOSE_BACK2IDLE__ */
- if (gSATContext.isInSATMenu)
- {
- gSATContext.historyFuncPtr = GoToSATMainMenu;
- if (isInCall() && !IsInSATCall())
- {
- /* diamond, 2006/05/30 SAT -> call -> SAT -> Terminal Response then go back to call screen not SAT screen */
- if (!IsScreenPresent(SCR_ID_SAT_HISTORY))
- {
- mmi_frm_add_history_before_cm_marker(SCR_ID_SAT_HISTORY, SATHistoryHandler);
- }
- GoBackHistory();
- }
- else if ((GetCurrScrnId() != SCR_ID_SAT_HISTORY) && (IsScreenPresent(SCR_ID_SAT_HISTORY)))
- {
- GoBackHistory();
- }
- else if (IsScreenPresent(SCR_ID_SAT_HISTORY))
- {
- GoBackToHistory(SCR_ID_SAT_HISTORY);
- }
- else
- {
- gSATContext.guiBufferPointer = NULL;
- GoToSATMainMenu();
- }
- }
- else
- {
- if (IsScreenPresent(SCR_ID_SAT_HISTORY))
- {
- GoBackToHistory(SCR_ID_SAT_HISTORY);
- }
- else
- {
- ClearIsInSATScreen();
- GoBackHistory();
- }
- }
- }
- else
- {
- gSATContext.historyFuncPtr = GoToSATMainMenu;
- if (!gSATContext.isInSATMenu)
- {
- ClearIsInSATScreen();
- DeleteScreenIfPresent(SCR_ID_SAT_HISTORY);
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * StartSATTimerNoResponsefromUser
- * DESCRIPTION
- * Starts No Response Timer and calls the passed
- * function if no key is pressed in that duration
- * PARAMETERS
- * FuncPtr [IN]
- * function(?) [IN] To be called on Timer Expiry
- * RETURNS
- * void
- *****************************************************************************/
- void StartSATTimerNoResponsefromUser(FuncPtr FuncPtr)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gSATContext.noResponseFuncPtr = FuncPtr;
- #ifdef __USAT__
- if (gSATContext.lastSATCmd == SAT_DISPLAY_TEXT_CMD && gSATDisplayText.duration != 0)
- {
- if (!gSATDisplayText.countdownStarted)
- {
- StartTimer(SAT_TERMINAL_RESP_TIMER, gSATDisplayText.duration, gSATContext.noResponseFuncPtr);
- gSATDisplayText.countdownStarted = 1;
- }
- return;
- }
- if (gSATContext.lastSATCmd == SAT_GET_INKEY && gSATGetInkey.duration != 0)
- {
- if (!gSATGetInkey.countdownStarted)
- {
- StartTimer(SAT_TERMINAL_RESP_TIMER, gSATGetInkey.duration, gSATContext.noResponseFuncPtr);
- gSATGetInkey.countdownStarted = 1;
- }
- return;
- }
- #endif /* __USAT__ */
- /* diamond, 2005/07/11 duration for DISPLAY TEXT "clear after a delay" case */
- if (gSATContext.lastSATCmd == SAT_DISPLAY_TEXT_CMD && gSATDisplayText.clearTextType == SAT_CLEAR_AFTER_DELAY)
- {
- StartTimer(SAT_TERMINAL_RESP_TIMER, SAT_DISPLAY_TEXT_DELAY_DURATION, gSATContext.noResponseFuncPtr);
- return;
- }
- /* end, diamond */
- #ifdef MMI_ON_HARDWARE_P
- if (is_test_sim())
- {
- StartTimer(SAT_TERMINAL_RESP_TIMER, 60000, gSATContext.noResponseFuncPtr);
- }
- else
- {
- StartTimer(SAT_TERMINAL_RESP_TIMER, SAT_NO_RESPONSE_TIMER_DURATION, gSATContext.noResponseFuncPtr);
- }
- #else /* MMI_ON_HARDWARE_P */
- StartTimer(SAT_TERMINAL_RESP_TIMER, SAT_NO_RESPONSE_TIMER_DURATION, gSATContext.noResponseFuncPtr);
- #endif /* MMI_ON_HARDWARE_P */
- }
- /*****************************************************************************
- * FUNCTION
- * StopSATTimerNoResponsefromUser
- * DESCRIPTION
- * Stops No Response Timer
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void StopSATTimerNoResponsefromUser(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- StopTimer(SAT_TERMINAL_RESP_TIMER);
- }
- /*****************************************************************************
- * FUNCTION
- * TemporaryStopSATTimerNoResponsefromUser
- * DESCRIPTION
- * Stops No Response Timer when any key is pressed
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void TemporaryStopSATTimerNoResponsefromUser(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- StopTimer(SAT_TERMINAL_RESP_TIMER);
- }
- /*****************************************************************************
- * FUNCTION
- * RestartSATTimerNoResponsefromUser
- * DESCRIPTION
- * ResStarts No Response Timer when any key is released
- * PARAMETERS
- * void
- * FuncPtr(?) [IN] Function to be called on Timer Expiry
- * RETURNS
- * void
- *****************************************************************************/
- void RestartSATTimerNoResponsefromUser(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* diamond, 2005/07/25 SAT timer */
- if (gSATContext.noResponseFuncPtr != NULL)
- {
- /* diamond, 2005/07/11 duration for DISPLAY TEXT "clear after a delay" case */
- if (gSATContext.lastSATCmd == SAT_DISPLAY_TEXT_CMD && gSATDisplayText.clearTextType == SAT_CLEAR_AFTER_DELAY)
- {
- StartTimer(SAT_TERMINAL_RESP_TIMER, SAT_DISPLAY_TEXT_DELAY_DURATION, gSATContext.noResponseFuncPtr);
- return;
- }
- /* end, diamond */
- #ifdef MMI_ON_HARDWARE_P
- if (is_test_sim())
- {
- StartTimer(SAT_TERMINAL_RESP_TIMER, 60000, gSATContext.noResponseFuncPtr);
- }
- else
- {
- StartTimer(SAT_TERMINAL_RESP_TIMER, SAT_NO_RESPONSE_TIMER_DURATION, gSATContext.noResponseFuncPtr);
- }
- #else /* MMI_ON_HARDWARE_P */
- StartTimer(SAT_TERMINAL_RESP_TIMER, SAT_NO_RESPONSE_TIMER_DURATION, gSATContext.noResponseFuncPtr);
- #endif /* MMI_ON_HARDWARE_P */
- }
- }
- /*****************************************************************************
- * FUNCTION
- * StartSATTimerHelp
- * DESCRIPTION
- * Starts Help Timer and calls the passed
- * function if no key is pressed in that duration
- * PARAMETERS
- * FuncPtr [IN]
- * function(?) [IN] To be called on Timer Expiry
- * RETURNS
- * void
- *****************************************************************************/
- void StartSATTimerHelp(FuncPtr FuncPtr)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gSATContext.helpFuncPtr = FuncPtr;
- StartTimer(SAT_HELP_TIMER, SAT_HELP_TIMER_DURATION, gSATContext.helpFuncPtr);
- }
- /*****************************************************************************
- * FUNCTION
- * StopSATTimerHelp
- * DESCRIPTION
- * Stops Help Timer
- * PARAMETERS
- * void
- * FuncPtr(?) [IN] Function to be called on Timer Expiry
- * RETURNS
- * void
- *****************************************************************************/
- void StopSATTimerHelp(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- StopTimer(SAT_HELP_TIMER);
- }
- /*****************************************************************************
- * FUNCTION
- * TemporaryStopSATTimerHelp
- * DESCRIPTION
- * Stops Help Timer when any key is pressed
- * PARAMETERS
- * void
- * FuncPtr(?) [IN] Function to be called on Timer Expiry
- * RETURNS
- * void
- *****************************************************************************/
- void TemporaryStopSATTimerHelp(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- StopTimer(SAT_HELP_TIMER);
- }
- /*****************************************************************************
- * FUNCTION
- * RestartSATTimerHelp
- * DESCRIPTION
- * Restarts Help Timer when any key is released
- * PARAMETERS
- * void
- * FuncPtr(?) [IN] Function to be called on Timer Expiry
- * RETURNS
- * void
- *****************************************************************************/
- void RestartSATTimerHelp(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* diamond, 2005/07/25 SAT timer */
- if (gSATContext.helpFuncPtr != NULL)
- {
- StartTimer(SAT_HELP_TIMER, SAT_HELP_TIMER_DURATION, gSATContext.helpFuncPtr);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * ExitVariables
- * DESCRIPTION
- * Reinitialises the global varibales of SAT while
- * exiting
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitVariables(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gSATContext.isInSATMenu = 0;
- gSATMainMenu.selectedMenuItem = 0;
- SATStopWaitTimer();
- ClearIsInSATScreen();
- }
- /*****************************************************************************
- * FUNCTION
- * ExitSATToIdle
- * DESCRIPTION
- * Takes the user back to Idle Screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitSATToIdle(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (isInCall())
- {
- HangupAllCalls();
- }
- else
- {
- gSATContext.isInSATMenu = 0;
- ClearIsInSATScreen();
- SATStopWaitTimer();
- DisplayIdleScreen();
- }
- }
- /*****************************************************************************
- * FUNCTION
- * SATPleaseWaitScreen
- * DESCRIPTION
- * Displays Please Wait Screen just sets the variables
- * PARAMETERS
- * string [IN] String to be displayed in Please Wait Screen
- * image [IN] Image to be displayed in Please Wait Screen
- * RETURNS
- * void
- *****************************************************************************/
- void SATPleaseWaitScreen(U16 string, U16 image)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gSATContext.waitString = string;
- gSATContext.waitImage = image;
- PleaseWaitActualScreen();
- #ifndef __MTK_TARGET__
- StartTimer(SAT_REFRESH_REBOOT_TIMER, 3000, SATMessageWaitTimer); /* diamond, 2006/05/30 Send NO FURTHER CMD to MMI */
- #endif
- }
- /*****************************************************************************
- * FUNCTION
- * PleaseWaitActualScreen
- * DESCRIPTION
- * Displays Wait Screen on MMI, Entry function
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void PleaseWaitActualScreen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- PRINT_INFORMATION(("[SAT] please wait screen: isInSATScreen = %d", gSATContext.isInSATScreen));
- if (gSATContext.isInSATScreen)
- {
- gSATContext.exitCondition = &gSATContext.waitTimeExpired;
- EntryNewScreen(SCR_ID_SAT_WAITSCREEN, SATGenericExitHandler, NULL, NULL);
- ClearHighlightHandler();
- #ifdef __MMI_SAT_PLEASE_WAIT_ONLY_TEXT__
- ShowCategory151Screen(0, 0, 0, 0, 0, 0, (PU8) GetString(gSATContext.waitString), 0, NULL);
- #else /* __MMI_SAT_PLEASE_WAIT_ONLY_TEXT__ */
- /* diamond, 2005/06/15 change screen style to be the same as DISPLAY TEXT if no image is assigned */
- if (gSATContext.waitImage == 0)
- {
- ShowCategory151Screen(0, 0, 0, 0, 0, 0, (PU8) GetString(gSATContext.waitString), 0, NULL);
- }
- else
- /* end, diamond */
- {
- ShowCategory9Screen(gSATContext.waitString, gSATContext.waitImage, NULL);
- }
- #endif /* __MMI_SAT_PLEASE_WAIT_ONLY_TEXT__ */
- SetKeyHandler(0, KEY_END, KEY_EVENT_DOWN);
- }
- gSATContext.historyFuncPtr = PleaseWaitActualScreen;
- /* micha1012 */
- AlmDisableExpiryHandler();
- StartTimer(SAT_MESSAGE_WAIT_TIMER, SAT_MESSAGE_WAIT_TIMER_DURATION, SATMessageWaitTimer);
- gSATContext.waitTimeExpired = 0;
- }
- /*****************************************************************************
- * FUNCTION
- * SATStopWaitTimer
- * DESCRIPTION
- * Stops Please Wait Timer, Timer is started when Please
- * Wait Screen is called
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void SATStopWaitTimer(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* micha1012 */
- AlmEnableExpiryHandler();
- StopTimer(SAT_MESSAGE_WAIT_TIMER);
- #ifndef __MTK_TARGET__
- StopTimer(SAT_REFRESH_REBOOT_TIMER);
- gSATContext.gotStage1Rsp = 1;
- #endif
- gSATContext.waitTimeExpired = 1;
- }
- /*****************************************************************************
- * FUNCTION
- * SATSetupMenuInd
- * DESCRIPTION
- * Protocol Handler for SETUP MENU IND
- * PARAMETERS
- * msgPtr [IN] Pointer to data from L4
- * RETURNS
- * void
- *****************************************************************************/
- void SATSetupMenuInd(void *msgPtr)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 i;
- U8 *tempDataPtr;
- SATMENUITEM *menuItem;
- mmi_sat_setup_menu_ind_struct *setupMenu;
- U16 convertedLen;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- setupMenu = (mmi_sat_setup_menu_ind_struct*) msgPtr;
- if (gSATContext.isSATPresent)
- {
- FreeMainMenu(&gSATMainMenu);
- }
- memset(&gSATMainMenu, 0, sizeof(gSATMainMenu));
- /* diamond, 2005/08/28 record the last selected item for backward move to SAT main menu */
- gSATMainMenu.selectedMenuItem = 0;
- gSATMainMenu.isHelpInfoAvailable = setupMenu->is_help_info_available;
- memcpy(gSATMainMenu.cmdDetail, setupMenu->cmd_detail, 5 * sizeof(U8));
- gSATMainMenu.numOfItem = setupMenu->num_of_item;
- #ifdef __SAT_MMI_UNIT_TEST__
- gSATMainMenu.isIconAvailable = 1;
- if (gSATMainMenu.isIconAvailable)
- {
- gSATMainMenu.IconID = 1;
- gSATMainMenu.iconAttr = SAT_ICON_NOT_SELF_EX;
- }
- gSATMainMenu.noItemIconIdList = 1;
- gSATMainMenu.itemIconListAttr = 1;
- gSATMainMenu.noNextActionIndList = 1;
- gSATMainMenu.dcsOfAlphaId = MMI_DEFAULT_DCS;
- /* diamond, 2006/05/22 Prevent from getting icon image unsuccessfully */
- gSATMainMenu.alphaIdLen = 20;
- gSATMainMenu.alphaId = CovertStringForPlatform(
- (PU8) "abcdefghji1234567890",
- gSATMainMenu.alphaIdLen,
- gSATMainMenu.dcsOfAlphaId,
- &gSATMainMenu.alphaIdLen);
- #else /* __SAT_MMI_UNIT_TEST__ */
- gSATMainMenu.isIconAvailable = setupMenu->is_icon_available;
- if (gSATMainMenu.isIconAvailable)
- {
- gSATMainMenu.IconID = setupMenu->icon_info.icon_id;
- gSATMainMenu.iconAttr = setupMenu->icon_info.icon_attr;
- }
- gSATMainMenu.noItemIconIdList = setupMenu->no_item_icon_id_list;
- gSATMainMenu.itemIconListAttr = setupMenu->item_icon_list_attr;
- gSATMainMenu.noNextActionIndList = setupMenu->no_next_action_ind_list;
- gSATMainMenu.dcsOfAlphaId = setupMenu->dcs_of_alpha_id;
- /* diamond, 2006/05/22 Prevent from getting icon image unsuccessfully */
- gSATMainMenu.alphaIdLen = setupMenu->no_alpha_id;
- gSATMainMenu.alphaId = CovertStringForPlatform(
- setupMenu->alpha_id,
- gSATMainMenu.alphaIdLen,
- gSATMainMenu.dcsOfAlphaId,
- &gSATMainMenu.alphaIdLen);
- #endif /* __SAT_MMI_UNIT_TEST__ */
- #ifdef __USAT__
- gSATMainMenu.noTextAttribute = setupMenu->no_text_attribute;
- if (gSATMainMenu.noTextAttribute != 0)
- {
- gSATMainMenu.textFormatting = OslMalloc(gSATMainMenu.noTextAttribute * 4);
- memcpy(gSATMainMenu.textFormatting, setupMenu->text_formatting, gSATMainMenu.noTextAttribute * 4);
- }
- #endif /* __USAT__ */
- if (gSATMainMenu.numOfItem == 0)
- {
- SendTerminalResponseSetupMenu(SAT_CMD_PERFORMED_SUCCESSFULLY, gSATMainMenu.cmdDetail);
- FreeMainMenu(&gSATMainMenu);
- gSATContext.isSATPresent = 0;
- if (gSATContext.isInSATMenu)
- {
- SATStopWaitTimer();
- DeleteScreenIfPresent(SCR_ID_SAT_HISTORY);
- if (GetExitScrnID() == SCR_ID_SAT_HISTORY)
- {
- ClearExitHandler();
- }
- GoToSATMainMenu();
- }
- return;
- }
- if (gSATMainMenu.numOfItem > 0)
- {
- gSATMainMenu.menuItems = OslMalloc(gSATMainMenu.numOfItem * sizeof(SATMENUITEM));
- menuItem = gSATMainMenu.menuItems;
- tempDataPtr = setupMenu->item_data;
- memset(gSATMainMenu.menuItems, 0, gSATMainMenu.numOfItem * sizeof(SATMENUITEM));
- for (i = 0; i < gSATMainMenu.numOfItem; i++, menuItem++)
- {
- menuItem->itemLen = (U16) (*(tempDataPtr + 1));
- if (menuItem->itemLen)
- {
- tempDataPtr += 2;
- menuItem->itemId = *tempDataPtr++;
- menuItem->itemDcs = *tempDataPtr++;
- menuItem->itemData = CovertStringForPlatform(tempDataPtr, menuItem->itemLen, menuItem->itemDcs, &convertedLen);
- tempDataPtr += menuItem->itemLen;
- menuItem->itemLen = convertedLen;
- }
- else
- {
- /* diamond, 2006/03/19 Keep the menu item if its content is nothing */
- tempDataPtr += 2;
- menuItem->itemId = *tempDataPtr++;
- menuItem->itemDcs = *tempDataPtr++;
- tempDataPtr += menuItem->itemLen;
- }
- if (gSATMainMenu.noItemIconIdList)
- #ifdef __SAT_MMI_UNIT_TEST__
- menuItem->IconID = 1;
- #else
- menuItem->IconID = *(setupMenu->item_icon_id_list + i);
- #endif
- /* diamond, 2006/05/22 Prevent from getting icon image unsuccessfully */
- #if 0
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- #endif /* 0 */
- if (gSATMainMenu.noNextActionIndList)
- #ifdef __SAT_MMI_UNIT_TEST__
- menuItem->nextAction = SAT_NEXT_ACTION_RESERVED_FOR_TIA;
- #else
- menuItem->nextAction = setupMenu->next_action_ind_list[i];
- #endif
- #ifdef __USAT__
- if (setupMenu->no_item_attribute)
- {
- memcpy(menuItem->itemTextFormatting, setupMenu->item_formatting + 4 * i, 4);
- }
- else
- {
- memset(menuItem->itemTextFormatting, 0, 4);
- }
- #endif /* __USAT__ */
- }
- }
- SendTerminalResponseSetupMenu(SAT_CMD_PERFORMED_SUCCESSFULLY, gSATMainMenu.cmdDetail);
- gSATContext.isSATPresent = 1;
- }
- /*****************************************************************************
- * FUNCTION
- * SATReturnNextAction
- * DESCRIPTION
- * SAT next action indication
- * PARAMETERS
- * NextActionID [IN]
- * RETURNS
- * void
- *****************************************************************************/
- /* micha1229 */
- PU8 SATReturnNextAction(U8 NextActionID)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- switch (NextActionID)
- {
- case SAT_NEXT_ACTION_SETUP_CALL:
- return ((PU8) GetString(SAT_NEXT_ACTION_SETUP_CALL_STRING_ID));
- case SAT_NEXT_ACTION_SEND_SS:
- return ((PU8) GetString(SAT_NEXT_ACTION_SEND_SS_STRING_ID));
- case SAT_NEXT_ACTION_SEND_USSD:
- return ((PU8) GetString(SAT_NEXT_ACTION_SEND_USSD_STRING_ID));
- case SAT_NEXT_ACTION_SEND_SMS:
- return ((PU8) GetString(SAT_NEXT_ACTION_SEND_SMS_STRING_ID));
- case SAT_NEXT_ACTION_PLAY_TONE:
- return ((PU8) GetString(SAT_NEXT_ACTION_PLAY_TONE_STRING_ID));
- case SAT_NEXT_ACTION_DISPLAY_TEXT:
- return ((PU8) GetString(SAT_NEXT_ACTION_DISPLAY_TEXT_STRING_ID));
- case SAT_NEXT_ACTION_GET_INKEY:
- return ((PU8) GetString(SAT_NEXT_ACTION_GET_INKEY_STRING_ID));
- case SAT_NEXT_ACTION_GET_INPUT:
- return ((PU8) GetString(SAT_NEXT_ACTION_GET_INPUT_STRING_ID));
- case SAT_NEXT_ACTION_SELECT_ITEM:
- return ((PU8) GetString(SAT_NEXT_ACTION_SELECT_ITEM_STRING_ID));
- case SAT_NEXT_ACTION_SETUP_MENU:
- return ((PU8) GetString(SAT_NEXT_ACTION_SETUP_MENU_STRING_ID));
- case SAT_NEXT_ACTION_SETUP_IDLE_TEXT:
- return ((PU8) GetString(SAT_NEXT_ACTION_SETUP_IDLE_TEXT_STRING_ID));
- case SAT_NEXT_ACTION_PERFORM_CARD_APDU:
- return ((PU8) GetString(SAT_NEXT_ACTION_PERFORM_CARD_APDU_STRING_ID));
- case SAT_NEXT_ACTION_POWER_ON_CARD:
- return ((PU8) GetString(SAT_NEXT_ACTION_POWER_ON_CARD_STRING_ID));
- case SAT_NEXT_ACTION_POWER_OFF_CARD:
- return ((PU8) GetString(SAT_NEXT_ACTION_POWER_OFF_CARD_STRING_ID));
- case SAT_NEXT_ACTION_GET_READER_STATUS:
- return ((PU8) GetString(SAT_NEXT_ACTION_GET_READER_STATUS_STRING_ID));
- case SAT_NEXT_ACTION_OPEN_CHANNEL:
- return ((PU8) GetString(SAT_NEXT_ACTION_OPEN_CHANNEL_STRING_ID));
- case SAT_NEXT_ACTION_CLOSE_CHANNEL:
- return ((PU8) GetString(SAT_NEXT_ACTION_CLOSE_CHANNEL_STRING_ID));
- case SAT_NEXT_ACTION_RECEIVE_DATA:
- return ((PU8) GetString(SAT_NEXT_ACTION_RECEIVE_DATA_STRING_ID));
- case SAT_NEXT_ACTION_SEND_DATA:
- return ((PU8) GetString(SAT_NEXT_ACTION_SEND_DATA_STRING_ID));
- case SAT_NEXT_ACTION_GET_CHANNEL_STATUS:
- return ((PU8) GetString(SAT_NEXT_ACTION_GET_CHANNEL_STATUS_STRING_ID));
- case SAT_NEXT_ACTION_RESERVED_FOR_TIA:
- return ((PU8) GetString(SAT_NEXT_ACTION_RESERVED_FOR_TIA_STRING_ID));
- case SAT_NEXT_ACTION_END_SESSION:
- return ((PU8) GetString(SAT_NEXT_ACTION_END_SESSION_STRING_ID));
- default:
- return (NULL);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * SATAddIconIDToList
- * DESCRIPTION
- *
- * PARAMETERS
- * IconID [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void SATAddIconIDToList(U8 IconID)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 i;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- for (i = 0; i < MAX_ICON_SUPPORT; i++)
- {
- if (gSATContext.iconList[i].iconID == IconID)
- {
- return;
- }
- if (gSATContext.iconList[i].iconID == 0)
- {
- gSATContext.iconList[i].iconID = IconID;
- return;
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * SATGetIconFromList
- * DESCRIPTION
- *
- * PARAMETERS
- * IconID [IN]
- * RETURNS
- * void
- *****************************************************************************/
- U8 *SATGetIconFromList(U8 IconID)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 i;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- for (i = 0; i < MAX_ICON_SUPPORT; i++)
- {
- if (gSATContext.iconList[i].iconID == IconID && gSATContext.iconList[i].gotFromSIM == MMI_TRUE)
- {
- gSATContext.isCMDIconSupported = (gSATContext.iconList[i].iconAvailable == MMI_TRUE) ? MMI_TRUE : MMI_FALSE; /* diamond 2005/05/24 icon */
- return (gSATContext.iconList[i].iconData);
- }
- if (gSATContext.iconList[i].iconID == 0)
- {
- return (NULL);
- }
- }
- return (NULL);
- }
- /*****************************************************************************
- * FUNCTION
- * SATCheckAllIconGot
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- MMI_BOOL SATCheckAllIconGot(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 i;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- for (i = 0; i < MAX_ICON_SUPPORT; i++)
- {
- if (gSATContext.iconList[i].iconID == 0)
- {
- return (MMI_TRUE);
- }
- if (gSATContext.iconList[i].gotFromSIM != MMI_TRUE)
- {
- return (MMI_FALSE);
- }
- }
- return (MMI_TRUE);
- }
- /*****************************************************************************
- * FUNCTION
- * SATClearAllIcons
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void SATClearAllIcons(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 i;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- for (i = 0; i < MAX_ICON_SUPPORT; i++)
- {
- if (gSATContext.iconList[i].iconID == 0)
- {
- return;
- }
- if (gSATContext.iconList[i].gotFromSIM == MMI_TRUE)
- {
- if (gSATContext.iconList[i].iconData != NULL)
- {
- if (gSATContext.iconList[i].iconAvailable == MMI_TRUE) /* diamond, 2005/06/03 icon */
- {
- OslMfree(gSATContext.iconList[i].iconData);
- }
- gSATContext.iconList[i].iconData = NULL;
- }
- gSATContext.iconList[i].iconID = 0;
- gSATContext.iconList[i].gotFromSIM = 0;
- gSATContext.iconList[i].iconAvailable = 0; /* diamond, 2005/06/03 icon */
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * SATGetIconDataToList
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void SATGetIconDataToList(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 i;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- for (i = 0; i < MAX_ICON_SUPPORT; i++)
- {
- if (gSATContext.iconList[i].iconID == 0)
- {
- gSATContext.currGetIconIndex = 0;
- SATGetIconCompleteCallBack();
- return;
- }
- if (gSATContext.iconList[i].gotFromSIM == MMI_FALSE)
- {
- gSATContext.currGetIconIndex = i;
- #ifdef __SAT_MMI_UNIT_TEST__
- SendImageDataRecordReq(&EFback1);
- #else
- SendImageLenRecordReq(gSATContext.iconList[i].iconID);
- #endif
- return;
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * SATGetIconDataCallBack
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void SATGetIconDataCallBack(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U32 dataSize, totalImageSize, rawBytes;
- U32 i; /* diamond, 2006/05/22 Handle the large icon */
- U8 j, bitPerRasterPoint, currBitIndex, bitMask, bitMask1, bitMask2, CLUTIndex;
- PU8 dataPointer, currColorImgByte;
- U16 c_black, c_white, pixData;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gSATContext.iconList[gSATContext.currGetIconIndex].gotFromSIM = MMI_TRUE;
- if (gSATImageRecord.noOfImages && (gSATImageRecord.imageData != NULL))
- {
- totalImageSize = (U32) (gSATImageRecord.imageInst->width * gSATImageRecord.imageInst->height * 2 + 19);
- /* diamond, 2005/05/24, If the icon is too large to allocate memory, the icon will be ignored. */
- gSATContext.iconList[gSATContext.currGetIconIndex].iconData = NULL;
- if (totalImageSize <= 2048 && /* the max size of OslMalloc */
- gSATImageRecord.imageInst->width == gSATImageRecord.imageData[0] &&
- gSATImageRecord.imageInst->height == gSATImageRecord.imageData[1])
- {
- gSATContext.iconList[gSATContext.currGetIconIndex].iconAvailable = MMI_TRUE;
- /* end, diamond */
- gSATContext.iconList[gSATContext.currGetIconIndex].iconData = (U8*) OslMalloc(totalImageSize * sizeof(U8));
- memset(gSATContext.iconList[gSATContext.currGetIconIndex].iconData, 0, totalImageSize * sizeof(U8));
- gSATContext.iconList[gSATContext.currGetIconIndex].iconData[0] = 4 /* IMAGE_TYPE_DEVICE_BITMAP */ ;
- gSATContext.iconList[gSATContext.currGetIconIndex].iconData[1] = 0;
- gSATContext.iconList[gSATContext.currGetIconIndex].iconData[2] = (U8) ((totalImageSize - 6) & 0x000000ff);
- gSATContext.iconList[gSATContext.currGetIconIndex].iconData[3] =
- (U8) (((totalImageSize - 6) >> 8) & 0x000000ff);
- gSATContext.iconList[gSATContext.currGetIconIndex].iconData[4] =
- (U8) (((totalImageSize - 6) >> 16) & 0x000000ff);
- gSATContext.iconList[gSATContext.currGetIconIndex].iconData[5] =
- (U8) (((totalImageSize - 6) >> 24) & 0x000000ff);
- gSATContext.iconList[gSATContext.currGetIconIndex].iconData[6] = gSATImageRecord.imageInst->width;
- gSATContext.iconList[gSATContext.currGetIconIndex].iconData[10] = gSATImageRecord.imageInst->height;
- gSATContext.iconList[gSATContext.currGetIconIndex].iconData[14] = 0x10;
- rawBytes = (U32) (gSATImageRecord.imageInst->width * 2);
- gSATContext.iconList[gSATContext.currGetIconIndex].iconData[15] = (U8) (rawBytes & 0x000000ff);
- gSATContext.iconList[gSATContext.currGetIconIndex].iconData[16] = (U8) ((rawBytes >> 8) & 0x000000ff);
- dataPointer = gSATContext.iconList[gSATContext.currGetIconIndex].iconData + 19;
- dataSize = (U32) gSATImageRecord.imageInst->width * (U32) gSATImageRecord.imageInst->height;
- if (gSATImageRecord.imageInst->coding == SAT_BASIC_IMAGE)
- {
- c_white = gdi_act_color_from_rgb(255, 255, 255, 255); /* GDI_RGB_TO_BUFFER_FORMAT(255,255,255); */
- c_black = gdi_act_color_from_rgb(255, 0, 0, 0); /* GDI_RGB_TO_BUFFER_FORMAT(0,0,0); */
- for (i = 0; i < dataSize; i++)
- {
- pixData = (*(gSATImageRecord.imageData + 2 + i / 8) >> (7 - (i % 8))) & 0x01 ? c_black : c_white;
- *(dataPointer + 2 * i) = (U8) (pixData & 0x00ff);
- *(dataPointer + 2 * i + 1) = (U8) ((pixData >> 8) & 0x00ff);
- }
- }
- else if (gSATImageRecord.imageInst->coding == SAT_COLORR_IMAGE)
- {
- bitPerRasterPoint = (U8) * (gSATImageRecord.imageData + 2);
- currBitIndex = 0;
- currColorImgByte = gSATImageRecord.imageData + 6;
- bitMask = 0x01;
- for (i = 0; i < bitPerRasterPoint; i++)
- {
- bitMask = 2 * bitMask;
- }
- bitMask = bitMask - 1;
- for (i = 0; i < dataSize; i++)
- {
- if ((currBitIndex + bitPerRasterPoint) < 8)
- {
- CLUTIndex = ((*currColorImgByte) >> (8 - currBitIndex - bitPerRasterPoint)) & bitMask;
- currBitIndex = currBitIndex + bitPerRasterPoint;
- }
- else
- {
- bitMask1 = 0x01;
- for (j = 0; j < 8 - currBitIndex; j++)
- {
- bitMask1 = 2 * bitMask1;
- }
- bitMask1 = bitMask1 - 1;
- if ((8 - bitPerRasterPoint - currBitIndex) == 0)
- {
- CLUTIndex = (*currColorImgByte) & bitMask1;
- }
- else
- {
- bitMask2 = 0x01;
- for (j = 0; j < bitPerRasterPoint + currBitIndex - 8; j++)
- {
- bitMask2 = 2 * bitMask2;
- }
- bitMask2 = bitMask2 - 1;
- CLUTIndex = ((*currColorImgByte) & bitMask1) +
- (((*currColorImgByte + 1) >> (8 - (bitPerRasterPoint + currBitIndex - 8))) & bitMask2);
- }
- currColorImgByte++;
- currBitIndex = (currBitIndex + bitPerRasterPoint) % 8;
- }
- //pixData = GDI_RGB_TO_BUFFER_FORMAT( gSATImageRecord.CLUTData[CLUTIndex].red,
- // gSATImageRecord.CLUTData[CLUTIndex].green,
- // gSATImageRecord.CLUTData[CLUTIndex].blue);
- pixData = gdi_act_color_from_rgb(
- 255,
- gSATImageRecord.CLUTData[CLUTIndex].red,
- gSATImageRecord.CLUTData[CLUTIndex].green,
- gSATImageRecord.CLUTData[CLUTIndex].blue);
- *(dataPointer + 2 * i) = (U8) (pixData & 0x00ff);
- *(dataPointer + 2 * i + 1) = (U8) ((pixData >> 8) & 0x00ff);
- }
- }
- }
- /* diamond, 2005/05/24 icon */
- else
- {
- gSATContext.iconList[gSATContext.currGetIconIndex].iconAvailable = MMI_FALSE;
- gSATContext.iconList[gSATContext.currGetIconIndex].iconData = NULL; /* (PU8)GetImage(IMG_GLOBAL_DEFAULT); */
- }
- /* end, diamond */
- }
- else
- {
- /* diamond, 2006/05/22 Prevent from getting icon image unsuccessfully */
- gSATContext.iconList[gSATContext.currGetIconIndex].iconAvailable = MMI_FALSE;
- gSATContext.iconList[gSATContext.currGetIconIndex].iconData = NULL;
- }
- gSATImageRecord.iconId = 0;
- gSATImageRecord.noOfImages = 0;
- gSATImageRecord.noOfCLUT = 0;
- gSATImageRecord.locOfCLUT = 0;
- if (gSATImageRecord.imageInst != NULL)
- {
- OslMfree(gSATImageRecord.imageInst);
- gSATImageRecord.imageInst = NULL;
- }
- if (gSATImageRecord.imageData != NULL)
- {
- OslMfree(gSATImageRecord.imageData);
- gSATImageRecord.imageData = NULL;
- }
- gSATImageRecord.CLUTData = NULL;
- SATGetIconDataToList();
- }
- /*****************************************************************************
- * FUNCTION
- * SendTerminalResponseSetupMenu
- * DESCRIPTION
- * Sends SETUP MENU REQ to L4
- * PARAMETERS
- * res [IN]
- * cmdDetail [?]
- * RETURNS
- * void
- *****************************************************************************/
- void SendTerminalResponseSetupMenu(U8 res, U8 *cmdDetail)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MYQUEUE *Message;
- mmi_sat_setup_menu_res_req_struct *dataPtr;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- Message = ALLOCATE_ITM(MOD_MMI);
- Message->oslSrcId = MOD_MMI;
- Message->oslDestId = MOD_L4C;
- Message->oslMsgId = PRT_MMI_SAT_SETUP_MENU_RES_REQ;
- dataPtr = (mmi_sat_setup_menu_res_req_struct*) OslConstructDataPtr(sizeof(mmi_sat_setup_menu_res_req_struct));
- memcpy(dataPtr->cmd_detail, (void*)cmdDetail, 5 * sizeof(U8));
- dataPtr->res = res;
- Message->oslDataPtr = (oslParaType*) dataPtr;
- Message->oslPeerBuffPtr = NULL;
- SEND_MSG(Message);
- gSATContext.lastSATCmd = SAT_NONE_CMD;
- if (gSATContext.isInSATMenu)
- {
- SATPleaseWaitScreen(SAT_WAIT_STRING_ID, SAT_WAIT_IMAGE_ID);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * SATSetupMenuRsp
- * DESCRIPTION
- * Protocol Handler for SETUP MENU RES
- * PARAMETERS
- * msgPtr [IN] Pointer to data from L4
- * RETURNS
- * void
- *****************************************************************************/
- void SATSetupMenuRsp(void *msgPtr)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- mmi_sat_setup_menu_res_rsp_struct *setupMenuRes;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- setupMenuRes = (mmi_sat_setup_menu_res_rsp_struct*) msgPtr;
- if (setupMenuRes->result == MMI_TRUE)
- {
- if (gSATContext.isInSATMenu)
- {
- SATStopWaitTimer();
- DeleteScreenIfPresent(SCR_ID_SAT_HISTORY);
- if (GetExitScrnID() == SCR_ID_SAT_HISTORY)
- {
- ClearExitHandler();
- }
- GoToSATMainMenu();
- }
- if (GetActiveScreenId() == SERVICES_MAIN_MENU_SCREEN_ID)
- {
- GoToServicesMenu();
- DeleteScreenIfPresent(SERVICES_MAIN_MENU_SCREEN_ID);
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * SimBusyPleaseWait
- * DESCRIPTION
- * Display SIM busy screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void SimBusyPleaseWait(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- //micha0714
- // gSATMainMenu.isSentRsp = 1;
- DisplayPopup((U8*) GetString(SAT_WAIT_STRING_ID), IMG_GLOBAL_UNFINISHED, 1, SSC_POP_UP_TIME, (U8) ERROR_TONE);
- /* SATPleaseWaitScreen(SAT_WAIT_STRING_ID, SAT_WAIT_IMAGE_ID); */
- }
- /*****************************************************************************
- * FUNCTION
- * GoToSATMainMenu
- * DESCRIPTION
- * Displays SAT Main Menu
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void GoToSATMainMenu(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *listItems[64];
- U8 *listItemsIcons[64];
- U8 *listNextAction[64];
- U16 i;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- memset(listItems, 0, sizeof(listItems));
- memset(listItemsIcons, 0, sizeof(listItemsIcons));
- memset(listNextAction, 0, sizeof(listNextAction));
- if (gSATMainMenu.isIconAvailable)
- {
- SATAddIconIDToList(gSATMainMenu.IconID);
- }
- for (i = 0; i < gSATMainMenu.noItemIconIdList; i++)
- {
- SATAddIconIDToList(gSATMainMenu.menuItems[i].IconID);
- }
- if (gSATMainMenu.isIconAvailable || gSATMainMenu.noItemIconIdList)
- {
- if (!SATCheckAllIconGot())
- {
- SATGetIconCompleteCallBack = GoToSATMainMenu;
- SATGetIconDataToList();
- return;
- }
- }
- for (i = 0; i < gSATMainMenu.numOfItem; i++)
- {
- listItems[i] = gSATMainMenu.menuItems[i].itemData;
- if (gSATMainMenu.noItemIconIdList)
- {
- listItemsIcons[i] = SATGetIconFromList(gSATMainMenu.menuItems[i].IconID);
- }
- if (gSATMainMenu.noNextActionIndList)
- {
- listNextAction[i] = SATReturnNextAction(gSATMainMenu.menuItems[i].nextAction);
- }
- /* diamond, 2006/05/22 Prevent from getting icon image unsuccessfully */
- if (gSATMainMenu.noItemIconIdList != 0 && gSATMainMenu.itemIconListAttr == SAT_ICON_SELF_EX &&
- listItemsIcons[i] != NULL)
- {
- listItems[i] = NULL;
- }
- }
- if (!gSATContext.isSATPresent)
- {
- DeleteScreenIfPresent(SCR_ID_SAT_MAINMENU);
- ExitSATMainMenu();
- return;
- }
- gSATContext.exitCondition = &gSATMainMenu.isSentRsp;
- EntryNewScreen(SCR_ID_SAT_MAINMENU, SATGenericExitHandler, NULL, NULL);
- gSATContext.historyFuncPtr = GoToSATMainMenu;
- SetIsInSATScreen();
- gSATMainMenu.isSentRsp = 0;
- RegisterHighlightHandler(SATMenuIndex);
- ShowCategory174Screen(
- gSATMainMenu.alphaId,
- SATGetIconFromList(gSATMainMenu.IconID),
- (PU8) GetString(STR_GLOBAL_OK),
- (PU8) GetImage(IMG_GLOBAL_OK),
- (PU8) GetString(STR_GLOBAL_BACK),
- (PU8) GetImage(IMG_GLOBAL_BACK),
- gSATMainMenu.numOfItem,
- listItems,
- /* listItemsIcons,listNextAction,0,0,gSATContext.guiBufferPointer); */ listItemsIcons,
- listNextAction,
- 0,
- gSATMainMenu.selectedMenuItem,
- gSATContext.guiBufferPointer);
- SetKeyHandler(ExitSATToIdle, KEY_END, KEY_EVENT_DOWN);
- SATCompletePreviousTransaction();
- /* micha0328 */
- if (gSATMainMenu.isHelpInfoAvailable)
- {
- SetKeyHandler(EnvelopeSetupMenuHelp, KEY_SEND, KEY_EVENT_UP);
- }
- if (gSATContext.gotStage1Rsp)
- {
- SetLeftSoftkeyFunction(EnvelopeSetupMenuOK, KEY_EVENT_UP);
- SetRightSoftkeyFunction(ExitSATMainMenu, KEY_EVENT_UP);
- SetKeyHandler(EnvelopeSetupMenuOK, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(ExitSATMainMenu, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- else
- {
- SetLeftSoftkeyFunction(SimBusyPleaseWait, KEY_EVENT_UP);
- SetRightSoftkeyFunction(ExitSATMainMenu, KEY_EVENT_UP);
- SetKeyHandler(SimBusyPleaseWait, KEY_RIGHT_ARROW, KEY_EVENT_DOWN);
- SetKeyHandler(ExitSATMainMenu, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- gSATContext.isInSATMenu = 1;
- }
- /*****************************************************************************
- * FUNCTION
- * SATCompletePreviousTransaction
- * DESCRIPTION
- * Prevent screen delete by others
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void SATCompletePreviousTransaction(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- switch (gSATContext.lastSATCmd)
- {
- case SAT_SELECT_ITEM_CMD:
- TerminalResponseSelectItem(SAT_PROACTIVE_CMD_TERMINATED_BY_USER, 0, gSATSubMenu.cmdDetail);
- break;
- case SAT_DISPLAY_TEXT_CMD:
- TerminalResponseDisplayText(SAT_PROACTIVE_CMD_TERMINATED_BY_USER, gSATDisplayText.cmdDetail);
- break;
- case SAT_GET_INPUT:
- TerminalResponseGetInput(SAT_PROACTIVE_CMD_TERMINATED_BY_USER, gSATGetInput.cmdDetail);
- break;
- case SAT_GET_INKEY:
- TerminalResponseGetInkey(SAT_PROACTIVE_CMD_TERMINATED_BY_USER, 0, gSATGetInkey.cmdDetail);
- break;
- case SAT_CALL_SETUP_CMD:
- TerminalResponseCallSetup(SAT_PROACTIVE_CMD_TERMINATED_BY_USER, 0, gSATCallSetup.cmdDetail); /* Avoid re-try by SIM */
- break;
- // case SAT_SEND_SMS_CMD:
- // TerminalResponseSendSMS(SAT_ME_CURRENTLY_UNABLE_TO_PROCESS_CMD, 0, gSATSendSMS.cmdDetail);
- // break;
- case SAT_PLAY_TONE_CMD:
- TerminalResponsePlayTone(SAT_ME_CURRENTLY_UNABLE_TO_PROCESS_CMD, gSATPlayTone.cmdDetail);
- break;
- case SAT_LAUNCH_BROWSER_CMD:
- TerminalResponseLaunchBrowser(SAT_ME_CURRENTLY_UNABLE_TO_PROCESS_CMD, 0, gSATLaunchBrowser.cmdDetail);
- break;
- case SAT_SEND_DTMF_CMD:
- TerminalResponseSendDTMF(SAT_ME_CURRENTLY_UNABLE_TO_PROCESS_CMD, 0, gSATSendDTMF.cmdDetail);
- break;
- case SAT_SEND_SS_CMD:
- TerminalResponseSendSS(SAT_ME_CURRENTLY_UNABLE_TO_PROCESS_CMD, 0, NULL, gSATSendSS.cmdDetail);
- break;
- // case SAT_SEND_USSD_CMD:
- // TerminalResponseSendUSSD(SAT_ME_CURRENTLY_UNABLE_TO_PROCESS_CMD, 0,NULL,gSATSendUSSD.cmdDetail);
- // break;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * ExitSATMainMenu
- * DESCRIPTION
- * Exit Handler for SAT Main Menu
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitSATMainMenu(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ExitVariables();
- GoBackHistory();
- }
- /*****************************************************************************
- * FUNCTION
- * FreeMainMenu
- * DESCRIPTION
- * Frees memory of various elements of SATSETUPMENU struct
- * PARAMETERS
- * mainMenu [IN] Pointer to SATSETUPMENU struct to be freed
- * RETURNS
- * void
- *****************************************************************************/
- void FreeMainMenu(SATSETUPMENU *mainMenu)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 i;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SATClearAllIcons();
- for (i = 0; i < mainMenu->numOfItem; i++)
- {
- /* micha1008 */
- if (mainMenu->menuItems[i].itemData)
- {
- OslMfree(mainMenu->menuItems[i].itemData);
- }
- mainMenu->menuItems[i].itemData = NULL;
- mainMenu->menuItems[i].itemLen = 0;
- }
- mainMenu->numOfItem = 0;
- if (mainMenu->menuItems != NULL)
- {
- OslMfree(mainMenu->menuItems);
- mainMenu->menuItems = NULL;
- }
- /* micha1008 */
- if (mainMenu->alphaId)
- {
- OslMfree(mainMenu->alphaId);
- }
- mainMenu->alphaId = NULL;
- mainMenu->alphaIdLen = 0;
- #ifdef __USAT__
- if (mainMenu.textFormatting)
- {
- OslMfree(mainMenu.textFormatting);
- }
- mainMenu.noTextAttribute = 0;
- mainMenu.textFormatting = NULL;
- #endif /* __USAT__ */
- }
- /*****************************************************************************
- * FUNCTION
- * SATMenuIndex
- * DESCRIPTION
- * Highlight Handler for various menus in SAT
- * PARAMETERS
- * index [IN] Index of item highlighted
- * RETURNS
- * void
- *****************************************************************************/
- void SATMenuIndex(S32 index)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gSATContext.highlightedIndex = (U8) index;
- /* diamond, 2006/03/22 record the last selected item for backward move to SAT main menu */
- if (gSATContext.historyFuncPtr == GoToSATMainMenu)
- {
- gSATMainMenu.selectedMenuItem = gSATContext.highlightedIndex;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * EnvelopeSetupMenuOK
- * DESCRIPTION
- * Key Handler for LSK of Main Menu
- * PARAMETERS
- * void
- * index(?) [IN] Index of item highlighted
- * RETURNS
- * void
- *****************************************************************************/
- void EnvelopeSetupMenuOK()
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (!gSATContext.gotStage1Rsp)
- {
- /* prevent from entry SAT screen first then get SEND SMS indication */
- SimBusyPleaseWait();
- return;
- }
- EnvelopeSetupMenu(gSATMainMenu.menuItems[gSATContext.highlightedIndex].itemId, FALSE);
- SATPleaseWaitScreen(SAT_WAIT_STRING_ID, SAT_WAIT_IMAGE_ID);
- }
- /*****************************************************************************
- * FUNCTION
- * EnvelopeSetupMenuHelp
- * DESCRIPTION
- * Key Handler for Hotkey of Main Menu
- * PARAMETERS
- * void
- * index(?) [IN] Index of item highlighted
- * RETURNS
- * void
- *****************************************************************************/
- void EnvelopeSetupMenuHelp(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EnvelopeSetupMenu(gSATMainMenu.menuItems[gSATContext.highlightedIndex].itemId, TRUE);
- SATPleaseWaitScreen(SAT_WAIT_STRING_ID, SAT_WAIT_IMAGE_ID);
- }
- /*****************************************************************************
- * FUNCTION
- * EnvelopeSetupMenu
- * DESCRIPTION
- * Sends ENVELOPE MENU SELECT to L4
- * PARAMETERS
- * itemId [IN] Item id of selcted item
- * isHelpInfoRequested [IN] Is help Rquested (TRUE/FALSE)
- * RETURNS
- * void
- *****************************************************************************/
- void EnvelopeSetupMenu(U8 itemId, U8 isHelpInfoRequested)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MYQUEUE *Message;
- mmi_sat_menu_select_req_struct *dataPtr;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* micha0216 */
- gSATContext.gotStage1Rsp = 0;
- gSATMainMenu.isSentRsp = 1;
- Message = ALLOCATE_ITM(MOD_MMI);
- Message->oslSrcId = MOD_MMI;
- Message->oslDestId = MOD_L4C;
- Message->oslMsgId = PRT_MMI_SAT_MENU_SELECT_REQ;
- dataPtr = (mmi_sat_menu_select_req_struct*) OslConstructDataPtr(sizeof(mmi_sat_menu_select_req_struct));
- dataPtr->item_id = itemId;
- dataPtr->is_help_info_requested = isHelpInfoRequested;
- Message->oslDataPtr = (oslParaType*) dataPtr;
- Message->oslPeerBuffPtr = NULL;
- SEND_MSG(Message);
- gSATContext.lastSATCmd = SAT_NONE_CMD;
- }
- /* micha0216 */
- /*****************************************************************************
- * FUNCTION
- * SATMenuSelectRsp
- * DESCRIPTION
- * Protocol Handler for menu select
- * PARAMETERS
- * msgPtr [IN] Pointer to data from L4
- * RETURNS
- * void
- *****************************************************************************/
- void SATMenuSelectRsp(void *msgPtr)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gSATContext.gotStage1Rsp = 1;
- }
- /*****************************************************************************
- * FUNCTION
- * SATSelectItemInd
- * DESCRIPTION
- * Protocol Handler for SELECT ITEM IND
- * PARAMETERS
- * msgPtr [IN] Pointer to data from L4
- * RETURNS
- * void
- *****************************************************************************/
- void SATSelectItemInd(void *msgPtr)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 i;
- U8 *tempDataPtr;
- SATMENUITEM *menuItem;
- mmi_sat_select_item_ind_struct *selectItem;
- U16 convertLen;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- selectItem = (mmi_sat_select_item_ind_struct*) msgPtr;
- FreeSubMenu();
- gSATContext.lastSATCmd = SAT_SELECT_ITEM_CMD;
- gSATContext.guiBufferPointer = NULL;
- gSATSubMenu.isSentRsp = 0;
- if (GetCurrentState() == CM_OUTGOING_STATE || GetCurrentState() == CM_INCOMING_STATE)
- {
- TerminalResponseSelectItem(SAT_ME_CURRENTLY_UNABLE_TO_PROCESS_CMD, 0, selectItem->cmd_detail);
- return;
- }
- #ifdef __FLIGHT_MODE_SUPPORT__
- if (mmi_bootup_get_active_flight_mode() == 1)
- {
- TerminalResponseSelectItem(SAT_ME_CURRENTLY_UNABLE_TO_PROCESS_CMD, 0, selectItem->cmd_detail);
- return;
- }
- #endif /* __FLIGHT_MODE_SUPPORT__ */
- gSATSubMenu.isHelpInfoAvailable = selectItem->is_help_info_available;
- memcpy(gSATSubMenu.cmdDetail, selectItem->cmd_detail, 5 * sizeof(U8));
- gSATSubMenu.numOfItem = selectItem->num_of_item;
- #ifdef __SAT_MMI_UNIT_TEST__
- gSATSubMenu.isIconAvailable = 1;
- if (gSATSubMenu.isIconAvailable)
- {
- gSATSubMenu.IconID = 1;
- gSATSubMenu.iconAttr = SAT_ICON_NOT_SELF_EX;
- }
- gSATSubMenu.noItemIconIdList = 1;
- gSATSubMenu.itemIconListAttr = 1;
- gSATSubMenu.noNextActionIndList = 1;
- gSATSubMenu.dcsOfAlphaId = selectItem->dcs_of_alpha_id;
- if (gSATSubMenu.isIconAvailable && gSATSubMenu.iconAttr == SAT_ICON_SELF_EX)
- {
- gSATSubMenu.alphaIdLen = 0;
- gSATSubMenu.alphaId = NULL;
- }
- else
- {
- gSATSubMenu.alphaIdLen = selectItem->no_alpha_id;
- gSATSubMenu.alphaId = CovertStringForPlatform(
- selectItem->alpha_id,
- gSATSubMenu.alphaIdLen,
- gSATSubMenu.dcsOfAlphaId,
- &gSATSubMenu.alphaIdLen);
- }
- #else /* __SAT_MMI_UNIT_TEST__ */
- gSATSubMenu.isIconAvailable = selectItem->is_icon_available;
- if (gSATSubMenu.isIconAvailable)
- {
- gSATSubMenu.IconID = selectItem->icon_info.icon_id;
- gSATSubMenu.iconAttr = selectItem->icon_info.icon_attr;
- }
- gSATSubMenu.noItemIconIdList = selectItem->no_item_icon_id_list;
- gSATSubMenu.itemIconListAttr = selectItem->item_icon_list_attr;
- gSATSubMenu.noNextActionIndList = selectItem->no_next_action_ind_list;
- gSATSubMenu.dcsOfAlphaId = selectItem->dcs_of_alpha_id;
- if (gSATSubMenu.isIconAvailable && gSATSubMenu.iconAttr == SAT_ICON_SELF_EX)
- {
- gSATSubMenu.alphaIdLen = 0;
- gSATSubMenu.alphaId = NULL;
- }
- else
- {
- gSATSubMenu.alphaIdLen = selectItem->no_alpha_id;
- gSATSubMenu.alphaId = CovertStringForPlatform(
- selectItem->alpha_id,
- gSATSubMenu.alphaIdLen,
- gSATSubMenu.dcsOfAlphaId,
- &gSATSubMenu.alphaIdLen);
- }
- #endif /* __SAT_MMI_UNIT_TEST__ */
- #ifdef __USAT__
- gSATMainMenu.noTextAttribute = selectItem->no_text_attribute;
- if (gSATMainMenu.noTextAttribute != 0)
- {
- gSATMainMenu.textFormatting = OslMalloc(gSATMainMenu.noTextAttribute * 4);
- memcpy(gSATMainMenu.textFormatting, selectItem->text_formatting, gSATMainMenu.noTextAttribute * 4);
- }
- #endif /* __USAT__ */
- if (gSATSubMenu.numOfItem == 0)
- {
- SelectItemWrongData();
- return;
- }
- if (gSATSubMenu.numOfItem > 0)
- {
- gSATSubMenu.menuItems = OslMalloc(gSATSubMenu.numOfItem * sizeof(SATMENUITEM));
- memset(gSATSubMenu.menuItems, 0, gSATSubMenu.numOfItem * sizeof(SATMENUITEM));
- menuItem = gSATSubMenu.menuItems;
- tempDataPtr = selectItem->item_data;
- for (i = 0; i < gSATSubMenu.numOfItem; i++, menuItem++)
- {
- menuItem->itemLen = (U16) (*(tempDataPtr + 1));
- /* micha0204 */
- tempDataPtr += 2;
- menuItem->itemId = *tempDataPtr++;
- menuItem->itemDcs = *tempDataPtr++;
- if (menuItem->itemLen != 0)
- {
- menuItem->itemData = CovertStringForPlatform(tempDataPtr, menuItem->itemLen, menuItem->itemDcs, &convertLen);
- tempDataPtr += menuItem->itemLen;
- menuItem->itemLen = convertLen;
- }
- else
- {
- menuItem->itemData = NULL;
- menuItem->itemLen = 0;
- }
- if (gSATSubMenu.noItemIconIdList)
- #ifdef __SAT_MMI_UNIT_TEST__
- menuItem->IconID = 1;
- #else
- menuItem->IconID = *(selectItem->item_icon_id_list + i);
- #endif
- if (gSATSubMenu.noItemIconIdList && gSATSubMenu.itemIconListAttr == SAT_ICON_SELF_EX)
- {
- if (menuItem->itemData)
- {
- OslMfree(menuItem->itemData);
- }
- menuItem->itemData = NULL;
- menuItem->itemLen = 0;
- }
- if (gSATSubMenu.noNextActionIndList)
- #ifdef __SAT_MMI_UNIT_TEST__
- menuItem->nextAction = SAT_NEXT_ACTION_RESERVED_FOR_TIA_STRING_ID;
- #else
- menuItem->nextAction = selectItem->next_action_ind_list[i];
- #endif
- #ifdef __USAT__
- if (selectItem->no_item_attribute)
- {
- memcpy(menuItem->itemTextFormatting, selectItem->item_formatting + 4 * i, 4);
- }
- else
- {
- memset(menuItem->itemTextFormatting, 0, 4);
- }
- #endif /* __USAT__ */
- }
- }
- gSATSubMenu.defaultIndex = 0;
- if (selectItem->is_item_id_available)
- {
- for (i = 0; i < gSATSubMenu.numOfItem; i++)
- {
- if (gSATSubMenu.menuItems[i].itemId == selectItem->item_id)
- {
- gSATSubMenu.defaultIndex = i;
- break;
- }
- }
- }
- SATStopWaitTimer();
- DeleteScreenIfPresent(SCR_ID_SAT_HISTORY);
- if (GetExitScrnID() == SCR_ID_SAT_HISTORY)
- {
- ClearExitHandler();
- }
- GoToSATSubMenu();
- }
- /*****************************************************************************
- * FUNCTION
- * SelectItemWrongData
- * DESCRIPTION
- * Displays SAT Sub Menu
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void SelectItemWrongData(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- TerminalResponseSelectItem(