⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 simdetection.c

📁 MTK6226修改平台UI的文件介绍
💻 C
📖 第 1 页 / 共 5 页
字号:
#endif 

#if defined(__MMI_DOWNLOAD_AGENT__)
#include "App_mine.h"
#include "FileMgr.h"
#include "DLAgentDef.h"
#include "DLAgentGProt.h"
#endif /* defined(__MMI_DOWNLOAD_AGENT__) */ 

#ifdef __MMI_IRDA_SUPPORT__
#include "IrdaMMIGprots.h"
#include "IrdaMMIScr.h"
extern void mmi_irda_exec_close_menu(void);
#endif /* __MMI_IRDA_SUPPORT__ */ 

#ifdef __CTM_SUPPORT__
#include "TextPhoneProt.h"
#endif

#if (defined(__MMI_VCARD__) || defined(__MMI_VCALENDAR__)) && defined(MMI_ON_HARDWARE_P)
#include "vObjects.h"
#endif

#ifdef __MMI_WLAN_FEATURES__
#include "NetworkSetupDefs.h"
#ifdef __MMI_IMPS__
#include "Mmi_imps_gprot.h"
#endif
#endif /* __MMI_WLAN_FEATURES__ */

#ifdef __MMI_CAMERA__
#include "lcd_if.h"     /* LCD layer enable flag */
#include "gdi_lcd_config.h"
#include "MMI_features_camera.h"
#include "mdi_datatype.h"
#include "mdi_camera.h" /* camera lib */
#include "CameraApp.h"
#endif /* __MMI_CAMERA__ */ 

/* External Functions   */

extern void FillCountDownNumber(sim_chv_info_struct chv_info);
extern void FillCountDownString(U8 TypeOfPass, U8 *PassCountdownDisp);
extern void CallBackPowerOnAnimationComplete(GDI_RESULT ret);
extern void DeInitSpecialMode(void);
extern void goto_opening_screen(void);
extern void MakeCall(PS8 strBumber);
extern void IdleSetStatusIcon(S16);
extern void IdleResetStatusIcon(S16);

/* extern void RstSmuVerifyPINRspHdlr(void *); */
extern void InitInsertSimApp(void);
extern void RefreshDisplayOwnerNumber(U8 lineid);
extern pBOOL isInCall(void);

#ifdef __J2ME__
extern void jvm_enter_idle_screen_notify(void);

#include "javaAgencyGprot.h"
#endif /* __J2ME__ */ 

void PowerOnBatteryIndicationComplete(void);
void InsertSimSetKeyPadLockFlag(void);
extern void mdi_audio_set_audio_mode(U8 mode);
extern void SATMessageWaitTimer(void);

#ifdef __MMI_BT_SUPPORT__
extern MMI_BOOL mmi_bt_ps_stack_and_hw_init(MMI_BOOL flight_mode, MMI_BOOL sim_inserted);
#endif 

/* Global Variables  */

#if ( defined(__MMI_ENGINEER_MODE__) || defined(__MMI_FACTORY_MODE__))
extern U8 gCurrentMode;
#endif 

extern charbat_context_struct g_charbat_context;
extern U8 isEarphonePlugged;

/* Password buffers for PIN, PUK, phone lock and personalization lock */
S8 gInputNewPinBufferSecondTime[MAX_PWD_LENGTH_MMI * ENCODING_LENGTH];
S8 gInputNewPinBufferFirstTime[MAX_PWD_LENGTH_MMI * ENCODING_LENGTH];
S8 gInputPwdBuffer[MAX_PWD_LENGTH_MMI * ENCODING_LENGTH];

/* Service area display buffers for line 1 and line 2 */
S8 gHomePLMNNum[MAX_PLMN_LEN_MMI + 1];
S8 gSimEccNumList[MAX_ECC_NUMBER_LIST_LENGTH][(EMERGENCY_NUMBER_LENGTH + 1)];
S8 gServProvderName[MAX_LENGTH_SERVICE_PROVIDER * ENCODING_LENGTH];
S8 gOperatorName[MAX_LENGTH_OPERATOR_NAME * ENCODING_LENGTH];
S8 gShortOperatorName[MAX_LENGTH_SHORT_OPERATOR_NAME * ENCODING_LENGTH];
S8 gOwnerName[MAX_LENGTH_OWNER_NUMBER * ENCODING_LENGTH];
U8 gOpNameValid = 0;
U8 gShortOpnameValid = 0;
U8 gSpnValid = 0;
MMI_OWNER_NUMBER_STRUCT gDispOwnerNumber[2];

#ifdef __MMI_WLAN_FEATURES__
U8 gWLANProviderName[MAX_LENGTH_DISPLAY_NAME * ENCODING_LENGTH];
#endif

/* SIM indication structures to hold the corresponding actions after power on animation completes */
MMISMUPASSWDREQIND gSMUPwdDataStruct;
MMISMUFAILIND gSMUFailIndStruct;

/* ECC buffers */
U16 EmergencyNumber[MAX_EMERGENCYNUMBER][4] = 
{
    {0x0039, 0x0031, 0x0031, 0x00}, /* 911 */
#ifdef __MEXICO_ECC__
    {0x0030, 0x0038, 0x0030, 0x00}, /* 080 */
    {0x0030, 0x0036, 0x0030, 0x00}, /* 060 */
    {0x0030, 0x0038, 0x00},         /* 08  */
#endif /* __MEXICO_ECC__ */ 
#ifdef __RUSSIA_ECC__
    {0x0030, 0x0031, 0x00},         /* 01  */
    {0x0030, 0x0032, 0x00},         /* 02  */
    {0x0030, 0x0033, 0x00},         /* 03  */
    {0x0030, 0x0030, 0x0031, 0x00}, /* 001 */
    {0x0030, 0x0030, 0x0032, 0x00}, /* 002 */
    {0x0030, 0x0030, 0x0033, 0x00}, /* 003 */
#endif /* __RUSSIA_ECC__ */
#if defined(__CPHS__)
    {0x0039, 0x0039, 0x0039, 0x00}, /* 999 */
#endif
    {0x0031, 0x0031, 0x0032, 0x00}  /* 112 */
};

U8 gCPHSRetryCount = 0;

/* extern U8 isIdleScreenReached; */

typedef enum
{
    SIM_ERROR_DISPLAY_INSERT_SIM,
    SIM_ERROR_DISPLAY_SIM_ACCESS_ERROR
} SIM_ERROR_DISPLAY;

U16 simErrorDisplayString = STR_SIM_INSERTION_MSG;

#if defined(__FS_CHECKDRIVE_SUPPORT__)
// NOT DONE or NONE: 0
// SKIP: 1
// DONE: 2
// Processing: 3
U8 SanityCheckDone = 0;
#else /* defined(__FS_CHECKDRIVE_SUPPORT__) */ 
U8 SanityCheckDone = 2;
#endif /* defined(__FS_CHECKDRIVE_SUPPORT__) */ 

extern pwr_context_struct g_pwr_context;    /* in BootupApp.c */


/*****************************************************************************
 * FUNCTION
 *  InitSimDetection
 * DESCRIPTION
 *  Initialize all protocol handlers for SIM Messages
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void InitSimDetection(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    SetProtocolEventHandler(SimECCInfoSave, PRT_SMU_STARTUP_INFO_IND);

    /* SimPasswdReqResponse: this indication implies that SIM is valid and may need security check */
    SetProtocolEventHandler(SimPasswdReqResponse, MSG_ID_GET_PIN_RES);

    /* SimQueryFailureRsp: this indication implies that SIM is invalid or not inserted */
    SetProtocolEventHandler(SimQueryFailureRsp, MSG_ID_SIM_CARD_FAILURE);

    g_keylock_context.gKeyPadLockFlag = 0;
}

/**************************************************************************
*        Bootup Revise                *
**************************************************************************/

/* diamond, 2005/08/16 bootup revise */

/*****************************************************************************
 * FUNCTION
 *  mmi_sim_error_hide_menu_items
 * DESCRIPTION
 *  Hide some menu items for no sim or sim blocked case
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
static void mmi_sim_error_hide_menu_items(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    mmi_frm_hide_menu_item(MENU_SETTING_SHOW_OWN_NUMBER);/* Hide "Show Owner Number" in No SIM screen */
    mmi_frm_hide_menu_item(MENU9146_WELCOME_TEXT);       /* Hide "Greeting Text" in No SIM screen */
    mmi_frm_hide_menu_item(MENU_SETTING_DEDICATED_KEYS); /* Hide "Dedicated key" in No SIM screen */
#ifdef __MMI_NITZ__
    mmi_frm_hide_menu_item(MENU9145_SETTIMEANDDATENITZ); /* Hide "Auto update of date and time" in No SIM screen */
    mmi_frm_hide_menu_item(MENU_SETTING_MENU_TREE);
#endif /* __MMI_NITZ__ */ 
    mmi_frm_hide_menu_item(MENU9169_SIM_LOCK);           /* Hide "SIM Lock" in No SIM screen */
    mmi_frm_hide_menu_item(MENU9167_FIXED_DIAL);         /* Hide "Fixed Dial" in No SIM screen */
    mmi_frm_hide_menu_item(MENU9168_BARRED_DAIL);        /* Hide "Barred Dail" in No SIM screen */
    mmi_frm_hide_menu_item(MENU9174_CP_PIN1);            /* Hide "Change Password/PIN1" in No SIM screen */
    mmi_frm_hide_menu_item(MENU9175_CP_PIN2);            /* Hide "Change Password/PIN2" in No SIM screen */
    mmi_frm_hide_menu_item(MENU_SETTING_SPEED_DIAL);     /* Hide "Speed Dial" in No SIM screen */

#ifdef __MMI_SIMAP_SUPPORT__
    mmi_frm_hide_menu_item(MENU_CONN_BT_SET_SIMAP);        /* Remote SIM mode */
#endif

#ifdef __MMI_WLAN_FEATURES__
    mmi_frm_hide_menu_item(MENU9186_SELECTION_MODE);
    mmi_frm_hide_menu_item(MENU9189_GPRS_CONNECTION_MODE);
#if defined(__GSM_RAT__) && defined(__WCDMA_RAT__)
    mmi_frm_hide_menu_item(MENU_ID_NETSET_SERVICE_SELECTION);
    mmi_frm_hide_menu_item(MENU_ID_NETSET_NETWORK_INFO);
#endif
#ifdef __MMI_USER_CTRL_PLMN_SUPPORT__
    mmi_frm_hide_menu_item(MENU_ID_NETSET_USER_CTRL_PLMN);
#endif
    mmi_frm_hide_menu_item(MESSAGES_MENU_SMS_MENUID);      /* SMS */
    mmi_frm_hide_menu_item(MESSAGES_MENU_MMS_MENUID);      /* MMS */
    mmi_frm_hide_menu_item(MENU_CHATAPP_ID);               /* Chat */
    mmi_frm_hide_menu_item(MESSAGES_MENU_VMAIL_MENUID);    /* Voice Mail */
    mmi_frm_hide_menu_item(MESSAGES_MENU_CB_MENUID);       /* Cell Broadcast */
    mmi_frm_hide_menu_item(MENU_ID_UM_MAIN);               /* Unified Message */

    mmi_frm_hide_menu_item(MENU_CALL_TIME_SETUP);          /* Call Time */
    mmi_frm_hide_menu_item(MENU_CALL_HISTORY_CALLCOST);    /* Call Cost */
    mmi_frm_hide_menu_item(MENU_CALL_HISTORY_SMSCOUNTER);  /* SMS Counter */
    mmi_frm_hide_menu_item(MENU_CALL_HISTORY_GPRSCOUNTER); /* GPRS Counter */

    g_pwr_context.CurrentServiceType = LIMITED_SERVICE; /* force to enter GSM no service state */
    g_pwr_context.PowerOnNWStatus |= MMI_NW_STATUS_NETWORK_FLAG;

    mmi_idle_notify_bootup_ready_to_wap();
#ifdef __MMI_IMPS__
    mmi_imps_notify_idle_reached();
#endif
#else /* __MMI_WLAN_FEATURES__ */
    mmi_frm_hide_menu_item(MENU_IDLE_SCR_DISP);          /* Hide "Display Characteristic" in No SIM screen */ 
#endif /* __MMI_WLAN_FEATURES__ */
}


/*****************************************************************************
 * FUNCTION
 *  mmi_sim_error_process_pending_events
 * DESCRIPTION
 *  Process pending events in sim error screen or security check screen
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
static void mmi_sim_error_process_pending_events(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    if (!mmi_bootup_is_searching_or_idle_reached())
    {
        PendingAlarmInPwronPeriod();
    }
    else
    {
        PendingAlarmReminder(); /* to prevent pending alarm in sim error screen */
    }

    if (g_charbat_context.isChargerConnected == 1 && g_charbat_context.ChargingComplete == 0)
    {
        IdleScreenChargerConnected(KAL_FALSE);
    }
}


/*****************************************************************************
 * FUNCTION
 *  InitSimErrorScreen
 * DESCRIPTION
 *  Initialize and enter SIM error screen
 * PARAMETERS
 *  error       [IN]        
 * RETURNS
 *  void
 *****************************************************************************/
void InitSimErrorScreen(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    InitInsertSimApp();
    RemoveStatusIconsForSimRemoved();
#ifdef __MMI_WLAN_FEATURES__
    mmi_netset_update_preferred_mode_menu();
#endif
    mmi_sim_error_hide_menu_items();
    EntryScrnSimErrorScreen();
    mmi_sim_error_process_pending_events();
}


/*****************************************************************************
 * FUNCTION
 *  InitSimBlockedScreen
 * DESCRIPTION
 *  Initialize and enter SIM blocked screen
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void InitSimBlockedScreen(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    InitInsertSimApp();
    RemoveStatusIconsForSimRemoved();
#ifdef __MMI_WLAN_FEATURES__
    mmi_netset_update_preferred_mode_menu();
#endif
    mmi_sim_error_hide_menu_items();
    EntryScrnSimBlockRsp();
    mmi_sim_error_process_pending_events();
}


/*****************************************************************************
 * FUNCTION
 *  ValidatePassword
 * DESCRIPTION
 *  Validate password
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void ValidatePassword(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    /* used to verify PIN or phone lock in power on period */
    MYQUEUE Message;
    MMISMUVERIFYPINREQ *local_data;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    ClearInputEventHandler(MMI_DEVICE_ALL); /* send message and wait response in the same screen and no input can be accepted */

    PRINT_INFORMATION(("@@@@@ Sending request for verifying password @@@@@"));
    Message.oslSrcId = MOD_MMI;
    Message.oslDestId = MOD_L4C;
    Message.oslMsgId = PRT_MMI_SMU_VERIFY_PIN_REQ;
    local_data = (MMISMUVERIFYPINREQ*) OslConstructDataPtr(sizeof(MMISMUVERIFYPINREQ));
    local_data->pin_type = MMI_TYPE_UNSPECIFIED;

    /* Change gInputPwdBuffer to ASCII then copy local_data->pin */
    UnicodeToAnsii((S8*) local_data->pin, (S8*) gInputPwdBuffer);

    Message.oslDataPtr = (oslParaType*) local_data;
    Message.oslPeerBuffPtr = NULL;
    OslMsgSendExtQueue(&Message);
}

/* end, diamond */

/**************************************************************************
   SIM Error APIs:
      void EntryScrnSimErrorScreen(void)
      void ExitScrnSimErrorScreen(void)
      void ShowSubLCDSimError(void)
      void ExitSubLCDSimError(void)
**************************************************************************/


/*****************************************************************************
 * FUNCTION
 *  mmi_sim_error_register_keypad_lock_key_events
 * DESCRIPTION
 *  
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
static void mmi_sim_error_register_keypad_lock_key_events(void)
{
    if (g_keylock_context.gKeyPadLockFlag != 0)
    {
        #if defined(__MMI_KEYPAD_LOCK_PROMPT_TEXT__)
            SetGroupKeyHandler(
                EntryScrKeyPadLockOnPessingAnyKey,
                (PU16) PresentAllKeys,
                (U8) TOTAL_KEYS,
                (U16) KEY_EVENT_DOWN);
        #endif /* defined(__MMI_KEYPAD_LOCK_PROMPT_TEXT__) */ 

        #ifdef __MMI_TOUCH_SCREEN__
            mmi_idle_pen_block();   /* diamond, 2005/12/22 Disable touch panel if re-entry idle keypad lock screen */
            SetKeyHandler(EntryScrAfterPessingRSK, KEY_SEND, KEY_EVENT_DOWN);
        #else /* __MMI_TOUCH_SCREEN__ */ 
        #ifdef __MMI_KEYPAD_LOCK_PATTERN_1__    /* Robin 1223 */
            SetRightSoftkeyFunction(EntryScrAfterPessingRSK, KEY_EVENT_UP);
        #endif 

        #ifdef __MMI_KEYPAD_LOCK_PATTERN_2__    /* Robin 1223 */
            SetLeftSoftkeyFunction(EntryScrAfterPessingRSK, KEY_EVENT_UP);
        #endif 
        #endif /* __MMI_TOUCH_SCREEN__ */
    }
}


/*****************************************************************************
 * FUNCTION
 *  EntryScrnSimErrorScreen
 * DESCRIPTION
 *  Entry screen when no SIM is inserted
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
#ifdef __J2ME__
extern BOOL java_is_launch_after_install(void);
extern void mmi_java_send_mid_start_req(game_type_enum type);
#endif /* __J2ME__ */ 

void EntryScrnSimErrorScreen(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    U8 *guiBuffer;  /* Buffer holding history data */
    U16 InsertSIMScreenDigits[MAX_INSERT_SCR_DIGITS] =
        {KEY_0, KEY_1, KEY_2, KEY_3, KEY_4, KEY_5, KEY_6, KEY_7, KEY_8, KEY_9, KEY_STAR, KEY_POUND};

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -