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

📄 commonstubs.c

📁 MTK手机平台的MMI部分的源代码
💻 C
📖 第 1 页 / 共 5 页
字号:
}


/*****************************************************************************
 * FUNCTION
 *  GetLSpkNowOff
 * DESCRIPTION
 *  
 * PARAMETERS
 *  void
 * RETURNS
 *  
 *****************************************************************************/
pBOOL GetLSpkNowOff(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    return cm_p->alert_info.IsLoudSpk;
}


/*****************************************************************************
 * FUNCTION
 *  SetVoiceRecordingFlag
 * DESCRIPTION
 *  
 * PARAMETERS
 *  flag        [IN]        
 * RETURNS
 *  void
 *****************************************************************************/
void SetVoiceRecordingFlag(pBOOL flag)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    cm_p->alert_info.IsRecord = flag;
}


/*****************************************************************************
 * FUNCTION
 *  GetVoiceRecordingFlag
 * DESCRIPTION
 *  
 * PARAMETERS
 *  void
 * RETURNS
 *  
 *****************************************************************************/
pBOOL GetVoiceRecordingFlag(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    return cm_p->alert_info.IsRecord;
}


/*****************************************************************************
 * FUNCTION
 *  CMSetupAlertForMT
 * DESCRIPTION
 *  
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void CMSetupAlertForMT(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    PHB_CM_INTERFACE *PhoneNumberStruct;
    CM_CALL_HANDLE tmp;

#ifdef __MMI_INCOMING_CALL_VIDEO__
    U16 imgId;
#endif 
#ifdef __MMI_PROFILE_ALERT_TYPE_DOMINANT__
    MMI_ALERT_TYPE alert_type;
#endif 

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    tmp = GetIncomingCallHandle();
    PhoneNumberStruct = GetCMPhoneBookStruct();

    cm_p->alert_info.RingToneId = PhoneNumberStruct->ringtoneId;
    cm_p->alert_info.BacklightPatternId = PhoneNumberStruct->backlightId;
    cm_p->alert_info.AlertType = PhoneNumberStruct->alertType;

#ifdef __MMI_INCOMING_CALL_VIDEO__
    imgId = GetCallImgId(tmp);
    if (((imgId & 0x8000) || ((imgId & 0x3fff) >= VDO_ID_PHB_MTCALL_1)) && (imgId & 0x4000))
        /* user defined video file or system default video resource */
        /* use video sound as ring tone */
    {
        cm_p->alert_info.RingToneId = CM_RINGTONE_VIDEO;
    }
    else
#endif /* __MMI_INCOMING_CALL_VIDEO__ */ 
        /* phb not set ring tone => use profile default */
    if (cm_p->alert_info.RingToneId == 0)
    {
        cm_p->alert_info.RingToneId = GetRingToneID();
    }

    /* phb not set backlight pattern => use profile default */
    if (cm_p->alert_info.BacklightPatternId == 0)
    {
        cm_p->alert_info.BacklightPatternId = GetLightStatus();
    }

    /* phb not set alert type => use profile default */
    if (cm_p->alert_info.AlertType == MMI_ALERT_NONE)
    {
        cm_p->alert_info.AlertType = GetMtCallAlertTypeEnum();
    }

#ifdef __MMI_PROFILE_ALERT_TYPE_DOMINANT__
    /* get alert type from profile */
    alert_type = GetMtCallAlertTypeEnum();
    /* if alert type is vibration only or silent, do not ring according to the caller group */
    if (alert_type == MMI_VIBRATION_ONLY || alert_type == MMI_SILENT)
    {
        cm_p->alert_info.AlertType = alert_type;
    }
#endif /* __MMI_PROFILE_ALERT_TYPE_DOMINANT__ */ 

#ifdef __MMI_CM_DATA_CALL_ONLY_PLAY_TONE__
    if (GetCallType(tmp) == CM_DATA_CALL)
    {
        cm_p->alert_info.RingToneId = TONE_DATA_CALL;
    }

    if (GetPreviousCallWAP() == TRUE)
    {
        SetPreviousCallWAP(FALSE);
        cm_p->alert_info.RingToneId = TONE_DATA_CALL;
    }
#endif /* __MMI_CM_DATA_CALL_ONLY_PLAY_TONE__ */ 
}


/*****************************************************************************
 * FUNCTION
 *  ShowIncomingCallIndication
 * DESCRIPTION
 *  This function is called to Show incoming call indication
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void ShowIncomingCallIndication(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    /* before show incoming call indication, it must entered incoming call screen 
       which will already suspend audio, no need to stop again */
    /* StopRingtoneOrVibrator(); */

    PRINT_INFORMATION(("ShowIncomingCallIndication\n"));

    CMSetupAlertForMT();

    StartRingtoneOrVibrator();

    SetRingingFlag(TRUE);

    if (GetCCBSFlag() == TRUE)
    {
        StartTimer(CM_CCBS_NOTIFYDURATION_TIMER, CM_CCBS_NOTIFY_TIMEOUT, StopIncomingCallIndication);
    }
}


/*****************************************************************************
 * FUNCTION
 *  StopIncomingCallIndication
 * DESCRIPTION
 *  This function is called to Stop incoming call indication
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void StopIncomingCallIndication(void)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    if (GetCallWaitFlag() && (!GetWait2RingCallFlag()))
    {
        /* stop waiting call indication */
        SetCallWaitFlag(FALSE);
        MMI_TRACE((MMI_TRACE_G5_CM, MMI_CM_INFO_StopRing1));
        AudioStopReq(TONE_CALL_WAITING);

    #if defined(__MMI_BT_HP_SUPPORT__) || defined(__MMI_BT_SUPPORT__)
        mmi_bt_stop_hf_ring_req();
    #endif 

        SetNoTwiceRingFlag(FALSE);
    }
    else
    {
        /* stop incoming call indication */
        if (GetWait2RingCallFlag())
        {
            SetWait2RingCallFlag(FALSE);
            SetNoTwiceRingFlag(FALSE);
        }
        MMI_TRACE((MMI_TRACE_G5_CM, MMI_CM_INFO_StopRing2));
        StopRingtoneOrVibrator();
    }

    if (GetAutoAnswerFlag() == TRUE)
    {
        StopTimer(CM_AUTOANSWER_NOTIFYDURATION_TIMER);
        SetAutoAnswerFlag(FALSE);
    }

    if (GetCCBSFlag() == TRUE)
    {
        StopTimer(CM_CCBS_NOTIFYDURATION_TIMER);
    }

    SetRingAfterVibFlag(FALSE);
    SetRingingFlag(FALSE);

    if (GetExitScrnID() == ITEMSCR_INCOMING_CALL && GetTotalCallCount() == 1)
    {
    #ifdef __MMI_INCOMING_CALL_VIDEO__
        CM_CALL_HANDLE handle;
        U16 imgId;

        handle = GetIncomingCallHandle();
        imgId = GetCallImgId(handle);

        /* pause video */
        if ((imgId & 0x8000) || ((imgId & 0x3fff) >= VDO_ID_PHB_MTCALL_1))
        {
            StopCategory17Video();
        }
        else
    #endif /* __MMI_INCOMING_CALL_VIDEO__ */ 
            MOMTHideAnimation();
    }

}


/*****************************************************************************
 * FUNCTION
 *  CMPlayMTRingTone
 * DESCRIPTION
 *  This function is called to play ring or vibrator
 *  according to current setting
 * PARAMETERS
 *  tone        [IN]        
 * RETURNS
 *  void
 *****************************************************************************/
void CMPlayMTRingTone(U16 tone)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
#ifdef __MMI_INCOMING_CALL_VIDEO__
    if (tone != CM_RINGTONE_VIDEO)
#endif 
        StartRingTone(tone);
}


/*****************************************************************************
 * FUNCTION
 *  StartRingtoneOrVibrator
 * DESCRIPTION
 *  This function is called to play ring or vibrator
 *  according to current setting
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
void StartRingtoneOrVibrator(void)
{
#if defined(__MMI_BT_HP_SUPPORT__) || defined(__MMI_BT_SUPPORT__)
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    if (mmi_bt_is_aud2hf() == MMI_TRUE)
    {
        mmi_bt_start_hf_ring_req();
    }
#endif /* defined(__MMI_BT_HP_SUPPORT__) || defined(__MMI_BT_SUPPORT__) */ 

    switch (cm_p->alert_info.AlertType)
    {
        case MMI_RING:
            /* StartRingTone (cm_p->alert_info.RingToneId); */
            CMPlayMTRingTone(cm_p->alert_info.RingToneId);
            break;
        case MMI_VIBRATION_ONLY:
            VibratorOn();
            break;
        case MMI_VIBRATION_AND_RING:
            VibratorOn();

      /************************************************/
            /* Robin 0602, Remove set AT command profile functions */
            /* AT command will query MMI when needed                   */
      /************************************************/
            /* NSC This API is not correct not integrated wit Profiles Silent Mode */
            /*
             * if(IsPhoneInSilent())
             * SilentModeOff();
             */
            /* StartRingTone (cm_p->alert_info.RingToneId); */
            CMPlayMTRingTone(cm_p->alert_info.RingToneId);
            break;
        case MMI_VIBRATION_THEN_RING:

⌨️ 快捷键说明

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