SimDetection.c
资源名称:mmi.rar [点击查看]
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:205k
源码类别:
MTK
开发平台:
C/C++
- *****************************************************************************/
- void EntryScrEmergencyCallDialing(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_pwr_context.SOSCallFlagTOAvoidHistorySave = 1;
- /* diamond, 2005/11/28 Remove keypad lock icon if user pressed emergency call number */
- if (g_keylock_context.gKeyPadLockFlag == 1)
- {
- g_keylock_context.gKeyPadLockFlag = 0;
- #ifdef __MMI_TOUCH_SCREEN__
- ChangeStatusIconImage(STATUS_ICON_KEYPAD_LOCK, IMG_SI_KEYPAD_UNLOCK);
- UpdateStatusIcons();
- #else /* __MMI_TOUCH_SCREEN__ */
- IdleResetStatusIcon(STATUS_ICON_KEYPAD_LOCK);
- #endif /* __MMI_TOUCH_SCREEN__ */
- #ifndef __MMI_KEYPADLOCK_WITH_KEYTONE__
- mmi_frm_kbd_set_tone_state(MMI_KEY_TONE_ENABLED);
- #endif
- }
- if (CheckValidEmergencyNo1(g_idle_context.DialPadCallBuffer))
- {
- g_pwr_context.ForCMToIdentifySOSCall = TRUE;
- #ifdef __FLIGHT_MODE_SUPPORT__
- if (mmi_bootup_get_active_flight_mode() == 1) /* 2005/11/01 Cannot allow to dial in flight mode insert SIM screen */
- {
- EntryScrSOSErrorMessage(STR_MENU_FLIGHT_MODE);
- }
- else
- #endif /* __FLIGHT_MODE_SUPPORT__ */
- if (IsSOSPossible())
- #ifdef __MMI_Emergency_Call_911_Support__
- /* For insert SIM case, dail 911 as emergency call */
- MakeCall((PS8) EmergencyNumber[0]);
- #else /* __MMI_Emergency_Call_911_Support__ */
- MakeCall(g_idle_context.DialPadCallBuffer);
- #endif /* __MMI_Emergency_Call_911_Support__ */
- else
- {
- EntryScrSOSErrorMessage(STR_NO_SERVICE_RUNNING_TEXT);
- }
- }
- else if (!SSCStringParsing2())
- {
- #ifdef __FLIGHT_MODE_SUPPORT__
- if (mmi_bootup_get_active_flight_mode() == 1) /* 2005/11/01 Cannot allow to dial in flight mode insert SIM screen */
- {
- EntryScrSOSErrorMessage(STR_MENU_FLIGHT_MODE);
- }
- else
- #endif /* __FLIGHT_MODE_SUPPORT__ */
- EntryScrSOSErrorMessage(STR_NOT_SOS_NUMBER);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * IsSOSPossible
- * DESCRIPTION
- * Return the possibility of SOS call
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- pBOOL IsSOSPossible(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_pwr_context.CurrentServiceType == FULL_SERVICE || g_pwr_context.CurrentServiceType == LIMITED_SERVICE ||
- /* g_pwr_context.InvalidSim) */
- mmi_bootup_is_nw_registration_ok() == MMI_TRUE)
- {
- return TRUE;
- }
- else
- {
- return FALSE;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * CheckSIMSOSEntries
- * DESCRIPTION
- * Checks for Emergency Nos in Different conditions
- * PARAMETERS
- * tempbuffer [IN]
- * RETURNS
- * void
- *****************************************************************************/
- pBOOL CheckSIMSOSEntries(S8 *tempbuffer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 count = 0;
- S8 SimEccNum[(EMERGENCY_NUMBER_LENGTH + 1) * ENCODING_LENGTH];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- while (count < MAX_ECC_NUMBER_LIST_LENGTH)
- {
- AnsiiToUnicodeString((S8*) SimEccNum, (S8*) (gSimEccNumList[count]));
- if (pfnUnicodeStrcmp(tempbuffer, (S8*) SimEccNum) == 0)
- {
- return 1;
- }
- count++;
- }
- return 0;
- }
- /*****************************************************************************
- * FUNCTION
- * CheckValidEmergencyNo1
- * DESCRIPTION
- * Checks for Emergency Nos in Different conditions
- * PARAMETERS
- * eccbuffer [IN]
- * RETURNS
- * void
- *****************************************************************************/
- pBOOL CheckValidEmergencyNo1(S8 *eccbuffer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 i;
- S8 *tempbuffer;
- U16 AdditionalCheckNumber[5][5] =
- {
- {0x002A, 0x0033, 0x0031, 0x0023, 0x002B}
- , /* prefix = *31#+ */
- {0x0023, 0x0033, 0x0031, 0x0023, 0x002B}
- , /* prefix = #31#+ */
- {0x002A, 0x0033, 0x0031, 0x0023}
- , /* prefix = *31# */
- {0x0023, 0x0033, 0x0031, 0x0023}
- , /* prefix = #31# */
- {0x002B} /* prefix = + */
- };
- S8 EmergencyNumberExt[16];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* diamond, 2006/02/08 Additional check for *31# and #31# before emergency call */
- /* diamond, 2006/03/26 Additional check for + before emergency call */
- if ((pfnUnicodeStrncmp(eccbuffer, (PS8) AdditionalCheckNumber[0], 5) == 0) ||
- (pfnUnicodeStrncmp(eccbuffer, (PS8) AdditionalCheckNumber[1], 5) == 0))
- {
- tempbuffer = eccbuffer + 10;
- }
- else if ((pfnUnicodeStrncmp(eccbuffer, (PS8) AdditionalCheckNumber[2], 4) == 0) ||
- (pfnUnicodeStrncmp(eccbuffer, (PS8) AdditionalCheckNumber[3], 4) == 0))
- {
- tempbuffer = eccbuffer + 8;
- }
- else if (pfnUnicodeStrncmp(eccbuffer, (PS8) AdditionalCheckNumber[4], 1) == 0)
- {
- tempbuffer = eccbuffer + 2;
- }
- else
- {
- tempbuffer = eccbuffer;
- }
- if (pfnUnicodeStrlen(tempbuffer) != 0)
- {
- for (i = 0; i < MAX_EMERGENCYNUMBER; i++)
- {
- if (pfnUnicodeStrcmp(tempbuffer, (PS8) EmergencyNumber[i]) == 0)
- {
- return 1;
- }
- /* diamond, 2006/03/31 Additional check for p or w after emergency call */
- pfnUnicodeStrcpy(EmergencyNumberExt, (PS8) EmergencyNumber[i]);
- pfnUnicodeStrcat(EmergencyNumberExt, (PS8) L"p");
- if (pfnUnicodeStrncmp(tempbuffer, EmergencyNumberExt, pfnUnicodeStrlen(EmergencyNumberExt)) == 0)
- {
- return 1;
- }
- pfnUnicodeStrcpy(EmergencyNumberExt, (PS8) EmergencyNumber[i]);
- pfnUnicodeStrcat(EmergencyNumberExt, (PS8) L"w");
- if (pfnUnicodeStrncmp(tempbuffer, EmergencyNumberExt, pfnUnicodeStrlen(EmergencyNumberExt)) == 0)
- {
- return 1;
- }
- /* diamond, 2006/05/12 Additional check for + after emergency call */
- pfnUnicodeStrcpy(EmergencyNumberExt, (PS8) EmergencyNumber[i]);
- pfnUnicodeStrcat(EmergencyNumberExt, (PS8) L"+");
- if (pfnUnicodeStrncmp(tempbuffer, EmergencyNumberExt, pfnUnicodeStrlen(EmergencyNumberExt)) == 0 &&
- pfnUnicodeStrncmp(tempbuffer + ((pfnUnicodeStrlen(tempbuffer) - 1) * ENCODING_LENGTH), (PS8) L"#", 1) != 0)
- {
- return 1;
- }
- }
- if ((g_pwr_context.PrevScreenIndicator != ENTER_SIM_BLOCK) &&
- (g_pwr_context.PrevScreenIndicator != ENTER_SIM_INSERTION))
- {
- if (CheckSIMSOSEntries(tempbuffer))
- {
- return 1;
- }
- else
- {
- return 0;
- }
- }
- }
- return 0;
- }
- /*****************************************************************************
- * FUNCTION
- * SimECCInfoSave
- * DESCRIPTION
- * Callback of PRT_SMU_STARTUP_INFO_IND
- * PARAMETERS
- * inMsg [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void SimECCInfoSave(void *inMsg)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- mmi_smu_startup_info_ind_struct *local_data = (mmi_smu_startup_info_ind_struct*) inMsg;
- U8 Count = 0;
- U8 i = 0, j = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* fill ECC codes to buffer */
- if (local_data->num > 0)
- {
- for (Count = 0; Count < local_data->num; Count++)
- {
- j = Count * (NUM_OF_BYTE_ECC * 2 + 1);
- while (local_data->ecc[i] != ' ')
- {
- gSimEccNumList[Count][i] = local_data->ecc[j];
- i++;
- j++;
- }
- gSimEccNumList[Count][i] = ' ';
- i = 0;
- }
- }
- #ifdef __MMI_AUTO_LANG_EN__
- /* process and store LP in context */
- PhnsetPLPInd(local_data->language);
- /* If UsrLangIdx != 0xFF, not necessary to handle it because */
- /* 1. PhnsetSetLangByNvramValue() has been executed --> Language has already set */
- /* 2. PhnsetSetLangByNvramValue() did not executed --> */
- /* PhnsetSetLangByNvramValue() will be execute later and Language will be set at that time */
- if (PhnsetGetLang() == 0xFF)
- {
- SetCurrentLanguage((S8) PhnsetGetAutoLangIdx()); /* in ReadRes.c */
- }
- #endif /* __MMI_AUTO_LANG_EN__ */
- #ifdef __MANUAL_MODE_NW_SEL__
- /* get PLMN selection mode */
- PLMNGetSelectionModeReq();
- #endif /* __MANUAL_MODE_NW_SEL__ */
- }
- /**************************************************************************
- SIM security check APIs:
- void SimPasswdReqResponse(void *inMsg)
- void SimQueryFailureRsp(void *inMsg)
- void EntryScrIncorrectPin(void)
- void EntryScrIncorrectPhoneLock(void)
- void EntryScrIncorrectPUK(void)
- void EntryScrPinBlocked(void)
- void ExitScrPinBlocked(void)
- void EntryScrCodeVerified(void)
- void ExitCodeVerifiedScr(void)
- void CodeVerifiedTimeoutFn(void)
- **************************************************************************/
- /*****************************************************************************
- * FUNCTION
- * mmi_bootup_sim_indication_bt_power_on
- * DESCRIPTION
- *
- * PARAMETERS
- * sim_ind [IN]
- * msg_type [IN]
- * RETURNS
- * void
- *****************************************************************************/
- static void mmi_bootup_sim_indication_bt_power_on(U8 sim_ind, U16 msg_type)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- #ifdef __MMI_BT_SUPPORT__
- static U8 BTPowerOnFlag = MMI_FALSE;
- pBOOL status;
- #endif /* __MMI_BT_SUPPORT__ */
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- #ifdef __MMI_IRDA_SUPPORT__
- if (mmi_bootup_is_sim_valid() == MMI_TRUE && sim_ind == 0 && msg_type != MMI_SIM_REFRESH &&
- MMI_IRDASCR_CNTX(irda_state) != MMIR_SCR_IRCLOSE)
- {
- if (mmi_irda_is_ircomm_active() == MMI_TRUE)
- {
- mmi_irda_ircomm_disconnect_request();
- }
- mmi_irda_exec_close_menu();
- }
- #endif /* __MMI_IRDA_SUPPORT__ */
- #ifdef __MMI_BT_SUPPORT__
- if (BTPowerOnFlag)
- {
- return;
- }
- if (sim_ind == 0) /* sim failure indication */
- {
- status = MMI_FALSE;
- }
- else /* sim password indication */
- {
- switch (msg_type)
- {
- case MMI_TYPE_PHONELOCK:
- case MMI_TYPE_CHV1:
- case MMI_TYPE_UBCHV1:
- case MMI_TYPE_NP:
- case MMI_TYPE_NSP:
- case MMI_TYPE_SP:
- case MMI_TYPE_CP:
- case MMI_TYPE_IMSI_LOCK:
- case MMI_TYPE_LINK_NS_SP:
- case MMI_TYPE_LINK_SIM_C:
- return;
- break;
- case MMI_TYPE_SIM_CARD_BLOCKED:
- status = MMI_FALSE;
- break;
- case MMI_TYPE_NO_REQUIRED:
- default:
- status = MMI_TRUE;
- break;
- }
- }
- mmi_bt_ps_stack_and_hw_init(mmi_bootup_get_active_flight_mode(), status);
- BTPowerOnFlag = MMI_TRUE;
- #endif /* __MMI_BT_SUPPORT__ */
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_bootup_phone_lock_history
- * DESCRIPTION
- * History of phone lock if SimPasswdReqResponse is received in call
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- static void mmi_bootup_phone_lock_history(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryScrEnterPhoneLock();
- InitEnterPasswordScreen(MMI_TRUE);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_bootup_sim_lock_history
- * DESCRIPTION
- * History of PIN lock if SimPasswdReqResponse is received in call
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- static void mmi_bootup_sim_lock_history(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryScrEnterPIN();
- InitEnterPasswordScreen(MMI_TRUE);
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_frm_add_history_before_cm_marker
- * DESCRIPTION
- * Add a screen to the history before CM_SCR_MARKER
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_frm_add_history_before_cm_marker(U16 scrn_id, FuncPtr func_ptr)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- history Scr;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- Scr.scrnID = scrn_id;
- Scr.entryFuncPtr = func_ptr;
- pfnUnicodeStrcpy((S8*) Scr.inputBuffer, (S8*) L"");
- InsertHistoryBeforeThisScrn(CM_SCR_MARKER, Scr);
- }
- /*****************************************************************************
- * FUNCTION
- * SimPasswdReqResponse
- * DESCRIPTION
- * This is called as a call back when MMI_SMU_PASSWORD_REQUIRED_IND is received from the L4
- * PARAMETERS
- * inMsg [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_ready_to_idle_screen_ind(void);
- void SimPasswdReqResponse(void *inMsg)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /* MMI will repeatedly receive this indication if its content isn't MMI_TYPE_NO_REQUIRED */
- /* (MMI_TYPE_PHONELOCK) -> (MMI_TYPE_CHV1) -> MMI_TYPE_NO_REQUIRED */
- static U8 gCodeVerifyRequiredFlag = 0;
- MMISMUPASSWDREQIND *local_data = (MMISMUPASSWDREQIND*) inMsg;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (g_pwr_context.PrevScreenIndicator == ENTER_SIM_INSERTION ||
- g_pwr_context.PrevScreenIndicator == ENTER_SIM_BLOCK)
- {
- return; /* diamond, 2005/12/26 If SIM is not inserted, verifying phone lock shall meet this message */
- }
- /* Retry count for PIN/PUK and personalization locks */
- FillCountDownNumber(local_data->chv_info);
- gCPHSRetryCount = local_data->cphs_retry_count;
- /* if((!g_pwr_context.PowerOnAnimationComplete) */
- if (mmi_bootup_is_power_on_animation_complete() == MMI_FALSE
- #if defined(__FS_CHECKDRIVE_SUPPORT__)
- || (SanityCheckDone == 0) || (SanityCheckDone == 3)
- #endif
- )
- {
- MMI_TRACE((MMI_TRACE_G7_MISC, MMI_POWER_ON_RECV_SIM_PSWD));
- memcpy(&gSMUPwdDataStruct, local_data, sizeof(MMISMUPASSWDREQIND));
- /* g_pwr_context.PasswdReqIndFlag=1; */
- if (mmi_bootup_is_power_on_animation_complete() == MMI_FALSE)
- {
- /* nand check first then receive this message */
- g_pwr_context.PowerOnMMIStatus = MMI_POWER_ON_ANIMATION_PSWD_REQ; /* 0x05: Power on animation with password requirement indication */
- }
- g_pwr_context.PowerOnSIMStatus |= MMI_SIM_STATUS_SECURITY_CHECK; /* 0x08: Need security check */
- /* Robin 0719, Cannon+ SCR 3585: [China FT]MMI-PLNM is display TWN GSM then display CU-GSM */
- /* Current, MMI will postpone handling SMU_PASSWORD_REQUIRED_IND to align with power on animation */
- /* So will delay the IMSI retrieve, cause realize roaming status too late. */
- /* Duplicate here to get IMSI immediately once SIM password verified done. */
- if (local_data->type == MMI_TYPE_NO_REQUIRED)
- {
- g_pwr_context.PowerOnSIMStatus &= ~MMI_SIM_STATUS_INVALID; /* 0x01: Invalid SIM reset */
- if (g_pwr_context.testRoaming == 1) /* Shall send GET IMSI REQ once */
- {
- RequestToTestRoamingEnabled();
- }
- }
- return; /* postpone this indication after power on animation completes */
- }
- MMI_TRACE((MMI_TRACE_G7_MISC, MMI_POWER_ON_PROC_SIM_PSWD));
- /* Notify BT to start init bt ps stack and hw */
- mmi_bootup_sim_indication_bt_power_on(1, local_data->type);
- /* g_pwr_context.PasswdReqIndFlag=0; */
- g_pwr_context.PowerOnSIMStatus &= ~MMI_SIM_STATUS_SECURITY_CHECK; /* 0x08: Security check done */
- StopLEDPatternPowerOn();
- ClearKeyEvents();
- memset((S8*) gInputPwdBuffer, 0, MAX_PWD_LENGTH_MMI * ENCODING_LENGTH);
- memset((S8*) gInputNewPinBufferFirstTime, 0, MAX_PWD_LENGTH_MMI * ENCODING_LENGTH);
- memset((S8*) gInputNewPinBufferSecondTime, 0, MAX_PWD_LENGTH_MMI * ENCODING_LENGTH);
- /* Close backling when enter password */
- #if MMI_ON_HARDWARE_P
- if (local_data->type != 0)
- {
- FirstTimeTurnOnBackLight();
- }
- #endif /* MMI_ON_HARDWARE_P */
- /* g_pwr_context.SimRemoveFlag=0; */
- g_pwr_context.PowerOnSIMStatus &= ~MMI_SIM_STATUS_NOT_INSERT; /* 0x02: SIM removed reset */
- //g_pwr_context.PowerOnTillIdleApp=1;
- //g_pwr_context.PowerOnPeriod=0;
- #ifdef MMI_ON_HARDWARE_P
- /* call this stop animation to stop all play power display, */
- /* which will stop all timer and avoid NVRAM & timer interlace problem */
- mmi_pwron_stop_animation();
- #else /* MMI_ON_HARDWARE_P */
- /* diamond, 2006/02/07 PC simulator cannot accept sim lock or phone lock case */
- local_data->type = MMI_TYPE_NO_REQUIRED;
- #endif /* MMI_ON_HARDWARE_P */
- switch (local_data->type)
- {
- /* Directly jump to idle screen */
- case MMI_TYPE_NO_REQUIRED:
- g_pwr_context.PowerOnSIMStatus &= ~MMI_SIM_STATUS_INVALID; /* 0x01: Invalid SIM reset */
- g_pwr_context.PowerOnMMIStatus = MMI_POWER_ON_SECURITY_NO_PSWD; /* 0x10: Security check */
- /* if(gSIMRefresh == 1) */
- if (mmi_bootup_is_sim_refresh() == MMI_TRUE)
- {
- g_phb_cntx.phb_ready = FALSE; /* MTK 2003-12-22 Wilson, for SIM refresh */
- //g_pwr_context.IsSimValid = 1;
- //EntryIdleScreen();
- if (IsInSATScreen())
- {
- SATMessageWaitTimer();
- DisplayPopup(
- (U8*) GetString(STR_ID_SIM_REFRESH),
- IMG_GLOBAL_WARNING,
- 0,
- UI_POPUP_NOTIFYDURATION_TIME,
- (U8) ERROR_TONE);
- }
- /* gSIMRefresh = 0; */
- if (GetActiveScreenId() == SCR_ENTER_PHONELOCK)
- {
- ExitVariables();
- EntryIdleScreen();
- }
- g_pwr_context.PowerOnSIMStatus &= ~MMI_SIM_STATUS_REFRESH; /* SIM refresh reset */
- g_pwr_context.PowerOnMMIStatus = MMI_POWER_ON_IDLE;
- /* diamond, 2006/04/04 Avoid the case of SIM refreshing before power on animation is complete */
- if (mmi_bootup_is_searching_or_idle_reached() == MMI_TRUE)
- {
- return;
- }
- }
- // MTK end
- //g_pwr_context.PowerOnPeriod=1;
- PRINT_INFORMATION(("MMI_TYPE_NO_REQUIRED"));
- g_pwr_context.SSCFromEnterPukAtBootUp = 0;
- // gTypeNoReq = 1;
- //g_pwr_context.IsSimValid = 1;
- g_pwr_context.PrevScreenIndicator = 0;
- #ifdef __MMI_SML_MENU__
- mmi_sml_power_on_query_req();
- #endif
- #ifdef __MMI_WLAN_FEATURES__
- mmi_netset_update_preferred_mode_menu();
- #endif
- /* Robin 0719, Cannon+ SCR 3585: [China FT]MMI-PLNM is display TWN GSM then display CU-GSM */
- /* Current, MMI will postpone handling SMU_PASSWORD_REQUIRED_IND to align with power on animation */
- /* So will delay the IMSI retrieve, cause realize roaming status too late. */
- /* Will duplicate to the top of this fucntion to get IMSI immediately once SIM password verified done. */
- if (g_pwr_context.testRoaming == 1) /* Shall send GET IMSI REQ once */
- {
- RequestToTestRoamingEnabled();
- }
- if (g_charbat_context.isChargerConnected == 1)
- {
- /* Hide status icon temporary, entry idle screen will start animation again */
- HideStatusIcon(STATUS_ICON_BATTERY_STRENGTH);
- ShowStatusIcon(STATUS_ICON_BATTERY_STRENGTH);
- UpdateStatusIcons();
- }
- if (gCodeVerifyRequiredFlag)
- {
- EntryScrCodeVerified();
- }
- else
- {
- /* DinitHistory(); // Not necessary to deinit history because there might be an incoming call */
- #ifdef MMI_ON_HARDWARE_P
- mmi_bootup_exit_security_check(); /* send message to it slef notify ready to go to idle */
- #else
- goto_opening_screen();
- #endif
- }
- break;
- case MMI_TYPE_PHONELOCK:
- PRINT_INFORMATION(("MMI_TYPE_PHONELOCK"));
- if (g_pwr_context.PrevScreenIndicator == ENTER_PHONELOCK)
- {
- EntryScrIncorrectPhoneLock();
- }
- else
- {
- if (isInCall())
- {
- mmi_frm_add_history_before_cm_marker(SCR_ENTER_PHONELOCK, mmi_bootup_phone_lock_history);
- }
- else
- {
- EntryScrEnterPhoneLock();
- InitEnterPasswordScreen(MMI_TRUE);
- }
- }
- break;
- /* Show Enter PIN Screen */
- case MMI_TYPE_CHV1:
- PRINT_INFORMATION(("Enter PIN [MMI_TYPE_CHV1]"));
- if (g_pwr_context.PrevScreenIndicator == ENTER_PIN_SCR)
- {
- EntryScrIncorrectPin();
- }
- else
- {
- gCodeVerifyRequiredFlag = 1;
- if (isInCall())
- {
- mmi_frm_add_history_before_cm_marker(SCR_ENTER_PIN, mmi_bootup_sim_lock_history);
- }
- else
- {
- EntryScrEnterPIN();
- InitEnterPasswordScreen(MMI_TRUE);
- }
- }
- break;
- case MMI_TYPE_CHV2:
- PRINT_INFORMATION(("Enter PIN [MMI_TYPE_CHV2]"));
- break;
- case MMI_TYPE_UBCHV1:
- PRINT_INFORMATION(("MMI_TYPE_UBCHV1"));
- if ((g_pwr_context.PrevScreenIndicator == ENTER_CONFIRM_PIN) || (g_pwr_context.SSCFromEnterPukAtBootUp))
- {
- EntryScrIncorrectPUK();
- }
- else
- {
- EntryScrPinBlocked();
- gCodeVerifyRequiredFlag = 1;
- }
- break;
- case MMI_TYPE_UBCHV2:
- PRINT_INFORMATION(("MMI_TYPE_UBCHV2"));
- break;
- case MMI_TYPE_CHV1_BLOCKED:
- PRINT_INFORMATION(("MMI_TYPE_CHV1_BLOCKED"));
- break;
- case MMI_TYPE_CHV2_BLOCKED:
- /* L4 not taking care it */
- PRINT_INFORMATION(("MMI_TYPE_CHV2_BLOCKED"));
- break;
- case MMI_TYPE_SIM_CARD_BLOCKED:
- PRINT_INFORMATION(("MMI_TYPE_SIM_CARD_BLOCKED"));
- g_pwr_context.PowerOnMMIStatus = MMI_POWER_ON_IDLE; /* 0x80: insert/blocked SIM idle screen */
- simErrorDisplayString = STR_SIM_BLOCK_MSG;
- InitSimBlockedScreen();
- break;
- case MMI_TYPE_UBCHV2_BLOCKED:
- /* Not used by L4 */
- PRINT_INFORMATION(("MMI_TYPE_UBCHV2_BLOCKED"));
- break;
- case MMI_TYPE_UBCHV1_CHV1_NOT_LOCK:
- /* Not used by L4 */
- PRINT_INFORMATION(("MMI_TYPE_UBCHV1_CHV1_NOT_LOCK"));
- break;
- case MMI_TYPE_NP:
- /* Not used by L4 */
- PRINT_INFORMATION(("MMI_TYPE_NP"));
- if (gCPHSRetryCount == 0)
- {
- g_pwr_context.PowerOnMMIStatus = MMI_POWER_ON_IDLE; /* 0x80: insert/blocked SIM idle screen */
- InitSimBlockedScreen();
- }
- else
- {
- if (g_pwr_context.PrevScreenIndicator == ENTER_NP)
- {
- EntryScrIncorrectNP();
- }
- else
- {
- EntryScrEnterNP();
- InitEnterPasswordScreen(MMI_TRUE);
- }
- }
- break;
- case MMI_TYPE_NSP:
- /* Not used by L4 */
- PRINT_INFORMATION(("MMI_TYPE_NSP"));
- if (gCPHSRetryCount == 0)
- {
- g_pwr_context.PowerOnMMIStatus = MMI_POWER_ON_IDLE; /* 0x80: insert/blocked SIM idle screen */
- InitSimBlockedScreen();
- }
- else
- {
- if (g_pwr_context.PrevScreenIndicator == ENTER_NSP)
- {
- EntryScrIncorrectNSP();
- }
- else
- {
- EntryScrEnterNSP();
- InitEnterPasswordScreen(MMI_TRUE);
- }
- }
- break;
- case MMI_TYPE_SP:
- /* Not used by L4 */
- PRINT_INFORMATION(("MMI_TYPE_SP"));
- if (gCPHSRetryCount == 0)
- {
- g_pwr_context.PowerOnMMIStatus = MMI_POWER_ON_IDLE; /* 0x80: insert/blocked SIM idle screen */
- InitSimBlockedScreen();
- }
- else
- {
- if (g_pwr_context.PrevScreenIndicator == ENTER_SP)
- {
- EntryScrIncorrectSP();
- }
- else
- {
- EntryScrEnterSP();
- InitEnterPasswordScreen(MMI_TRUE);
- }
- }
- break;
- case MMI_TYPE_CP:
- /* Not used by L4 */
- PRINT_INFORMATION(("MMI_TYPE_CP"));
- if (gCPHSRetryCount == 0)
- {
- g_pwr_context.PowerOnMMIStatus = MMI_POWER_ON_IDLE; /* 0x80: insert/blocked SIM idle screen */
- InitSimBlockedScreen();
- }
- else
- {
- if (g_pwr_context.PrevScreenIndicator == ENTER_CP)
- {
- EntryScrIncorrectCP();
- }
- else
- {
- EntryScrEnterCP();
- InitEnterPasswordScreen(MMI_TRUE);
- }
- }
- break;
- case MMI_TYPE_IMSI_LOCK:
- /* Not used by L4 */
- PRINT_INFORMATION(("MMI_TYPE_IMSI_LOCK"));
- if (gCPHSRetryCount == 0)
- {
- g_pwr_context.PowerOnMMIStatus = MMI_POWER_ON_IDLE; /* 0x80: insert/blocked SIM idle screen */
- InitSimBlockedScreen();
- }
- else
- {
- if (g_pwr_context.PrevScreenIndicator == ENTER_SIMP)
- {
- EntryScrIncorrectSIMP();
- }
- else
- {
- EntryScrEnterSIMP();
- InitEnterPasswordScreen(MMI_TRUE);
- }
- }
- break;
- #ifdef __MMI_SML_MENU__
- case MMI_TYPE_LINK_NS_SP:
- /* Not used by L4 */
- PRINT_INFORMATION(("MMI_TYPE_LINK_NS_SP"));
- if (gCPHSRetryCount == 0)
- {
- g_pwr_context.PowerOnMMIStatus = MMI_POWER_ON_IDLE; /* 0x80: insert/blocked SIM idle screen */
- InitSimBlockedScreen();
- }
- else
- {
- if (g_pwr_context.PrevScreenIndicator == ENTER_NS_SP)
- {
- EntryScrIncorrectNSSP();
- }
- else
- {
- EntryScrEnterNSSP();
- InitEnterPasswordScreen(MMI_TRUE);
- }
- }
- break;
- case MMI_TYPE_LINK_SIM_C:
- /* Not used by L4 */
- PRINT_INFORMATION(("MMI_TYPE_LINK_SIM_C"));
- if (gCPHSRetryCount == 0)
- {
- g_pwr_context.PowerOnMMIStatus = MMI_POWER_ON_IDLE; /* 0x80: insert/blocked SIM idle screen */
- InitSimBlockedScreen();
- }
- else
- {
- if (g_pwr_context.PrevScreenIndicator == ENTER_SIM_C)
- {
- EntryScrIncorrectSIMC();
- }
- else
- {
- EntryScrEnterSIMC();
- InitEnterPasswordScreen(MMI_TRUE);
- }
- }
- break;
- #endif /* __MMI_SML_MENU__ */
- case MMI_TYPE_PERSONALIZATION_KEY:
- /* Not used by L4 */
- PRINT_INFORMATION(("MMI_TYPE_PERSONALIZATION_KEY"));
- break;
- case MMI_TYPE_UNSPECIFIED:
- /* Not a response from L4 needed by mmi to set PIN */
- PRINT_INFORMATION(("MMI_TYPE_UNSPECIFIED"));
- break;
- default:
- PRINT_INFORMATION(("Unhandled enum type in SimPasswdReqResponse"));
- break;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * SimQueryFailureRsp
- * DESCRIPTION
- * This is called as a call back when MMI_SMU_FAIL_IND is received from the L4
- * PARAMETERS
- * inMsg [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void SimQueryFailureRsp(void *inMsg)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MMISMUFAILIND *local_data = (MMISMUFAILIND*) inMsg;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* if((!g_pwr_context.PowerOnAnimationComplete) */
- if (mmi_bootup_is_power_on_animation_complete() == MMI_FALSE
- #if defined(__FS_CHECKDRIVE_SUPPORT__)
- || (SanityCheckDone == 0) || (SanityCheckDone == 3)
- #endif
- )
- {
- MMI_TRACE((MMI_TRACE_G7_MISC, MMI_POWER_ON_RECV_SIM_FAIL));
- /* g_pwr_context.SimQueryFailIndFlag=1; */
- g_pwr_context.PowerOnSIMStatus |= MMI_SIM_STATUS_INVALID; /* 0x01: Invalid SIM */
- if (local_data->cause != MMI_SIM_REFRESH)
- {
- g_pwr_context.PowerOnSIMStatus |= MMI_SIM_STATUS_FAILURE_RSP; /* 0x10: SIM failure rsp */
- }
- if (mmi_bootup_is_power_on_animation_complete() == MMI_FALSE)
- {
- /* nand check first then receive this message */
- g_pwr_context.PowerOnMMIStatus = MMI_POWER_ON_ANIMATION_SIM_FAIL; /* 0x06: Power on animation with SIM failure indication */
- }
- memcpy(&gSMUFailIndStruct, local_data, sizeof(MMISMUFAILIND));
- return; /* postpone this indication after power on animation completes */
- }
- MMI_TRACE((MMI_TRACE_G7_MISC, MMI_POWER_ON_PROC_SIM_FAIL));
- /* Notify BT not to init bt ps stack and hw */
- mmi_bootup_sim_indication_bt_power_on(0, local_data->cause);
- //g_pwr_context.SimQueryFailIndFlag=0;
- //g_pwr_context.PowerOnPeriod=0;
- g_pwr_context.PowerOnMMIStatus = MMI_POWER_ON_IDLE; /* 0x80: insert/blocked SIM idle screen */
- StopLEDPatternPowerOn();
- /* g_pwr_context.IsSimValid = 0; */
- g_pwr_context.PowerOnSIMStatus |= MMI_SIM_STATUS_INVALID; /* 0x01: Invalid SIM */
- /* g_pwr_context.PowerOnTillIdleApp=0; */
- ClearKeyEvents();
- #ifdef MMI_ON_HARDWARE_P
- FirstTimeTurnOnBackLight();
- #endif
- mmi_idle_notify_bootup_ready_to_l4c();
- switch (local_data->cause)
- {
- case MMI_SIM_CARD_REMOVED:
- PRINT_INFORMATION(("MMI_SIM_CARD_REMOVED"));
- /* if(g_pwr_context.SimRemoveFlag==0) */
- if (mmi_bootup_is_sim_removed() == MMI_FALSE)
- {
- /* g_pwr_context.SimRemoveFlag=1; */
- g_pwr_context.PowerOnSIMStatus |= MMI_SIM_STATUS_NOT_INSERT; /* 0x02: SIM removed */
- simErrorDisplayString = STR_SIM_INSERTION_MSG;
- InitSimErrorScreen();
- }
- break;
- case MMI_SIM_ACCESS_ERROR:
- PRINT_INFORMATION(("MMI_SIM_ACCESS_ERROR"));
- simErrorDisplayString = STR_SIM_ACCESS_ERROR_MSG;
- InitSimErrorScreen();
- break;
- case MMI_SIM_CMD_SUCCESS:
- PRINT_INFORMATION(("MMI_SIM_CMD_SUCCESS"));
- break;
- case MMI_SIM_CMD_FAIL:
- PRINT_INFORMATION(("MMI_SIM_CMD_FAIL"));
- /* g_pwr_context.SimRemoveFlag=1; */
- g_pwr_context.PowerOnSIMStatus |= MMI_SIM_STATUS_NOT_INSERT; /* 0x02: SIM removed */
- simErrorDisplayString = STR_SIM_INSERTION_MSG;
- InitSimErrorScreen();
- break;
- case MMI_SIM_FATAL_ERROR:
- PRINT_INFORMATION(("MMI_SIM_FATAL_ERROR"));
- simErrorDisplayString = STR_SIM_ACCESS_ERROR_MSG;
- InitSimErrorScreen();
- break;
- case MMI_SIM_NO_INSERTED:
- PRINT_INFORMATION(("MMI_SIM_NO_INSERTED"));
- /* g_pwr_context.SimRemoveFlag=1; */
- g_pwr_context.PowerOnSIMStatus |= MMI_SIM_STATUS_NOT_INSERT; /* 0x02: SIM removed */
- simErrorDisplayString = STR_SIM_INSERTION_MSG;
- InitSimErrorScreen();
- break;
- case MMI_SIM_CHV_NOT_INIT:
- PRINT_INFORMATION(("MMI_SIM_CHV_NOT_INIT"));
- break;
- case MMI_SIM_CHV_RETRY_ALLOW:
- PRINT_INFORMATION(("MMI_SIM_CHV_RETRY_ALLOW"));
- break;
- case MMI_SIM_CHV_BLOCK:
- PRINT_INFORMATION(("MMI_SIM_CHV_BLOCK"));
- InitSimBlockedScreen();
- break;
- case MMI_SIM_ACCESS_NOT_ALLOW:
- PRINT_INFORMATION(("MMI_SIM_ACCESS_NOT_ALLOW"));
- break;
- case MMI_SIM_SAT_CMD_BUSY:
- PRINT_INFORMATION(("MMI_SIM_SAT_CMD_BUSY"));
- break;
- case MMI_SIM_DL_ERROR:
- PRINT_INFORMATION(("MMI_SIM_DL_ERROR"));
- break;
- case MMI_SIM_MEMORY_PROBLEM:
- PRINT_INFORMATION(("MMI_SIM_MEMORY_PROBLEM"));
- break;
- case MMI_SIM_TECHNICAL_PROBLEM:
- PRINT_INFORMATION(("MMI_SIM_TECHNICAL_PROBLEM"));
- break;
- case MMI_SIM_REFRESH:
- /* gSIMRefresh = 1; */
- g_pwr_context.PowerOnSIMStatus |= MMI_SIM_STATUS_REFRESH; /* 0x04 SIM refresh */
- break;
- #ifdef __MMI_SIMAP_SUPPORT__
- case MMI_SIM_BT_ACCESS_PROFILE_ON:
- if (!mmi_bootup_get_active_bt_access_profile_mode())
- {
- g_pwr_context.PowerOnSIMStatus |= MMI_SIM_STATUS_BT_ACCESS; /* 0x40 BT SIM access profile */
- g_pwr_context.CurrentServiceType = LIMITED_SERVICE; /* prevent from no following network attachment indication */
- #ifdef __MMI_WLAN_FEATURES__
- mmi_sim_error_update_sim_access_profile_menu_items();
- #endif
- if (isInCall())
- {
- DeleteBeyondScrTillScr(CM_SCR_MARKER, IDLE_SCREEN_ID);
- mmi_frm_add_history_before_cm_marker(IDLE_SCREEN_ID, EntryIdleScreen);
- }
- else
- {
- EntryIdleScreen();
- }
- }
- break;
- case MMI_SIM_BT_ACCESS_PROFILE_OFF:
- if (mmi_bootup_get_active_bt_access_profile_mode())
- {
- g_pwr_context.PowerOnSIMStatus &= ~MMI_SIM_STATUS_INVALID; /* 0x02: SIM removed reset */
- g_pwr_context.PowerOnSIMStatus &= ~MMI_SIM_STATUS_BT_ACCESS; /* 0x40 BT SIM access profile */
- #ifdef __MMI_WLAN_FEATURES__
- mmi_sim_error_restore_sim_access_profile_menu_items();
- #endif
- if (isInCall())
- {
- DeleteBeyondScrTillScr(CM_SCR_MARKER, IDLE_SCREEN_ID);
- mmi_frm_add_history_before_cm_marker(IDLE_SCREEN_ID, EntryIdleScreen);
- }
- else
- {
- EntryIdleScreen();
- }
- }
- break;
- #endif /* __MMI_SIMAP_SUPPORT__ */
- default:
- PRINT_INFORMATION(("Invalid cause from SIM FAIL error"));
- break;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * EntryScrIncorrectPin
- * DESCRIPTION
- * Flash message incorrect PIN try again
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryScrIncorrectPin(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- DisplayPopup((U8*) GetString(STR_INCORRECT_PIN), IMG_GLOBAL_ERROR, 0, 2000, (U8) ERROR_TONE);
- }
- /*****************************************************************************
- * FUNCTION
- * EntryScrIncorrectPhoneLock
- * DESCRIPTION
- * Flash message incorrect phonelock try again
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryScrIncorrectPhoneLock(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- DisplayPopup((U8*) GetString(STR_INCORRECT_PHONELOCK), IMG_GLOBAL_ERROR, 0, 2000, (U8) ERROR_TONE);
- }
- /*****************************************************************************
- * FUNCTION
- * EntryScrIncorrectPUK
- * DESCRIPTION
- * Flash message incorrect PUK try again
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryScrIncorrectPUK(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- DisplayPopup((U8*) GetString(STR_INCORRECT_PUK), IMG_GLOBAL_ERROR, 0, 2000, (U8) ERROR_TONE);
- DeleteUptoScrID(SCR_ENTER_PUK);
- }
- /*****************************************************************************
- * FUNCTION
- * EntryScrPinBlocked
- * DESCRIPTION
- * Flash message PIN is blocked
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryScrPinBlocked(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(STR_PIN_BLOCKED_PUK, ExitScrPinBlocked, NULL, NULL);
- GenericExitScreen(SCR_POP_UP_HISTORY, EntryScrEnterPUK);
- ShowCategory123Screen(0, 0, 0, 0, 0, 0, STR_PIN_BLOCKED_PUK, IMG_GLOBAL_WARNING, NULL);
- playRequestedTone(WARNING_TONE);
- StartTimer(CODE_VERIFIED_TIMER, CODE_VERIFIED_TIMEOUT, EntryScrEnterPUK);
- SetGroupKeyHandler(EntryScrEnterPUK, (PU16) PresentAllKeys, (U8) TOTAL_KEYS, (U16) KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * ExitScrPinBlocked
- * DESCRIPTION
- * Exit function for PIN blocked screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitScrPinBlocked(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- stopRequestedTone(WARNING_TONE);
- StopTimer(CODE_VERIFIED_TIMER);
- }
- /*****************************************************************************
- * FUNCTION
- * EntryScrCodeVerified
- * DESCRIPTION
- * PopUp when code is verified
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryScrCodeVerified(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- DisplayPopup((U8*) GetString(STR_CODE_VERIFIED), IMG_GLOBAL_ACTIVATED, 0, 2000, (U8) SUCCESS_TONE);
- DeleteScreenIfPresent(SCR_ENTER_PIN);
- DeleteScreenIfPresent(SCR_ENTER_PUK);
- DeleteScreenIfPresent(SCR_ENTER_NEW_PIN);
- DeleteScreenIfPresent(SCR_ENTER_CONFIRM_PIN);
- DeleteScreenIfPresent(SCR_ENTER_NP);
- DeleteScreenIfPresent(SCR_ENTER_NSP);
- DeleteScreenIfPresent(SCR_ENTER_CP);
- DeleteScreenIfPresent(SCR_ENTER_SP);
- DeleteScreenIfPresent(SCR_ENTER_SIMP);
- #ifdef __MMI_SML_MENU__
- DeleteScreenIfPresent(SCR_ENTER_NS_SP);
- DeleteScreenIfPresent(SCR_ENTER_SIM_C);
- #endif /* __MMI_SML_MENU__ */
- if (isInCall())
- {
- /* input PIN1 screen + incoming call + code accepted screen */
- mmi_frm_add_history_before_cm_marker(GLOBAL_SCR_DUMMY, mmi_bootup_exit_security_check);
- }
- else
- {
- /* input PIN1 screen + unfinished code accepted screen + incoming call */
- GenericExitScreen(GLOBAL_SCR_DUMMY, mmi_bootup_exit_security_check);
- }
- }
- /**************************************************************************
- SSC APIs:
- void SSCHandleEnterPUK(void)
- void ExitSSCHandleEnterPUK(void)
- void ValidateSSCStringPUK(void)
- void MakeCallSSCStringPUK(void)
- **************************************************************************/
- /*****************************************************************************
- * FUNCTION
- * SSCHandleEnterPUK
- * DESCRIPTION
- * Input PUK by SSC string
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void SSCHandleEnterPUK(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 Keycode, Keytype;
- U8 *history_buffer;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (pfnUnicodeStrlen((S8*) gInputPwdBuffer) == 0)
- {
- EntryNewScreen(SCR_SSC_ENTER_PUK, ExitSSCHandleEnterPUK, NULL, NULL);
- GetkeyInfo(&Keycode, &Keytype);
- if (pfnUnicodeStrlen(g_idle_context.DialPadCallBuffer) == 0)
- {
- g_idle_context.IdleScreenDigitKeyCode = Keycode;
- }
- g_pwr_context.SSCFromEnterPukAtBootUp = 0;
- history_buffer = GetCurrGuiBuffer(SCR_SSC_ENTER_PUK);
- ShowCategory16Screen(
- 0,
- 0,
- STR_GLOBAL_BACK,
- 0,
- (U8*) g_idle_context.DialPadCallBuffer,
- MAX_DIAL_PAD,
- history_buffer);
- if (g_idle_context.IdleScreenDigitKeyCode >= 0)
- {
- ExecuteCurrKeyHandler(g_idle_context.IdleScreenDigitKeyCode, KEY_EVENT_DOWN);
- }
- /* if come from setting PUK scr then should not go to idle scr on press on END --vanita */
- if (IsScreenPresent(SCR_ID_SECSET_PUK1))
- {
- ClearKeyHandler(KEY_END, KEY_EVENT_DOWN);
- ClearKeyHandler(KEY_END, KEY_EVENT_UP);
- }
- SetKeyHandler(ValidateSSCStringPUK, KEY_POUND, KEY_EVENT_UP);
- SetCategory16RightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * ExitSSCHandleEnterPUK
- * DESCRIPTION
- * Exit function for SSC screen from PUK
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitSSCHandleEnterPUK(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (!g_pwr_context.SSCFromEnterPukAtBootUp)
- {
- GenericExitScreen(SCR_SSC_ENTER_PUK, SSCHandleEnterPUK);
- }
- g_idle_context.IdleScreenDigitKeyCode = -1;
- }
- /*****************************************************************************
- * FUNCTION
- * ValidateSSCStringPUK
- * DESCRIPTION
- * Validate is it a valid SSC for puk screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ValidateSSCStringPUK(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_pwr_context.SSCFromEnterPukAtBootUp = 1;
- if (!SSCStringParsing3())
- {
- DisplayPopup((U8*) GetString(STR_INCORRECT_SSC), IMG_GLOBAL_WARNING, 0, 2000, (U8) ERROR_TONE);
- g_pwr_context.SSCFromEnterPukAtBootUp = 0;
- DeleteScreenIfPresent(SCR_SSC_ENTER_PUK);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * MakeCallSSCStringPUK
- * DESCRIPTION
- * Make call for PUK screen SSC
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void MakeCallSSCStringPUK(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MakeCall(g_idle_context.DialPadCallBuffer);
- }
- /**************************************************************************
- NAND sanity check APIs:
- void PWR_NAND_SanityCheck_Popup(void)
- void PWR_NAND_SanityCheck_response_handler(void)
- void PWR_NAND_SanityCheck_skip_check(void)
- void PWR_NAND_SanityCheck_proceed_check(void)
- void PWR_NAND_SanityCheckDisplay_Exit(void)
- void PWR_NAND_SanityCheckDisplay(void)
- **************************************************************************/
- #ifdef __FS_CHECKDRIVE_SUPPORT__
- /*****************************************************************************
- * FUNCTION
- * PWR_NAND_SanityCheck_Popup
- * DESCRIPTION
- * NAND check popup for done
- * PARAMETERS
- * info [IN]
- * RETURNS
- * void
- *****************************************************************************/
- extern pBOOL isInCall(void);
- extern void mmi_pwron_entry_animation_screen(void);
- static void PWR_NAND_SanityCheck_Popup(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- DisplayPopup(
- (U8*) GetString(STR_GLOBAL_DONE),
- IMG_GLOBAL_ACTIVATED,
- 1,
- 2000,
- (U8) SUCCESS_TONE);
- ClearKeyHandler(KEY_END, KEY_EVENT_DOWN);
- SanityCheckDone = 2;
- DeleteScreenIfPresent(SCR_NAND_FLASH_CHECK);
- DeleteScreenIfPresent(SCR_NAND_CHECK_PROCESSING);
- DeleteScreenIfPresent(SCR_CHARGER_POPUP);
- /* Aviod no history to go back */
- if (!IsScreenPresent(SCR_OPEN_SCREEN_ID))
- {
- if (isInCall())
- {
- mmi_frm_add_history_before_cm_marker(SCR_OPEN_SCREEN_ID, mmi_pwron_entry_animation_screen);
- }
- else
- {
- GenericExitScreen(SCR_OPEN_SCREEN_ID, mmi_pwron_entry_animation_screen);
- }
- }
- FS_ClearDiskFlag();
- }
- /*****************************************************************************
- * FUNCTION
- * PWR_NAND_SanityCheck_skip_check
- * DESCRIPTION
- * Skip NAND check
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- static void PWR_NAND_SanityCheck_skip_check(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SanityCheckDone = 1;
- mmi_bootup_exit_nand_check_query();
- }
- /*****************************************************************************
- * FUNCTION
- * PWR_NAND_SanityCheck_proceed_check
- * DESCRIPTION
- * Proceed NAND check
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- static void PWR_NAND_SanityCheck_proceed_check(void)
- {
- #ifdef MMI_ON_HARDWARE_P
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MYQUEUE Message;
- mmi_fmt_check_drive_req_strcut *req =
- (mmi_fmt_check_drive_req_strcut*) OslConstructDataPtr(sizeof(mmi_fmt_check_drive_req_strcut));
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_NAND_CHECK_PROCESSING, NULL, PWR_NAND_SanityCheck_proceed_check, NULL);
- #ifdef __MMI_FILE_MANAGER__
- req->drive = MMI_PUBLIC_DRV;
- #endif
- if (SanityCheckDone != 3)
- {
- SanityCheckDone = 3; /* processing */
- /* Send message to FMT */
- Message.oslSrcId = MOD_MMI;
- Message.oslDestId = MOD_FMT;
- Message.oslMsgId = MSG_ID_MMI_FMT_CHECK_DRIVE_REQ;
- Message.oslDataPtr = (oslParaType*) req;
- Message.oslPeerBuffPtr = NULL;
- OslMsgSendExtQueue(&Message);
- SetProtocolEventHandler(PWR_NAND_SanityCheck_Popup, PRT_MMI_FMGR_CHECK_DRIVE_RSP);
- }
- ShowCategory66Screen(
- STR_NAND_CHECK_TITLE,
- 0,
- 0,
- 0,
- 0,
- 0,
- (PU8) GetString(STR_NAND_CHECK_PROCESSING),
- IMG_GLOBAL_PROGRESS,
- NULL);
- ClearKeyHandler(KEY_END, KEY_EVENT_DOWN);
- #else /* MMI_ON_HARDWARE_P */ /* for pc simulator */
- extern void EntryScrDisplayUSSNMsg(void);
- EntryNewScreen(SCR_NAND_CHECK_PROCESSING, NULL, PWR_NAND_SanityCheck_proceed_check, NULL);
- StopTimer(WELCOME_SCR_TIMER);
- if (SanityCheckDone != 3)
- {
- SanityCheckDone = 3; /* processing */
- StartTimer(WELCOME_SCR_TIMER, 5000, PWR_NAND_SanityCheck_Popup);
- }
- ShowCategory66Screen(
- STR_NAND_CHECK_TITLE,
- 0,
- 0,
- 0,
- 0,
- 0,
- (PU8) GetString(STR_NAND_CHECK_PROCESSING),
- IMG_GLOBAL_PROGRESS,
- NULL);
- ClearKeyHandler(KEY_END, KEY_EVENT_DOWN);
- #endif /* MMI_ON_HARDWARE_P */
- }
- /*****************************************************************************
- * FUNCTION
- * PWR_NAND_SanityCheckDisplay_Exit
- * DESCRIPTION
- * Exit NAND check
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void PWR_NAND_SanityCheckDisplay_Exit(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- #ifdef __MMI_UI_SMALL_SCREEN_SUPPORT__
- restore_small_screen();
- #endif
- stopRequestedTone(WARNING_TONE);
- }
- /*****************************************************************************
- * FUNCTION
- * PWR_NAND_SanityCheckDisplay
- * DESCRIPTION
- * Display NAND check operation screen
- * Pressing End key will come back here except during a call
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- extern void SetCat165TimerExpireFunc(FuncPtr f);
- static void PWR_NAND_SanityCheckDisplay(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- guiBuffer = GetCurrGuiBuffer(SCR_NAND_FLASH_CHECK);
- /* Some application might be performed during NAND check */
- /* if the user press end key, here will be the root entry function */
- if (GetActiveScreenId() != SCR_NAND_FLASH_CHECK) /* root and only nand check screen */
- {
- if (SanityCheckDone == 0)
- {
- EntryNewScreen(SCR_NAND_FLASH_CHECK, PWR_NAND_SanityCheckDisplay_Exit, PWR_NAND_SanityCheckDisplay, NULL);
- #ifdef __MMI_UI_SMALL_SCREEN_SUPPORT__
- force_no_small_screen();
- #endif
- ShowCategory165Screen_ext(
- STR_GLOBAL_YES,
- IMG_GLOBAL_YES,
- STR_GLOBAL_NO,
- IMG_GLOBAL_NO,
- get_string(STR_NAND_CHECK),
- IMG_GLOBAL_QUESTION,
- 10,
- guiBuffer);
- SetCat165TimerExpireFunc(PWR_NAND_SanityCheck_proceed_check);
- playRequestedTone(WARNING_TONE);
- StopLEDPatternPowerOn();
- ShowIdleAppSubLcd();
- SetKeyHandler(PWR_NAND_SanityCheck_skip_check, KEY_END, KEY_EVENT_DOWN);
- SetLeftSoftkeyFunction(PWR_NAND_SanityCheck_proceed_check, KEY_EVENT_UP);
- SetRightSoftkeyFunction(PWR_NAND_SanityCheck_skip_check, KEY_EVENT_UP);
- }
- else
- {
- /* skip or done or processing */
- mmi_bootup_exit_low_battery_warning(); /* a little strange... */
- }
- }
- }
- #endif /* __FS_CHECKDRIVE_SUPPORT__ */
- /**************************************************************************
- Welcome screen APIs:
- void ShowWelcomeScr(void)
- void ExitWelcomeScreen(void)
- void ShowAphorismScr(void)
- void ExitAphorismScreen(void)
- S8* GetAphorismScrText(void)
- void BeforeEntryIdleScr(void)
- **************************************************************************/
- /*****************************************************************************
- * FUNCTION
- * ShowWelcomeScr
- * DESCRIPTION
- * Show welcome screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ShowWelcomeScr(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S8 *WelcomeString = NULL;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_TRACE((MMI_TRACE_G7_MISC, MMI_POWER_ON_START_WELCOME));
- g_pwr_context.PowerOnMMIStatus = MMI_POWER_ON_WELCOME; /* 0x20: Welcome screen */
- if (IsShowWelcomeScr1())
- {
- EntryNewScreen(WELCOME_SCREEN_ID, ExitWelcomeScreen, ShowWelcomeScr, NULL);
- DeleteScreenIfPresent(GLOBAL_SCR_DUMMY);
- WelcomeString = GetWelcomeText();
- StartTimer(WELCOME_SCR_TIMER, WELCOME_SCR_TIME, mmi_bootup_exit_welcome_screen);
- ShowCategory61Screen((U8*) WelcomeString, IMG_WELCOME_SCR, NULL);
- OslMfree(WelcomeString);
- /* diamond, 2005/12/22 Not allow to press END key to prevent from going back to power on animation */
- ClearKeyHandler(KEY_END, KEY_EVENT_DOWN);
- }
- else
- {
- mmi_bootup_exit_welcome_screen();
- }
- }
- /*****************************************************************************
- * FUNCTION
- * ExitWelcomeScreen
- * DESCRIPTION
- * Exit welcome screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitWelcomeScreen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_TRACE((MMI_TRACE_G7_MISC, MMI_POWER_ON_STOP_WELCOME));
- StopTimer(WELCOME_SCR_TIMER);
- }
- #if defined(__MMI_APHORISM__)
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- #endif /* defined(__MMI_APHORISM__) */ // #if defined(__MMI_APHORISM__)
- /*****************************************************************************
- * FUNCTION
- * BeforeEntryIdleScr
- * DESCRIPTION
- * Function to be called before entry into idle screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void BeforeEntryIdleScr(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* if ( g_pwr_context.InvalidSim && !g_pwr_context.InvalidSimShowed) */
- if (mmi_bootup_is_nw_registration_ok() == MMI_FALSE && !g_pwr_context.InvalidSimShowed)
- {
- g_pwr_context.InvalidSimShowed = 1;
- DisplayInvalidSimInfo();
- DinitHistory(); /* do not go back to power on animation */
- ExitIdleScreen();
- }
- else
- {
- if (isEarphonePlugged) /* MTK add, Robin 1015 for earphone indication comming before power on indication */
- {
- #ifdef __CTM_SUPPORT__
- mmi_ctm_switch_tty_status(MMI_TRUE);
- if (mmi_ctm_is_tty_on())
- {
- /* TTY in, hide earphone icon */
- #if (defined (__MMI_STATUS_ICON_EN_EARPHONE__) || defined(__MMI_BT_SUPPORT__))
- IdleResetStatusIcon(STATUS_ICON_EARPHONE_INDICATOR);
- #endif
- mdi_audio_set_audio_mode(AUD_MODE_NORMAL);
- SetModeSpeechVolume();
- mmi_profiles_headset_deactivate_profile();
- }
- else /* not TTY, it's earphone */
- #endif /* __CTM_SUPPORT__ */
- {
- SetModeSpeechVolume();
- mmi_profiles_headset_activate_profile();
- }
- }
- else if (gactivatedprofile == MMI_PROFILE_HEADSET)
- {
- mdi_audio_set_audio_mode(AUD_MODE_NORMAL);
- SetModeSpeechVolume();
- mmi_profiles_headset_deactivate_profile();
- }
- EntryIdleScreen();
- }
- }
- /**************************************************************************
- Abnormal reset APIs:
- U8 GetAbnormalReset(void)
- void SetAbnormalReset(void)
- void ResetAbnormalReset(void)
- **************************************************************************/
- /*****************************************************************************
- * FUNCTION
- * GetAbnormalReset
- * DESCRIPTION
- * Get the status of abnormal reset
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- U8 GetAbnormalReset(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return g_pwr_context.AbnormalReset;
- }
- /*****************************************************************************
- * FUNCTION
- * SetAbnormalReset
- * DESCRIPTION
- * Set the status of abnormal reset
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void SetAbnormalReset(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_pwr_context.AbnormalReset = 1;
- g_pwr_context.IsCampOnTonePlayed = 1;
- //g_pwr_context.PowerOnAnimationComplete = 1;
- //g_pwr_context.PowerOnPeriod = 1;
- g_pwr_context.PowerOnMMIStatus = MMI_POWER_ON_LOW_BATTERY; /* 0x08: Power on animation complete */
- SanityCheckDone = 2; /* diamond, 2005/12/18 NAND check should be "done" in abnormal reset */
- }
- /*****************************************************************************
- * FUNCTION
- * ResetAbnormalReset
- * DESCRIPTION
- * Reset the status of abnormal reset
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ResetAbnormalReset(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_pwr_context.AbnormalReset = 0;
- }
- /**************************************************************************
- Other APIs:
- void ServiceIndicationStringDisplay(void *inMsg)
- void mmi_ready_to_idle_screen_ind_hdlr(void* msg)
- void mmi_ready_to_idle_screen_ind(void)
- void mmi_idle_notify_bootup_ready_to_l4c(void)
- void DisplayInvalidSimInfo(void)
- void RemoveStatusIconsForSimRemoved(void)
- void FirstTimeTurnOnBackLight(void)
- void PowerOnBatteryIndicationCompletePhase2(void)
- void PowerOnBatteryIndicationComplete(void)
- void CallBackPowerOnAnimationComplete(GDI_RESULT ret)
- void ExitLowBatteryScrAtPowerOn(void)
- **************************************************************************/
- /*****************************************************************************
- * FUNCTION
- * ServiceIndicationStringDisplay
- * DESCRIPTION
- * This function is a call back for MSG_ID_MMI_CPHS_MMI_INFO_IND
- * It will be passed to CPHSMMInfoInd first
- * PARAMETERS
- * inMsg [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void ServiceIndicationStringDisplay(void *inMsg)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- mmi_cphs_mmi_info_ind_struct *local_data = (mmi_cphs_mmi_info_ind_struct*) inMsg;
- U8 i = 0, len = 0;
- PS8 pString;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gOpNameValid = local_data->is_opname_valid;
- gShortOpnameValid = local_data->is_sopname_valid;
- gSpnValid = local_data->is_spn_valid;
- /* not to display RPLMN if SPN say so */
- if (gSpnValid == 1)
- {
- g_pwr_context.RequireRPLMN = local_data->is_spn_RPLMN_required;
- }
- if (gOpNameValid)
- {
- AnsiiToUnicodeString(gOperatorName, (S8*) local_data->opname);
- }
- if (gShortOpnameValid)
- {
- AnsiiToUnicodeString(gShortOperatorName, (S8*) local_data->sopname);
- }
- if (gSpnValid)
- {
- if (local_data->spn[0] >= 0x80) /* diamond, 2005/08/03 support SPN with UCS2 from SIM */
- {
- U8 *convertedData = NULL;
- U8 dcs;
- switch (local_data->spn[0])
- {
- case 0x80:
- dcs = MMI_UCS2_DCS;
- break;
- case 0x81:
- dcs = MMI_UCS2_81;
- break;
- case 0x82:
- dcs = MMI_UCS2_82;
- break;
- default:
- dcs = 0;
- break;
- }
- if (dcs == 0)
- {
- gSpnValid = 0;
- }
- else
- {
- convertedData = CovertStringForPlatform(
- local_data->spn + 1,
- (U16) (strlen((PS8) (local_data->spn + 1))),
- dcs,
- NULL);
- pfnUnicodeStrcpy((PS8) gServProvderName, (PS8) convertedData);
- OslMfree(convertedData);
- }
- }
- else
- {
- AnsiiToUnicodeString(gServProvderName, (S8*) local_data->spn);
- }
- }
- /* Owner Number */
- memset((void*)&gDispOwnerNumber, 0, sizeof(gDispOwnerNumber));
- if (local_data->no_msisdn > 0)
- {
- for (i = 0; ((i < MAX_LINE_NUM) && (i < local_data->no_msisdn)); i++)
- {
- if (local_data->msisdn[i].alpha_id_size != 0)
- {
- len =
- (((local_data->msisdn[i].alpha_id_size) >
- MAX_PB_NAME_LENGTH) ? MAX_PB_NAME_LENGTH : (local_data->msisdn[i].alpha_id_size));
- InputboxConvertGSMToDeviceEncoding(
- local_data->msisdn[i].alpha_id,
- gDispOwnerNumber[i].name,
- len,
- (MAX_PB_NAME_LENGTH + 1) * ENCODING_LENGTH,
- local_data->msisdn[i].alpha_id_dcs,
- 0,
- 1);
- }
- if ((strlen((S8*) local_data->msisdn[i].digit) != 0) ||
- (local_data->msisdn[i].ton_npi != 0xFF && ((local_data->msisdn[i].ton_npi) & 0x10) != 0))
- {
- /* Prevent PS error. Watch out!! should sync with l4csmu_addr_struct */
- local_data->msisdn[i].digit[MAX_PB_NUMBER_LENGTH] = 0x0;
- local_data->msisdn[i].digit[MAX_PB_NUMBER_LENGTH - 1] = 0x0;
- if (((local_data->msisdn[i].ton_npi) & 0x10) != 0)
- {
- len = MAX_PB_NUMBER_LENGTH;
- gDispOwnerNumber[i].number[0] = '+';
- pString = (PS8) gDispOwnerNumber[i].number + ENCODING_LENGTH;
- }
- else
- {
- len = MAX_PB_NUMBER_LENGTH + 1;
- pString = (PS8) gDispOwnerNumber[i].number;
- }
- AnsiiNToUnicodeString((PS8) pString, (S8*) local_data->msisdn[i].digit, len);
- }
- }
- }
- RefreshDisplayOwnerNumber((U8) g_callset_context.LineID); /* in LineSwitching.c */
- if (g_idle_context.IsOnIdleScreen)
- {
- EntryIdleScreen();
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_ready_to_idle_screen_ind_hdlr
- * DESCRIPTION
- * Ready go to idle handler
- * We use this message to enter idle screen, this is used to solve NVRAM/timer interlace problem
- * PARAMETERS
- * msg [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_ready_to_idle_screen_ind_hdlr(void *msg)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* there might be an very critail timing issue here */
- /*
- * (PS. set Tab=3 to view the following diagram correctly)
- *
- * (1) =======================================================
- *
- * [Sim ready, send SIM_READY_IND to MMI]
- *
- *
- * PS ------------------------------------------------
- *
- * (SIM ready)
- * SIM ----------*-------------------------------------
- * | SIM_RDY_IND
- * v
- * PWRON HDLR ------------------------------------------------
- *
- *
- * MT SCREEN ------------------------------------------------
- *
- *
- * [MSG Queue: (1)SIM_RDY_INC]
- *
- * ===========================================================
- *
- *
- * (2) =======================================================
- *
- * [Before SIM_RDY_IND arrive MMI, MT Call happened]
- * (MT Call)
- * PS ------------*-----------------------------------
- * | MT_CALL_IND
- * |
- * SIM ----------*-|-----------------------------------
- * | |
- * v |
- * PWRON HDLR ------------|-----------------------------------
- * |
- * v
- * MT SCREEN ------------------------------------------------
- *
- *
- * [MSG Queue: (1)SIM_RDY_INC, (2) MT_CALL_IND]
- * ===========================================================
- *
- *
- * (3) =======================================================
- *
- * [Then we will process SIM_RDY_INC, it will call this function
- * to send MMI_RDT_TO_IDLE_SCR_IND to it self]
- *
- *
- * (MT Call)
- * PS ------------*-----------------------------------
- * | MT_CALL_IND
- * |
- * SIM ----------*-|-----------------------------------
- * | |
- * | |
- * PWRON HDLR ----------#-|-----------------------------------
- * |
- * v
- * MT SCREEN ------------------------------------------------
- *
- *
- * [MSG Queue: (1) MT_CALL_IND (2) MMI_RDT_TO_IDLE_SCR_IND ]
- * ===========================================================
- *
- * (4) Then will proceed MT_CALL_IND first, it will enter MT call screen.
- * (5) But it will follow up by proceeding MMI_RDT_TO_IDLE_SCR_IND, it
- * will force to enter idle screen. So the MT call screen will gone..
- *
- * [Soultion]
- * We have to check if it is already in MT call screen. If yes, we do not send
- * MSG_ID_MMI_READY_TO_IDLE_SCREEN_IND.
- *
- */
- /*
- * the reason to send out this message, it to solve NVRAM/Timer interleaving problem
- * while powering on.
- */
- if (isInCall())
- {
- /* is in call, after call end, call management will lead to idle screen */
- MMI_TRACE((MMI_TRACE_G7_MISC, MMI_POWER_ON_CALL_BEFORE_IDLE));
- return;
- }
- MMI_TRACE((MMI_TRACE_G7_MISC, MMI_POWER_ON_READY_TO_IDLE));
- ClearProtocolEventHandler(MSG_ID_MMI_READY_TO_IDLE_SCREEN_IND);
- goto_opening_screen();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_ready_to_idle_screen_ind
- * DESCRIPTION
- * Send message to MMI itself for ready to idle screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_ready_to_idle_screen_ind(void) /* this function is call by MMI */
- {
- #ifdef MMI_ON_HARDWARE_P
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MYQUEUE Message;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_TRACE((MMI_TRACE_G7_MISC, MMI_POWER_ON_SEND_MSG_2_MMI));
- Message.oslSrcId = MOD_MMI;
- Message.oslDestId = MOD_MMI;
- Message.oslMsgId = MSG_ID_MMI_READY_TO_IDLE_SCREEN_IND;
- Message.oslDataPtr = (oslParaType*) NULL;
- Message.oslPeerBuffPtr = NULL;
- OslMsgSendExtQueue(&Message);
- SetProtocolEventHandler(mmi_ready_to_idle_screen_ind_hdlr, MSG_ID_MMI_READY_TO_IDLE_SCREEN_IND);
- #endif /* MMI_ON_HARDWARE_P */
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_idle_notify_bootup_ready_to_l4c
- * DESCRIPTION
- * Send message to L4C to notify idle screen reached
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_idle_notify_bootup_ready_to_l4c(void) /* this function is call by MMI */
- {
- #ifdef MMI_ON_HARDWARE_P
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- static BOOL haveBeenCalled = MMI_FALSE;
- MYQUEUE Message;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (haveBeenCalled == MMI_FALSE)
- {
- haveBeenCalled = MMI_TRUE;
- Message.oslSrcId = MOD_MMI;
- Message.oslDestId = MOD_L4C;
- Message.oslMsgId = MSG_ID_MMI_READY_NOTIFY_REQ;
- Message.oslDataPtr = (oslParaType*) NULL;
- Message.oslPeerBuffPtr = NULL;
- OslMsgSendExtQueue(&Message);
- }
- #endif /* MMI_ON_HARDWARE_P */
- }
- /*****************************************************************************
- * FUNCTION
- * DisplayInvalidSimInfo
- * DESCRIPTION
- * Display invalid SIM info
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void DisplayInvalidSimInfo(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_INVALID_SIM_INFO, NULL, DisplayInvalidSimInfo, NULL);
- ShowCategory2Screen(
- STR_SIM_INVALID_SIM_TITLE,
- 0,
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- 0,
- 0,
- STR_SIM_INVALID_SIM_TXT,
- NULL);
- if (gSecuritySetupContext.PINBlocked || IsScreenPresent(IDLE_SCREEN_ID))
- {
- SetLeftSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- }
- else
- {
- SetLeftSoftkeyFunction(EntryIdleScreen, KEY_EVENT_UP);
- }
- /* end the network searching screen */
- g_pwr_context.PowerOnNWStatus |= MMI_NW_STATUS_NETWORK_FLAG;
- }
- /*****************************************************************************
- * FUNCTION
- * RemoveStatusIconsForSimRemoved
- * DESCRIPTION
- * Remove invalid status icon when sim is removed or blocked in running condition
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void RemoveStatusIconsForSimRemoved(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_TRACE((MMI_TRACE_G7_MISC, MMI_POWER_ON_REMOVE_ICONS));
- HideStatusIcon(STATUS_ICON_ROAMING);
- HideStatusIcon(STATUS_ICON_CALL_DIVERT_L1L2);
- #ifdef __MMI_CFU_SEPARATE_LINE__
- HideStatusIcon(STATUS_ICON_CALL_DIVERT_L1);
- HideStatusIcon(STATUS_ICON_CALL_DIVERT_L2);
- #endif /* __MMI_CFU_SEPARATE_LINE__ */
- HideStatusIcon(STATUS_ICON_INCOMING_SMS);
- #ifndef __MMI_TOUCH_SCREEN__
- HideStatusIcon(STATUS_ICON_KEYPAD_LOCK);
- #endif
- HideStatusIcon(STATUS_ICON_MISSED_CALL);
- #ifndef __MMI_SUBLCD_SHORT_STATUSICON_LIST__
- HideStatusIcon(STATUS_ICON_SUBLCD_MISSED_CALL);
- #endif
- HideStatusIcon(STATUS_ICON_UNREAD_VOICE_L1L2);
- HideStatusIcon(STATUS_ICON_UNREAD_VOICE_L1);
- HideStatusIcon(STATUS_ICON_UNREAD_VOICE_L2);
- HideStatusIcon(STATUS_ICON_UNREAD_FAX_L1L2);
- HideStatusIcon(STATUS_ICON_UNREAD_FAX_L1);
- HideStatusIcon(STATUS_ICON_UNREAD_FAX_L2);
- HideStatusIcon(STATUS_ICON_UNREAD_EMAIL_L1L2);
- HideStatusIcon(STATUS_ICON_UNREAD_EMAIL_L1);
- HideStatusIcon(STATUS_ICON_UNREAD_EMAIL_L2);
- HideStatusIcon(STATUS_ICON_SUBLCD_SMS);
- HideStatusIcon(STATUS_ICON_MMS_UNREAD);
- HideStatusIcon(STATUS_ICON_MMS_BUSY);
- HideStatusIcon(STATUS_ICON_CHAT_INDICATION_ROOM1);
- HideStatusIcon(STATUS_ICON_CHAT_INDICATION_ROOM2);
- HideStatusIcon(STATUS_ICON_WAP);
- HideStatusIcon(STATUS_ICON_NETWORK_CIPHER_GSM);
- HideStatusIcon(STATUS_ICON_NETWORK_CIPHER_GPRS);
- #ifdef __MMI_STATUS_ICON_SIGNAL_WITH_LINE_SWITCH__
- ChangeStatusIconImage(STATUS_ICON_SIGNAL_STRENGTH, IMG_SI_SIGNAL_STRENGTH);
- #else /* __MMI_STATUS_ICON_SIGNAL_WITH_LINE_SWITCH__ */
- HideStatusIcon(STATUS_ICON_ALTERNATE_LINE_L1);
- HideStatusIcon(STATUS_ICON_ALTERNATE_LINE_L2);
- #endif /* __MMI_STATUS_ICON_SIGNAL_WITH_LINE_SWITCH__ */
- #ifdef __MMI_POC__
- HideStatusIcon(STATUS_ICON_POC);
- #endif
- #ifndef __MMI_BT_MTK_SUPPORT__
- #if defined(__MMI_BT_HP_SUPPORT__) || defined(__MMI_BT_SUPPORT__)
- HideStatusIcon(STATUS_ICON_BT);
- HideStatusIcon(STATUS_ICON_BT_CON);
- HideStatusIcon(STATUS_ICON_BT_ND);
- #endif /* defined(__MMI_BT_HP_SUPPORT__) || defined(__MMI_BT_SUPPORT__) */
- #endif /* __MMI_BT_MTK_SUPPORT__ */
- #ifdef __MMI_IMPS__
- HideStatusIcon(STATUS_ICON_IMPS_MSG);
- HideStatusIcon(STATUS_ICON_IMPS_LOGIN);
- #endif /* __MMI_IMPS__ */
- UpdateStatusIcons();
- }
- /*****************************************************************************
- * FUNCTION
- * FirstTimeTurnOnBackLight
- * DESCRIPTION
- * Enter this function once after maui is finished to turn on backlight
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void FirstTimeTurnOnBackLight(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- static U8 FirstTime = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (!FirstTime)
- {
- FirstTime = 1;
- TurnOffBacklight();
- if (isEarphonePlugged) /* for earphone indication comming before power on indication */
- {
- mmi_profiles_headset_activate_profile();
- SetModeSpeechVolume();
- }
- }
- else
- {
- TurnOnBacklight(1);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * PowerOnBatteryIndicationCompletePhase2
- * DESCRIPTION
- * Start to process SimQueryFailureRsp or SimPasswdReqResponse
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void PowerOnBatteryIndicationCompletePhase2(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- #ifdef MMI_ON_HARDWARE_P
- FS_SetDiskFlag();
- #endif
- if (mmi_bootup_is_sim_failure_received() == MMI_TRUE) /* if(g_pwr_context.SimQueryFailIndFlag) */
- {
- SimQueryFailureRsp(&gSMUFailIndStruct);
- }
- else if (mmi_bootup_is_sim_need_security_check() == MMI_TRUE) /* else if(g_pwr_context.PasswdReqIndFlag) */
- {
- SimPasswdReqResponse(&gSMUPwdDataStruct);
- }
- else if (mmi_bootup_is_sim_valid() == MMI_TRUE)
- {
- ShowWelcomeScr();
- }
- /* else */
- /* diamond, 2006/04/17 Re-entry power on animation */
- }
- /*****************************************************************************
- * FUNCTION
- * PowerOnBatteryIndicationComplete
- * DESCRIPTION
- * Function to be called after power on animatin is completed
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void PowerOnBatteryIndicationComplete(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* g_pwr_context.PowerOnAnimationComplete=1; */
- if (mmi_bootup_is_in_security_check() != MMI_TRUE)
- {
- g_pwr_context.PowerOnMMIStatus = MMI_POWER_ON_NAND_CHECK; /* 0x09: NAND check screen */
- }
- #ifdef __FS_CHECKDRIVE_SUPPORT__
- #ifdef MMI_ON_HARDWARE_P
- if (FS_CheckDiskFlag() && g_pwr_context.NandIdCheckRes)
- #else
- if (1)
- #endif
- {
- if ((SanityCheckDone == 0) || (SanityCheckDone == 3))
- {
- if (IsScreenPresent(SCR_NAND_CHECK_PROCESSING))
- {
- GoBackToHistory(SCR_NAND_CHECK_PROCESSING);
- }
- else if (IsScreenPresent(SCR_NAND_FLASH_CHECK))
- {
- GoBackToHistory(SCR_NAND_FLASH_CHECK);
- }
- else
- {
- PWR_NAND_SanityCheckDisplay();
- }
- return; /* wait for PRT_MMI_FMGR_CHECK_DRIVE_RSP */
- }
- }
- else
- {
- SanityCheckDone = 2;
- }
- #endif /* __FS_CHECKDRIVE_SUPPORT__ */
- mmi_bootup_exit_nand_check_query();
- }
- /*****************************************************************************
- * FUNCTION
- * BatteryCheckAfterPowerOnAnimation
- * DESCRIPTION
- * Battrey status check function
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void BatteryCheckAfterPowerOnAnimation(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* Low battery warning */
- if (g_charbat_context.chargerLevel == BATTERY_LOW_TX_PROHIBIT ||
- g_charbat_context.chargerLevel == BATTERY_LOW_WARNING)
- {
- g_pwr_context.PowerOnMMIStatus = MMI_POWER_ON_LOW_BATTERY; /* 0x08: Power on animation complete */
- EntryNewScreen(SCR_CHARGER_POPUP, ExitLowBatteryScrAtPowerOn, NULL, NULL);
- ClearKeyEvents();
- ShowCategory64Screen(STR_LOW_BATTERY, IMG_GLOBAL_WARNING, 0);
- /* StartTimer(LOW_BATTERY_SCR_TIMER,LOW_BATTERY_SCR_TIMEOUT, PowerOnBatteryIndicationComplete ); */
- StartTimer(LOW_BATTERY_SCR_TIMER, LOW_BATTERY_SCR_TIMEOUT, mmi_bootup_exit_low_battery_warning);
- }
- else
- {
- mmi_bootup_exit_low_battery_warning();
- }
- }
- /*****************************************************************************
- * FUNCTION
- * CallBackPowerOnAnimationComplete
- * DESCRIPTION
- * Callback function when power on animation is completed
- * PARAMETERS
- * ret [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void CallBackPowerOnAnimationComplete(GDI_RESULT ret)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* power on sequence after animation: */
- /* animation stop -> CallBackPowerOnAnimationComplete -> PowerOnBatteryIndicationComplete -> */
- /* (nand check) -> PowerOnBatteryIndicationCompletePhase2 -> (security check) */
- /* Low battery shutdown */
- if (((g_charbat_context.batteryStatus == PMIC_VBAT_STATUS || g_charbat_context.batteryStatus == PMIC_CHARGER_OUT) && g_charbat_context.isChargerConnected == 0) /* Battery Status */
- && (g_charbat_context.chargerLevel == BATTERY_LOW_POWEROFF) /* Battery Level */ )
- {
- ShowLowPowerShutdownScr();
- return;
- }
- if (ret < 0 || ret == GDI_IMAGE_IS_STILL_IMAGE)
- {
- /* Broken animation image - force enter */
- mmi_bootup_exit_low_battery_warning();
- return;
- }
- /* SIM ready/fail indication has been arrival */
- /* if( g_pwr_context.PasswdReqIndFlag || g_pwr_context.SimQueryFailIndFlag ) */
- if (g_pwr_context.PowerOnMMIStatus > 0x04)
- {
- #ifdef __MMI_TOUCH_SCREEN__
- /*
- * Pen calibration is invoked between power-on animation and mmi_bootup_exit_animation()
- *
- * 1. On production line, LCD might not be connected and it's impossible to complete pen calibration.
- * However, we may need to use ATD command to test RF hardware. If we invoke pen calibration
- * before poweron animation, network is not ready at the time and ATD command never succeeds,
- * it causes problem in hardware testing.
- *
- * 2. If we invoke pen calibration at idle screen, we cannot use pen to input PIN code, etc.
- *
- * As a result, pen calibration is invoked immediately after power-on animation.
- */
- if (PhnsetNeedFactoryDefaultCalibration())
- {
- /* Although we have not reached idle screen, but it still sends MSG_ID_MMI_READY_NOTIFY_REQ to L4
- to allow ATD command in the first-time boot after flash download. */
- mmi_idle_notify_bootup_ready_to_l4c();
- EntryPhnseFactoryDefaultCalibrationScr(mmi_bootup_exit_animation);
- }
- else
- {
- mmi_bootup_exit_animation();
- }
- #else /* __MMI_TOUCH_SCREEN__ */
- mmi_bootup_exit_animation();
- #endif /* __MMI_TOUCH_SCREEN__ */
- }
- }
- /*****************************************************************************
- * FUNCTION
- * ExitLowBatteryScrAtPowerOn
- * DESCRIPTION
- * Exit Low battery screen when it appears just after power on animation
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitLowBatteryScrAtPowerOn(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- GenericExitScreen(SCR_CHARGER_POPUP, mmi_bootup_exit_low_battery_warning);
- StopTimer(LOW_BATTERY_SCR_TIMER);
- }
- /*****************************************************************************
- * FUNCTION
- * EntryScrInvalidPINPUKPLOCKLength
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryScrInvalidPINPUKPLOCKLength(void) /* referred by personalization.c */
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- DisplayPopup(
- (U8*) GetString(STR_INVALID_PINPUKPLOCK_LENGTH_RUNNING_TEXT),
- IMG_GLOBAL_WARNING,
- 0,
- 2000,
- (U8) ERROR_TONE);
- }
- /**************************************************************************
- Insert SIM keypad lock APIs:
- void InsertSimRSKPressOnScreenSaver(void)
- void InsertSimSetKeyPadLockFlag(void)
- **************************************************************************/
- /*****************************************************************************
- * FUNCTION
- * InsertSimRSKPressOnScreenSaver
- * DESCRIPTION
- * Handle RSK pressed in keypad locked insert SIM screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void InsertSimRSKPressOnScreenSaver(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_idle_context.IsRSKPressOnScreenSaver = 1;
- if (IsScreenPresent(SCR_SIM_BLOCK) || GetActiveScreenId() == SCR_SIM_BLOCK)
- {
- EntryScrnSimBlockRsp();
- }
- else
- {
- EntryScrnSimErrorScreen();
- }
- }
- /*****************************************************************************
- * FUNCTION
- * InsertSimSetKeyPadLockFlag
- * DESCRIPTION
- * Timeout to lock keypad in insert SIM screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- //KP Jerry add on 2007-4-10 start
- #if defined(__MMI_PEN_BLOCK_WHEN_KAYPAD_LOCKED__)
- extern BOOL GetLCDSleepStatus(void);
- #endif
- //KP Jerry add on 2007-4-10 end
- void InsertSimSetKeyPadLockFlag(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_keylock_context.gKeyPadLockFlag = 1;
- #if 0 /* diamond, 2006/03/07 Not necessary to block pen here because pen is blocked in EntryIdleScreen */
- #ifdef __MMI_TOUCH_SCREEN__
- /* under construction !*/
- #endif
- #endif /* 0 */
- #ifdef __MMI_KEYPADLOCK_WITH_KEYTONE__
- #else
- mmi_frm_kbd_set_tone_state(MMI_KEY_TONE_DISABLED);
- #endif
- if (IsScreenPresent(SCR_SIM_BLOCK) || GetActiveScreenId() == SCR_SIM_BLOCK)
- {
- EntryScrnSimBlockRsp();
- }
- else
- {
- EntryScrnSimErrorScreen();
- }
- #if defined(__MMI_TOUCH_SCREEN__) && (!defined(__MMI_TOUCH_SCREEN_WITH_NUMERIC_KEY__) || defined(__MMI_SLIDE__)) //KP Jerry add "!defined(__MMI_TOUCH_SCREEN_WITH_NUMERIC_KEY__)" on 2007-3-26
- SetKeyHandler(InsertSimRSKPressOnScreenSaver, KEY_SEND, KEY_EVENT_DOWN);
- #else /* __MMI_TOUCH_SCREEN__ && !__MMI_TOUCH_SCREEN_WITH_NUMERIC_KEY__ */ //KP Jerry add "!__MMI_TOUCH_SCREEN_WITH_NUMERIC_KEY__" on 2007-3-26
- #if defined(__MMI_KEYPAD_LOCK_PATTERN_1__) || defined(__MMI_KEYPAD_LOCK_PATTERN_3__) || defined(__MMI_KEYPAD_LOCK_PATTERN_4__) //KP Jerry add "__MMI_KEYPAD_LOCK_PATTERN_3__" on 2007-3-26 /* Robin 1223 */
- SetRightSoftkeyFunction(InsertSimRSKPressOnScreenSaver, KEY_EVENT_DOWN);
- #endif
- #ifdef __MMI_KEYPAD_LOCK_PATTERN_2__ /* Robin 1223 */
- SetLeftSoftkeyFunction(InsertSimRSKPressOnScreenSaver, KEY_EVENT_DOWN);
- #endif
- #endif /* __MMI_TOUCH_SCREEN__ && !__MMI_TOUCH_SCREEN_WITH_NUMERIC_KEY__ */ //KP Jerry add "!__MMI_TOUCH_SCREEN_WITH_NUMERIC_KEY__" on 2007-3-26
- #ifdef __MMI_TOUCH_SCREEN__
- ChangeStatusIconImage(STATUS_ICON_KEYPAD_LOCK, IMG_SI_KEYPAD_LOCK);
- UpdateStatusIcons();
- #else /* __MMI_TOUCH_SCREEN__ */
- IdleSetStatusIcon(STATUS_ICON_KEYPAD_LOCK);
- #endif /* __MMI_TOUCH_SCREEN__ */
- StopTimer(IDLE_APP_AUTO_LOCK_TIMER_ID);
- //KP Jerry add on 2007-4-10 start
- #if defined(__MMI_PEN_BLOCK_WHEN_KAYPAD_LOCKED__)
- if(GetLCDSleepStatus())
- {
- //touch_panel_enable(KAL_FALSE);
- //touch_panel_flush();
- //mmi_pen_forced_block();
- }
- #endif
- //KP Jerry add on 2007-4-10 end
- }
- #ifdef __MMI_SIMAP_SUPPORT__
- /*****************************************************************************
- * FUNCTION
- * mmi_sim_error_update_sim_access_profile_menu_items
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_sim_error_update_sim_access_profile_menu_items(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_frm_hide_menu_item(MENU_IDLE_SCR_DISP); /* Hide "Display Characteristic" 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_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 */
- mmi_frm_hide_menu_item(MENU8237_SCR8093_MNGCALL_MENU_MAIN);
- #endif /* __MMI_WLAN_FEATURES__ */
- PhnsetFlightModeSaveStatusIconFlags();
- RemoveStatusIconsForSimRemoved();
- UpdateStatusIcons();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_sim_error_restore_sim_access_profile_menu_items
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_sim_error_restore_sim_access_profile_menu_items(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- mmi_frm_unhide_menu_item(MENU_IDLE_SCR_DISP); /* Hide "Display Characteristic" in No SIM screen */
- mmi_frm_unhide_menu_item(MENU9146_WELCOME_TEXT); /* Hide "Greeting Text" in No SIM screen */
- mmi_frm_unhide_menu_item(MENU_SETTING_DEDICATED_KEYS); /* Hide "Dedicated key" in No SIM screen */
- #ifdef __MMI_NITZ__
- mmi_frm_unhide_menu_item(MENU9145_SETTIMEANDDATENITZ); /* Hide "Auto update of date and time" in No SIM screen */
- mmi_frm_unhide_menu_item(MENU_SETTING_MENU_TREE);
- #endif /* __MMI_NITZ__ */
- mmi_frm_unhide_menu_item(MENU9169_SIM_LOCK); /* Hide "SIM Lock" in No SIM screen */
- mmi_frm_unhide_menu_item(MENU9167_FIXED_DIAL); /* Hide "Fixed Dial" in No SIM screen */
- mmi_frm_unhide_menu_item(MENU9168_BARRED_DAIL); /* Hide "Barred Dail" in No SIM screen */
- mmi_frm_unhide_menu_item(MENU9174_CP_PIN1); /* Hide "Change Password/PIN1" in No SIM screen */
- mmi_frm_unhide_menu_item(MENU9175_CP_PIN2); /* Hide "Change Password/PIN2" in No SIM screen */
- mmi_frm_unhide_menu_item(MENU_SETTING_SPEED_DIAL); /* Hide "Speed Dial" in No SIM screen */
- #ifdef __MMI_WLAN_FEATURES__
- mmi_frm_unhide_menu_item(MENU9186_SELECTION_MODE);
- mmi_frm_unhide_menu_item(MENU9189_GPRS_CONNECTION_MODE);
- #if defined(__GSM_RAT__) && defined(__WCDMA_RAT__)
- mmi_frm_unhide_menu_item(MENU_ID_NETSET_SERVICE_SELECTION);
- mmi_frm_unhide_menu_item(MENU_ID_NETSET_NETWORK_INFO);
- #endif
- #ifdef __MMI_USER_CTRL_PLMN_SUPPORT__
- mmi_frm_unhide_menu_item(MENU_ID_NETSET_USER_CTRL_PLMN);
- #endif
- mmi_frm_unhide_menu_item(MESSAGES_MENU_SMS_MENUID); /* SMS */
- mmi_frm_unhide_menu_item(MESSAGES_MENU_MMS_MENUID); /* MMS */
- mmi_frm_unhide_menu_item(MENU_CHATAPP_ID); /* Chat */
- mmi_frm_unhide_menu_item(MESSAGES_MENU_VMAIL_MENUID); /* Voice Mail */
- mmi_frm_unhide_menu_item(MESSAGES_MENU_CB_MENUID); /* Cell Broadcast */
- mmi_frm_unhide_menu_item(MENU_ID_UM_MAIN); /* Unified Message */
- mmi_frm_unhide_menu_item(MENU_CALL_TIME_SETUP); /* Call Time */
- mmi_frm_unhide_menu_item(MENU_CALL_HISTORY_CALLCOST); /* Call Cost */
- mmi_frm_unhide_menu_item(MENU_CALL_HISTORY_SMSCOUNTER); /* SMS Counter */
- mmi_frm_unhide_menu_item(MENU_CALL_HISTORY_GPRSCOUNTER); /* GPRS Counter */
- mmi_frm_unhide_menu_item(MENU8237_SCR8093_MNGCALL_MENU_MAIN);
- #endif /* __MMI_WLAN_FEATURES__ */
- PhnsetFlightModeRestoreStatusIconFlags();
- UpdateStatusIcons();
- }
- #endif /* __MMI_SIMAP_SUPPORT__ */