SecuritySetup.c
资源名称:mmi.rar [点击查看]
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:181k
源码类别:
MTK
开发平台:
C/C++
- * void
- *****************************************************************************/
- void ExitSECSETChangePWOldPWD(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- history Scr; /* Variable to hold the history data */
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- Scr.scrnID = SCR_ID_SECSET_CHANGEPW_OLD_PWD;
- Scr.entryFuncPtr = EntrySECSETChangePWOldPWD;
- pfnUnicodeStrcpy((S8*) Scr.inputBuffer, (S8*) gSecuritySetupContext.Password);
- GetCategoryHistory(Scr.guiBuffer);
- AddHistory(Scr);
- }
- /*****************************************************************************
- * FUNCTION
- * EntrySECSETChangePWNewPWD
- * DESCRIPTION
- * Entry screen to enter new pwd for all options.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntrySECSETChangePWNewPWD(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer;
- U8 *inputBuffer;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_SECSET_CHANGEPW_NEW_PWD, ExitSECSETChangePWNewPWD, NULL, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_SECSET_CHANGEPW_NEW_PWD);
- inputBuffer = GetCurrInputBuffer(SCR_ID_SECSET_CHANGEPW_NEW_PWD);
- if (inputBuffer == NULL)
- {
- memset(gSecuritySetupContext.NewPassword, 0, (MAX_SIM_SETTING_PASSWD_LEN + 1) * ENCODING_LENGTH);
- }
- else
- {
- pfnUnicodeStrcpy((S8*) gSecuritySetupContext.NewPassword, (S8*) inputBuffer);
- }
- RegisterInputBoxValidationFunction(RstrSettingPasswdScrSoftKeyFunc);
- switch (gSecuritySetupContext.CurrentPassword)
- {
- case 0:
- ShowCategory111Screen(
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- STR_SETTING_NEW_PIN,
- INPUT_TYPE_NUMERIC_PASSWORD,
- gSecuritySetupContext.NewPassword,
- (MAX_SIM_SETTING_PASSWD_LEN + 1),
- NULL,
- NULL);
- break;
- case 1:
- ShowCategory111Screen(
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- STR_SETTING_NEW_PIN2,
- INPUT_TYPE_NUMERIC_PASSWORD,
- gSecuritySetupContext.NewPassword,
- (MAX_SIM_SETTING_PASSWD_LEN + 1),
- NULL,
- guiBuffer);
- break;
- case 2:
- ShowCategory111Screen(
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- STR_SCR9030_NEW_PW_CAPTION,
- INPUT_TYPE_NUMERIC_PASSWORD,
- gSecuritySetupContext.NewPassword,
- (MAX_SIM_SETTING_PASSWD_LEN + 1),
- NULL,
- guiBuffer);
- break;
- }
- SetLeftSoftkeyFunction(EntrySECSETChangePWCfmPWD, KEY_EVENT_UP);
- SetKeyHandler(EntrySECSETChangePWCfmPWD, KEY_POUND, KEY_EVENT_UP);
- SetCategory111RightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- /* micha0606 */
- gSecuritySetupContext.PasswdLenCheckCallBack = EntrySECSETChangePWCfmPWD;
- if (pfnUnicodeStrlen((S8*) gSecuritySetupContext.NewPassword) < MIN_PASSWORD_LENGTH)
- {
- ChangeLeftSoftkey(0, 0);
- ClearKeyHandler(KEY_POUND, KEY_EVENT_UP);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * ExitSECSETChangePWNewPWD
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitSECSETChangePWNewPWD(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- history Scr; /* Variable to hold the history data */
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- Scr.scrnID = SCR_ID_SECSET_CHANGEPW_NEW_PWD;
- Scr.entryFuncPtr = EntrySECSETChangePWNewPWD;
- pfnUnicodeStrcpy((S8*) Scr.inputBuffer, (S8*) gSecuritySetupContext.NewPassword);
- GetCategoryHistory(Scr.guiBuffer);
- AddHistory(Scr);
- }
- /*****************************************************************************
- * FUNCTION
- * EntrySECSETChangePWCfmPWD
- * DESCRIPTION
- * Entry screen to confirm new pwd for all options.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntrySECSETChangePWCfmPWD(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer;
- U8 *inputBuffer;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_SECSET_CHANGEPW_CFM_PWD, ExitSECSETChangePWCfmPWD, NULL, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_SECSET_CHANGEPW_CFM_PWD);
- inputBuffer = GetCurrInputBuffer(SCR_ID_SECSET_CHANGEPW_CFM_PWD);
- if (inputBuffer == NULL)
- {
- memset(gSecuritySetupContext.ConfirmPassword, 0, (MAX_SIM_SETTING_PASSWD_LEN + 1) * ENCODING_LENGTH);
- }
- else
- {
- pfnUnicodeStrcpy((S8*) gSecuritySetupContext.ConfirmPassword, (S8*) inputBuffer);
- }
- RegisterInputBoxValidationFunction(RstrSettingPasswdScrSoftKeyFunc);
- ShowCategory111Screen(
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- STR_SCR9031_CONFIRM_PW_CAPTION,
- INPUT_TYPE_NUMERIC_PASSWORD,
- gSecuritySetupContext.ConfirmPassword,
- (MAX_SIM_SETTING_PASSWD_LEN + 1),
- NULL,
- guiBuffer);
- SetLeftSoftkeyFunction(SendReqToChangePwd, KEY_EVENT_UP);
- SetKeyHandler(SendReqToChangePwd, KEY_POUND, KEY_EVENT_UP);
- SetCategory111RightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- /* micha0606 */
- gSecuritySetupContext.PasswdLenCheckCallBack = SendReqToChangePwd;
- if (pfnUnicodeStrlen((S8*) gSecuritySetupContext.ConfirmPassword) < MIN_PASSWORD_LENGTH)
- {
- ChangeLeftSoftkey(0, 0);
- ClearKeyHandler(KEY_POUND, KEY_EVENT_UP);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * ExitSECSETChangePWCfmPWD
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitSECSETChangePWCfmPWD(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- history Scr; /* Variable to hold the history data */
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- Scr.scrnID = SCR_ID_SECSET_CHANGEPW_CFM_PWD;
- Scr.entryFuncPtr = EntrySECSETChangePWCfmPWD;
- pfnUnicodeStrcpy((S8*) Scr.inputBuffer, (S8*) gSecuritySetupContext.ConfirmPassword);
- GetCategoryHistory(Scr.guiBuffer);
- AddHistory(Scr);
- }
- /*****************************************************************************
- * FUNCTION
- * SendReqToChangePwd
- * DESCRIPTION
- * Make the req to L4 for change pwd of Phonelock,Pin1/Pin2.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void SendReqToChangePwd(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MYQUEUE msgStruct;
- PASSWORDREQ *passWord;
- historyNode *History;
- S8 pOutBuffer[(MAX_SIM_SETTING_PASSWD_LEN + 1) + 1];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- memset(pOutBuffer, 0, (MAX_SIM_SETTING_PASSWD_LEN + 1) + 1);
- //micha0716
- // passWord = OslConstructDataPtr(sizeof (PASSWORDREQ));
- if ((pfnUnicodeStrcmp((PS8) gSecuritySetupContext.NewPassword, (PS8) gSecuritySetupContext.ConfirmPassword) == 0))
- {
- /* micha0716 */
- passWord = OslConstructDataPtr(sizeof(PASSWORDREQ));
- UnicodeToAnsii(pOutBuffer, (PS8) gSecuritySetupContext.Password);
- memcpy(passWord->old, pOutBuffer, (MAX_SIM_SETTING_PASSWD_LEN + 1));
- memset(pOutBuffer, 0, (MAX_SIM_SETTING_PASSWD_LEN + 1) + 1);
- UnicodeToAnsii(pOutBuffer, (PS8) gSecuritySetupContext.NewPassword);
- memcpy(passWord->new1, pOutBuffer, (MAX_SIM_SETTING_PASSWD_LEN + 1));
- memset(pOutBuffer, 0, (MAX_SIM_SETTING_PASSWD_LEN + 1) + 1);
- UnicodeToAnsii(pOutBuffer, (PS8) gSecuritySetupContext.ConfirmPassword);
- memcpy(passWord->new2, pOutBuffer, (MAX_SIM_SETTING_PASSWD_LEN + 1));
- switch (gSecuritySetupContext.CurrentPassword)
- {
- case 0:
- passWord->type = MMI_SETTING_TYPE_CHV1;
- SetProtocolEventHandler(SECSETChangePasswordPIN1Rsp, PRT_MMI_SMU_CHANGE_PASSWORD_RSP);
- break;
- case 1:
- passWord->type = MMI_SETTING_TYPE_CHV2;
- SetProtocolEventHandler(SECSETChangePasswordPIN2Rsp, PRT_MMI_SMU_CHANGE_PASSWORD_RSP);
- break;
- case 2:
- passWord->type = MMI_SETTING_TYPE_PHONELOCK;
- SetProtocolEventHandler(SECSETChangePasswordPhoneRsp, PRT_MMI_SMU_CHANGE_PASSWORD_RSP);
- break;
- default:
- break;
- }
- ClearInputEventHandler(MMI_DEVICE_ALL);
- msgStruct.oslSrcId = MOD_MMI;
- msgStruct.oslDestId = MOD_L4C;
- /* micha1229 */
- msgStruct.oslMsgId = PRT_MMI_SMU_CHANGE_PASSWORD_REQ;
- msgStruct.oslSapId = INVALID_SAP;
- msgStruct.oslDataPtr = (oslParaType*) passWord;
- msgStruct.oslPeerBuffPtr = NULL;
- OslMsgSendExtQueue(&msgStruct);
- }
- else
- {
- memset(gSecuritySetupContext.NewPassword, 0, (MAX_SIM_SETTING_PASSWD_LEN + 1) * ENCODING_LENGTH);
- memset(gSecuritySetupContext.ConfirmPassword, 0, (MAX_SIM_SETTING_PASSWD_LEN + 1) * ENCODING_LENGTH);
- switch (gSecuritySetupContext.CurrentPassword)
- {
- case 0:
- DisplayPopup(
- (PU8) GetString(STR_DIFF_PIN),
- IMG_GLOBAL_ERROR,
- 0,
- ST_NOTIFYDURATION,
- ERROR_TONE);
- DeleteUptoScrID(SCR_ID_SECSET_CHANGEPW_NEW_PWD);
- if (GetHistoryScrID(SCR_ID_SECSET_CHANGEPW_NEW_PWD, &History) == ST_SUCCESS)
- {
- if (History->inputBuffer != NULL)
- {
- memset(History->inputBuffer, 0, ENCODING_LENGTH);
- }
- if (History->guiBuffer != NULL)
- {
- memset(History->guiBuffer, 0, 2);
- }
- }
- break;
- case 1:
- DisplayPopup((PU8) GetString(STR_DIFF_PIN2), IMG_GLOBAL_ERROR, 0, ST_NOTIFYDURATION, ERROR_TONE);
- DeleteUptoScrID(SCR_ID_SECSET_CHANGEPW_NEW_PWD);
- if (GetHistoryScrID(SCR_ID_SECSET_CHANGEPW_NEW_PWD, &History) == ST_SUCCESS)
- {
- if (History->inputBuffer != NULL)
- {
- memset(History->inputBuffer, 0, ENCODING_LENGTH);
- }
- if (History->guiBuffer != NULL)
- {
- memset(History->guiBuffer, 0, 2);
- }
- }
- break;
- case 2:
- DisplayPopup((PU8) GetString(STR_DIFF_PHONE), IMG_GLOBAL_ERROR, 0, ST_NOTIFYDURATION, ERROR_TONE);
- DeleteUptoScrID(SCR_ID_SECSET_CHANGEPW_NEW_PWD);
- if (GetHistoryScrID(SCR_ID_SECSET_CHANGEPW_NEW_PWD, &History) == ST_SUCCESS)
- {
- if (History->inputBuffer != NULL)
- {
- memset(History->inputBuffer, 0, ENCODING_LENGTH);
- }
- if (History->guiBuffer != NULL)
- {
- memset(History->guiBuffer, 0, 2);
- }
- }
- break;
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * SECSETChangePasswordPhoneRsp
- * DESCRIPTION
- * Response handler of change phonelock password req.
- * PARAMETERS
- * info [?]
- * RETURNS
- * void
- *****************************************************************************/
- void SECSETChangePasswordPhoneRsp(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- RESULTSTRUCT *resp;
- historyNode *History;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- resp = (RESULTSTRUCT*) (info);
- memset(gSecuritySetupContext.Password, 0, (MAX_SIM_SETTING_PASSWD_LEN + 1) * ENCODING_LENGTH);
- memset(gSecuritySetupContext.NewPassword, 0, (MAX_SIM_SETTING_PASSWD_LEN + 1) * ENCODING_LENGTH);
- memset(gSecuritySetupContext.ConfirmPassword, 0, (MAX_SIM_SETTING_PASSWD_LEN + 1) * ENCODING_LENGTH);
- if (resp->result == 1)
- {
- DisplayPopup((PU8) GetString(STR_PHONE_CHANGE), IMG_GLOBAL_ACTIVATED, 1, ST_NOTIFYDURATION, 0);
- DeleteUptoScrID(SCR_ID_SECSET_CHANGE_PASSWORD);
- }
- else
- {
- DisplayPopup((PU8) GetString(STR_SETTING_WRONG), IMG_GLOBAL_ERROR, 0, ST_NOTIFYDURATION, ERROR_TONE);
- DeleteUptoScrID(SCR_ID_SECSET_CHANGEPW_OLD_PWD);
- if (GetHistoryScrID(SCR_ID_SECSET_CHANGEPW_OLD_PWD, &History) == ST_SUCCESS)
- {
- if (History->inputBuffer != NULL)
- {
- memset(History->inputBuffer, 0, ENCODING_LENGTH);
- }
- if (History->guiBuffer != NULL)
- {
- memset(History->guiBuffer, 0, 2);
- }
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * SECSETChangePasswordPIN1Rsp
- * DESCRIPTION
- * Response handler of change PIN1 password req.
- * PARAMETERS
- * info [?]
- * RETURNS
- * void
- *****************************************************************************/
- void SECSETChangePasswordPIN1Rsp(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- mmi_smu_change_password_rsp_struct *resp;
- historyNode *History;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- resp = (mmi_smu_change_password_rsp_struct*) (info);
- FillCountDownNumber(resp->chv_info);
- memset(gSecuritySetupContext.Password, 0, (MAX_SIM_SETTING_PASSWD_LEN + 1) * ENCODING_LENGTH);
- memset(gSecuritySetupContext.NewPassword, 0, (MAX_SIM_SETTING_PASSWD_LEN + 1) * ENCODING_LENGTH);
- memset(gSecuritySetupContext.ConfirmPassword, 0, (MAX_SIM_SETTING_PASSWD_LEN + 1) * ENCODING_LENGTH);
- if (resp->result == 1)
- {
- DisplayPopup((PU8) GetString(STR_PIN_CHANGE), IMG_GLOBAL_ACTIVATED, 1, ST_NOTIFYDURATION, 0);
- if (IsScreenPresent(SCR_ID_SECSET_CHANGE_PASSWORD))
- {
- DeleteScreenIfPresent(SCR_ID_SECSET_CHANGEPW_OLD_PWD);
- DeleteScreenIfPresent(SCR_ID_SECSET_CHANGEPW_NEW_PWD);
- DeleteScreenIfPresent(SCR_ID_SECSET_CHANGEPW_CFM_PWD);
- }
- else
- {
- DeleteUptoScrID(IDLE_SCREEN_ID);
- }
- }
- else if (resp->result == 0 && resp->cause == MMI_SETTING_TYPE_UBCHV1)
- {
- ExitSECSETPUK1();
- /* micha0519, modify all in this file */
- gSecuritySetupContext.PINBlocked = 1;
- g_pwr_context.PowerOnSIMStatus |= MMI_SIM_STATUS_INVALID; /* 0x01: Invalid SIM */
- DisplayPopup((PU8) GetString(STR_SETTING_PIN_BLK), IMG_GLOBAL_ERROR, 0, ST_NOTIFYDURATION, ERROR_TONE);
- if (GetHistoryScrID(SCR_ID_SECSET_PUK1, &History) == ST_SUCCESS)
- {
- if (History->inputBuffer != NULL)
- {
- memset(History->inputBuffer, 0, ENCODING_LENGTH);
- }
- if (History->guiBuffer != NULL)
- {
- memset(History->guiBuffer, 0, 2);
- }
- }
- DeleteUptoScrID(SCR_ID_SECSET_PUK1);
- }
- else
- {
- DisplayPopup((PU8) GetString(STR_WRONG_PIN), IMG_GLOBAL_ERROR, 0, ST_NOTIFYDURATION, ERROR_TONE);
- if (IsScreenPresent(SCR_ID_SECSET_CHANGEPW_OLD_PWD))
- {
- DeleteUptoScrID(SCR_ID_SECSET_CHANGEPW_OLD_PWD);
- if (GetHistoryScrID(SCR_ID_SECSET_CHANGEPW_OLD_PWD, &History) == ST_SUCCESS)
- {
- if (History->inputBuffer != NULL)
- {
- memset(History->inputBuffer, 0, ENCODING_LENGTH);
- }
- if (History->guiBuffer != NULL)
- {
- memset(History->guiBuffer, 0, 2);
- }
- }
- }
- else
- {
- DeleteUptoScrID(IDLE_SCREEN_ID);
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * SECSETChangePasswordPIN2Rsp
- * DESCRIPTION
- * Response handler of change Pin2 password req.
- * PARAMETERS
- * info [?]
- * RETURNS
- * void
- *****************************************************************************/
- void SECSETChangePasswordPIN2Rsp(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- mmi_smu_change_password_rsp_struct *resp;
- historyNode *History;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- resp = (mmi_smu_change_password_rsp_struct*) (info);
- FillCountDownNumber(resp->chv_info);
- memset(gSecuritySetupContext.Password, 0, (MAX_SIM_SETTING_PASSWD_LEN + 1) * ENCODING_LENGTH);
- memset(gSecuritySetupContext.NewPassword, 0, (MAX_SIM_SETTING_PASSWD_LEN + 1) * ENCODING_LENGTH);
- memset(gSecuritySetupContext.ConfirmPassword, 0, (MAX_SIM_SETTING_PASSWD_LEN + 1) * ENCODING_LENGTH);
- if (resp->result == 1)
- {
- DisplayPopup((PU8) GetString(STR_PIN2_CHANGE), IMG_GLOBAL_ACTIVATED, 1, ST_NOTIFYDURATION, 0);
- if (IsScreenPresent(SCR_ID_SECSET_CHANGE_PASSWORD))
- {
- DeleteScreenIfPresent(SCR_ID_SECSET_CHANGEPW_OLD_PWD);
- DeleteScreenIfPresent(SCR_ID_SECSET_CHANGEPW_NEW_PWD);
- DeleteScreenIfPresent(SCR_ID_SECSET_CHANGEPW_CFM_PWD);
- }
- else
- {
- DeleteUptoScrID(IDLE_SCREEN_ID);
- }
- }
- else if (resp->result == 0 && resp->cause == MMI_SETTING_TYPE_UBCHV2)
- {
- ExitSECSETPUK2();
- DisplayPopup((PU8) GetString(STR_SETTING_PIN2_BLK), IMG_GLOBAL_ERROR, 0, ST_NOTIFYDURATION, ERROR_TONE);
- if (GetHistoryScrID(SCR_ID_SECSET_PUK2, &History) == ST_SUCCESS)
- {
- if (History->inputBuffer != NULL)
- {
- memset(History->inputBuffer, 0, ENCODING_LENGTH);
- }
- if (History->guiBuffer != NULL)
- {
- memset(History->guiBuffer, 0, 2);
- }
- }
- DeleteUptoScrID(SCR_ID_SECSET_PUK2);
- }
- else
- {
- DisplayPopup((PU8) GetString(STR_WRONG_PIN2), IMG_GLOBAL_ERROR, 0, ST_NOTIFYDURATION, ERROR_TONE);
- if (IsScreenPresent(SCR_ID_SECSET_CHANGEPW_OLD_PWD))
- {
- DeleteUptoScrID(SCR_ID_SECSET_CHANGEPW_OLD_PWD);
- if (GetHistoryScrID(SCR_ID_SECSET_CHANGEPW_OLD_PWD, &History) == ST_SUCCESS)
- {
- if (History->inputBuffer != NULL)
- {
- memset(History->inputBuffer, 0, ENCODING_LENGTH);
- }
- if (History->guiBuffer != NULL)
- {
- memset(History->guiBuffer, 0, 2);
- }
- }
- }
- else
- {
- DeleteUptoScrID(IDLE_SCREEN_ID);
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * GetPhoneLock
- * DESCRIPTION
- * Get the status of phonelock from NVRAM.
- * PARAMETERS
- * void
- * RETURNS
- * pBOOL
- *
- * Author : Vanita Jain
- *****************************************************************************/
- U8 GetPhoneLock(void)
- {
- #ifdef MMI_ON_HARDWARE_P
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gSecuritySetupContext.PhoneLockStatus = smu_query_phone_lock_enabled();
- if (gSecuritySetupContext.PhoneLockStatus == 1)
- {
- return MMI_TRUE;
- }
- else
- {
- return MMI_FALSE;
- }
- #else /* MMI_ON_HARDWARE_P */
- U8 data = 0;
- S16 error;
- ReadValue(NVRAM_SETTING_PHONELOCK, &data, DS_BYTE, &error);
- gSecuritySetupContext.PhoneLockStatus = data;
- if (gSecuritySetupContext.PhoneLockStatus == 1)
- {
- return MMI_TRUE;
- }
- else if (gSecuritySetupContext.PhoneLockStatus == 0xff)
- {
- data = 0;
- WriteValue(NVRAM_SETTING_PHONELOCK, &data, DS_BYTE, &error);
- return MMI_FALSE;
- }
- else
- {
- return MMI_FALSE;
- }
- #endif /* MMI_ON_HARDWARE_P */
- }
- /*****************************************************************************
- * FUNCTION
- * GetAutoKeypadLockTime
- * DESCRIPTION
- * API to return the Autokeypadlock time.
- * PARAMETERS
- * void
- * RETURNS
- * pBOOL
- *
- * Author : Vanita Jain
- *****************************************************************************/
- SETTING_AKPL_TIME GetAutoKeypadLockTime(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 data = 0;
- S16 error;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ReadValue(NVRAM_SETTING_AUTOKEYPADLOCK_TIME, &data, DS_BYTE, &error);
- if (data == 0xff)
- {
- data = 0;
- WriteValue(NVRAM_SETTING_AUTOKEYPADLOCK_TIME, &data, DS_BYTE, &error);
- }
- return (SETTING_AKPL_TIME) (data);
- }
- /*****************************************************************************
- * FUNCTION
- * SettingChangePasswdPuk
- * DESCRIPTION
- * Displays popup that Pin1/Pin2 changed.
- * PARAMETERS
- * void
- * RETURNS
- * pBOOL(?)
- *
- * Author : Vanita Jain(?)
- *****************************************************************************/
- void SettingChangePasswdPuk(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (gSecuritySetupContext.CurrentPassword == 0)
- {
- DisplayPopup((PU8) GetString(STR_PIN_CHANGE), IMG_GLOBAL_ACTIVATED, 1, ST_NOTIFYDURATION, 0);
- GoBackToPasswordScr();
- }
- else
- {
- DisplayPopup((PU8) GetString(STR_PIN2_CHANGE), IMG_GLOBAL_ACTIVATED, 1, ST_NOTIFYDURATION, 0);
- GoBackToPasswordScr();
- }
- }
- /*****************************************************************************
- * FUNCTION
- * GoBackToPasswordScr
- * DESCRIPTION
- * Delete history upto Changepassword screen.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *
- * Author : Vanita Jain(?)
- *****************************************************************************/
- void GoBackToPasswordScr(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- DeleteUptoScrID(SCR_ID_SECSET_CHANGE_PASSWORD);
- }
- /*****************************************************************************
- * FUNCTION
- * DialSoSPUK1
- * DESCRIPTION
- * Function takes care that from which buffer DialPadBuffer should be filled up.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void DialSoSPUK1(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- pfnUnicodeStrcpy(g_idle_context.DialPadCallBuffer, (S8*) gSecuritySetupContext.NewPassword);
- EntryScrEmergencyCallDialing();
- }
- /*****************************************************************************
- * FUNCTION
- * DialSoSNewPIN1
- * DESCRIPTION
- * Function takes care that from which buffer DialPadBuffer should be filled up.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void DialSoSNewPIN1(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- pfnUnicodeStrcpy(g_idle_context.DialPadCallBuffer, (S8*) gSecuritySetupContext.Password);
- EntryScrEmergencyCallDialing();
- }
- /*****************************************************************************
- * FUNCTION
- * DialSoSNewPIN1Conf
- * DESCRIPTION
- * Function takes care that from which buffer DialPadBuffer should be filled up.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void DialSoSNewPIN1Conf(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- pfnUnicodeStrcpy(g_idle_context.DialPadCallBuffer, (S8*) gSecuritySetupContext.ConfirmPassword);
- EntryScrEmergencyCallDialing();
- }
- /*****************************************************************************
- * FUNCTION
- * EntrySECSETPUK1
- * DESCRIPTION
- * Entry fn for PUK.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntrySECSETPUK1(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer;
- U8 *inputBuffer;
- U8 PassCountdownDisp[MAX_PASS_COUNTDOWN_DISP];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_SECSET_PUK1, ExitSECSETPUK1, NULL, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_SECSET_PUK1);
- inputBuffer = GetCurrInputBuffer(SCR_ID_SECSET_PUK1);
- if (inputBuffer == NULL)
- {
- memset(gSecuritySetupContext.NewPassword, 0, (MAX_SIM_SETTING_PASSWD_LEN + 1) * ENCODING_LENGTH);
- }
- else
- {
- pfnUnicodeStrcpy((S8*) gSecuritySetupContext.NewPassword, (S8*) inputBuffer);
- }
- g_pwr_context.PowerOnSIMStatus |= MMI_SIM_STATUS_INVALID; /* 0x01: Invalid SIM */
- gSecuritySetupContext.PINBlocked = 1;
- RegisterInputBoxValidationFunction(ScrSettingPukValidation);
- FillCountDownString(MMI_SETTING_TYPE_UBCHV1, PassCountdownDisp);
- sprintf(g_idle_context.DialPadCallBuffer, ""); /* reset dial pad for input * to start ssc */
- ShowCategory111Screen(
- STR_GLOBAL_OK, /* OK */
- IMG_GLOBAL_OK,
- STR_SETTING_SOS,
- 0,
- STR_SETTING_PUK,
- INPUT_TYPE_NUMERIC_PASSWORD,
- gSecuritySetupContext.NewPassword,
- (MAX_SIM_SETTING_PASSWD_LEN + 1),
- PassCountdownDisp,
- guiBuffer);
- SetCategory111RightSoftkeyFunction(ShowMakeSOSCallScr, KEY_EVENT_UP);
- SetKeyHandler(DialSoSPUK1, KEY_SEND, KEY_EVENT_UP);
- SetKeyHandler(SSCHandleEnterPUK, KEY_STAR, KEY_EVENT_DOWN);
- ClearKeyHandler(KEY_END, KEY_EVENT_DOWN);
- ClearKeyHandler(KEY_END, KEY_EVENT_UP);
- SetLeftSoftkeyFunction(EntrySECSETPUKNewPIN1, KEY_EVENT_UP);
- SetKeyHandler(EntrySECSETPUKNewPIN1, KEY_POUND, KEY_EVENT_UP);
- /* micha0606 */
- gSecuritySetupContext.PasswdLenCheckCallBack = EntrySECSETPUKNewPIN1;
- if (pfnUnicodeStrlen((S8*) gSecuritySetupContext.NewPassword) < MMI_MIN_PUK_LENGTH)
- {
- ChangeLeftSoftkey(0, 0);
- ClearKeyHandler(KEY_POUND, KEY_EVENT_UP);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * ExitSECSETPUK1
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitSECSETPUK1(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- history Scr; /* Variable to hold the history data */
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- Scr.scrnID = SCR_ID_SECSET_PUK1;
- Scr.entryFuncPtr = EntrySECSETPUK1;
- pfnUnicodeStrcpy((S8*) Scr.inputBuffer, (S8*) gSecuritySetupContext.NewPassword);
- GetCategoryHistory(Scr.guiBuffer);
- AddHistory(Scr);
- }
- /*****************************************************************************
- * FUNCTION
- * EntrySECSETPUKNewPIN1
- * DESCRIPTION
- * Entry fn to enter new PIN
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntrySECSETPUKNewPIN1(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer; /* Buffer holding history data */
- U8 *inputBuffer;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_SECSET_PUK_NEW_PIN1, ExitSECSETNewPIN1, NULL, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_SECSET_PUK_NEW_PIN1);
- inputBuffer = GetCurrInputBuffer(SCR_ID_SECSET_PUK_NEW_PIN1);
- if (inputBuffer == NULL)
- {
- memset(gSecuritySetupContext.Password, 0, (MAX_SIM_SETTING_PASSWD_LEN + 1) * ENCODING_LENGTH);
- }
- else
- {
- memset(gSecuritySetupContext.Password, 0, (MAX_SIM_SETTING_PASSWD_LEN + 1) * ENCODING_LENGTH);
- pfnUnicodeStrcpy((S8*) gSecuritySetupContext.Password, (S8*) inputBuffer);
- }
- RegisterInputBoxValidationFunction(RstrSettingPasswdScrSoftKeyFunc);
- ShowCategory111Screen(
- STR_GLOBAL_OK, /* OK */
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- STR_NEW_PIN1,
- INPUT_TYPE_NUMERIC_PASSWORD,
- gSecuritySetupContext.Password,
- (MAX_SIM_SETTING_PASSWD_LEN + 1),
- NULL,
- guiBuffer);
- ClearKeyHandler(KEY_END, KEY_EVENT_DOWN);
- ClearKeyHandler(KEY_END, KEY_EVENT_UP);
- SetCategory111RightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetLeftSoftkeyFunction(EntrySECSETPUKConfirmPIN1, KEY_EVENT_UP);
- SetKeyHandler(EntrySECSETPUKConfirmPIN1, KEY_POUND, KEY_EVENT_UP);
- SetKeyHandler(DialSoSNewPIN1, KEY_SEND, KEY_EVENT_UP);
- /* micha0606 */
- gSecuritySetupContext.PasswdLenCheckCallBack = EntrySECSETPUKConfirmPIN1;
- if (pfnUnicodeStrlen((S8*) gSecuritySetupContext.Password) < MIN_PASSWORD_LENGTH)
- {
- ChangeLeftSoftkey(0, 0);
- ClearKeyHandler(KEY_POUND, KEY_EVENT_UP);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * ExitSECSETNewPIN1
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitSECSETNewPIN1(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- history Scr; /* Variable to hold the history data */
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- Scr.scrnID = SCR_ID_SECSET_PUK_NEW_PIN1;
- Scr.entryFuncPtr = EntrySECSETPUKNewPIN1;
- pfnUnicodeStrcpy((S8*) Scr.inputBuffer, (S8*) gSecuritySetupContext.Password);
- GetCategoryHistory(Scr.guiBuffer);
- AddHistory(Scr);
- }
- /*****************************************************************************
- * FUNCTION
- * EntrySECSETPUKConfirmPIN1
- * DESCRIPTION
- * ENtry fn for confirm PIN.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntrySECSETPUKConfirmPIN1(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer; /* Buffer holding history data */
- U8 *inputBuffer;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_SECSET_PUK_CONFIRM_PIN1, ExitSECSETNewPIN1Confirm, NULL, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_SECSET_PUK_CONFIRM_PIN1);
- inputBuffer = GetCurrInputBuffer(SCR_ID_SECSET_PUK_CONFIRM_PIN1);
- if (inputBuffer == NULL)
- {
- memset(gSecuritySetupContext.ConfirmPassword, 0, (MAX_SIM_SETTING_PASSWD_LEN + 1) * ENCODING_LENGTH);
- }
- else
- {
- pfnUnicodeStrcpy((S8*) gSecuritySetupContext.ConfirmPassword, (S8*) inputBuffer);
- }
- RegisterInputBoxValidationFunction(RstrSettingPasswdScrSoftKeyFunc);
- ShowCategory111Screen(
- STR_GLOBAL_OK, /* OK */
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- STR_SCR9031_CONFIRM_PW_CAPTION,
- INPUT_TYPE_NUMERIC_PASSWORD,
- gSecuritySetupContext.ConfirmPassword,
- (MAX_SIM_SETTING_PASSWD_LEN + 1),
- NULL,
- guiBuffer);
- ClearKeyHandler(KEY_END, KEY_EVENT_DOWN);
- ClearKeyHandler(KEY_END, KEY_EVENT_UP);
- SetCategory111RightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(ValidateNewPin1, KEY_POUND, KEY_EVENT_UP);
- SetLeftSoftkeyFunction(ValidateNewPin1, KEY_EVENT_UP);
- SetKeyHandler(DialSoSNewPIN1Conf, KEY_SEND, KEY_EVENT_UP);
- /* micha0606 */
- gSecuritySetupContext.PasswdLenCheckCallBack = ValidateNewPin1;
- if (pfnUnicodeStrlen((S8*) gSecuritySetupContext.ConfirmPassword) < MIN_PASSWORD_LENGTH)
- {
- ChangeLeftSoftkey(0, 0);
- ClearKeyHandler(KEY_POUND, KEY_EVENT_UP);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * ExitSECSETNewPIN1Confirm
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitSECSETNewPIN1Confirm(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- history Scr; /* Variable to hold the history data */
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- Scr.scrnID = SCR_ID_SECSET_PUK_CONFIRM_PIN1;
- Scr.entryFuncPtr = EntrySECSETPUKConfirmPIN1;
- pfnUnicodeStrcpy((S8*) Scr.inputBuffer, (S8*) gSecuritySetupContext.ConfirmPassword);
- GetCategoryHistory(Scr.guiBuffer);
- AddHistory(Scr);
- }
- /*****************************************************************************
- * FUNCTION
- * ValidateNewPin1
- * DESCRIPTION
- * validates the length of Both new pin and confirm pin and also
- * Check if both Pin matches.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ValidateNewPin1(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- historyNode *History;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (memcmp
- (gSecuritySetupContext.Password, gSecuritySetupContext.ConfirmPassword,
- ((MAX_SIM_SETTING_PASSWD_LEN + 1) - 1) * ENCODING_LENGTH) == 0)
- {
- SECSETVerifyPINReq(
- MMI_SETTING_TYPE_UBCHV1,
- gSecuritySetupContext.NewPassword,
- gSecuritySetupContext.Password,
- ValidateNewPin1Success);
- }
- else
- {
- DisplayPopup(
- (PU8) GetString(STR_DIFF_PIN),
- IMG_GLOBAL_ERROR,
- 0,
- ST_NOTIFYDURATION,
- ERROR_TONE);
- DeleteUptoScrID(SCR_ID_SECSET_PUK_NEW_PIN1);
- if (GetHistoryScrID(SCR_ID_SECSET_PUK_NEW_PIN1, &History) == ST_SUCCESS)
- {
- if (History->inputBuffer != NULL)
- {
- memset(History->inputBuffer, 0, ENCODING_LENGTH);
- }
- if (History->guiBuffer != NULL)
- {
- memset(History->guiBuffer, 0, 2);
- }
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * ValidateNewPin1Success
- * DESCRIPTION
- * validates the length of Both new pin and confirm pin and also
- * Check if both Pin matches.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ValidateNewPin1Success(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SECSETGetPIN1StatusReq();
- DisplayPopup((PU8) GetString(STR_SETTING_CODE_VERIFIED), IMG_GLOBAL_ACTIVATED, 1, ST_NOTIFYDURATION, SUCCESS_TONE);
- DeleteUptoScrID(IDLE_SCREEN_ID);
- }
- /*****************************************************************************
- * FUNCTION
- * EntrySECSETPUK2
- * DESCRIPTION
- * Entry fn for PUK.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntrySECSETPUK2(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer;
- U8 *inputBuffer;
- U8 PassCountdownDisp[MAX_PASS_COUNTDOWN_DISP];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_SECSET_PUK2, ExitSECSETPUK2, NULL, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_SECSET_PUK2);
- inputBuffer = GetCurrInputBuffer(SCR_ID_SECSET_PUK2);
- if (inputBuffer == NULL)
- {
- memset(gSecuritySetupContext.NewPassword, 0, (MAX_SIM_SETTING_PASSWD_LEN + 1) * ENCODING_LENGTH);
- }
- else
- {
- pfnUnicodeStrcpy((S8*) gSecuritySetupContext.NewPassword, (S8*) inputBuffer);
- }
- RegisterInputBoxValidationFunction(ScrSettingPukValidation);
- FillCountDownString(MMI_SETTING_TYPE_UBCHV2, PassCountdownDisp);
- ShowCategory111Screen(
- STR_GLOBAL_OK, /* OK */
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- STR_SETTING_ENTER_PUK2,
- INPUT_TYPE_NUMERIC_PASSWORD,
- gSecuritySetupContext.NewPassword,
- (MAX_SIM_SETTING_PASSWD_LEN + 1),
- PassCountdownDisp,
- guiBuffer);
- SetCategory111RightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetLeftSoftkeyFunction(EntrySECSETPUK2NewPIN2, KEY_EVENT_UP);
- SetKeyHandler(EntrySECSETPUK2NewPIN2, KEY_POUND, KEY_EVENT_UP);
- /* micha0606 */
- gSecuritySetupContext.PasswdLenCheckCallBack = EntrySECSETPUK2NewPIN2;
- if (pfnUnicodeStrlen((S8*) gSecuritySetupContext.NewPassword) < MMI_MIN_PUK_LENGTH)
- {
- ChangeLeftSoftkey(0, 0);
- ClearKeyHandler(KEY_POUND, KEY_EVENT_UP);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * ExitSECSETPUK2
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitSECSETPUK2(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- history Scr; /* Variable to hold the history data */
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- Scr.scrnID = SCR_ID_SECSET_PUK2;
- Scr.entryFuncPtr = EntrySECSETPUK2;
- pfnUnicodeStrcpy((S8*) Scr.inputBuffer, (S8*) gSecuritySetupContext.NewPassword);
- GetCategoryHistory(Scr.guiBuffer);
- AddHistory(Scr);
- }
- /*****************************************************************************
- * FUNCTION
- * EntrySECSETPUK2NewPIN2
- * DESCRIPTION
- * Entry fn to enter new PIN
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntrySECSETPUK2NewPIN2(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer; /* Buffer holding history data */
- U8 *inputBuffer;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_SECSET_PUK2_NEW_PIN2, ExitSECSETNewPIN2, NULL, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_SECSET_PUK2_NEW_PIN2);
- inputBuffer = GetCurrInputBuffer(SCR_ID_SECSET_PUK2_NEW_PIN2);
- if (inputBuffer == NULL)
- {
- memset(gSecuritySetupContext.Password, 0, (MAX_SIM_SETTING_PASSWD_LEN + 1) * ENCODING_LENGTH);
- }
- else
- {
- memset(gSecuritySetupContext.Password, 0, (MAX_SIM_SETTING_PASSWD_LEN + 1) * ENCODING_LENGTH);
- pfnUnicodeStrcpy((S8*) gSecuritySetupContext.Password, (S8*) inputBuffer);
- }
- RegisterInputBoxValidationFunction(RstrSettingPasswdScrSoftKeyFunc);
- ShowCategory111Screen(
- STR_GLOBAL_OK, /* OK */
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- STR_SETTING_ENTER_NEW_PIN2,
- INPUT_TYPE_NUMERIC_PASSWORD,
- gSecuritySetupContext.Password,
- (MAX_SIM_SETTING_PASSWD_LEN + 1),
- NULL,
- guiBuffer);
- SetCategory111RightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetLeftSoftkeyFunction(EntrySECSETPUK2ConfirmPIN2, KEY_EVENT_UP);
- SetKeyHandler(EntrySECSETPUK2ConfirmPIN2, KEY_POUND, KEY_EVENT_UP);
- /* micha0606 */
- gSecuritySetupContext.PasswdLenCheckCallBack = EntrySECSETPUK2ConfirmPIN2;
- if (pfnUnicodeStrlen((S8*) gSecuritySetupContext.Password) < MIN_PASSWORD_LENGTH)
- {
- ChangeLeftSoftkey(0, 0);
- ClearKeyHandler(KEY_POUND, KEY_EVENT_UP);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * ExitSECSETNewPIN2
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitSECSETNewPIN2(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- history Scr; /* Variable to hold the history data */
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- Scr.scrnID = SCR_ID_SECSET_PUK2_NEW_PIN2;
- Scr.entryFuncPtr = EntrySECSETPUK2NewPIN2;
- pfnUnicodeStrcpy((S8*) Scr.inputBuffer, (S8*) gSecuritySetupContext.Password);
- GetCategoryHistory(Scr.guiBuffer);
- AddHistory(Scr);
- }
- /*****************************************************************************
- * FUNCTION
- * EntrySECSETPUK2ConfirmPIN2
- * DESCRIPTION
- * ENtry fn for confirm PIN.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntrySECSETPUK2ConfirmPIN2(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer; /* Buffer holding history data */
- U8 *inputBuffer;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_SECSET_PUK2_CONFIRM_PIN2, ExitSECSETNewPIN2Confirm, NULL, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_SECSET_PUK2_CONFIRM_PIN2);
- inputBuffer = GetCurrInputBuffer(SCR_ID_SECSET_PUK2_CONFIRM_PIN2);
- if (inputBuffer == NULL)
- {
- memset(gSecuritySetupContext.ConfirmPassword, 0, (MAX_SIM_SETTING_PASSWD_LEN + 1) * ENCODING_LENGTH);
- }
- else
- {
- pfnUnicodeStrcpy((S8*) gSecuritySetupContext.ConfirmPassword, (S8*) inputBuffer);
- }
- RegisterInputBoxValidationFunction(RstrSettingPasswdScrSoftKeyFunc);
- ShowCategory111Screen(
- STR_GLOBAL_OK, /* OK */
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- STR_SCR9031_CONFIRM_PW_CAPTION,
- INPUT_TYPE_NUMERIC_PASSWORD,
- gSecuritySetupContext.ConfirmPassword,
- (MAX_SIM_SETTING_PASSWD_LEN + 1),
- NULL,
- guiBuffer);
- SetCategory111RightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(ValidateNewPin2, KEY_POUND, KEY_EVENT_UP);
- SetLeftSoftkeyFunction(ValidateNewPin2, KEY_EVENT_UP);
- /* micha0606 */
- gSecuritySetupContext.PasswdLenCheckCallBack = ValidateNewPin2;
- if (pfnUnicodeStrlen((S8*) gSecuritySetupContext.ConfirmPassword) < MIN_PASSWORD_LENGTH)
- {
- ChangeLeftSoftkey(0, 0);
- ClearKeyHandler(KEY_POUND, KEY_EVENT_UP);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * ExitSECSETNewPIN2Confirm
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitSECSETNewPIN2Confirm(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- history Scr; /* Variable to hold the history data */
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- Scr.scrnID = SCR_ID_SECSET_PUK2_CONFIRM_PIN2;
- Scr.entryFuncPtr = EntrySECSETPUK2ConfirmPIN2;
- pfnUnicodeStrcpy((S8*) Scr.inputBuffer, (S8*) gSecuritySetupContext.ConfirmPassword);
- GetCategoryHistory(Scr.guiBuffer);
- AddHistory(Scr);
- }
- /*****************************************************************************
- * FUNCTION
- * ValidateNewPin2
- * DESCRIPTION
- * validates the length of Both new pin and confirm pin and also
- * Check if both Pin matches.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ValidateNewPin2(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- historyNode *History;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (memcmp
- (gSecuritySetupContext.Password, gSecuritySetupContext.ConfirmPassword,
- ((MAX_SIM_SETTING_PASSWD_LEN + 1) - 1) * ENCODING_LENGTH) == 0)
- {
- SECSETVerifyPINReq(
- MMI_SETTING_TYPE_UBCHV2,
- gSecuritySetupContext.NewPassword,
- gSecuritySetupContext.Password,
- NULL);
- }
- else
- {
- /* micha0702 */
- DisplayPopup((PU8) GetString(STR_DIFF_PIN2), IMG_GLOBAL_ERROR, 0, ST_NOTIFYDURATION, ERROR_TONE);
- DeleteUptoScrID(SCR_ID_SECSET_PUK2_NEW_PIN2);
- if (GetHistoryScrID(SCR_ID_SECSET_PUK2_NEW_PIN2, &History) == ST_SUCCESS)
- {
- if (History->inputBuffer != NULL)
- {
- memset(History->inputBuffer, 0, ENCODING_LENGTH);
- }
- if (History->guiBuffer != NULL)
- {
- memset(History->guiBuffer, 0, 2);
- }
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * SECSETVerifyPINReq
- * DESCRIPTION
- * Send PUK to L4 for verification.
- * PARAMETERS
- * pin_type [IN]
- * ucs2_pin [?]
- * ucs2_new_pin [?]
- * success_callback [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void SECSETVerifyPINReq(U8 pin_type, U8 *ucs2_pin, U8 *ucs2_new_pin, FuncPtr success_callback)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 tempBuffer[(MAX_SIM_SETTING_PASSWD_LEN + 1)];
- MYQUEUE Message;
- MMIPHONEVERIFYREQ *local_data;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ClearInputEventHandler(MMI_DEVICE_ALL);
- ClearKeyHandler(KEY_END, KEY_EVENT_DOWN); /* So that user can't go to idle screen. */
- ClearKeyHandler(KEY_END, KEY_EVENT_UP);
- #ifdef __MMI_TOUCH_SCREEN__
- wgui_clear_pen_handlers();
- #endif
- Message.oslSrcId = MOD_MMI;
- Message.oslDestId = MOD_L4C;
- Message.oslMsgId = PRT_MMI_SMU_VERIFY_PIN_REQ;
- local_data = (MMIPHONEVERIFYREQ*) OslConstructDataPtr(sizeof(MMIPHONEVERIFYREQ));
- memset(local_data->pin, ' ', (MAX_SIM_SETTING_PASSWD_LEN + 1));
- memset(local_data->new_pin, ' ', (MAX_SIM_SETTING_PASSWD_LEN + 1));
- local_data->pin_type = pin_type; /* _smu_security_type_enum */
- memset(tempBuffer, 0, (MAX_SIM_SETTING_PASSWD_LEN + 1));
- UnicodeNToAnsii((S8*) tempBuffer, (S8*) ucs2_pin, (MAX_SIM_SETTING_PASSWD_LEN + 1));
- memcpy(local_data->pin, tempBuffer, (MAX_SIM_SETTING_PASSWD_LEN + 1));
- memset(tempBuffer, 0, (MAX_SIM_SETTING_PASSWD_LEN + 1));
- UnicodeNToAnsii((S8*) tempBuffer, (S8*) ucs2_new_pin, (MAX_SIM_SETTING_PASSWD_LEN + 1));
- memcpy(local_data->new_pin, tempBuffer, (MAX_SIM_SETTING_PASSWD_LEN + 1));
- if (success_callback != NULL)
- {
- gSecuritySetupContext.VerifyPassSuccessCallBack = success_callback;
- }
- SetProtocolEventHandler(SECSETVerifyPINRsp, PRT_MMI_SMU_VERIFY_PIN_RSP);
- Message.oslDataPtr = (oslParaType*) local_data;
- Message.oslPeerBuffPtr = NULL;
- OslMsgSendExtQueue(&Message);
- }
- /*****************************************************************************
- * FUNCTION
- * SECSETVerifyPINRsp
- * DESCRIPTION
- *
- * PARAMETERS
- * info [?]
- * RETURNS
- * void
- *****************************************************************************/
- void SECSETVerifyPINRsp(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- mmi_smu_verify_pin_rsp_struct *local_data = (mmi_smu_verify_pin_rsp_struct*) info;
- historyNode *History;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- FillCountDownNumber(local_data->chv_info);
- gSecuritySetupContext.PINBlocked = 0;
- /* diamond, 2006/04/17 Not reset invalid sim flag because verify pin request may be used in no sim case */
- if (mmi_bootup_is_sim_removed() == MMI_FALSE)
- {
- g_pwr_context.PowerOnSIMStatus &= ~MMI_SIM_STATUS_INVALID; /* 0x01: Invalid SIM reset */
- }
- switch (local_data->next_type)
- {
- case MMI_SETTING_TYPE_NO_REQUIRED:
- if (gSecuritySetupContext.VerifyPassSuccessCallBack != NULL)
- {
- (*gSecuritySetupContext.VerifyPassSuccessCallBack) ();
- gSecuritySetupContext.VerifyPassSuccessCallBack = NULL;
- }
- else
- {
- PRINT_INFORMATION_2((MMI_TRACE_G7_MISC, "[SecuritySetup.c] SECSETVerifyPINRsp ABNORMAL"));
- DisplayPopup((PU8) GetString(STR_GLOBAL_DONE), IMG_GLOBAL_ACTIVATED, 1, ST_NOTIFYDURATION, 0);
- DeleteUptoScrID(IDLE_SCREEN_ID);
- }
- break;
- case MMI_SETTING_TYPE_PHONELOCK:
- DisplayPopup((PU8) GetString(STR_SETTING_WRONG), IMG_GLOBAL_ERROR, 0, ST_NOTIFYDURATION, ERROR_TONE);
- if (GetHistoryScrID(SCR_RESTORE, &History) == ST_SUCCESS)
- {
- if (History->inputBuffer != NULL)
- {
- memset(History->inputBuffer, 0, ENCODING_LENGTH);
- }
- if (History->guiBuffer != NULL)
- {
- memset(History->guiBuffer, 0, 2);
- }
- }
- memset(gPhonePassword, 0, (MAX_SIM_SETTING_PASSWD_LEN + 1));
- break;
- case MMI_SETTING_TYPE_CHV1:
- DisplayPopup((PU8) GetString(STR_WRONG_PIN), IMG_GLOBAL_ERROR, 0, ST_NOTIFYDURATION, ERROR_TONE);
- break;
- case MMI_SETTING_TYPE_CHV2:
- DisplayPopup((PU8) GetString(STR_WRONG_PIN2), IMG_GLOBAL_ERROR, 0, ST_NOTIFYDURATION, ERROR_TONE);
- if (GetHistoryScrID(SCR_ID_SECSET_PIN2, &History) == ST_SUCCESS)
- {
- if (History->inputBuffer != NULL)
- {
- memset(History->inputBuffer, 0, ENCODING_LENGTH);
- }
- if (History->guiBuffer != NULL)
- {
- memset(History->guiBuffer, 0, 2);
- }
- }
- DeleteUptoScrID(SCR_ID_SECSET_PIN2);
- break;
- case MMI_SETTING_TYPE_UBCHV1:
- DisplayPopup((PU8) GetString(STR_SETTING_WRONG_PUK), IMG_GLOBAL_ERROR, 0, ST_NOTIFYDURATION, ERROR_TONE);
- if (GetHistoryScrID(SCR_ID_SECSET_PUK1, &History) == ST_SUCCESS)
- {
- if (History->inputBuffer != NULL)
- {
- memset(History->inputBuffer, 0, ENCODING_LENGTH);
- }
- if (History->guiBuffer != NULL)
- {
- memset(History->guiBuffer, 0, 2);
- }
- }
- DeleteUptoScrID(SCR_ID_SECSET_PUK1);
- /* micha0915 */
- RemoveSSReqScr();
- break;
- case MMI_SETTING_TYPE_UBCHV2:
- if (GetExitScrnID() == SCR_ID_SECSET_PIN2)
- {
- ClearExitHandler();
- ExitSECSETPUK2();
- DisplayPopup((PU8) GetString(STR_SETTING_PIN2_BLK), IMG_GLOBAL_ERROR, 0, ST_NOTIFYDURATION, ERROR_TONE);
- }
- else
- {
- DisplayPopup(
- (PU8) GetString(STR_SETTING_WRONG_PUK2),
- IMG_GLOBAL_ERROR,
- 0,
- ST_NOTIFYDURATION,
- ERROR_TONE);
- DeleteUptoScrID(SCR_ID_SECSET_PUK2);
- /* micha0915 */
- RemoveSSReqScr();
- }
- if (GetHistoryScrID(SCR_ID_SECSET_PUK2, &History) == ST_SUCCESS)
- {
- if (History->inputBuffer != NULL)
- {
- memset(History->inputBuffer, 0, ENCODING_LENGTH);
- }
- if (History->guiBuffer != NULL)
- {
- memset(History->guiBuffer, 0, 2);
- }
- }
- break;
- case MMI_SETTING_TYPE_CHV1_BLOCKED:
- break;
- case MMI_SETTING_TYPE_CHV2_BLOCKED:
- DisplayPopup(
- (PU8) GetString(STR_SETTING_PIN2_BLOCK_MSG),
- IMG_GLOBAL_ERROR,
- 0,
- ST_NOTIFYDURATION,
- ERROR_TONE);
- DeleteNScrId(SCR_ID_SECSET_MAIN);
- break;
- case MMI_SETTING_TYPE_SIM_CARD_BLOCKED:
- EntryScrnSimBlockRsp();
- break;
- case MMI_SETTING_TYPE_UBCHV2_BLOCKED:
- DisplayPopup(
- (PU8) GetString(STR_ID_PIN2_NOT_SUPPORT),
- IMG_GLOBAL_ERROR,
- 0,
- ST_NOTIFYDURATION,
- ERROR_TONE);
- DeleteNScrId(SCR_ID_SECSET_PUK2);
- break;
- case MMI_SETTING_TYPE_UBCHV1_CHV1_NOT_LOCK:
- break;
- case MMI_SETTING_TYPE_UNSPECIFIED:
- DisplayPopup((PU8) GetString(STR_ID_SECSET_UNSPECIFIED_ERROR), IMG_GLOBAL_UNFINISHED, 1, ST_NOTIFYDURATION, ERROR_TONE);
- break;
- default:
- break;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * EntrySECSETSIMLockPIN1
- * DESCRIPTION
- * Entry fn to get SIM lock pwd from user.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntrySECSETSIMLockPIN1(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer; /* Buffer holding history data */
- U8 *inputBuffer;
- U8 PassCountdownDisp[MAX_PASS_COUNTDOWN_DISP];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ID_SECSET_SIM_LOCK_PIN1, ExitSECSETSIMLockPIN1, NULL, NULL);
- guiBuffer = GetCurrGuiBuffer(SCR_ID_SECSET_SIM_LOCK_PIN1);
- inputBuffer = GetCurrInputBuffer(SCR_ID_SECSET_SIM_LOCK_PIN1);
- if (inputBuffer == NULL)
- {
- memset(gSecuritySetupContext.Password, 0, (MAX_SIM_SETTING_PASSWD_LEN + 1) * ENCODING_LENGTH);
- }
- else
- {
- pfnUnicodeStrcpy((S8*) gSecuritySetupContext.Password, (S8*) inputBuffer);
- }
- RegisterInputBoxValidationFunction(RstrSettingPasswdScrSoftKeyFunc);
- FillCountDownString(MMI_SETTING_TYPE_CHV1, PassCountdownDisp);
- /* START VIJAY PMT 20060103 */
- #if defined UI_SMALL_PIN_EDITOR_SCREEN
- enable_resized_small_screen();
- #endif
- /* END VIJAY PMT 20060103 */
- ShowCategory111Screen(
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- STR_SCR9028_PIN1_CAPTION,
- INPUT_TYPE_NUMERIC_PASSWORD,
- gSecuritySetupContext.Password,
- (MAX_SIM_SETTING_PASSWD_LEN + 1),
- PassCountdownDisp,
- guiBuffer);
- SetCategory111RightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetLeftSoftkeyFunction(SECSETSetSIMLockReq, KEY_EVENT_UP);
- SetKeyHandler(SECSETSetSIMLockReq, KEY_POUND, KEY_EVENT_UP);
- /* micha0606 */
- gSecuritySetupContext.PasswdLenCheckCallBack = SECSETSetSIMLockReq;
- if (pfnUnicodeStrlen((S8*) gSecuritySetupContext.Password) < MIN_PASSWORD_LENGTH)
- {
- ChangeLeftSoftkey(0, 0);
- ClearKeyHandler(KEY_POUND, KEY_EVENT_UP);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * ExitSECSETSIMLockPIN1
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitSECSETSIMLockPIN1(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- history Scr; /* Variable to hold the history data */
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- Scr.scrnID = SCR_ID_SECSET_SIM_LOCK_PIN1;
- Scr.entryFuncPtr = EntrySECSETSIMLockPIN1;
- pfnUnicodeStrcpy((S8*) Scr.inputBuffer, (S8*) gSecuritySetupContext.Password);
- GetCategoryHistory(Scr.guiBuffer);
- AddHistory(Scr);
- }
- /*****************************************************************************
- * FUNCTION
- * SECSETSetFdlModeReq
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void SECSETSetFdlModeReq(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MYQUEUE msgStruct;
- MMISMUDIALMODEREQSTRUCT *dailStruct;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- dailStruct = OslConstructDataPtr(sizeof(MMISMUDIALMODEREQSTRUCT));
- if (gSecuritySetupContext.FdlStatus)
- {
- dailStruct->on_off = (U8) MMI_OFF_OPTION;
- }
- else
- {
- dailStruct->on_off = (U8) MMI_ON_OPTION;
- }
- dailStruct->type = MMI_TYPE_FDN;
- memset(dailStruct->pin, 0, (MAX_SIM_SETTING_PASSWD_LEN + 1));
- SetProtocolEventHandler(SECSETSetFdlModeRsp, PRT_MMI_SMU_SET_DIAL_MODE_RSP);
- msgStruct.oslSrcId = MOD_MMI;
- msgStruct.oslDestId = MOD_L4C;
- /* micha1229 */
- msgStruct.oslMsgId = PRT_MMI_SMU_SET_DIAL_MODE_REQ;
- msgStruct.oslSapId = INVALID_SAP;
- msgStruct.oslDataPtr = (oslParaType*) dailStruct;
- msgStruct.oslPeerBuffPtr = NULL;
- OslMsgSendExtQueue(&msgStruct);
- }
- /*****************************************************************************
- * FUNCTION
- * SECSETSetFdlModeRsp
- * DESCRIPTION
- *
- * PARAMETERS
- * info [?]
- * RETURNS
- * void
- *****************************************************************************/
- void SECSETSetFdlModeRsp(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- mmi_smu_set_dial_mode_rsp_struct *resp;
- U16 index;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- index = GetCurrHiliteID();
- memset((S8*) hintData[(index)], 0, MAX_SUB_MENU_SIZE);
- resp = (mmi_smu_set_dial_mode_rsp_struct*) (info);
- if (resp->result == 1)
- {
- gSecuritySetupContext.FdlStatus = !gSecuritySetupContext.FdlStatus;
- g_phb_cntx.phb_ready = FALSE;
- if (gSecuritySetupContext.FdlStatus)
- {
- pfnUnicodeStrncpy((PS8) hintData[index], (PS8) GetString(STR_GLOBAL_ON), MAX_SUBMENU_CHARACTERS);
- Category52ChangeItemDescription(0, hintData[index]);
- change_left_softkey(STR_GLOBAL_OFF, 0);
- DisplayPopup((PU8) GetString(STR_FDL_IS_ON), IMG_GLOBAL_ACTIVATED, 1, ST_NOTIFYDURATION, 0);
- }
- else
- {
- pfnUnicodeStrncpy((PS8) hintData[index], (PS8) GetString(STR_GLOBAL_OFF), MAX_SUBMENU_CHARACTERS);
- Category52ChangeItemDescription(0, hintData[index]);
- change_left_softkey(STR_GLOBAL_ON, 0);
- DisplayPopup((PU8) GetString(STR_FDL_IS_OFF), IMG_GLOBAL_ACTIVATED, 1, ST_NOTIFYDURATION, 0);
- }
- }
- else
- {
- DisplayPopup((PU8) GetString(STR_GLOBAL_UNFINISHED), IMG_GLOBAL_ERROR, 0, ST_NOTIFYDURATION, ERROR_TONE);
- }
- DeleteScreenIfPresent(SCR_ID_SECSET_PIN2);
- DeleteScreenIfPresent(SCR_ID_SECSET_PUK2);
- DeleteScreenIfPresent(SCR_ID_SECSET_PUK2_NEW_PIN2);
- DeleteScreenIfPresent(SCR_ID_SECSET_PUK2_CONFIRM_PIN2);
- }
- /*****************************************************************************
- * FUNCTION
- * SECSETSetBdlModeReq
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void SECSETSetBdlModeReq(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MYQUEUE msgStruct;
- MMISMUDIALMODEREQSTRUCT *dailStruct;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- dailStruct = OslConstructDataPtr(sizeof(MMISMUDIALMODEREQSTRUCT));
- if (gSecuritySetupContext.BdlStatus)
- {
- dailStruct->on_off = (U8) MMI_OFF_OPTION;
- }
- else
- {
- dailStruct->on_off = (U8) MMI_ON_OPTION;
- }
- dailStruct->type = MMI_TYPE_BDN;
- memset(dailStruct->pin, 0, (MAX_SIM_SETTING_PASSWD_LEN + 1));
- SetProtocolEventHandler(SECSETSetBdlModeRsp, PRT_MMI_SMU_SET_DIAL_MODE_RSP);
- msgStruct.oslSrcId = MOD_MMI;
- msgStruct.oslDestId = MOD_L4C;
- /* micha1229 */
- msgStruct.oslMsgId = PRT_MMI_SMU_SET_DIAL_MODE_REQ;
- msgStruct.oslSapId = INVALID_SAP;
- msgStruct.oslDataPtr = (oslParaType*) dailStruct;
- msgStruct.oslPeerBuffPtr = NULL;
- OslMsgSendExtQueue(&msgStruct);
- }
- /*****************************************************************************
- * FUNCTION
- * SECSETSetBdlModeRsp
- * DESCRIPTION
- *
- * PARAMETERS
- * info [?]
- * RETURNS
- * void
- *****************************************************************************/
- void SECSETSetBdlModeRsp(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- mmi_smu_set_dial_mode_rsp_struct *resp;
- U16 index;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- index = GetCurrHiliteID();
- memset((S8*) hintData[(index)], 0, MAX_SUB_MENU_SIZE);
- resp = (mmi_smu_set_dial_mode_rsp_struct*) (info);
- if (resp->result == 1)
- {
- gSecuritySetupContext.BdlStatus = !gSecuritySetupContext.BdlStatus;
- g_phb_cntx.phb_ready = FALSE;
- if (gSecuritySetupContext.BdlStatus)
- {
- pfnUnicodeStrncpy((PS8) hintData[index], (PS8) GetString(STR_GLOBAL_ON), MAX_SUBMENU_CHARACTERS);
- Category52ChangeItemDescription(0, hintData[index]);
- change_left_softkey(STR_GLOBAL_OFF, 0);
- DisplayPopup((PU8) GetString(STR_FDL_IS_ON), IMG_GLOBAL_ACTIVATED, 1, ST_NOTIFYDURATION, 0);
- }
- else
- {
- pfnUnicodeStrncpy((PS8) hintData[index], (PS8) GetString(STR_GLOBAL_OFF), MAX_SUBMENU_CHARACTERS);
- Category52ChangeItemDescription(0, hintData[index]);
- change_left_softkey(STR_GLOBAL_ON, 0);
- DisplayPopup((PU8) GetString(STR_FDL_IS_OFF), IMG_GLOBAL_ACTIVATED, 1, ST_NOTIFYDURATION, 0);
- }
- }
- else
- {
- DisplayPopup((PU8) GetString(STR_GLOBAL_UNFINISHED), IMG_GLOBAL_ERROR, 0, ST_NOTIFYDURATION, ERROR_TONE);
- }
- DeleteScreenIfPresent(SCR_ID_SECSET_PIN2);
- DeleteScreenIfPresent(SCR_ID_SECSET_PUK2);
- DeleteScreenIfPresent(SCR_ID_SECSET_PUK2_NEW_PIN2);
- DeleteScreenIfPresent(SCR_ID_SECSET_PUK2_CONFIRM_PIN2);
- }
- /*****************************************************************************
- * FUNCTION
- * ScrSettingPukValidation
- * DESCRIPTION
- * Fn for length validation at PUk screen
- * PARAMETERS
- * text [?]
- * cursor [?]
- * length [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void ScrSettingPukValidation(U8 *text, U8 *cursor, S32 length)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* micha0606 */
- if ((length) < MMI_MIN_PUK_LENGTH)
- {
- ChangeLeftSoftkey(0, 0);
- ClearKeyHandler(KEY_POUND, KEY_EVENT_UP);
- }
- else
- {
- EnableLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
- SetKeyHandler(gSecuritySetupContext.PasswdLenCheckCallBack, KEY_POUND, KEY_EVENT_UP);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * SECSETGetFdlBdlModeReq
- * DESCRIPTION
- * Send req to L4 to know the status of FDL mode.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void SECSETGetFdlBdlModeReq(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MYQUEUE msgStruct;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetProtocolEventHandler(SECSETGetFdlBdlModeRsp, PRT_MMI_SMU_GET_DIAL_MODE_RSP);
- msgStruct.oslSrcId = MOD_MMI;
- msgStruct.oslDestId = MOD_L4C;
- /* micha1229 */
- msgStruct.oslMsgId = PRT_MMI_SMU_GET_DIAL_MODE_REQ;
- msgStruct.oslSapId = INVALID_SAP;
- msgStruct.oslDataPtr = NULL;
- msgStruct.oslPeerBuffPtr = NULL;
- OslMsgSendExtQueue(&msgStruct);
- }
- /*****************************************************************************
- * FUNCTION
- * SECSETGetFdlBdlModeRsp
- * DESCRIPTION
- * Response handler for req to know the status of FDL mode.
- * PARAMETERS
- * info [?]
- * RETURNS
- * void
- *****************************************************************************/
- void SECSETGetFdlBdlModeRsp(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- DIALMODESTATUSRSPSTRUCT *resp;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- resp = (DIALMODESTATUSRSPSTRUCT*) (info);
- switch (resp->dial_mode)
- {
- case MMI_TYPE_ADN:
- gSecuritySetupContext.BdlStatus = 0;
- gSecuritySetupContext.FdlStatus = 0;
- break;
- case MMI_TYPE_FDN:
- gSecuritySetupContext.FdlStatus = 1;
- gSecuritySetupContext.BdlStatus = 0;
- break;
- case MMI_TYPE_BDN:
- gSecuritySetupContext.FdlStatus = 0;
- gSecuritySetupContext.BdlStatus = 1;
- break;
- case MMI_TYPE_FDN_BDN:
- gSecuritySetupContext.BdlStatus = 1;
- gSecuritySetupContext.FdlStatus = 1;
- break;
- default:
- break;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * FillCountDownNumber
- * DESCRIPTION
- *
- * PARAMETERS
- * chv_info [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void FillCountDownNumber(sim_chv_info_struct chv_info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gSecuritySetupContext.CHV1Count = chv_info.chv1_count;
- gSecuritySetupContext.CHV2Count = chv_info.chv2_count;
- gSecuritySetupContext.UBCHV1Count = chv_info.ubchv1_count;
- gSecuritySetupContext.UBCHV2Count = chv_info.ubchv2_count;
- }
- /*****************************************************************************
- * FUNCTION
- * FillCountDownString
- * DESCRIPTION
- *
- * PARAMETERS
- * TypeOfPass [IN]
- * PassCountdownDisp [?]
- * RETURNS
- * void
- *****************************************************************************/
- void FillCountDownString(U8 TypeOfPass, U8 *PassCountdownDisp)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S8 temp1[10];
- S8 temp2[20];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- switch (TypeOfPass)
- {
- case MMI_SETTING_TYPE_CHV1:
- sprintf(temp1, "%d", gSecuritySetupContext.CHV1Count);
- break;
- case MMI_SETTING_TYPE_CHV2:
- sprintf(temp1, "%d", gSecuritySetupContext.CHV2Count);
- break;
- case MMI_SETTING_TYPE_UBCHV1:
- sprintf(temp1, "%d", gSecuritySetupContext.UBCHV1Count);
- break;
- case MMI_SETTING_TYPE_UBCHV2:
- sprintf(temp1, "%d", gSecuritySetupContext.UBCHV2Count);
- break;
- }
- AnsiiToUnicodeString(temp2, temp1);
- pfnUnicodeStrcpy((S8*) PassCountdownDisp, (S8*) GetString(STR_PASS_TRIALS_REMAIN));
- pfnUnicodeStrcat((S8*) PassCountdownDisp, (S8*) temp2);
- }
- /*****************************************************************************
- * FUNCTION
- * SECSETGetFdlStatusReq
- * DESCRIPTION
- * Send req to L4 to know the status of FDL or BDL.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *
- * Author : Vanita Jain(?)
- *****************************************************************************/
- void SECSETGetFdlStatusReq(void)
- {
- #ifdef MMI_ON_HARDWARE_P
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MYQUEUE msgStruct;
- mmi_smu_read_file_info_req_struct *fdlstatus;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ClearInputEventHandler(MMI_DEVICE_ALL);
- fdlstatus = OslConstructDataPtr(sizeof(mmi_smu_read_file_info_req_struct));
- fdlstatus->file_idx = FILE_FDN_IDX;
- SetProtocolEventHandler(SECSETGetFdlStatusRsp, PRT_MMI_SMU_READ_FILE_INFO_RSP);
- msgStruct.oslSrcId = MOD_MMI;
- msgStruct.oslDestId = MOD_L4C;
- /* micha1229 */
- msgStruct.oslMsgId = PRT_MMI_SMU_READ_FILE_INFO_REQ;
- msgStruct.oslSapId = INVALID_SAP;
- msgStruct.oslDataPtr = (oslParaType*) fdlstatus;
- msgStruct.oslPeerBuffPtr = NULL;
- OslMsgSendExtQueue(&msgStruct);
- #else /* MMI_ON_HARDWARE_P */
- PopupNoSupport(); /* PC simulator doesn't support to access FDN from SIM card */
- #endif /* MMI_ON_HARDWARE_P */
- }
- /*****************************************************************************
- * FUNCTION
- * SECSETGetFdlStatusRsp
- * DESCRIPTION
- * Response for the request to get the status of FDL or BDL.
- * PARAMETERS
- * info [?]
- * RETURNS
- * void
- *
- * Author : Vanita Jain(?)
- *****************************************************************************/
- void SECSETGetFdlStatusRsp(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- mmi_smu_read_file_info_rsp_struct *resp;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- resp = (mmi_smu_read_file_info_rsp_struct*) (info);
- if (resp->result.flag == 0 /* ok */
- #ifdef MMI_ON_HARDWARE_P
- && (sim_service_table_query(SERVICE_FDN) == SERVICE_SUPPORT || sim_service_table_query(SERVICE_FDN) == SERVICE_ALLOCATE)
- #endif
- ) /* diamond, 2006/01/26 Need to check both FDN file and SIM service table */
- {
- gFDLBDLContext.MaxFDL = resp->num_of_rec;
- EntrySECSETFixDial();
- }
- else
- {
- DisplayPopup((PU8) GetString(STR_NO_FDL), IMG_GLOBAL_ERROR, 0, ST_NOTIFYDURATION, ERROR_TONE);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * SECSETGetBdlStatusReq
- * DESCRIPTION
- * Send req to L4 to know the status of FDL or BDL.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *
- * Author : Vanita Jain(?)
- *****************************************************************************/
- void SECSETGetBdlStatusReq(void)
- {
- #ifdef MMI_ON_HARDWARE_P
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MYQUEUE msgStruct;
- mmi_smu_read_file_info_req_struct *fdlstatus;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ClearInputEventHandler(MMI_DEVICE_ALL);
- fdlstatus = OslConstructDataPtr(sizeof(mmi_smu_read_file_info_req_struct));
- fdlstatus->file_idx = FILE_BDN_IDX;
- SetProtocolEventHandler(SECSETGetBdlStatusRsp, PRT_MMI_SMU_READ_FILE_INFO_RSP);
- msgStruct.oslSrcId = MOD_MMI;
- msgStruct.oslDestId = MOD_L4C;
- /* micha1229 */
- msgStruct.oslMsgId = PRT_MMI_SMU_READ_FILE_INFO_REQ;
- msgStruct.oslSapId = INVALID_SAP;
- msgStruct.oslDataPtr = (oslParaType*) fdlstatus;
- msgStruct.oslPeerBuffPtr = NULL;
- OslMsgSendExtQueue(&msgStruct);
- #else /* MMI_ON_HARDWARE_P */
- PopupNoSupport(); /* PC simulator doesn't support to access BDN from SIM card */
- #endif /* MMI_ON_HARDWARE_P */
- }
- /*****************************************************************************
- * FUNCTION
- * SECSETGetBdlStatusRsp
- * DESCRIPTION
- * Response for the request to get the status of FDL or BDL.
- * PARAMETERS
- * info [?]
- * RETURNS
- * void
- *
- * Author : Vanita Jain(?)
- *****************************************************************************/
- void SECSETGetBdlStatusRsp(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- mmi_smu_read_file_info_rsp_struct *resp;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- resp = (mmi_smu_read_file_info_rsp_struct*) (info);
- if (resp->result.flag == 0 /* ok */
- #ifdef MMI_ON_HARDWARE_P
- && (sim_service_table_query(SERVICE_BDN) == SERVICE_SUPPORT || sim_service_table_query(SERVICE_BDN) == SERVICE_ALLOCATE)
- #endif
- ) /* diamond, 2006/01/26 Need to check both BDN file and SIM service table */
- {
- gFDLBDLContext.MaxBDL = resp->num_of_rec;
- EntrySECSETBarDial();
- }
- else
- {
- DisplayPopup((PU8) GetString(STR_NO_FDL), IMG_GLOBAL_ERROR, 0, ST_NOTIFYDURATION, ERROR_TONE);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_secset_set_fixed_dial_mode
- * DESCRIPTION
- * Entry function of set FDN mode
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_secset_set_fixed_dial_mode(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gSecuritySetupContext.VerifyPassSuccessCallBack = SECSETSetFdlModeReq;
- SECSETGetPIN2StatusReq();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_secset_set_barred_dial_mode
- * DESCRIPTION
- * Entry function of set BDN mode
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_secset_set_barred_dial_mode(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gSecuritySetupContext.VerifyPassSuccessCallBack = SECSETSetBdlModeReq;
- SECSETGetPIN2StatusReq();
- }
- /*****************************************************************************
- * FUNCTION
- * mmi_secset_at_cmd_update_chv
- * DESCRIPTION
- * Message handler for AT verify PIN
- * PARAMETERS
- * info [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void mmi_secset_at_cmd_update_chv(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- mmi_smu_verify_pin_result_ind_struct *at_verify_pin_ind = (mmi_smu_verify_pin_result_ind_struct *)info;
- historyNode *History;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- FillCountDownNumber(at_verify_pin_ind->chv_info);
- switch (at_verify_pin_ind->next_type)
- {
- case MMI_SETTING_TYPE_NO_REQUIRED:
- if (gSecuritySetupContext.PINBlocked)
- {
- gSecuritySetupContext.PINBlocked = 0;
- g_pwr_context.PowerOnSIMStatus &= ~MMI_SIM_STATUS_INVALID; /* 0x01: Invalid SIM */
- DisplayPopup((PU8) GetString(STR_GLOBAL_DONE), IMG_GLOBAL_ACTIVATED, 1, ST_NOTIFYDURATION, 0);
- DeleteScreenIfPresent(SCR_ID_SECSET_PUK1);
- DeleteScreenIfPresent(SCR_ID_SECSET_PUK_NEW_PIN1);
- DeleteScreenIfPresent(SCR_ID_SECSET_PUK_CONFIRM_PIN1);
- }
- break;
- case MMI_SETTING_TYPE_UBCHV1:
- if (gSecuritySetupContext.PINBlocked)
- {
- DisplayPopup((PU8) GetString(STR_SETTING_WRONG_PUK), IMG_GLOBAL_ERROR, 0, ST_NOTIFYDURATION, ERROR_TONE);
- if (GetHistoryScrID(SCR_ID_SECSET_PUK1, &History) == ST_SUCCESS)
- {
- if (History->inputBuffer != NULL)
- {
- memset(History->inputBuffer, 0, ENCODING_LENGTH);
- }
- if (History->guiBuffer != NULL)
- {
- memset(History->guiBuffer, 0, 2);
- }
- }
- DeleteUptoScrID(SCR_ID_SECSET_PUK1);
- }
- else
- {
- DisplayPopup((PU8) GetString(STR_SETTING_PIN_BLK), IMG_GLOBAL_ERROR, 0, ST_NOTIFYDURATION, ERROR_TONE);
- memset(gSecuritySetupContext.NewPassword, 0, (MAX_SIM_SETTING_PASSWD_LEN + 1) * ENCODING_LENGTH);
- gSecuritySetupContext.PINBlocked = 1;
- g_pwr_context.PowerOnSIMStatus |= MMI_SIM_STATUS_INVALID; /* 0x01: Invalid SIM */
- if (IsScreenPresent(CM_SCR_MARKER))
- {
- mmi_frm_add_history_before_cm_marker(SCR_ID_SECSET_PUK1, EntrySECSETPUK1);
- }
- else
- {
- ExitSECSETPUK1();
- DeleteUptoScrID(SCR_ID_SECSET_PUK1);
- }
- }
- break;
- case MMI_SETTING_TYPE_SIM_CARD_BLOCKED:
- EntryScrnSimBlockRsp();
- break;
- default:
- break;
- }
- }