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

📄 cmerrorhandlers.c

📁 MTK手机平台的MMI部分的源代码
💻 C
📖 第 1 页 / 共 2 页
字号:
/*****************************************************************************
*  Copyright Statement:
*  --------------------
*  This software is protected by Copyright and the information contained
*  herein is confidential. The software may not be copied and the information
*  contained herein may not be used or disclosed except with the written
*  permission of MediaTek Inc. (C) 2005
*
*  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
*  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
*  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
*  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
*  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
*  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
*  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
*  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
*  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
*  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
*  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
*  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
*
*  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
*  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
*  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
*  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
*  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. 
*
*  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
*  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
*  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
*  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
*  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
*
*****************************************************************************/
/*******************************************************************************
 *  Modification Notice:
 *  --------------------------
 *  This software is modified by MediaTek Inc. and the information contained
 *  herein is confidential. The software may not be copied and the information
 *  contained herein may not be used or disclosed except with the written
 *  permission of MediaTek Inc. (C) 2001
 *
 *******************************************************************************/

 /*******************************************************************************
 * Filename:
 * ---------
 *   CmErrorHandlers.c
 *
 * Project:
 * --------
 *   Maui_Software
 *
 * Description:
 * ------------
 *  .......
 *
 * Author:
 * -------
 * -------
 *
 *------------------------------------------------------------------------------
 * $Log$
 *
 * removed!
 * removed!
 * 
 *
 * removed!
 * removed!
 * 
 *
 * removed!
 * removed!
 * 
 *
 * removed!
 * removed!
 * 
 *
 * removed!
 * removed!
 * 
 *
 * removed!
 * removed!
 * 
 *
 * removed!
 * removed!
 * 
 *
 * removed!
 * removed!
 * 
 *
 * removed!
 * removed!
 * 
 *
 * removed!
 * removed!
 * 
 *
 *******************************************************************************/

/**
 * Copyright Notice
 * ?2002 - 2003, Pixtel Communications, Inc., 1489 43rd Ave. W.,
 * Vancouver, B.C. V6M 4K8 Canada. All Rights Reserved.
 *  (It is illegal to remove this copyright notice from this software or any
 *  portion of it)
 */
/**************************************************************

   FILENAME : CmErrorHandlers.c

   PURPOSE     : Call Management error handlers

   REMARKS     : nil

   AUTHOR      : Gupta Ashish

   DATE     : Apr 07, 03

**************************************************************/
#include "stdC.h"
#include "MMI_Features.h"
#include "L4Dr.h"
#include "L4Dr1.h"
#include "PixtelDataTypes.h"
#include "DebugInitDef.h"
#include "MMI_trc.h"
#include "TimerEvents.h"
#include "HistoryGprot.h"
#include "SubLCDHistoryGProt.h"
#include "Wgui_categories_popup.h"

#include "ProfileGprots.h"

#include "CallManagementIdDef.h"
#include "CmErrorTypes.h"
#include "CallManagementStruct.h"
#include "CallStructureManagementProt.h"
#include "CommonStubsProt.h"
#include "HistoryHelperProt.h"
#include "RedialHelperGProt.h"
#include "CallManagementGprot.h"
#include "OutgoingCallManagementProt.h"

#include "CmErrorHandlersProt.h"
#include "CommonScreens.h"      /* for popup window timer. */


/*****************************************************************************
 * FUNCTION
 *  ProcessIncomingFailureEvents
 * DESCRIPTION
 *  This function handles all the failure conditions in call management.
 * PARAMETERS
 *  event           [IN]        
 *  cause           [IN]        
 *  Incoming(?)     [IN]        Event Type, Any information associated with the event
 * RETURNS
 *  void
 *****************************************************************************/
void ProcessIncomingFailureEvents(CM_EVENT_TYPES event, U16 cause)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    MMI_TRACE((MMI_TRACE_G5_CM, MMI_CM_FUNC_ProcessIncomingFailureEvents));

    switch (event)
    {
        case CM_PS_HELD_CALL_ACTIVE:
        case CM_PS_ACTIVE_CALL_HELD:
        case CM_PS_INCOMING_CALL_CONNECTED:
            /* fail to answer incoming call or waiting call */
            //No need to modify state machine in case of ERROR
            //ProcessIncomingFailureCallEvent(cause);
            ShowCallManagementErrorMessage(cause);
            break;

        case CM_PS_INCOMING_CALL_DEFLECT:
        case CM_PS_ACTIVATED_CCBS:
        case CM_PS_CCBS_INVOKE_DIAL:
            ShowCallManagementErrorMessage(cause);
            break;

        default:
            ShowCallManagementErrorMessage(ERR_L4C_GEN_CAUSE);
            PRINT_INFORMATION(("File: [%s]  Line: [%d] <<Not Valid State Machine event>>\n", __FILE__, __LINE__));
            break;
    }
}


/*****************************************************************************
 * FUNCTION
 *  OutgoingProcessCMFailureEvent
 * DESCRIPTION
 *  This is the Entry function for all the Events while the Call-Management application
 *  is Active.
 *  
 *  This function handles the events from both keyboard and protocol stack.
 *  The keyboard events have KB in there defination and Protocol has PS.
 * PARAMETERS
 *  inEvenType      [IN]        
 *  cause           [IN]        
 *  void(?)         [IN]        *(pointer to the event's associated structure)
 * RETURNS
 *  void
 *****************************************************************************/
void OutgoingProcessCMFailureEvent(CM_EVENT_TYPES inEvenType, U16 cause)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    MMI_TRACE((MMI_TRACE_G5_CM, MMI_CM_FUNC_OutgoingProcessCMFailureEvent));
    switch (inEvenType)
    {
        case CM_PS_CALLCONNECTED:
            /* fail in ss_parse_rsp, dial_ind, connect_ind or
               got release_ind before connect */
            ProcessPSCallConnectFailEvent(cause);
            break;

        case CM_PS_HOLDSUC:     /* hold fail */
        case CM_PS_RETRIEVESUC: /* retreive fail */
        case CM_PS_SWAPSUC:     /* swap fail */
        case CM_PS_CONFSUC:     /* conference fail */
        case CM_PS_SPLITSUC:    /* split fail */
        case CM_PS_ECT_SUC:     /* ECT fail */
            ShowCallManagementErrorMessage(cause);
            break;

        default:
            PRINT_INFORMATION(("\n CM Event Handler does not exist \n"));
            break;
    }
}


/*****************************************************************************
 * FUNCTION
 *  ProcessPSCallConnectFailEvent
 * DESCRIPTION
 *  This is the function to process Protocol(Response) failure Event.
 * PARAMETERS
 *  cause       [IN]        
 *  void(?)     [IN]        *(this points to CM_CALL_HANDLE of the call which requested CM_KB_OUTGOINGCALL)
 * RETURNS
 *  void
 *****************************************************************************/
void ProcessPSCallConnectFailEvent(U16 cause)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    CM_CALL_HANDLE callHandle;
    U8 type;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    if (GetCCFlag() == TRUE)
    {
        callHandle = GetOutgoingCallHandle();

        if (callHandle == -1)
        {
            PRINT_INFORMATION(("\n ProcessPSCallConnectFailEvent Getting the Connected Handle has -1 \n"));
            return;
        }

        switch (GetCurrentState())
        {
                /* amanda add 0326, MO MT collision */
            case CM_INCOMING_STATE:
                PurgeOutgoingCallsStructure();
                cause = 0;
                break;

            case CM_OUTGOING_STATE:
                type = GetOutgoingCallType();
                PurgeOutgoingCallsStructure();
                SetCurrentState(GetPreviousState());
                SetPreviousState(CM_OUTGOING_STATE);
                if (GetTotalCallCount() == 0)
                {
                    /* only voice call can redial */
                    if ((type != CM_VOICE_CALL) || (IsRedialNeeded(cause) == FALSE))
                    {
                        /* no need to redial, just show error and get out of CM */
                        ShowCallManagementErrorMessage(cause);
                        GetOutOfCMforAdjustHistory();
                        return;
                    }
                    else
                    {
                        /* need to redial, show error and redial */
                        if (IsRedialSet())
                        {
                            SetCallEndedBeforeConnFlag(FALSE);
                            CheckRedialOrShowError(cause);
        					/* abort SS if needed */
                            DeleteScreenIfPresent(ITEM_SCR_USSN_MSG);
                            return;
                        }
                    }
                }
                /* still have other call, can't redial, just show error */
                break;

            default:
                PRINT_INFORMATION(("\n ProcessPSCallConnectFailEvent CM State m/c Corrupted \n"));
                break;
        }
    }
    ShowCallManagementErrorMessage(cause);
}


/*****************************************************************************
 * FUNCTION
 *  ShowCallManagementErrorMessage
 * DESCRIPTION
 *  This function shows the failure in case of call management
 *  
 *  This is a part of other hardware application.
 * PARAMETERS
 *  cause       [IN]        
 *  TRUE(?)     [OUT]       Or FALSE
 * RETURNS
 *  pBOOL(?)
 *****************************************************************************/
void ShowCallManagementErrorMessage(U16 cause)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */

⌨️ 快捷键说明

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