ps call

本文详细解析了Android系统中PSCall的实现流程,从GsmCdmaPhone类开始,介绍了如何根据IMS服务状态选择呼叫方式,并深入到ImsPhone、ImsPhoneCallTracker等关键组件的具体实现。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

ps call

  • ps call 从 GsmCdmaPhone 开始 判断是否注册ims 才开始进行imsphone 实例的获取
  • 所以从GsmCdmaPhone开始跟踪流程 如果不清楚可以查看 结构图 明确标出

  • com.android.internal.telephony.GsmCdmaPhone#dial

 @Override
    public Connection dial(String dialString, UUSInfo uusInfo, int videoState, Bundle intentExtras)
            throws CallStateException {
                //...

        Phone imsPhone = mImsPhone;

        //...

        if ((imsUseEnabled && (!isUt || useImsForUt)) || useImsForEmergency) {
            try {
                if (DBG) logd("Trying IMS PS call");
                return imsPhone.dial(dialString, uusInfo, videoState, intentExtras); //--->dial
            } catch (CallStateException e) {
               //...
            }
        }

        //...
    }
  • com.android.internal.telephony.imsphone.ImsPhone#dialInternal
    private Connection dialInternal(String dialString, int videoState, Bundle intentExtras)
            throws CallStateException {
        //...

        if (mmi == null) {
            return mCT.dial(dialString, videoState, intentExtras);//--- dial
        } else if (mmi.isTemporaryModeCLIR()) {
            return mCT.dial(mmi.getDialingNumber(), mmi.getCLIRMode(), videoState, intentExtras);
        } else if (!mmi.isSupportedOverImsPhone()) {
            // If the mmi is not supported by IMS service,
            // try to initiate dialing with default phone
            throw new CallStateException(CS_FALLBACK);
        } else {
//...
        }
    }
  • com.android.internal.telephony.imsphone.ImsPhoneCallTracker#dialInternal

private void dialInternal(ImsPhoneConnection conn, int clirMode, int videoState,
            Bundle intentExtras) {

        //...

        try {
            //...

            ImsCall imsCall = mImsManager.makeCall(mServiceId, profile,
                    callees, mImsCallListener); //---dial
            conn.setImsCall(imsCall);

            //...
        } catch (ImsException e) {
            loge("dialInternal : " + e);
            conn.setDisconnectCause(DisconnectCause.ERROR_UNSPECIFIED);
            sendEmptyMessageDelayed(EVENT_HANGUP_PENDINGMO, TIMEOUT_HANGUP_PENDINGMO);
        } catch (RemoteException e) {
        }
    }
  • com.android.ims.ImsManager#makeCall
   public ImsCall makeCall(int serviceId, ImsCallProfile profile, String[] callees,
            ImsCall.Listener listener) throws ImsException {
        if (DBG) {
            log("makeCall :: serviceId=" + serviceId
                    + ", profile=" + profile);
        }


        ImsCall call = new ImsCall(mContext, profile);

        call.setListener(listener);
        ImsCallSession session = createCallSession(serviceId, profile);

        if ((callees != null) && (callees.length == 1)) {
            call.start(session, callees[0]); //---dial
        } else {
            call.start(session, callees);
        }

        return call;
    }
  • com.android.ims.internal.ImsCallSession#start
    public void start(String callee, ImsCallProfile profile) {
        if (mClosed) {
            return;
        }

        try {
            miSession.start(callee, profile); //---dial
        } catch (RemoteException e) {
        }
    }

  • miSession 是调用 IImsCallSession 进程间通讯的 实例 是谷歌提供给厂商的接口

  • 举例高通是ImsCallSessionImpl 路径在vendor目录下面 由于这部分非公开 自己参考 各平台厂商的代码


作者:贱贱的杨
从此你们的路上不会孤单,还有贱贱的我

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值