CallManagementIncoming.c
资源名称:mmi.rar [点击查看]
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:214k
源码类别:
MTK
开发平台:
C/C++
- * void
- *****************************************************************************/
- ACTION_RESULT ProcessCallsHeld(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_TRACE((MMI_TRACE_G5_CM, MMI_CM_FUNC_ProcessCallsHeld));
- if (GetTotalCallCount() > 0)
- {
- SyncCallList();
- }
- gAttempToAnswer = FALSE;
- switch (GetPreviousState())
- {
- case CM_INCOMING_STATE:
- MMI_TRACE((MMI_TRACE_G5_CM, MMI_CM_INFO_ProcessCallsHeld));
- SetCurrentState(CM_INCOMING_STATE);
- SetPreviousState(CM_HOLD_STATE);
- MakeHold();
- GoBackHistory();
- return CM_CALL_SUCCESS;
- case CM_ACTIVE_STATE:
- if (gAcceptIncoming)
- {
- MakeHold();
- ProcessIncomingEvents(CM_PS_INCOMING_CALL_CONNECTED, info);
- gAcceptIncoming = FALSE;
- }
- else
- {
- SetPreviousState(CM_HOLD_STATE);
- SetCurrentState(CM_ACTIVE_STATE);
- /* if(GetMissedCallFlag()==FALSE) */
- DeleteScreenIfPresent(ITEMSCR_INCOMING_CALL);
- SetIncomingCallStateActive();
- GoBackHistory();
- }
- return CM_CALL_SUCCESS;
- case CM_HOLD_STATE:
- SetPreviousState(GetCurrentState());
- SetCurrentState(CM_HOLD_STATE);
- GoBackHistory();
- return CM_CALL_SUCCESS;
- default:
- return CM_CALL_FAILURE;
- }
- /* return CM_CALL_FAILURE; */
- }
- /*****************************************************************************
- * FUNCTION
- * PsCBackIncomingCallRejected
- * DESCRIPTION
- * This function is called back by the protocol stack when there
- * Incoming Call is reject
- * PARAMETERS
- * info [?]
- * RETURNS
- * void
- *****************************************************************************/
- void PsCBackIncomingCallRejected(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_TRACE((MMI_TRACE_G5_CM, MMI_CM_FUNC_PsCBackIncomingCallRejected));
- ProcessIncomingEvents(CM_PS_INCOMING_CALL_REJECTED, info);
- SetProtocolEventHandler(PsCBackNetworkCallDropped, PRT_NWRK_CALL_RELEASE);
- }
- /*****************************************************************************
- * FUNCTION
- * ProcessAcceptIncomingCall
- * DESCRIPTION
- * This function is called by the state machine function accept
- * incoming call
- * PARAMETERS
- * info [?]
- * any(?) [IN] Information associated with incoming call
- * result(?) [OUT] Of execution of function which may be success or failure
- * RETURNS
- * void
- *****************************************************************************/
- ACTION_RESULT ProcessAcceptIncomingCall(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_TRACE((MMI_TRACE_G5_CM, MMI_CM_FUNC_ProcessAcceptIncomingCall));
- SetCallHandleForStartTimeUpdate(GetIncomingCallHandle());
- switch (GetPreviousState())
- {
- case CM_IDLE_STATE:
- SetPreviousState(GetCurrentState());
- SetCurrentState(CM_ACTIVE_STATE);
- SetIncomingCallStateActive();
- EntryScr1002ActiveCall();
- /* check if entering SMS application in call */
- if (IsScreenPresent(SCR_ID_MSG_MAIN_MENU_NO_MMS))
- {
- mmi_frm_sms_delete_action_pending();
- }
- DeleteUptoCmScreen();
- return CM_CALL_SUCCESS;
- case CM_ACTIVE_STATE:
- SetPreviousState(CM_INCOMING_STATE);
- SetCurrentState(CM_ACTIVE_STATE);
- SetIncomingCallStateActive();
- /* SS present, waiting call should not use GoBackToHistory
- to remove SS screen */
- if (IsScreenPresent(ITEM_SCR_USSN_MSG))
- {
- DeleteScreenIfPresent(SCR_CM_ACTIVECALLSCREEN);
- }
- if (IsScreenPresent(SCR_CM_ACTIVECALLSCREEN))
- {
- /* check if entering SMS application in call */
- if (IsScreenPresent(SCR_ID_MSG_MAIN_MENU_NO_MMS))
- {
- mmi_frm_sms_delete_action_pending();
- }
- GoBackToHistory(SCR_CM_ACTIVECALLSCREEN);
- }
- else
- {
- EntryScr1002ActiveCall();
- DeleteScreenIfPresent(ITEM_SCR_INC_ACTIVE_OPN);
- DeleteScreenIfPresent(ITEM_SCR_INCOMING_OPTIONS);
- if (!IsScreenPresent(CM_SCR_MARKER))
- {
- AddMarkerToHistory();
- }
- }
- return CM_CALL_SUCCESS;
- case CM_HOLD_STATE:
- SetIncomingCallStateActive();
- if (GetTotalHoldCallCount() > 0)
- {
- SetPreviousState(GetCurrentState());
- SetCurrentState(CM_ACTIVE_STATE);
- /* check if entering SMS application in call */
- if (IsScreenPresent(SCR_ID_MSG_MAIN_MENU_NO_MMS))
- {
- mmi_frm_sms_delete_action_pending();
- }
- /* GoBackToHistory(SCR_CM_ACTIVECALLSCREEN); */
- }
- else
- {
- SetPreviousState(GetCurrentState());
- SetCurrentState(CM_ACTIVE_STATE);
- /* check if entering SMS application in call */
- if (IsScreenPresent(SCR_ID_MSG_MAIN_MENU_NO_MMS))
- {
- mmi_frm_sms_delete_action_pending();
- }
- /* GoBackToHistory(SCR_CM_ACTIVECALLSCREEN); */
- }
- /* SS present, waiting call should not use GoBackToHistory
- to remove SS screen */
- if (IsScreenPresent(ITEM_SCR_USSN_MSG))
- {
- DeleteScreenIfPresent(SCR_CM_ACTIVECALLSCREEN);
- EntryScr1002ActiveCall();
- DeleteScreenIfPresent(ITEM_SCR_INC_ACTIVE_OPN);
- DeleteScreenIfPresent(ITEM_SCR_INCOMING_OPTIONS);
- }
- else
- {
- GoBackToHistory(SCR_CM_ACTIVECALLSCREEN);
- }
- return CM_CALL_SUCCESS;
- case CM_INCOMING_STATE:
- case CM_OUTGOING_STATE:
- SetPreviousState(CM_INCOMING_STATE);
- SetCurrentState(CM_ACTIVE_STATE);
- SetIncomingCallStateActive();
- if (IsScreenPresent(SCR_CM_ACTIVECALLSCREEN))
- {
- /* check if entering SMS application in call */
- if (IsScreenPresent(SCR_ID_MSG_MAIN_MENU_NO_MMS))
- {
- mmi_frm_sms_delete_action_pending();
- }
- GoBackToHistory(SCR_CM_ACTIVECALLSCREEN);
- }
- else
- {
- EntryScr1002ActiveCall();
- /* check if entering SMS application in call */
- if (IsScreenPresent(SCR_ID_MSG_MAIN_MENU_NO_MMS))
- {
- mmi_frm_sms_delete_action_pending();
- }
- DeleteUptoCmScreen();
- }
- return CM_CALL_SUCCESS;
- default:
- return CM_CALL_FAILURE;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * PsCBackselectedCallEnded
- * DESCRIPTION
- * This function is called back by the protocol stack when there
- * selected active call ends
- *
- * info is actually the Call Handle
- * PARAMETERS
- * info [?]
- * RETURNS
- * void
- *****************************************************************************/
- void PsCBackselectedCallEnded(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetProtocolEventHandler(PsCBackNetworkCallDropped, PRT_NWRK_CALL_RELEASE);
- gMyCallHandle = DeriveCallHandle(info);
- MMI_TRACE((MMI_TRACE_G5_CM, MMI_CM_FUNC_PsCBackselectedCallEnded, gMyCallHandle));
- ProcessIncomingEvents(CM_PS_ACTIVE_CALL_DISCONNECTED, &gMyCallHandle);
- }
- /*****************************************************************************
- * FUNCTION
- * PsCBackActiveCallEndedHeldRetrieved
- * DESCRIPTION
- * This function is called back by the protocol stack when active
- * call ended for retrieve held
- *
- * info is actually the Call Handle
- * PARAMETERS
- * info [?]
- * RETURNS
- * void
- *****************************************************************************/
- void PsCBackActiveCallEndedHeldRetrieved(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetProtocolEventHandler(PsCBackNetworkCallDropped, PRT_NWRK_CALL_RELEASE);
- MMI_TRACE((MMI_TRACE_G5_CM, MMI_CM_FUNC_PsCBackActiveCallEndedHeldRetrieved));
- gMyCallHandle = DeriveCallHandle(info);
- ProcessIncomingEvents(CM_PS_ALL_ACTIVE_CALL_DISCONNECTED, &gMyCallHandle);
- }
- /*****************************************************************************
- * FUNCTION
- * ProcessEndAllActiveCall
- * DESCRIPTION
- * This function is called by the state machine function to
- * end all active call
- * PARAMETERS
- * info [?]
- * Call(?) [IN] Handle
- * RETURNS
- * void
- *****************************************************************************/
- ACTION_RESULT ProcessEndAllActiveCall(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- CM_CALL_HANDLE *handle;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_TRACE((MMI_TRACE_G5_CM, MMI_CM_FUNC_ProcessEndAllActiveCall));
- handle = (CM_CALL_HANDLE*) info;
- /* Start by Julia: Drop call refinement */
- if ((*handle) == -1)
- {
- PRINT_INFORMATION(("nBad call handle -1 in EndAllActiveCalln"));
- return CM_CALL_FAILURE;
- }
- /* dropped call is already released due to rel complete */
- else if (GetMMIStructIndexof(*handle) == -1)
- {
- PRINT_INFORMATION(("ncall already dropped in EndAllActiveCalln"));
- return CM_CALL_SUCCESS;
- }
- /* End by Julia */
- LogCallInfoForCallHistory(*handle);
- GetEndTimeAndNotifyEndCallDuration(*handle);
- SetCallState(*handle, CM_IDLE_STATE, TRUE);
- return CM_CALL_SUCCESS;
- }
- /*****************************************************************************
- * FUNCTION
- * CBackHangupAllActive
- * DESCRIPTION
- * Hangs Up all Active Calls
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void CBackHangupAllActive(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 holdCall;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetChldReqSent(CM_ACTION_NONE);
- /* if (gHold2End)
- {
- gHold2End = FALSE;
- return;
- } */
- holdCall = GetTotalHoldCallCount();
- MMI_TRACE((MMI_TRACE_G5_CM, MMI_CM_FUNC_CBackHangupAllActive, holdCall));
- if ((GetCurrentState() != CM_INCOMING_STATE) && !(holdCall >= 1))
- {
- GetOutOfCMApplication();
- return;
- }
- else if (holdCall >= 1)
- {
- return;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * CBackHangupAllActiveAcceptOther
- * DESCRIPTION
- * Hangs Up all Active Calls Except Incoming
- * PARAMETERS
- * info [?]
- * RETURNS
- * void
- *****************************************************************************/
- void CBackHangupAllActiveAcceptOther(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 holdCall, result;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetChldReqSent(CM_ACTION_NONE);
- SetProtocolEventHandler(PsCBackNetworkCallDropped, PRT_NWRK_CALL_RELEASE);
- if (CheckChldRequestSuccess(info, &result))
- {
- holdCall = GetTotalHoldCallCount();
- MMI_TRACE((MMI_TRACE_G5_CM, MMI_CM_FUNC_CBackHangupAllActiveAcceptOther, holdCall));
- if (holdCall > 0)
- {
- ProcessIncomingEvents(CM_PS_HELD_CALL_ACTIVE, NULL);
- }
- }
- else
- {
- /* fail to hold and accept => state not changed */
- ResetAllHangupFlag();
- RestoreCallState();
- if (GetTotalCallCount() > 0)
- {
- ShowCallManagementErrorMessage(result);
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * ProcessHold2Active
- * DESCRIPTION
- * This function is called by the state machine function to
- * make hold call active
- * PARAMETERS
- * info [?]
- * Any(?) [IN] Information associated with Held Call
- * ACTION_RESULT(?) [OUT] If the function was a success or failure
- * RETURNS
- * void
- *****************************************************************************/
- ACTION_RESULT ProcessHold2Active(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_TRACE((MMI_TRACE_G5_CM, MMI_CM_FUNC_ProcessHold2Active));
- if (GetTotalCallCount() > 0)
- {
- SyncCallList();
- }
- UpdateStateMachine();
- MakeRetrieve();
- switch (GetCurrentState())
- {
- case CM_INCOMING_STATE:
- SetPreviousState(CM_ACTIVE_STATE);
- GoBackHistory();
- return CM_CALL_SUCCESS;
- case CM_ACTIVE_STATE:
- SetPreviousState(CM_HOLD_STATE);
- GoBackToHistory(SCR_CM_ACTIVECALLSCREEN);
- return CM_CALL_SUCCESS;
- case CM_HOLD_STATE:
- EntryScr1006NotifyRetrieveSucess();
- if ((GetTotalCallCount() == GetTotalActiveCallCount()) && (GetTotalHoldCallCount() == 0))
- {
- SetPreviousState(GetCurrentState());
- SetCurrentState(CM_ACTIVE_STATE);
- }
- return CM_CALL_SUCCESS;
- default:
- PRINT_INFORMATION(("File: [%s] Line: [%d] <<Problem in Hold To active>>n", __FILE__, __LINE__));
- return CM_CALL_FAILURE;
- }
- /* return CM_CALL_FAILURE; */
- }
- /*****************************************************************************
- * FUNCTION
- * ProcessCCBSDialRequest
- * DESCRIPTION
- * This function is called by the state machine function
- * to dial CCBS call
- * PARAMETERS
- * info [?]
- * any(?) [IN] Information associated with ccbs
- * result(?) [OUT] Of execution of function which may be success or failure
- * RETURNS
- * void
- *****************************************************************************/
- ACTION_RESULT ProcessCCBSDialRequest(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_TRACE((MMI_TRACE_G5_CM, MMI_CM_FUNC_ProcessCCBSDialRequest));
- MakePsActiveHold((void*)CCBSDialResponse);
- OutgoingProcessCMEvent(CM_PS_SHOW_OUTGOING_CALL_SCREEN, NULL);
- return CM_CALL_SUCCESS;
- }
- /*****************************************************************************
- * FUNCTION
- * CCBSDialResponse
- * DESCRIPTION
- * This function is called back by the protocol
- * CCBS Dial response is recieved
- *
- * info is
- * PARAMETERS
- * info [?]
- * RETURNS
- * void
- *****************************************************************************/
- void CCBSDialResponse(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 result;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_TRACE((MMI_TRACE_G5_CM, MMI_CM_FUNC_CCBSDialResponse));
- SetCCBSFlag(FALSE);
- if (CheckChldRequestSuccess(info, &result))
- {
- MMI_TRACE((MMI_TRACE_G5_CM, MMI_CM_INFO_CCBSDialResponse1));
- }
- else
- {
- MMI_TRACE((MMI_TRACE_G5_CM, MMI_CM_INFO_CCBSDialResponse2));
- ProcessIncomingFailureEvents(CM_PS_CCBS_INVOKE_DIAL, result);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * ProcessCCBSRejectRequest
- * DESCRIPTION
- * This function is called by the state machine function
- * to reject CCBS call
- * PARAMETERS
- * info [?]
- * any(?) [IN] Information associated with ccbs
- * result(?) [OUT] Of execution of function which may be success or failure
- * RETURNS
- * void
- *****************************************************************************/
- ACTION_RESULT ProcessCCBSRejectRequest(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_TRACE((MMI_TRACE_G5_CM, MMI_CM_FUNC_ProcessCCBSRejectRequest));
- MakePsSendUDUB((void*)PsCBackCCBSRejectResponse);
- return CM_CALL_SUCCESS;
- }
- /*****************************************************************************
- * FUNCTION
- * PsCBackCCBSRejectResponse
- * DESCRIPTION
- * This function is called back by the protocol
- * stack when USSD data is recieved by n/w
- *
- * info is
- * PARAMETERS
- * info [?]
- * RETURNS
- * void
- *****************************************************************************/
- void PsCBackCCBSRejectResponse(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_TRACE((MMI_TRACE_G5_CM, MMI_CM_FUNC_PsCBackCCBSRejectResponse));
- SetProtocolEventHandler(PsCBackNetworkCallDropped, PRT_NWRK_CALL_RELEASE);
- ProcessIncomingEvents(CM_PS_INCOMING_CALL_REJECTED, info);
- }
- /*****************************************************************************
- * FUNCTION
- * AcceptCallForAT
- * DESCRIPTION
- * Accept Incoming Call from AT Command
- * PARAMETERS
- * handle [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void AcceptCallForAT(S16 handle)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gAttempToAnswer = TRUE;
- StopIncomingCallIndication();
- }
- #define PHB_PICTURE_TYPE_PIC_FILE 1
- //jerson add begin 20070622
- #ifdef __MMI_ONEKEY_SNDREC_SUPPORT__
- extern void DummyEntrySoundRecorderInCall(void);
- #endif
- //jerson add end 20070622
- /*****************************************************************************
- * FUNCTION
- * EntryScrIncomingCallEvent
- * DESCRIPTION
- * This function is the entry screen for the incoming call
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryScrIncomingCallEvent(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MMI_ANSWERING_MODE *AnsMode;
- PU8 guiBuffer;
- PU8 tmpName;
- S8 *imgPath = NULL;
- CM_CALL_HANDLE tmp;
- U16 imgId, icon_id = IMG_CM_ICON_LINE1;
- BOOL needPlayRing = MMI_FALSE;
- BOOL play_now = MMI_FALSE;
- U8 display_type = WGUI_CATE_MOMT_RES_TYPE_IMAGE_ID;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- AnsMode = GetAnswerMode();
- EntryNewScreen(ITEMSCR_INCOMING_CALL, ExitScrIncomingCallEvent, NULL, NULL);
- guiBuffer = GetCurrGuiBuffer(ITEMSCR_INCOMING_CALL);
- MMI_TRACE((MMI_TRACE_G5_CM, MMI_CM_FUNC_EntryScrIncomingCallEvent));
- ClearKeyEvents();
- #if ((defined __MMI_WGUI_CSK_ENABLE__) && (defined __MMI_TOUCH_SCREEN__))
- ResetCenterSoftkey();
- #endif
- DeleteScreenIfPresent(CM_SCR_RDL_TIME);
- TurnOnBacklight(1);
- if (guiBuffer == NULL)
- {
- mdi_audio_suspend_background_play();
- }
- if (IS_LOW_BATTERY())
- {
- /* Robin 1209 */
- ChgrPlayLowBatTone();
- }
- #ifdef __MMI_VOIP__
- if ((GetTotalCallCount() == 1) && (CM_INCOMING_STATE == GetCurrentState()) &&
- (gAttempToReject == MMI_FALSE) && (gAttempToAnswer == MMI_FALSE) &&
- (mmi_voip_app_total_call() == 0))
- #else
- if ((GetTotalCallCount() == 1) && (CM_INCOMING_STATE == GetCurrentState()) &&
- (gAttempToReject == MMI_FALSE) && (gAttempToAnswer == MMI_FALSE))
- #endif
- {
- if (GetCallWaitFlag() && !GetNoTwiceRingFlag())
- {
- MMI_TRACE((MMI_TRACE_G5_CM, MMI_CM_INFO_EntryScrIncomingCallEvent));
- SetWait2RingCallFlag(TRUE);
- SetNoTwiceRingFlag(TRUE);
- needPlayRing = MMI_TRUE;
- }
- if (GetRingingFlag() == FALSE && GetPreviousState() != CM_IDLE_STATE)
- {
- needPlayRing = MMI_TRUE;
- }
- }
- tmp = GetIncomingCallHandle();
- tmpName = GetCallName(tmp);
- imgId = GetCallImgId(tmp);
- gdispnameForSubLCD = tmpName;
- #if defined(__MMI_PHB_CALL_SHOW_PICTURE_FROM_FILE__)
- if (imgId == PHB_PICTURE_TYPE_PIC_FILE)
- {
- imgPath = GetCallImgPath(tmp);
- if (imgPath == NULL)
- {
- imgId = IMG_PHB_DEFAULT;
- }
- else
- {
- display_type = WGUI_CATE_MOMT_RES_TYPE_IMAGE_FILE;
- imgId = 0;
- }
- }
- #endif /* defined(__MMI_PHB_CALL_SHOW_PICTURE_FROM_FILE__) */
- if (isCSPPresent == 0 ||
- IsResetCSPGroupService(CSP_CPHS_TELESERVICES_SERVICE_GROUP, ALS))
- icon_id = 0;
- else
- {
- if (GetIncomingCallType() == CM_AUX_VOICE_CALL)
- icon_id = IMG_CM_ICON_LINE2;
- }
- /* Start by Julia: Drop call refinement */
- /* disconnecting call pending */
- if (GetDisconnectingCallHandle() != -1)
- {
- /* show sub before main LCD */
- ForceSubLCDScreen(EntrySubLcdScrIncomingCallEvent);
- #if 1
- ShowCategory17Screen(0, /* title_id */
- 0, /* left_softkey */
- 0, /* left_softkey_icon */
- 0, /* right_softkey */
- 0, /* right_softkey_icon */
- 0, /* NotificationStringId */
- tmpName, /* NameOrNumber */
- NULL, /* IP_Number */
- icon_id,//fred
- IMG_PHB_DEFAULT, /*default_image_id */
- imgId, /* resource_id */
- imgPath, /* resource_filename */
- display_type,
- 0, /* repeat_count, video/swflash only, repeat_count, 0 = infinite */
- FALSE, /* is_visaul_update, video/swflash only, update to LCM or not */
- FALSE, /* is_video_aud, video/swflash only, play video's audio */
- FALSE, /* is_play_aud_when_start */
- guiBuffer);
- #else /* 0 */
- /* 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 /* 0 */
- }
- else
- /* End by Julia */
- /* no disconnecting call */
- {
- #ifdef __MMI_INCOMING_CALL_VIDEO__
- if ((imgId & 0x8000) || ((imgId & 0x3fff) >= VDO_ID_PHB_MTCALL_1))
- {
- /* use video for display */
- /* user defined video file or system default video resource */
- BOOL video_sound = MMI_FALSE;
- BOOL video_update = MMI_FALSE;
- if (imgId & 0x8000)
- {
- /* file */
- imgPath = GetCallVideoPath(tmp);
- if (imgPath == NULL)
- {
- imgId = IMG_PHB_DEFAULT;
- }
- #ifdef __MMI_SWFLASH__
- else if (imgId & 0x2000)
- {
- display_type = WGUI_CATE_MOMT_RES_TYPE_SWFLASH_FILE;
- imgId = 0;
- }
- #endif /* __MMI_SWFLASH__ */
- else
- {
- display_type = WGUI_CATE_MOMT_RES_TYPE_VIDEO_FILE;
- imgId = 0;
- }
- }
- else
- {
- /* resource */
- imgPath = NULL;
- imgId &= 0x3fff;
- #ifdef __MMI_SWFLASH__ /* Check it's default sw flash or video */
- if (imgId >= MFH_ID_PHB_MTCALL_1)
- {
- display_type = WGUI_CATE_MOMT_RES_TYPE_SWFLASH_ID;
- }
- else
- #endif /* __MMI_SWFLASH__ */
- {
- display_type = WGUI_CATE_MOMT_RES_TYPE_VIDEO_ID;
- }
- }
- #if defined (__MMI_CLAMSHELL__) && !defined (__MMI_SLIDE__)
- /* show sub before main LCD */
- if (IsClamClose())
- {
- /* show animated sub LCD */
- ForceSubLCDScreen(EntrySubLcdScrIncomingCallEvent);
- }
- else
- #endif /* __MMI_CLAMSHELL__ */
- {
- /* show static sub LCD */
- video_update = MMI_TRUE;
- ForceSubLCDScreen(EntrySubLcdScrStaticIncomingCallEvent);
- }
- if (cm_p->alert_info.RingToneId == CM_RINGTONE_VIDEO && gAttempToAnswer == FALSE)
- {
- video_sound = MMI_TRUE;
- }
- if ((cm_p->alert_info.AlertType == MMI_RING) ||
- (cm_p->alert_info.AlertType == MMI_VIBRATION_AND_RING) ||
- ((cm_p->alert_info.AlertType == MMI_VIBRATION_THEN_RING) && (GetRingAfterVibFlag() == TRUE)))
- {
- play_now = MMI_TRUE;
- }
- #if 1
- ShowCategory17Screen(0, /* title_id */
- STR_GLOBAL_OPTIONS, /* left_softkey */
- IMG_GLOBAL_OPTIONS, /* left_softkey_icon */
- INC_SCR_RSK_STR, /* right_softkey */
- 0, /* right_softkey_icon */
- 0, /* NotificationStringId */
- tmpName, /* NameOrNumber */
- NULL, /* IP_Number */
- icon_id,//fred
- IMG_PHB_DEFAULT,
- imgId, /* resource_id */
- imgPath, /* resource_filename */
- display_type,
- 0, /* repeat_count, video only, repeat_count, 0 = infinite */
- video_update, /* is_visaul_update, video only, update to LCM or not */
- video_sound, /* is_video_aud, video only, play video's audio */
- play_now,
- guiBuffer); /* history_buffer */
- #else /* 0 */
- /* 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 /* 0 */
- /* bad video, play default ring */
- if (play_now == MMI_TRUE && video_sound == MMI_TRUE &&
- (IsCategory17VideoValid() == MMI_FALSE
- #ifdef __MMI_SWFLASH__
- && IsCategory17SWFlashValid() == MMI_FALSE
- #endif
- ))
- {
- PHB_CM_INTERFACE *temp;
- needPlayRing = MMI_TRUE;
- temp = GetCMPhoneBookStruct();
- temp->videoId = 0;
- SetCMPhoneBookStruct(temp);
- }
- }
- else
- /* use image for display */
- #endif /* __MMI_INCOMING_CALL_VIDEO__ */
- {
- /* show sub before main LCD */
- ForceSubLCDScreen(EntrySubLcdScrIncomingCallEvent);
- #if 1
- ShowCategory17Screen(0, /* title_id */
- STR_GLOBAL_OPTIONS, /* left_softkey */
- IMG_GLOBAL_OPTIONS, /* left_softkey_icon */
- INC_SCR_RSK_STR, /* right_softkey */
- 0, /* right_softkey_icon */
- 0, /* NotificationStringId */
- tmpName, /* NameOrNumber */
- NULL, /* IP_Number */
- icon_id,//fred
- IMG_PHB_DEFAULT,
- imgId, /* resource_id */
- imgPath, /* resource_filename */
- display_type,
- 0, /* repeat_count, video only, repeat_count, 0 = infinite */
- FALSE, /* is_visaul_update, video only, update to LCM or not */
- FALSE, /* is_video_aud, video only, play video's audio */
- FALSE,
- guiBuffer); /* history_buffer */
- #else /* 0 */
- /* 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 !*/
- #ifdef __MMI_INCOMING_CALL_VIDEO__
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- #endif /* __MMI_INCOMING_CALL_VIDEO__ */
- #endif /* 0 */
- }
- }
- /* Start by Julia: Drop call refinement */
- if (GetDisconnectingCallHandle() != -1)
- {
- SetKeyHandler(ReleaseCall, KEY_END, KEY_EVENT_DOWN);
- return;
- }
- else
- /* End by Julia */
- {
- if (GetTotalCallCount() > 1)
- {
- /* other call existed */
- /* soft key */
- SetLeftSoftkeyFunction(EntryScrIncomingMultipleOptions, KEY_EVENT_UP);
- /* SEND, END key */
- if (GetTotalActiveCallCount() == 0 || GetTotalHoldCallCount() == 0)
- {
- SetKeyHandler(KbCBackCallIncomingAccepted, KEY_SEND, KEY_EVENT_DOWN);
- }
- #ifdef __MMI_CLAMSHELL__
- SetKeyHandler(KbCBackCallIncomingRejected, KEY_END, KEY_EVENT_DOWN);
- #else
- SetKeyHandler(KbCBackEndAllCallsExceptIncoming, KEY_END, KEY_EVENT_DOWN);
- #endif
- /* group key */
- if (!(EmergencyCallPresent() || IsWapCallPresent()))
- {
- SetGroupKeyHandler(
- EnterScreenAndHandleDigit,
- (PU16) CMIdleScreenDigits,
- MAX_CM_SCREEN_DIGITS - 1,
- KEY_EVENT_DOWN);
- #if ( (defined __MMI_WGUI_CSK_ENABLE__) && (defined __MMI_TOUCH_SCREEN__) )
- EnableCenterSoftkey(0, IMG_CSK_DIAL_ICON);
- SetCenterSoftkeyFunction(EnterScreenAndHandleDigit, KEY_EVENT_UP);
- redraw_center_softkey();
- #endif
- }
- /* side key */
- if (GetTotalActiveCallCount() > 0)
- {
- SetSideVolumeKeysForCM();
- }
- }
- else
- {
- /* no other call */
- /* group key */
- if (AnsMode->anyKey == TRUE)
- {
- SetGroupKeyHandler(KbCBackCallIncomingAccepted, (PU16) PresentAllKeys, TOTAL_KEYS, KEY_EVENT_DOWN);
- }
- else
- {
- SetGroupKeyHandler(
- InvisibleDigitHandler,
- (PU16) CMIdleScreenDigits,
- MAX_CM_SCREEN_DIGITS - 1,
- KEY_EVENT_DOWN);
- }
- /* soft key */
- SetLeftSoftkeyFunction(EntryScrIncomingOptions, KEY_EVENT_UP);
- //jerson add begin 20070622
- #ifdef __MMI_ONEKEY_SNDREC_SUPPORT__
- SetKeyHandler(DummyEntrySoundRecorderInCall,KEY_ENTER,KEY_EVENT_UP);
- #endif
- //jerson add end 20070622
- /* SEND, END key */
- SetKeyHandler(KbCBackCallIncomingAccepted, KEY_SEND, KEY_EVENT_DOWN);
- SetKeyHandler(KbCBackCallIncomingRejected, KEY_END, KEY_EVENT_DOWN);
- /* side key */
- #ifdef __MMI_CLAMSHELL__
- #ifdef __MMI_SIDEKEY_SUPPRESS_RING__
- SetKeyHandler(StopIncomingCallIndication, KEY_VOL_DOWN, KEY_EVENT_DOWN);
- SetKeyHandler(KbCBackCallIncomingSuppressTone, KEY_VOL_DOWN, KEY_EVENT_UP);
- SetKeyHandler(KbCBackCallIncomingRejectedNoTone, KEY_VOL_DOWN, KEY_EVENT_LONG_PRESS);
- #else /* __MMI_SIDEKEY_SUPPRESS_RING__ */
- SetKeyHandler(KbCBackCallIncomingAccepted, KEY_VOL_UP, KEY_EVENT_DOWN);
- SetKeyHandler(KbCBackCallIncomingRejected, KEY_VOL_DOWN, KEY_EVENT_DOWN);
- #endif /* __MMI_SIDEKEY_SUPPRESS_RING__ */
- //KP Jerry add on 2007-2-12 start
- #else
- #ifdef __MMI_SIDEKEY_SUPPRESS_RING__
- SetKeyHandler(StopIncomingCallIndication,KEY_RSK,KEY_EVENT_DOWN); //old= KEY_VOL_DOWN //jerson modify 20070622
- SetKeyHandler(KbCBackCallIncomingSuppressTone,KEY_RSK,KEY_EVENT_UP);
- SetKeyHandler(KbCBackCallIncomingRejectedNoTone,KEY_RSK,KEY_EVENT_LONG_PRESS);
- #endif
- //KP Jerry add on 2007-2-12 end
- #endif /* __MMI_CLAMSHELL__ */
- }
- SetRightSoftkeyFunction(KbCBackCallIncomingRejected, KEY_EVENT_UP);
- }
- if (needPlayRing == MMI_TRUE && gAttempToAnswer == MMI_FALSE)
- {
- ShowIncomingCallIndication();
- }
- if (gAttempToAnswer == TRUE)
- {
- ClearInputEventHandler(MMI_DEVICE_ALL);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * ExitScrIncomingCallEvent
- * DESCRIPTION
- * This function is the exit screen for the incoming call
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitScrIncomingCallEvent(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- history scr101;
- U16 nHistory = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (-1 != GetIncomingCallHandle())
- {
- pfnUnicodeStrcpy((S8*) scr101.inputBuffer, (PS8) & nHistory);
- scr101.scrnID = ITEMSCR_INCOMING_CALL;
- scr101.entryFuncPtr = EntryScrIncomingCallEvent;
- GetCategoryHistory(scr101.guiBuffer);
- AddHistory(scr101);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * EntrySubLcdScrIncomingCallEvent
- * DESCRIPTION
- * Entry screen for Sub Lcd Incoming Call
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntrySubLcdScrIncomingCallEvent(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ExecSubLCDCurrExitHandler();
- ShowCategory311Screen(gdispnameForSubLCD, IMG_CM_SUBLCD_CALLING, NULL);
- SetSubLCDExitHandler(ExitSubLcdScrIncomingCallEvent);
- }
- #ifdef __MMI_INCOMING_CALL_VIDEO__
- /*****************************************************************************
- * FUNCTION
- * EntrySubLcdScrStaticIncomingCallEvent
- * DESCRIPTION
- * Entry screen for Sub Lcd Incoming Call
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntrySubLcdScrStaticIncomingCallEvent(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ExecSubLCDCurrExitHandler();
- ShowCategory332Screen(IMG_CM_STATE_CONNECTED);
- SetSubLCDExitHandler(ExitSubLcdScrStaticIncomingCallEvent);
- }
- #endif /* __MMI_INCOMING_CALL_VIDEO__ */
- /*****************************************************************************
- * FUNCTION
- * ExitSubLcdScrIncomingCallEvent
- * DESCRIPTION
- * Exit Handler for Sub Lcd Incoming Call Screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitSubLcdScrIncomingCallEvent(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- #ifdef __MMI_INCOMING_CALL_VIDEO__
- StopCategory17Video();
- #endif
- if (-1 != GetIncomingCallHandle() && !IsSubLCDScreenPresent(SUB_LCD_ITEMSCR_INCOMING_CALL))
- {
- SubLCDHistoryNode SubLCDHistory;
- SubLCDHistory.entryFuncPtr = EntrySubLcdScrIncomingCallEvent;
- AddSubLCDHistoryWithScrID(&SubLCDHistory, SUB_LCD_ITEMSCR_INCOMING_CALL);
- }
- }
- #ifdef __MMI_INCOMING_CALL_VIDEO__
- /*****************************************************************************
- * FUNCTION
- * ExitSubLcdScrStaticIncomingCallEvent
- * DESCRIPTION
- * Exit Handler for Sub Lcd Incoming Call Screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitSubLcdScrStaticIncomingCallEvent(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- StopCategory17Video();
- if (-1 != GetIncomingCallHandle() && !IsSubLCDScreenPresent(SUB_LCD_ITEMSCR_INCOMING_CALL))
- {
- SubLCDHistoryNode SubLCDHistory;
- SubLCDHistory.entryFuncPtr = EntrySubLcdScrStaticIncomingCallEvent;
- AddSubLCDHistoryWithScrID(&SubLCDHistory, SUB_LCD_ITEMSCR_INCOMING_CALL);
- }
- }
- #endif /* __MMI_INCOMING_CALL_VIDEO__ */
- /*****************************************************************************
- * FUNCTION
- * EntryScrIncomingMultipleOptions
- * DESCRIPTION
- * Entry screen for Incoming Call option menu when
- * there are more than one calls
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryScrIncomingMultipleOptions(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- PU8 guiBuffer;
- static U8 *PopUpList[10];
- U16 nNumofItem; /* Stores no of children in the submenu */
- U16 nStrItemList[10]; /* Stores the strings id of submenus returned */
- U16 menuId;
- S16 nActiveCall;
- U16 nHeldCall;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_TRACE((MMI_TRACE_G5_CM, MMI_CM_FUNC_EntryScrIncomingMultipleOptions));
- nActiveCall = GetTotalActiveCallCount();
- nHeldCall = GetTotalHoldCallCount();
- if (nActiveCall == 1 && nHeldCall == 0)
- {
- if (GetWapCallPresent())
- {
- menuId = MITEM_INC_WAP_OPT_PSEUDO;
- }
- else
- {
- menuId = MITEM_INC_ACT_OPT_PSEUDO;
- }
- }
- else if (nActiveCall == 0 && nHeldCall == 1)
- {
- menuId = MITEM_INC_HLD_OPT_PSEUDO;
- }
- else if (nActiveCall > 1 && nHeldCall == 0)
- {
- menuId = MITEM_IMA_OPT_PSEUDO;
- }
- else if (nActiveCall == 0 && nHeldCall > 1)
- {
- menuId = MITEM_INC_MHLD_OPT_PSEUDO;
- }
- else if (nActiveCall == 1 && nHeldCall == 1)
- {
- menuId = MITEM_IAH_OPT_PSEUDO;
- }
- else if (nActiveCall > 1 && nHeldCall > 0)
- {
- menuId = MITEM_IMAH_OPT_PSEUDO;
- }
- else if (nActiveCall > 0 && nHeldCall > 1)
- {
- menuId = MITEM_IAMH_OPT_PSEUDO;
- }
- else
- {
- return;
- }
- /* incoming call option menu will not enter other app,
- no need to set CM flag */
- /* SetCMScrnFlag(TRUE); */
- EntryNewScreen(ITEM_SCR_INC_MACT_OPN, ExitScrIncomingMultipleOptions, NULL, NULL);
- guiBuffer = GetCurrGuiBuffer(ITEM_SCR_INC_MACT_OPN); /* Getting the Index from history */
- SetParentHandler(menuId);
- RegisterHighlightHandler(ExecuteCurrHiliteHandler);
- #if defined(__MMI_BT_HP_SUPPORT__) || defined(__MMI_BT_SUPPORT__)
- if (mmi_bt_is_incall_aud_swap2bt())
- {
- mmi_frm_hide_menu_item(MITEM_INC_ACT_OPT_LOUDSP);
- }
- #endif /* defined(__MMI_BT_HP_SUPPORT__) || defined(__MMI_BT_SUPPORT__) */
- #ifdef __MMI_VOIP__
- /* hide call deflect option menu if voip call exists */
- if (mmi_voip_app_total_call())
- {
- mmi_frm_hide_menu_item(MITEM_INC_OPT_DEFLN);
- }
- #endif /* __MMI_VOIP__ */
- nNumofItem = GetNumOfChild_Ext(menuId);
- GetSequenceStringIds_Ext(menuId, nStrItemList);
- ConstructHintsList(menuId, PopUpList);
- ShowCategory55Screen(
- STR_SCR1002_CAPTION,
- IMG_SCR1002_CAPTION,
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- nNumofItem,
- nStrItemList,
- (U8 **) PopUpList,
- 0,
- guiBuffer);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- if (nActiveCall == 0 || nHeldCall == 0)
- {
- SetKeyHandler(KbCBackCallIncomingAccepted, KEY_SEND, KEY_EVENT_DOWN);
- }
- #ifdef __MMI_CLAMSHELL__
- SetKeyHandler(KbCBackCallIncomingRejected, KEY_END, KEY_EVENT_DOWN);
- #else
- SetKeyHandler(KbCBackEndAllCallsExceptIncoming, KEY_END, KEY_EVENT_DOWN);
- #endif
- SetSideVolumeKeysForCM();
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * ExitScrIncomingMultipleOptions
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitScrIncomingMultipleOptions(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- history Scr1001;
- U16 nHistory=0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- #if defined(__MMI_BT_HP_SUPPORT__) || defined(__MMI_BT_SUPPORT__)
- mmi_frm_unhide_menu_item(MITEM_INC_ACT_OPT_LOUDSP);
- #endif
- Scr1001.scrnID = ITEM_SCR_INC_MACT_OPN;
- Scr1001.entryFuncPtr = EntryScrIncomingMultipleOptions;
- pfnUnicodeStrcpy((S8*) Scr1001.inputBuffer, (PS8) & nHistory);
- GetCategoryHistory(Scr1001.guiBuffer);
- AddHistory(Scr1001);
- }
- /*****************************************************************************
- * FUNCTION
- * EntryScrIncomingOptions
- * DESCRIPTION
- * This function is the entry screen for the incoming call options
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryScrIncomingOptions(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer;
- S32 number_of_items = 0;
- U16 list_of_items[32];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(ITEM_SCR_INCOMING_OPTIONS, NULL, EntryScrIncomingOptions, NULL);
- MMI_TRACE((MMI_TRACE_G5_CM, MMI_CM_FUNC_EntryScrIncomingOptions));
- /* incoming call option menu will not enter other app,
- no need to set CM flag */
- /* SetCMScrnFlag(TRUE); */
- guiBuffer = GetCurrGuiBuffer(ITEM_SCR_INCOMING_OPTIONS); /* Getting the Index from history */
- #ifdef __MMI_VOIP__
- /* hide call deflect option menu if voip call exists */
- if (mmi_voip_app_total_call())
- {
- mmi_frm_hide_menu_item(MITEM_INC_OPT_DEFLN);
- }
- #endif /* __MMI_VOIP__ */
- number_of_items = GetNumOfChild_Ext(MITEM_OPT_PSEUDO);
- GetSequenceStringIds_Ext(MITEM_OPT_PSEUDO, list_of_items);
- SetParentHandler(MITEM_OPT_PSEUDO);
- RegisterHighlightHandler(ExecuteCurrHiliteHandler);
- ShowCategory1Screen(
- STR_SCR1002_CAPTION,
- 0,
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- number_of_items,
- list_of_items,
- 0,
- guiBuffer);
- /*
- * Leo Remove, use category1 instead.
- * ShowCategory101Screen(STR_OPT_PSEUDO, 0,
- * STR_GLOBAL_OK, IMG_GLOBAL_OK,
- * STR_GLOBAL_BACK, IMG_GLOBAL_BACK,
- * MITEM_OPT_PSEUDO, guiBuffer);
- */
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(KbCBackCallIncomingRejected, KEY_END, KEY_EVENT_DOWN);
- SetKeyHandler(KbCBackCallIncomingAccepted, KEY_SEND, KEY_EVENT_DOWN);
- SetSideVolumeKeysForCM();
- /*
- * #ifdef __MMI_SIDEKEY_SUPPRESS_RING__
- * SetKeyHandler(StopIncomingCallIndication,KEY_VOL_DOWN,KEY_EVENT_DOWN);
- * SetKeyHandler(KbCBackCallIncomingSuppressTone,KEY_VOL_DOWN,KEY_EVENT_UP);
- * SetKeyHandler(KbCBackCallIncomingRejectedNoTone,KEY_VOL_DOWN,KEY_EVENT_LONG_PRESS);
- * #else
- * SetKeyHandler(KbCBackCallIncomingAccepted,KEY_VOL_UP,KEY_EVENT_DOWN);
- * SetKeyHandler(KbCBackCallIncomingRejected,KEY_VOL_DOWN,KEY_EVENT_DOWN);
- * #endif
- */
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * EntryScrCcbsActivate
- * DESCRIPTION
- * This function is the entry screen for displaying CCBS Info to user
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryScrCcbsActivate(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(ITEM_SCR_CCBS_IND, ExitScrCcbsActivate, NULL, NULL);
- ShowCategory123Screen(0, 0, STR_GLOBAL_YES, 0, STR_GLOBAL_NO, 0, STR_NFY_CCBS, IMG_GLOBAL_QUESTION, NULL);
- SetLeftSoftkeyFunction(ActivateCCBS, KEY_EVENT_UP);
- SetRightSoftkeyFunction(IgnoreCCBS, KEY_EVENT_UP);
- SetKeyHandler(IgnoreCCBS, KEY_END, KEY_EVENT_DOWN);
- if (GetTotalCallCount() == 0)
- {
- playRequestedTone(CCBS_TONE);
- SetErrorToneFlag(CCBS_TONE);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * ExitScrCcbsActivate
- * DESCRIPTION
- * This function is the exit screen for CCBS info to user
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitScrCcbsActivate(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (GetErrorToneFlag() > 0)
- {
- stopRequestedTone(GetErrorToneFlag());
- SetErrorToneFlag(0);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * EntryScrNotifyCCBSSuccess
- * DESCRIPTION
- * This is a notification which does not have history and used when the
- * ccbs activation is success with a timeout of CM_NOTIFY_TIMEOUT.
- *
- * This has to display the time,we need to have the time display catefory function.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryScrNotifyCCBSSuccess(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(SCR_ECT_NFY_TRNT, ExitScrNotifyCMPopUpTone, NULL, NULL);
- ShowCategory62Screen(CCBS_ACTIVATED_STR, IMG_GLOBAL_ACTIVATED, NULL);
- if (GetTotalCallCount() == 0)
- {
- playRequestedTone(SUCCESS_TONE_IN_CALL);
- SetErrorToneFlag(SUCCESS_TONE_IN_CALL);
- }
- SetPOPUpFlag(TRUE);
- SetKeysForPOPUp();
- StartTimer(CM_NOTIFYDURATION_TIMER, CM_NOTIFY_TIMEOUT, GoBackfromNotifyScr);
- }
- /*****************************************************************************
- * FUNCTION
- * EntryScrCCBSInvokeEvent
- * DESCRIPTION
- * This function is the entry screen for the CCBS Invoke
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryScrCCBSInvokeEvent(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- PU8 guiBuffer;
- PU8 tmpName;
- S8 *imgPath = NULL;
- CM_CALL_HANDLE tmp;
- U16 imgId;
- BOOL needPlayRing = MMI_FALSE;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(ITEMSCR_CCBS_INVOKE, NULL, EntryScrCCBSInvokeEvent, NULL);
- TurnOnBacklight(1);
- MMI_TRACE((MMI_TRACE_G5_CM, MMI_CM_FUNC_EntryScrCCBSInvokeEvent));
- if ((GetTotalCallCount() == 1) && (CM_INCOMING_STATE == GetCurrentState()))
- {
- if (GetCallWaitFlag())
- {
- MMI_TRACE((MMI_TRACE_G5_CM, MMI_CM_INFO_EntryScrIncomingCallEvent));
- SetWait2RingCallFlag(TRUE);
- needPlayRing = MMI_TRUE;
- }
- }
- guiBuffer = GetCurrGuiBuffer(ITEMSCR_CCBS_INVOKE);
- tmp = GetIncomingCallHandle();
- tmpName = GetCallName(tmp);
- imgId = GetCallImgId(tmp);
- #if defined(__MMI_PHB_CALL_SHOW_PICTURE_FROM_FILE__)
- if (imgId == 1)
- {
- imgPath = GetCallImgPath(tmp);
- if (imgPath == NULL)
- {
- imgId = IMG_PHB_DEFAULT;
- }
- }
- #endif /* defined(__MMI_PHB_CALL_SHOW_PICTURE_FROM_FILE__) */
- if (GetTotalCallCount() > 1)
- {
- if (imgId == 1)
- {
- ShowCategory18Screen(0, STR_GLOBAL_OPTIONS, IMG_GLOBAL_OPTIONS, STR_GLOBAL_BACK, IMG_GLOBAL_BACK, 0, tmpName, NULL, 0,/*fred*/ 0, imgPath, FALSE, guiBuffer); /* INC_SCR_NFY_CCBS_STR */
- }
- else
- {
- ShowCategory18Screen(0, STR_GLOBAL_OPTIONS, IMG_GLOBAL_OPTIONS, STR_GLOBAL_BACK, IMG_GLOBAL_BACK, 0, tmpName, NULL, 0,/*fred*/ imgId, NULL, FALSE, guiBuffer); /* INC_SCR_NFY_CCBS_STR */
- }
- SetLeftSoftkeyFunction(EntryScrCCBSInvokeMultipleOptions, KEY_EVENT_UP);
- if (GetTotalActiveCallCount() == 0 || GetTotalHoldCallCount() == 0)
- {
- SetKeyHandler(KbCBackCCBSDialCall, KEY_SEND, KEY_EVENT_DOWN);
- }
- #ifdef __MMI_CLAMSHELL__
- SetKeyHandler(KbCBackCCBSInvokeRejected, KEY_END, KEY_EVENT_DOWN);
- #else
- SetKeyHandler(KbCBackEndAllCallsExceptIncoming, KEY_END, KEY_EVENT_DOWN);
- #endif
- SetSideVolumeKeysForCM();
- }
- else
- {
- if (imgId == 1)
- {
- ShowCategory18Screen(0, STR_GLOBAL_DIAL, 0, STR_GLOBAL_BACK, IMG_GLOBAL_BACK, 0, tmpName, NULL, 0,/*fred*/ 0, imgPath, FALSE, guiBuffer); /* INC_SCR_NFY_CCBS_STR */
- }
- else
- {
- ShowCategory18Screen(0, STR_GLOBAL_DIAL, 0, STR_GLOBAL_BACK, IMG_GLOBAL_BACK, 0, tmpName, NULL, 0,/*fred*/ imgId, NULL, FALSE, guiBuffer); /* INC_SCR_NFY_CCBS_STR */
- }
- SetLeftSoftkeyFunction(KbCBackCCBSDialCall, KEY_EVENT_UP);
- SetKeyHandler(KbCBackCCBSDialCall, KEY_SEND, KEY_EVENT_DOWN);
- SetKeyHandler(KbCBackCCBSInvokeRejected, KEY_END, KEY_EVENT_DOWN);
- SetKeyHandler(KbCBackCCBSDialCall, KEY_VOL_UP, KEY_EVENT_DOWN);
- SetKeyHandler(KbCBackCCBSInvokeRejected, KEY_VOL_DOWN, KEY_EVENT_DOWN);
- }
- SetRightSoftkeyFunction(KbCBackCCBSInvokeRejected, KEY_EVENT_UP);
- SetGroupKeyHandler(EnterScreenAndHandleDigit, (PU16) CMIdleScreenDigits, MAX_CM_SCREEN_DIGITS - 1, KEY_EVENT_DOWN);
- gdispnameForSubLCD = tmpName;
- ShowSubLCDScreen(EntrySubLcdScrIncomingCallEvent);
- if (needPlayRing == MMI_TRUE)
- {
- ShowIncomingCallIndication();
- }
- }
- /*****************************************************************************
- * FUNCTION
- * EntryScrCCBSInvokeMultipleOptions
- * DESCRIPTION
- * This function is the entry screen for the CCBS Invoke
- * option menu when there are more than one calls
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryScrCCBSInvokeMultipleOptions(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- PU8 guiBuffer;
- static U8 *PopUpList[10];
- U16 nNumofItem; /* Stores no of children in the submenu */
- U16 nStrItemList[10]; /* Stores the strings id of submenus returned */
- U16 menuId;
- S16 nActiveCall;
- U16 nHeldCall;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_TRACE((MMI_TRACE_G5_CM, MMI_CM_FUNC_EntryScrCCBSInvokeMultipleOptions));
- nActiveCall = GetTotalActiveCallCount();
- nHeldCall = GetTotalHoldCallCount();
- if (nActiveCall == 1 && nHeldCall == 0)
- {
- menuId = MITEM_CCBS_ACT_OPT_PSEUDO;
- }
- else if (nActiveCall == 0 && nHeldCall == 1)
- {
- menuId = MITEM_CCBS_HLD_OPT_PSEUDO;
- }
- else if (nActiveCall > 1 && nHeldCall == 0)
- {
- menuId = MITEM_CCBS_MACT_OPT_PSEUDO;
- }
- else if (nActiveCall == 0 && nHeldCall > 1)
- {
- menuId = MITEM_CCBS_MHLD_OPT_PSEUDO;
- }
- else if (nActiveCall == 1 && nHeldCall == 1)
- {
- menuId = MITEM_CCBS_ACT_HLD_OPT_PSEUDO;
- }
- else if (nActiveCall > 1 && nHeldCall > 0)
- {
- menuId = MITEM_CCBS_MACT_HLD_OPT_PSEUDO;
- }
- else if (nActiveCall > 0 && nHeldCall > 1)
- {
- menuId = MITEM_CCBS_ACT_MHLD_OPT_PSEUDO;
- }
- else
- {
- return;
- }
- EntryNewScreen(ITEM_SCR_CCBS_ACT_MHLD_OPN, NULL, EntryScrCCBSInvokeMultipleOptions, NULL);
- guiBuffer = GetCurrGuiBuffer(ITEM_SCR_CCBS_ACT_MHLD_OPN);
- SetParentHandler(menuId);
- RegisterHighlightHandler(ExecuteCurrHiliteHandler);
- nNumofItem = GetNumOfChild(menuId);
- GetSequenceStringIds(menuId, nStrItemList);
- ConstructHintsList(menuId, PopUpList);
- ShowCategory55Screen(
- STR_SCR1002_CAPTION,
- IMG_SCR1002_CAPTION,
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- nNumofItem,
- nStrItemList,
- (U8 **) PopUpList,
- 0,
- guiBuffer);
- SetRightSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- if (GetTotalActiveCallCount() == 0 || GetTotalHoldCallCount() == 0)
- {
- SetKeyHandler(KbCBackCCBSDialCall, KEY_SEND, KEY_EVENT_DOWN);
- }
- #ifdef __MMI_CLAMSHELL__
- SetKeyHandler(KbCBackCCBSInvokeRejected, KEY_END, KEY_EVENT_DOWN);
- #else
- SetKeyHandler(KbCBackEndAllCallsExceptIncoming, KEY_END, KEY_EVENT_DOWN);
- #endif
- SetSideVolumeKeysForCM();
- SetKeyHandler(GoBackHistory, KEY_LEFT_ARROW, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * EntryScrShowSSEvent
- * DESCRIPTION
- * This function is the entry screen for displaying SS info to user
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryScrShowSSEvent(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /* U8* guiBuffer; */
- U16 scrIdDisplay;
- U8 ptrDisplayString[150];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- scrIdDisplay = GetStrDisplayForId(gSSEvent);
- if (scrIdDisplay == 0)
- {
- return;
- }
- EntryNewScreen(ITEM_SCR_SS_NFY, ExitScrShowSSEvent, NULL, NULL);
- MMI_TRACE((MMI_TRACE_G5_CM, MMI_CM_FUNC_EntryScrShowSSEvent));
- SetNotifySSFlag(TRUE);
- // guiBuffer = GetCurrGuiBuffer(ITEM_SCR_SS_NFY); /* Getting the Index from history */
- pfnUnicodeStrcpy((PS8) ptrDisplayString, (PS8) GetString(scrIdDisplay));
- if(gSSEventNotifyPresent) /* By Mick: present notification info to user*/
- {
- switch(gSSEventNotify)
- {
- case 1: /* The call is forwarded : 00000001*/
- pfnUnicodeStrcat((S8 *)ptrDisplayString, (S8 *)(L"."));
- pfnUnicodeStrcat((S8 *)ptrDisplayString, (S8 *)(L"nn"));
- pfnUnicodeStrcat((S8 *)ptrDisplayString, (S8 *)GetString(STR_ID_CALL_IS_FORWARDED_CALL));
- pfnUnicodeStrcat((S8 *)ptrDisplayString, (S8 *)(L"."));
- break;
- case 2: /* 00000010 */
- //UCS2Strcat((S8 *)ptrDisplayString, (S8 *)(L"(02)"));
- break;
- case 4: /* The received call is forwarded : 00000100*/
- if(gSSEvent != CSMCC_NOTIFY_CF) /*avoid double call forwarded msg*/
- {
- pfnUnicodeStrcat((S8 *)ptrDisplayString, (S8 *)(L"."));
- pfnUnicodeStrcat((S8 *)ptrDisplayString, (S8 *)(L"nn"));
- pfnUnicodeStrcat((S8 *)ptrDisplayString, (S8 *)GetString(STR_ID_CALL_IS_FORWARDED));
- pfnUnicodeStrcat((S8 *)ptrDisplayString, (S8 *)(L"."));
- }
- break;
- default:
- break;
- }
- }
- ShowCategory63Screen((U8*) ptrDisplayString, 0, NULL);
- if (GetCurrentState() == CM_OUTGOING_STATE)
- {
- SetRightSoftkeyFunction(DropRequest, KEY_EVENT_UP);
- if (1 == GetTotalCallCount())
- {
- SetKeyHandler(DropRequest, KEY_END, KEY_EVENT_DOWN);
- }
- else
- {
- SetKeyHandler(HangupAll, KEY_END, KEY_EVENT_DOWN);
- }
- }
- SetLeftSoftkeyFunction(GoBackfromNotifyScr, KEY_EVENT_UP);
- SetPOPUpFlag(TRUE);
- SetKeysForPOPUp();
- StartTimer(CM_NOTIFYDURATION_TIMER, CM_NOTIFY_TIMEOUT, GoBackfromNotifyScr);
- }
- /*****************************************************************************
- * FUNCTION
- * ExitScrShowSSEvent
- * DESCRIPTION
- * This function is the exit screen for for displaying SS info to user
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitScrShowSSEvent(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_TRACE((MMI_TRACE_G5_CM, MMI_CM_FUNC_ExitScrShowSSEvent));
- StopTimer(CM_NOTIFYDURATION_TIMER);
- if (GetPOPUpFlag())
- {
- SetPOPUpFlag(FALSE);
- AdjustHistoryForCM();
- }
- SetNotifySSFlag(FALSE);
- if (GetCbackAfterSS())
- {
- MMI_TRACE((MMI_TRACE_G5_CM, MMI_CM_INFO_ExitScrShowSSEvent1));
- if (GetCurrentState() == CM_INCOMING_STATE && IsScreenPresent(ITEMSCR_INCOMING_CALL))
- {
- SetCbackAfterSS(NULL);
- GoBackToHistory(ITEMSCR_INCOMING_CALL);
- MMI_TRACE((MMI_TRACE_G5_CM, MMI_CM_INFO_ExitScrShowSSEvent2));
- }
- else if ((GetCbackAfterSS() == EntryScr1002ActiveCall) && IsScreenPresent(SCR_CM_ACTIVECALLSCREEN))
- {
- GoBackToHistory(SCR_CM_ACTIVECALLSCREEN);
- MMI_TRACE((MMI_TRACE_G5_CM, MMI_CM_INFO_ExitScrShowSSEvent3));
- }
- else
- {
- MMI_TRACE((MMI_TRACE_G5_CM, MMI_CM_INFO_ExitScrShowSSEvent4));
- (*GetCbackAfterSS())();
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * HandleCallDelfectDigitEntry
- * DESCRIPTION
- * This function is entered when a key
- * is pressed at the Call Deflect screen.
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void HandleCallDelfectDigitEntry(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U16 Keycode, Keytype;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- memset(CallDeflectBuffer, 0, sizeof(CallDeflectBuffer));
- GetkeyInfo(&Keycode, &Keytype);
- CallDeflectDigitKeyCode = Keycode;
- EntryCallDeflectDigitHandler();
- }
- /*****************************************************************************
- * FUNCTION
- * EntryCallDeflectDigitHandler
- * DESCRIPTION
- * Inputs the digits of a phone number for Call Deflection
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryCallDeflectDigitHandler(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *history_buffer;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(ITEM_SCR_CALL_DEFLECT_DIGIT_HANDLER_ID, ExitCallDeflectDigitHandler, NULL, NULL);
- cm_p->history_info.IsSave = TRUE;
- history_buffer = GetCurrGuiBuffer(ITEM_SCR_CALL_DEFLECT_DIGIT_HANDLER_ID);
- MMI_TRACE((MMI_TRACE_G5_CM, MMI_CM_FUNC_EntryCallDeflectDigitHandler));
- RegisterInputBoxEmptyFunction(CallDeflectScreenEmpty);
- RegisterInputBoxNotEmptyFunction(CallDeflectScreenNotEmpty);
- ShowCategory16Screen(
- CALL_DEFLECT_SEARCH_LSK,
- 0,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- (U8*) CallDeflectBuffer,
- MAX_DIGIT,
- history_buffer);
- if (GetTotalCallCount() == 1)
- {
- SetKeyHandler(KbCBackCallIncomingRejected, KEY_END, KEY_EVENT_DOWN);
- }
- else
- {
- #ifdef __MMI_CLAMSHELL__
- SetKeyHandler(KbCBackCallIncomingRejected, KEY_END, KEY_EVENT_DOWN);
- #else
- SetKeyHandler(KbCBackEndAllCallsExceptIncoming, KEY_END, KEY_EVENT_DOWN);
- #endif
- }
- if ((CallDeflectDigitKeyCode >= KEY_0 && CallDeflectDigitKeyCode <= KEY_9) ||
- CallDeflectDigitKeyCode == KEY_STAR || CallDeflectDigitKeyCode == KEY_POUND)
- {
- ExecuteCurrKeyHandler(CallDeflectDigitKeyCode, KEY_EVENT_DOWN);
- }
- SetCategory16RightSoftkeyFunction(CheckBeforeGoBackHistory, KEY_EVENT_UP);
- }
- /*****************************************************************************
- * FUNCTION
- * ExitCallDeflectDigitHandler
- * DESCRIPTION
- * exit fn for Call Deflect digit handle
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitCallDeflectDigitHandler(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (cm_p->history_info.IsSave)
- {
- history h;
- S16 nHistory = 0;
- h.scrnID = ITEM_SCR_CALL_DEFLECT_DIGIT_HANDLER_ID;
- h.entryFuncPtr = EntryCallDeflectDigitHandler;
- CallDeflectDigitKeyCode = -1;
- pfnUnicodeStrcpy((S8*) h.inputBuffer, (S8*) & nHistory);
- GetCategoryHistory(h.guiBuffer);
- AddHistory(h);
- }
- else
- {
- cm_p->history_info.IsSave = TRUE;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * CallDeflectScreenEmpty
- * DESCRIPTION
- * register function when screen is empty for call deflection
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void CallDeflectScreenEmpty(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ChangeLeftSoftkey(CALL_DEFLECT_SEARCH_LSK, 0);
- SetLeftSoftkeyFunction(mmi_phb_call_enter_from_deflect_option, KEY_EVENT_UP);
- ClearKeyHandler(KEY_SEND, KEY_EVENT_DOWN);
- #if ( (defined __MMI_WGUI_CSK_ENABLE__) && defined (__MMI_TOUCH_SCREEN__) )
- #if defined (__MMI_TOUCH_DIAL_SCREEN_WITH_FUNCTION__)
- SetDialingKeypadCallHandler(UI_dummy_function);
- SetDialingKeypadIPCallHandler(UI_dummy_function); //KP Jerry add on 2006-11-12
- SetDialingKeypadPhonebookHandler(mmi_phb_call_enter_from_deflect_option);
- #else /* defined (__MMI_TOUCH_DIAL_SCREEN_WITH_FUNCTION__) */
- SetCenterSoftkeyFunction(UI_dummy_function, KEY_EVENT_UP);
- #endif /* defined (__MMI_TOUCH_DIAL_SCREEN_WITH_FUNCTION__) */
- #endif /* ( (defined __MMI_WGUI_CSK_ENABLE__) && defined (__MMI_TOUCH_SCREEN__) ) */
- }
- /*****************************************************************************
- * FUNCTION
- * CallDeflectScreenNotEmpty
- * DESCRIPTION
- * register function when screen is not empty for call deflection
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void CallDeflectScreenNotEmpty(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ChangeLeftSoftkey(STR_GLOBAL_OK, 0);
- SetLeftSoftkeyFunction(CallDeflectDigitCall, KEY_EVENT_UP);
- SetKeyHandler(CallDeflectDigitCall, KEY_SEND, KEY_EVENT_DOWN);
- #if ( (defined __MMI_WGUI_CSK_ENABLE__) && defined (__MMI_TOUCH_SCREEN__) )
- #if defined (__MMI_TOUCH_DIAL_SCREEN_WITH_FUNCTION__)
- SetDialingKeypadCallHandler(CallDeflectDigitCall);
- SetDialingKeypadIPCallHandler(CallDeflectDigitIPCall); //KP Jerry add on 2006-11-12
- SetDialingKeypadPhonebookHandler(mmi_phb_call_enter_from_deflect_option);
- #else /* defined (__MMI_TOUCH_DIAL_SCREEN_WITH_FUNCTION__) */
- SetCenterSoftkeyFunction(CallDeflectDigitCall, KEY_EVENT_UP);
- #endif /* defined (__MMI_TOUCH_DIAL_SCREEN_WITH_FUNCTION__) */
- #endif /* ( (defined __MMI_WGUI_CSK_ENABLE__) && defined (__MMI_TOUCH_SCREEN__) ) */
- }
- /*****************************************************************************
- * FUNCTION
- * CallDeflectDigitCall
- * DESCRIPTION
- * Make a call from scratch pad
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void CallDeflectDigitCall(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetCallDeflectFlag(TRUE);
- MakeCall(CallDeflectBuffer);
- }
- //KP Jerry add on 2006-11-12 start
- /**************************************************************
- FUNCTION NAME : CallDeflectDigitIPCall
- PURPOSE : Make a IPcall from scratch pad
- INPUT PARAMETERS : nil
- OUTPUT PARAMETERS : nil
- RETURNS : void
- REMARKS :
- **************************************************************/
- void CallDeflectDigitIPCall(void)
- {
- SetTempUseIPNumber(TRUE);
- SetCallDeflectFlag(TRUE);
- MakeCall(CallDeflectBuffer);
- }
- //KP Jerry add on 2006-11-12 end
- /*****************************************************************************
- * FUNCTION
- * CBackCallDeflectNumberFromPB
- * DESCRIPTION
- *
- * PARAMETERS
- * number [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void CBackCallDeflectNumberFromPB(PS8 number)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- memcpy(CallDeflectBuffer, number, MAX_NUMBER);
- CallDeflectDigitCall();
- }
- /*****************************************************************************
- * FUNCTION
- * CheckBeforeGoBackHistory
- * DESCRIPTION
- * exit fn for Call Deflect digit handle
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void CheckBeforeGoBackHistory(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetNoSave();
- if (0 == GetTotalCallCount())
- {
- GoBackfromNotifyScr();
- }
- else
- {
- GoBackHistory();
- }
- }
- /*****************************************************************************
- * FUNCTION
- * EntryScrConfirmDTMFString
- * DESCRIPTION
- * Entry func to screen prompting for dtmf
- * confirmation
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryScrConfirmDTMFString(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 tempBuf[MAX_DTMFBUF_DIGITS * ENCODING_LENGTH + 40];
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- memset(tempBuf, 0, sizeof(tempBuf));
- if (GetTotalActiveCallCount() < 1)
- {
- StartTimer(CM_NOTIFYDURATION_TIMER, 1, GoBackfromNotifyScr);
- return;
- }
- EntryNewScreen(ITEM_SCR_CONFIRM_DTMF_STRING, ExitScrConfirmDTMFString, NULL, NULL);
- cm_p->history_info.IsSave = TRUE;
- pfnUnicodeStrcpy((S8*) tempBuf, (S8*) GetString(STR_DTMF_CONFIRMATION));
- AnsiiToUnicodeString((S8*) tempBuf + (pfnUnicodeStrlen((S8*) tempBuf) * ENCODING_LENGTH), (S8*) gDTMFConfirmBuf);
- PRINT_INFORMATION(("EntryScrConfirmDTMFString show screen 1n"));
- ShowCategory66Screen(0, 0, STR_GLOBAL_YES, IMG_GLOBAL_YES, STR_GLOBAL_NO, IMG_GLOBAL_NO, tempBuf, 0, NULL);
- PRINT_INFORMATION(("EntryScrConfirmDTMFString show screen 2n"));
- SetLeftSoftkeyFunction(ConfirmDTMFString, KEY_EVENT_UP);
- SetRightSoftkeyFunction(IgnoreDTMFStringAndGoBackHistory, KEY_EVENT_UP);
- SetKeyHandler(IgnoreDTMFStringAndGoBackHistory, KEY_END, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * ExitScrConfirmDTMFString
- * DESCRIPTION
- * exit function for EntryScrConfirmDTMFString()
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitScrConfirmDTMFString(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (cm_p->history_info.IsSave)
- {
- history scr101;
- U16 nHistory = 0;
- pfnUnicodeStrcpy((S8*) scr101.inputBuffer, (PS8) & nHistory);
- scr101.scrnID = ITEM_SCR_CONFIRM_DTMF_STRING;
- scr101.entryFuncPtr = EntryScrConfirmDTMFString;
- GetCategoryHistory(scr101.guiBuffer);
- AddHistory(scr101);
- }
- else
- {
- cm_p->history_info.IsSave = TRUE;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * NotifyMONumberChange
- * DESCRIPTION
- * This function displays number change notification
- * PARAMETERS
- * newNumber [IN]
- * ptrDisplayString [OUT]
- * RETURNS
- * void
- *****************************************************************************/
- void NotifyMONumberChange(U8 *newNumber, U8 *ptrDisplayString)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 index;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (GetCurrentState() != CM_OUTGOING_STATE)
- {
- return;
- }
- index = GetOutgoingCallIndex();
- if (index == -1)
- {
- return;
- }
- SetCalledNumber(index, newNumber);
- EntryNewScreen(ITEM_SCR_MO_NUM_CHANGE_NFY, ExitScrNotifyCMPopUp, NULL, NULL);
- ShowCategory63Screen((U8*) ptrDisplayString, 0, NULL);
- SetLeftSoftkeyFunction(GoBackfromNotifyScr, KEY_EVENT_UP);
- SetPOPUpFlag(TRUE);
- SetKeysForPOPUp();
- StartTimer(CM_NOTIFYDURATION_TIMER, CM_NOTIFY_TIMEOUT, GoBackfromNotifyScr);
- }
- /*****************************************************************************
- * FUNCTION
- * InvisibleDigitHandler
- * DESCRIPTION
- * Set group key handler for single MT call screen
- * instead of enter dial pad screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void InvisibleDigitHandler(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ClearDtmfBuf();
- AuxInvisibleDigitHandler();
- SetKeyHandler(MakeCallFromDTMFScr, KEY_SEND, KEY_EVENT_DOWN);
- SetGroupKeyHandler(AuxInvisibleDigitHandler, (PU16) CMIdleScreenDigits, MAX_CM_SCREEN_DIGITS - 1, KEY_EVENT_DOWN);
- }
- /*****************************************************************************
- * FUNCTION
- * AuxInvisibleDigitHandler
- * DESCRIPTION
- * Convert key digits to ascii to fill dtmf buffer
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void AuxInvisibleDigitHandler(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S16 keycode, keytype;
- U8 len;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- GetkeyInfo((U16*) & keycode, (U16*) & keytype);
- len = (U8) pfnUnicodeStrlen((S8*) UnicodeDTMFPadCallBuffer);
- if (keycode >= KEY_0 && keycode <= KEY_9)
- {
- UnicodeDTMFPadCallBuffer[len * ENCODING_LENGTH] = keycode + '0';
- }
- else if (keycode == KEY_STAR)
- {
- UnicodeDTMFPadCallBuffer[len * ENCODING_LENGTH] = '*';
- }
- else if (keycode == KEY_POUND)
- {
- UnicodeDTMFPadCallBuffer[len * ENCODING_LENGTH] = '#';
- }
- }
- /****************************** CISS ***********************************************/
- /*****************************************************************************
- * FUNCTION
- * PsCBackUSSNInd
- * DESCRIPTION
- * This function is intended for registering USSN Indication
- * for PS Callback
- * PARAMETERS
- * info [?]
- * RETURNS
- * void
- *****************************************************************************/
- void PsCBackUSSNInd(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- DeriveUSSNbuf(info);
- SetDelScrnIDCallbackHandler(ITEM_SCR_USSN_MSG, (HistoryDelCBPtr) NULL);
- DeleteScreenIfPresent(ITEM_SCR_USSN_MSG);
- if (IsScreenPresent(SCR_CM_REQUESTINGUSSD))
- {
- HistoryReplace(SCR_CM_REQUESTINGUSSD, ITEM_SCR_USSN_MSG, EntryScrDisplayUSSNMsg);
- SetDelScrnIDCallbackHandler(ITEM_SCR_USSN_MSG, (HistoryDelCBPtr) USSRDelHistoryHdlr);
- }
- else
- {
- EntryScrDisplayUSSNMsg();
- #ifdef __MMI_RECEIVE_USSD_TONE__
- playRequestedTone(WARNING_TONE);
- #endif
- }
- }
- /*****************************************************************************
- * FUNCTION
- * PsCBackUSSRInd
- * DESCRIPTION
- * This function is intended for registering USSR Indication
- * for PS Callback
- * PARAMETERS
- * info [?]
- * RETURNS
- * void
- *****************************************************************************/
- void PsCBackUSSRInd(void *info)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- DeriveUSSRbuf(info);
- SetDelScrnIDCallbackHandler(ITEM_SCR_USSN_MSG, (HistoryDelCBPtr) NULL);
- if (IsScreenPresent(SCR_CM_REQUESTINGUSSD))
- {
- HistoryReplace(SCR_CM_REQUESTINGUSSD, ITEM_SCR_USSN_MSG, EntryScrDisplayUSSRMsg);
- SetDelScrnIDCallbackHandler(ITEM_SCR_USSN_MSG, (HistoryDelCBPtr) USSRDelHistoryHdlr);
- }
- else
- {
- EntryScrDisplayUSSRMsg();
- #ifdef __MMI_RECEIVE_USSD_TONE__ /* for KLM only */
- playRequestedTone(WARNING_TONE);
- #endif
- }
- }
- /*****************************************************************************
- * FUNCTION
- * EntryScrDisplayUSSNMsg
- * DESCRIPTION
- * This function is the entry screen for displaying USSN info to user
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryScrDisplayUSSNMsg(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- history ss_scr;
- S16 nHistory = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetDelScrnIDCallbackHandler(ITEM_SCR_USSN_MSG, (HistoryDelCBPtr) NULL);
- DeleteScreenIfPresent(ITEM_SCR_USSN_MSG);
- if ((GetCurrentState() == CM_OUTGOING_STATE) || (GetCurrentState() == CM_INCOMING_STATE))
- {
- TurnOnBacklight(TRUE);
- EntryNewScreen(POPUP_SCREENID, ExitDisplayPopup, NULL, NULL);
- RemoveSSReqScr();
- ss_scr.scrnID = ITEM_SCR_USSN_MSG;
- ss_scr.entryFuncPtr = EntryScrDisplayUSSNMsg;
- pfnUnicodeStrcpy((S8*) ss_scr.inputBuffer, (S8*) & nHistory);
- InsertHistoryBeforeThisScrnReference(CM_SCR_MARKER, &ss_scr);
- ShowCategory74Screen(
- STR_TITLE_SCR_USSN_MSG,
- 0,
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- (PU8) gUSSDbuf,
- pfnUnicodeStrlen(gUSSDbuf),
- NULL);
- SetGroupKeyHandler(PopupTimerFlagEnable, (PU16) PresentAllKeys, TOTAL_KEYS, KEY_EVENT_DOWN);
- SetGroupKeyHandler(PopupCloseByPressAnyKey, (PU16) PresentAllKeys, TOTAL_KEYS, KEY_EVENT_UP);
- StartTimer(POPUP_TIMER, 1000, PopupTimerOver);
- }
- else
- {
- EntryNewScreen(ITEM_SCR_USSN_MSG, NULL, EntryScrDisplayUSSNMsg, NULL);
- if (isInCall())
- {
- SetCMScrnFlag(MMI_FALSE);
- }
- RemoveSSReqScr();
- ShowCategory74Screen(
- STR_TITLE_SCR_USSN_MSG,
- 0,
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- (PU8) gUSSDbuf,
- pfnUnicodeStrlen(gUSSDbuf),
- NULL);
- SetDelScrnIDCallbackHandler(ITEM_SCR_USSN_MSG, (HistoryDelCBPtr) USSRDelHistoryHdlr);
- TurnOnBacklight(1);
- SetLeftSoftkeyFunction(MMIUSSNReceiveOK, KEY_EVENT_UP);
- SetRightSoftkeyFunction(MMIUSSNReceiveBack, KEY_EVENT_UP);
- SetKeyHandler(MMIUSSNReceiveEnd, KEY_END, KEY_EVENT_DOWN);
- SetKeyHandler(NULL, KEY_VOL_UP, KEY_EVENT_UP);
- SetKeyHandler(NULL, KEY_VOL_UP, KEY_LONG_PRESS);
- SetKeyHandler(NULL, KEY_VOL_DOWN, KEY_EVENT_UP);
- SetKeyHandler(NULL, KEY_VOL_DOWN, KEY_LONG_PRESS);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * GoBackFromUSSNMsg
- * DESCRIPTION
- * This function is the entry screen for displaying USSN info to user
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void GoBackFromUSSNMsg(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (isInCall())
- {
- SetCMScrnFlag(MMI_FALSE);
- }
- GoBackHistory();
- }
- /*****************************************************************************
- * FUNCTION
- * MMIUSSNReceiveOK
- * DESCRIPTION
- * Receive USSN OK
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void MMIUSSNReceiveOK(void)
- {
- ClearDelScrnIDCallbackHandler(ITEM_SCR_USSN_MSG, NULL);
- GoBackFromUSSNMsg();
- }
- /*****************************************************************************
- * FUNCTION
- * MMIUSSNReceiveAbort
- * DESCRIPTION
- * Receive USSN Abort
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void MMIUSSNReceiveAbort(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MYQUEUE Message;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ResetCFCondStage();
- Message.oslSrcId = MOD_MMI;
- Message.oslDestId = MOD_L4C;
- Message.oslMsgId = PRT_SS_STRING_ABORT_REQ;
- Message.oslPeerBuffPtr = NULL;
- Message.oslDataPtr = NULL;
- ClearProtocolEventHandler(PRT_SS_STRING_ABORT_RSP);
- OslMsgSendExtQueue(&Message);
- }
- /*****************************************************************************
- * FUNCTION
- * MMIUSSNReceiveBack
- * DESCRIPTION
- * Receive USSN Back
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void MMIUSSNReceiveBack(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetDelScrnIDCallbackHandler(ITEM_SCR_USSN_MSG, (HistoryDelCBPtr) NULL);
- MMIUSSNReceiveAbort();
- GoBackFromUSSNMsg();
- }
- /*****************************************************************************
- * FUNCTION
- * MMIUSSNReceiveEnd
- * DESCRIPTION
- * Receive USSN Back
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void MMIUSSNReceiveEnd(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetDelScrnIDCallbackHandler(ITEM_SCR_USSN_MSG, (HistoryDelCBPtr) NULL);
- MMIUSSNReceiveAbort();
- if (isInCall())
- {
- SetCMScrnFlag(MMI_FALSE);
- GoBackHistory();
- }
- else
- {
- DisplayIdleScreen();
- }
- }
- /*****************************************************************************
- * FUNCTION
- * EntryScrDisplayUSSRMsg
- * DESCRIPTION
- * This function is the entry screen for displaying USSR info to user
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryScrDisplayUSSRMsg(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- history ss_scr;
- S16 nHistory = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetDelScrnIDCallbackHandler(ITEM_SCR_USSN_MSG, (HistoryDelCBPtr) NULL);
- DeleteScreenIfPresent(ITEM_SCR_USSN_MSG);
- if ((GetCurrentState() == CM_OUTGOING_STATE) || (GetCurrentState() == CM_INCOMING_STATE))
- {
- TurnOnBacklight(TRUE);
- EntryNewScreen(POPUP_SCREENID, ExitDisplayPopup, NULL, NULL);
- RemoveSSReqScr();
- ss_scr.scrnID = ITEM_SCR_USSN_MSG;
- ss_scr.entryFuncPtr = EntryScrDisplayUSSRMsg;
- pfnUnicodeStrcpy((S8*) ss_scr.inputBuffer, (S8*) & nHistory);
- InsertHistoryBeforeThisScrnReference(CM_SCR_MARKER, &ss_scr);
- ShowCategory74Screen(
- STR_TITLE_SCR_USSR_MSG,
- 0,
- STR_GLOBAL_REPLY,
- 0,
- STR_GLOBAL_CANCEL,
- 0,
- (PU8) gUSSDbuf,
- pfnUnicodeStrlen(gUSSDbuf),
- NULL);
- SetGroupKeyHandler(PopupTimerFlagEnable, (PU16) PresentAllKeys, TOTAL_KEYS, KEY_EVENT_DOWN);
- SetGroupKeyHandler(PopupCloseByPressAnyKey, (PU16) PresentAllKeys, TOTAL_KEYS, KEY_EVENT_UP);
- StartTimer(POPUP_TIMER, 1000, PopupTimerOver);
- }
- else
- {
- EntryNewScreen(ITEM_SCR_USSN_MSG, NULL, EntryScrDisplayUSSRMsg, NULL);
- RemoveSSReqScr();
- ShowCategory74Screen(
- STR_TITLE_SCR_USSR_MSG,
- 0,
- STR_GLOBAL_REPLY,
- 0,
- STR_GLOBAL_CANCEL,
- 0,
- (PU8) gUSSDbuf,
- pfnUnicodeStrlen(gUSSDbuf),
- NULL);
- TurnOnBacklight(1);
- SetDelScrnIDCallbackHandler(ITEM_SCR_USSN_MSG, (HistoryDelCBPtr) USSRDelHistoryHdlr);
- SetRightSoftkeyFunction(AbortUSSDResultRequest, KEY_EVENT_UP);
- SetKeyHandler(AbortUSSDResultRequestEND, KEY_END, KEY_EVENT_DOWN);
- SetLeftSoftkeyFunction(EntryScrEditUSSRMsg, KEY_EVENT_UP);
- SetKeyHandler(NULL, KEY_VOL_UP, KEY_EVENT_UP);
- SetKeyHandler(NULL, KEY_VOL_UP, KEY_LONG_PRESS);
- SetKeyHandler(NULL, KEY_VOL_DOWN, KEY_EVENT_UP);
- SetKeyHandler(NULL, KEY_VOL_DOWN, KEY_LONG_PRESS);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * USSRDelHistoryHdlr
- * DESCRIPTION
- *
- * PARAMETERS
- * in_param [?]
- * RETURNS
- * U8
- *****************************************************************************/
- U8 USSRDelHistoryHdlr(void *in_param)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MYQUEUE Message;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_TRACE((MMI_TRACE_G5_CM, MMI_CM_FUNC_MakePsDropUSSDReq));
- ResetCFCondStage();
- Message.oslSrcId = MOD_MMI;
- Message.oslDestId = MOD_L4C;
- Message.oslMsgId = PRT_SS_STRING_ABORT_REQ;
- Message.oslPeerBuffPtr = NULL;
- Message.oslDataPtr = NULL;
- ClearProtocolEventHandler(PRT_SS_STRING_ABORT_RSP);
- OslMsgSendExtQueue(&Message);
- return FALSE;
- }
- /*****************************************************************************
- * FUNCTION
- * RegisterUSSRMsgKeyFunction
- * DESCRIPTION
- *
- * PARAMETERS
- * text [?]
- * cursor [?]
- * length [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void RegisterUSSRMsgKeyFunction(U8 *text, U8 *cursor, S32 length)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* check the validity of the input password */
- if ((length) < 1)
- {
- /* if length is short then disable lsk */
- ChangeLeftSoftkey(0, 0);
- }
- else
- {
- /* if its valid length then enable lsk */
- EnableLeftSoftkey(STR_GLOBAL_OK, IMG_GLOBAL_OK);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * EntryScrDisplayUSSDRes
- * DESCRIPTION
- * This function is the entry screen for displaying USSN info to user
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryScrDisplayUSSDRes(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- history ss_scr;
- S16 nHistory = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetDelScrnIDCallbackHandler(ITEM_SCR_USSN_MSG, (HistoryDelCBPtr) NULL);
- DeleteScreenIfPresent(ITEM_SCR_USSN_MSG);
- if ((GetCurrentState() == CM_OUTGOING_STATE) || (GetCurrentState() == CM_INCOMING_STATE))
- {
- TurnOnBacklight(TRUE);
- EntryNewScreen(POPUP_SCREENID, ExitDisplayPopup, NULL, NULL);
- RemoveSSReqScr();
- ss_scr.scrnID = ITEM_SCR_USSN_MSG;
- ss_scr.entryFuncPtr = EntryScrDisplayUSSDRes;
- pfnUnicodeStrcpy((S8*) ss_scr.inputBuffer, (S8*) & nHistory);
- InsertHistoryBeforeThisScrnReference(CM_SCR_MARKER, &ss_scr);
- ShowCategory74Screen(
- STR_TITLE_SCR_USSD_MSG,
- 0,
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- 0,
- 0,
- (PU8) gUSSDbuf,
- pfnUnicodeStrlen(gUSSDbuf),
- NULL);
- SetGroupKeyHandler(PopupTimerFlagEnable, (PU16) PresentAllKeys, TOTAL_KEYS, KEY_EVENT_DOWN);
- SetGroupKeyHandler(PopupCloseByPressAnyKey, (PU16) PresentAllKeys, TOTAL_KEYS, KEY_EVENT_UP);
- StartTimer(POPUP_TIMER, 1000, PopupTimerOver);
- }
- else
- {
- SetDelScrnIDCallbackHandler(ITEM_SCR_USSN_MSG, (HistoryDelCBPtr) NULL);
- EntryNewScreen(ITEM_SCR_USSN_MSG, NULL, EntryScrDisplayUSSDRes, NULL);
- RemoveSSReqScr();
- ShowCategory74Screen(
- STR_TITLE_SCR_USSD_MSG,
- 0,
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- 0,
- 0,
- (PU8) gUSSDbuf,
- pfnUnicodeStrlen(gUSSDbuf),
- NULL);
- SetLeftSoftkeyFunction(GoBackHistory, KEY_EVENT_UP);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * EntryScrEditUSSRMsg
- * DESCRIPTION
- * This function is the entry screen for Editing USSR info by user
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EntryScrEditUSSRMsg(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- U8 *guiBuffer; /* Buffer holding history data */
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- EntryNewScreen(ITEM_SCR_USSR_EDIT, NULL, EntryScrEditUSSRMsg, NULL);
- SetDelScrnIDCallbackHandler(ITEM_SCR_USSN_MSG, (HistoryDelCBPtr) NULL);
- DeleteScreenIfPresent(ITEM_SCR_USSR_MSG);
- guiBuffer = GetCurrGuiBuffer(ITEM_SCR_USSR_EDIT);
- if (guiBuffer == NULL)
- {
- memset(g_callset_context.SSCFNum, 0, (MAX_CC_ADDR_LEN * ENCODING_LENGTH) + 2);
- }
- RegisterInputBoxValidationFunction(RegisterUSSRMsgKeyFunction);
- ShowCategory5Screen(
- STR_TITLE_SCR_USSR_EDIT_MSG,
- 0,
- STR_GLOBAL_OK,
- IMG_GLOBAL_OK,
- STR_GLOBAL_BACK,
- IMG_GLOBAL_BACK,
- (S16) (INPUT_TYPE_KEYPAD_NUMERIC | INPUT_TYPE_ALPHANUMERIC_UPPERCASE | INPUT_TYPE_USE_ONLY_ENGLISH_MODES),
- (U8*) g_callset_context.SSCFNum,
- MAX_CC_ADDR_LEN,
- guiBuffer);
- SetDelScrnIDCallbackHandler(ITEM_SCR_USSR_EDIT, (HistoryDelCBPtr) USSRDelHistoryHdlr);
- SetCategory5RightSoftkeyFunction(EditUSSRGoBack, KEY_EVENT_UP);
- SetKeyHandler(AbortUSSDResultRequestEND, KEY_END, KEY_EVENT_DOWN);
- SetLeftSoftkeyFunction(SendUSSRMsg, KEY_EVENT_UP);
- SetKeyHandler(NULL, KEY_VOL_UP, KEY_EVENT_UP);
- SetKeyHandler(NULL, KEY_VOL_UP, KEY_LONG_PRESS);
- SetKeyHandler(NULL, KEY_VOL_DOWN, KEY_EVENT_UP);
- SetKeyHandler(NULL, KEY_VOL_DOWN, KEY_LONG_PRESS);
- if (pfnUnicodeStrlen((S8*) g_callset_context.SSCFNum) == 0)
- {
- ChangeLeftSoftkey(0, 0);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * EditUSSRGoBack
- * DESCRIPTION
- * Sends USSR
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void EditUSSRGoBack(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetDelScrnIDCallbackHandler(ITEM_SCR_USSR_EDIT, (HistoryDelCBPtr) NULL);
- GoBackHistory();
- }
- /*****************************************************************************
- * FUNCTION
- * SendUSSRMsg
- * DESCRIPTION
- * Sends USSR
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void SendUSSRMsg(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- PU8 Buf;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SetDelScrnIDCallbackHandler(ITEM_SCR_USSN_MSG, (HistoryDelCBPtr) NULL);
- SetDelScrnIDCallbackHandler(ITEM_SCR_USSR_EDIT, (HistoryDelCBPtr) NULL);
- DeleteScreenIfPresent(ITEM_SCR_USSN_MSG);
- ClearExitHandler();
- ClearDtmfBuf();
- FillDtmfBuff((PU8) g_callset_context.SSCFNum);
- Buf = GetDtmfBuffer();
- MakeMyCall((PS8) Buf);
- }
- /*****************************************************************************
- * FUNCTION
- * AbortUSSDResultRequest
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void AbortUSSDResultRequest(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_TRACE((MMI_TRACE_G5_CM, MMI_CM_FUNC_AbortUSSDResultRequest));
- SetDelScrnIDCallbackHandler(ITEM_SCR_USSN_MSG, (HistoryDelCBPtr) NULL);
- ClearExitHandler();
- MakePsDropUSSDReq(CBackDropUSSDReq);
- }
- /*****************************************************************************
- * FUNCTION
- * AbortUSSDResultRequestEND
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void AbortUSSDResultRequestEND(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (isInCall())
- {
- HangupAllCalls();
- return;
- }
- MMI_TRACE((MMI_TRACE_G5_CM, MMI_CM_FUNC_AbortUSSDResultRequestEND));
- SetDelScrnIDCallbackHandler(ITEM_SCR_USSN_MSG, (HistoryDelCBPtr) NULL);
- SetDelScrnIDCallbackHandler(ITEM_SCR_USSR_EDIT, (HistoryDelCBPtr) NULL);
- DeleteScreenIfPresent(ITEM_SCR_USSN_MSG);
- ClearExitHandler();
- MakePsDropUSSDReq(CBackDropUSSDReqEND);
- }
- /*****************************************************************************
- * FUNCTION
- * ResumeSSScrInCall
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ResumeSSScrInCall(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- history temphistory;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (IsScreenPresent(ITEM_SCR_USSN_MSG))
- {
- GetHistory(ITEM_SCR_USSN_MSG, &temphistory);
- SetDelScrnIDCallbackHandler(ITEM_SCR_USSN_MSG, (HistoryDelCBPtr) NULL);
- SetDelScrnIDCallbackHandler(ITEM_SCR_USSR_EDIT, (HistoryDelCBPtr) NULL);
- DeleteScreenIfPresent(ITEM_SCR_USSN_MSG);
- DeleteScreenIfPresent(ITEM_SCR_USSR_EDIT);
- (*(temphistory.entryFuncPtr)) ();
- }
- else if (IsScreenPresent(SCR_CM_REQUESTINGUSSD))
- {
- GetHistory(SCR_CM_REQUESTINGUSSD, &temphistory);
- SetDelScrnIDCallbackHandler(SCR_CM_REQUESTINGUSSD, (HistoryDelCBPtr) NULL);
- DeleteScreenIfPresent(SCR_CM_REQUESTINGUSSD);
- (*(temphistory.entryFuncPtr)) ();
- }
- }