IMS Modify Call (3) accept reject timeout 接受/拒接/超时 视频升级请求

来源:互联网 发布:linux查询外网ip地址 编辑:程序博客网 时间:2024/06/11 02:15
本文内容包括语音电话中MT端收到视频升级请求后,做出响应的消息下发和不同响应的关键log。

流程图

已接受VT请求为例

Modify_response.jpg

代码段

代码比较少,感觉也不复杂的样子,基本上也不会改这个流程。

package/apps/InCallUI

AnswerPresenter.java
参数videoState,除了0以外,其他用来表示是但双向视频,不过我们已经改成只保留双向了。
<div class="linenums" style="margin:0px; padding-left:30px!important; color:rgb(30,52,123)"><div class="L0" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-html" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">public void onAnswer(int videoState, Context context) {</span></code></div><div class="L1" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-html" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">        int phoneId = getActivePhoneId();</span></code></div><div class="L2" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-html" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">        Log.i(this, "onAnswer  mCallId:" + mCallId + "phoneId:" + phoneId);</span></code></div><div class="L3" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-html" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">        if (mCallId == null || phoneId == -1) {</span></code></div><div class="L4" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-html" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">            return;</span></code></div><div class="L5" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-html" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">        }</span></code></div><div class="L6" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-html" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"> </code></div><div class="L7" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-html" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">        if (mCall[phoneId].getSessionModificationState()</span></code></div><div class="L8" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-html" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">                == Call.SessionModificationState.RECEIVED_UPGRADE_TO_VIDEO_REQUEST) {</span></code></div><div class="L9" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-html" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">            Log.d(this, "onAnswer (upgradeCall) mCallId=" + mCallId + " videoState=" + videoState);</span></code></div><div class="L0" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-html" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">            InCallPresenter.getInstance().<span style="background-color:rgb(192,192,192)">acceptUpgradeRequest</span>(videoState, context);</span></code></div><div class="L1" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-html" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">        } else {</span></code></div><div class="L2" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-html" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">            Log.d(this, "onAnswer (answerCall) mCallId=" + mCallId + " videoState=" + videoState);</span></code></div><div class="L3" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-html" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">            TelecomAdapter.getInstance().answerCall(mCall[phoneId].getId(), videoState);</span></code></div><div class="L4" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-html" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">        }</span></code></div><div class="L5" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-html" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">    }</span></code></div></div>
packages/apps/InCallUI/src/com/android/incallui/InCallPresenter.java
<div class="linenums" style="margin:0px; padding-left:30px!important; color:rgb(30,52,123)"><div class="L0" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-html" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">    public void acceptUpgradeRequest(int videoState, Context context) {</span></code></div><div class="L1" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-html" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">        Log.d(this, " acceptUpgradeRequest videoState " + videoState);</span></code></div><div class="L2" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-html" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">        // Bail if we have been shut down and the call list is null.</span></code></div><div class="L3" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-html" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">        if (mCallList == null) {</span></code></div><div class="L4" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-html" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">            StatusBarNotifier.clearAllCallNotifications(context);</span></code></div><div class="L5" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-html" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">            Log.e(this, " acceptUpgradeRequest mCallList is empty so returning");</span></code></div><div class="L6" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-html" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">            return;</span></code></div><div class="L7" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-html" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">        }</span></code></div><div class="L8" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-html" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"> </code></div><div class="L9" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-html" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">        Call call = mCallList.getVideoUpgradeRequestCall();///原来还有这个方法,惊</span></code></div><div class="L0" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-html" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">        if (call != null) {</span></code></div><div class="L1" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-html" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">            VideoProfile videoProfile = new VideoProfile(videoState);</span></code></div><div class="L2" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-html" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">            call.getVideoCall().<span style="background-color:rgb(192,192,192)">sendSessionModifyResponse</span>(videoProfile);</span></code></div><div class="L3" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-html" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">            call.setSessionModificationState(Call.SessionModificationState.NO_REQUEST);</span></code></div><div class="L4" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-html" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">            InCallAudioManager.getInstance().onAcceptUpgradeRequest(call, videoState);//调整Speaker</span></code></div><div class="L5" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-html" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">        }</span></code></div><div class="L6" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-html" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">    }</span></code></div></div>

frameworks/base/telecomm

InCallService.java
frameworks/base/telecomm/java/android/telecom/InCallService.java
accept和decline都会执行这个方法,带的参数不一样,也就是用0和3来区分是accept和reject(decline)。
<div class="linenums" style="margin:0px; padding-left:30px!important; color:rgb(30,52,123)"><div class="L0" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-html" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">        /**</span></code></div><div class="L1" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-html" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">         * Provides a response to a request to change the current call video session</span></code></div><div class="L2" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-html" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">         * properties.  This should be called in response to a request the {@link InCallService} has</span></code></div><div class="L3" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-html" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">         * received via {@link VideoCall.Callback#onSessionModifyRequestReceived}.</span></code></div><div class="L4" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-html" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">         * </span><span class="tag" style="color:#0088;"><p></span></code></div><div class="L5" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-html" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">         * Handled by</span></code></div><div class="L6" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-html" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">         * {@link Connection.VideoProvider#onSendSessionModifyResponse(VideoProfile)}.</span></code></div><div class="L7" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-html" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">         *</span></code></div><div class="L8" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-html" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">         * @param responseProfile The response call video properties.</span></code></div><div class="L9" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-html" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">         */</span></code></div><div class="L0" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-html" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">        public abstract void sendSessionModifyResponse(VideoProfile responseProfile);</span></code></div></div>
frameworks/base/telecomm/java/android/telecom/VideoCallImpl.java
重写
accept和decline都会执行这个方法,带的参数不一样。
<div class="linenums" style="margin:0px; padding-left:30px!important; color:rgb(30,52,123)"><div class="L0" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-html" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">    /** {@inheritDoc} */</span></code></div><div class="L1" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-html" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">    public void sendSessionModifyResponse(VideoProfile responseProfile) {</span></code></div><div class="L2" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-html" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">        try {</span></code></div><div class="L3" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-html" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">            mVideoProvider.<span style="background-color:rgb(192,192,192)">sendSessionModifyResponse</span>(responseProfile);</span></code></div><div class="L4" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-html" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">        } catch (RemoteException e) {</span></code></div><div class="L5" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-html" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">        }</span></code></div><div class="L6" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-html" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">    }</span></code></div></div>
frameworks/base/telecomm/java/android/telecom/Connection.java
<div class="linenums" style="margin:0px; padding-left:30px!important; color:rgb(30,52,123)"><div class="L1" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-html" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">        /**</span></code></div><div class="L2" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-html" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">         * IVideoProvider stub implementation.</span></code></div><div class="L3" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-html" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">         */</span></code></div><div class="L4" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-html" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">        private final class VideoProviderBinder extends IVideoProvider.Stub {</span></code></div><div class="L5" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-html" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">            ...</span></code></div><div class="L2" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-html" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"> </code></div><div class="L3" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-html" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">            public void sendSessionModifyResponse(VideoProfile responseProfile) {</span></code></div><div class="L4" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-html" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">                mMessageHandler.obtainMessage(</span></code></div><div class="L5" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-html" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">                        <span style="background-color:rgb(192,192,192)">MSG_SEND_SESSION_MODIFY_RESPONSE</span>, responseProfile).sendToTarget();</span></code></div><div class="L6" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-html" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">            }</span></code></div></div>

<div class="linenums" style="margin:0px; padding-left:30px!important; color:rgb(30,52,123)"><div class="L0" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-java" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="com" style="color:#93a1a1;">/**</span></code></div><div class="L1" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-java" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="com" style="color:#93a1a1;">         * Default handler used to consolidate binder method calls onto a single thread.</span></code></div><div class="L2" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-java" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="com" style="color:#93a1a1;">         */</span></code></div><div class="L3" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-java" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">        </span><span class="kwd" style="color:#1e347b;">private</span><span class="pln" style="color:#48484c;"> </span><span class="kwd" style="color:#1e347b;">final</span><span class="pln" style="color:#48484c;"> </span><span class="kwd" style="color:#1e347b;">class</span><span class="pln" style="color:#48484c;"> </span><span class="typ" style="color:teal;">VideoProviderHandler</span><span class="pln" style="color:#48484c;"> </span><span class="kwd" style="color:#1e347b;">extends</span><span class="pln" style="color:#48484c;"> </span><span class="typ" style="color:teal;">Handler</span><span class="pln" style="color:#48484c;"> </span><span class="pun" style="color:#93a1a1;">{</span></code></div><div class="L4" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-java" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">            </span><span class="kwd" style="color:#1e347b;">public</span><span class="pln" style="color:#48484c;"> </span><span class="typ" style="color:teal;">VideoProviderHandler</span><span class="pun" style="color:#93a1a1;">()</span><span class="pln" style="color:#48484c;"> </span><span class="pun" style="color:#93a1a1;">{</span></code></div><div class="L5" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-java" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">                </span><span class="kwd" style="color:#1e347b;">super</span><span class="pun" style="color:#93a1a1;">();</span></code></div><div class="L6" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-java" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">            </span><span class="pun" style="color:#93a1a1;">}</span></code></div><div class="L7" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-java" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">            </span><span class="kwd" style="color:#1e347b;">public</span><span class="pln" style="color:#48484c;"> </span><span class="typ" style="color:teal;">VideoProviderHandler</span><span class="pun" style="color:#93a1a1;">(</span><span class="typ" style="color:teal;">Looper</span><span class="pln" style="color:#48484c;"> looper</span><span class="pun" style="color:#93a1a1;">)</span><span class="pln" style="color:#48484c;"> </span><span class="pun" style="color:#93a1a1;">{</span></code></div><div class="L8" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-java" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">                </span><span class="kwd" style="color:#1e347b;">super</span><span class="pun" style="color:#93a1a1;">(</span><span class="pln" style="color:#48484c;">looper</span><span class="pun" style="color:#93a1a1;">);</span></code></div><div class="L9" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-java" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">            </span><span class="pun" style="color:#93a1a1;">}</span></code></div><div class="L0" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-java" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">            </span><span class="lit" style="color:#195f91;">@Override</span></code></div><div class="L1" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-java" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">            </span><span class="kwd" style="color:#1e347b;">public</span><span class="pln" style="color:#48484c;"> </span><span class="kwd" style="color:#1e347b;">void</span><span class="pln" style="color:#48484c;"> handleMessage</span><span class="pun" style="color:#93a1a1;">(</span><span class="typ" style="color:teal;">Message</span><span class="pln" style="color:#48484c;"> msg</span><span class="pun" style="color:#93a1a1;">)</span><span class="pln" style="color:#48484c;"> </span><span class="pun" style="color:#93a1a1;">{</span></code></div><div class="L2" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-java" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">                </span><span class="kwd" style="color:#1e347b;">switch</span><span class="pln" style="color:#48484c;"> </span><span class="pun" style="color:#93a1a1;">(</span><span class="pln" style="color:#48484c;">msg</span><span class="pun" style="color:#93a1a1;">.</span><span class="pln" style="color:#48484c;">what</span><span class="pun" style="color:#93a1a1;">)</span><span class="pln" style="color:#48484c;"> </span><span class="pun" style="color:#93a1a1;">{</span></code></div><div class="L3" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-java" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">                    </span></code></div><div class="L4" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-java" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pun" style="color:#93a1a1;">...</span><span class="pln" style="color:#48484c;">                    </span><span class="kwd" style="color:#1e347b;">case</span><span class="pln" style="color:#48484c;"> <span style="background-color:rgb(192,192,192)">MSG_SEND_SESSION_MODIFY_RESPONSE</span></span><span class="pun" style="color:#93a1a1;">:</span></code></div><div class="L5" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-java" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">                        onSendSessionModifyResponse</span><span class="pun" style="color:#93a1a1;">((</span><span class="typ" style="color:teal;">VideoProfile</span><span class="pun" style="color:#93a1a1;">)</span><span class="pln" style="color:#48484c;"> msg</span><span class="pun" style="color:#93a1a1;">.</span><span class="pln" style="color:#48484c;">obj</span><span class="pun" style="color:#93a1a1;">);</span></code></div><div class="L6" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-java" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">                        </span><span class="kwd" style="color:#1e347b;">break</span><span class="pun" style="color:#93a1a1;">;</span></code></div></div>

frameworks/opt/net/ims

frameworks/opt/net/ims/src/java/com/android/ims/internal/ImsVideoCallProviderWrapper.java
<div class="linenums" style="margin:0px; padding-left:30px!important; color:rgb(30,52,123)"><div class="L0" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-java" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">    </span><span class="com" style="color:#93a1a1;">/** @inheritDoc */</span></code></div><div class="L1" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-java" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">    </span><span class="kwd" style="color:#1e347b;">public</span><span class="pln" style="color:#48484c;"> </span><span class="kwd" style="color:#1e347b;">void</span><span class="pln" style="color:#48484c;"> onSendSessionModifyResponse</span><span class="pun" style="color:#93a1a1;">(</span><span class="typ" style="color:teal;">VideoProfile</span><span class="pln" style="color:#48484c;"> responseProfile</span><span class="pun" style="color:#93a1a1;">)</span><span class="pln" style="color:#48484c;"> </span><span class="pun" style="color:#93a1a1;">{</span></code></div><div class="L2" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-java" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">        </span><span class="kwd" style="color:#1e347b;">try</span><span class="pln" style="color:#48484c;"> </span><span class="pun" style="color:#93a1a1;">{</span></code></div><div class="L3" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-java" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">            mVideoCallProvider</span><span class="pun" style="color:#93a1a1;">.</span><span class="pln" style="color:#48484c;background-color:rgb(192,192,192)">sendSessionModifyResponse</span><span class="pun" style="color:#93a1a1;">(</span><span class="pln" style="color:#48484c;">responseProfile</span><span class="pun" style="color:#93a1a1;">);</span></code></div><div class="L4" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-java" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">        </span><span class="pun" style="color:#93a1a1;">}</span><span class="pln" style="color:#48484c;"> </span><span class="kwd" style="color:#1e347b;">catch</span><span class="pln" style="color:#48484c;"> </span><span class="pun" style="color:#93a1a1;">(</span><span class="typ" style="color:teal;">RemoteException</span><span class="pln" style="color:#48484c;"> e</span><span class="pun" style="color:#93a1a1;">)</span><span class="pln" style="color:#48484c;"> </span><span class="pun" style="color:#93a1a1;">{</span></code></div><div class="L5" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-java" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">        </span><span class="pun" style="color:#93a1a1;">}</span></code></div><div class="L6" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-java" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">    </span><span class="pun" style="color:#93a1a1;">}</span></code></div></div>

frameworks/opt/net/ims/src/java/com/android/ims/internal/ImsVideoCallProvider.java
<div class="linenums" style="margin:0px; padding-left:30px!important; color:rgb(30,52,123)"><div class="L0" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-java" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">        </span><span class="kwd" style="color:#1e347b;">public</span><span class="pln" style="color:#48484c;"> </span><span class="kwd" style="color:#1e347b;">void</span><span class="pln" style="color:#48484c;"> sendSessionModifyResponse</span><span class="pun" style="color:#93a1a1;">(</span><span class="typ" style="color:teal;">VideoProfile</span><span class="pln" style="color:#48484c;"> responseProfile</span><span class="pun" style="color:#93a1a1;">)</span><span class="pln" style="color:#48484c;"> </span><span class="pun" style="color:#93a1a1;">{</span></code></div><div class="L1" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-java" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">            mProviderHandler</span><span class="pun" style="color:#93a1a1;">.</span><span class="pln" style="color:#48484c;">obtainMessage</span><span class="pun" style="color:#93a1a1;">(</span><span class="com" style="color:#93a1a1;">//4h</span></code></div><div class="L2" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-java" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">                    <span style="background-color:rgb(192,192,192)">MSG_SEND_SESSION_MODIFY_RESPONSE</span></span><span class="pun" style="color:#93a1a1;">,</span><span class="pln" style="color:#48484c;"> responseProfile</span><span class="pun" style="color:#93a1a1;">).</span><span class="pln" style="color:#48484c;">sendToTarget</span><span class="pun" style="color:#93a1a1;">();</span></code></div><div class="L3" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-java" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">        </span><span class="pun" style="color:#93a1a1;">}</span></code></div></div>

<div class="linenums" style="margin:0px; padding-left:30px!important; color:rgb(30,52,123)"><div class="L0" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-java" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;"> </span><span class="com" style="color:#93a1a1;">/**</span></code></div><div class="L1" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-java" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="com" style="color:#93a1a1;">     * Default handler used to consolidate binder method calls onto a single thread.</span></code></div><div class="L2" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-java" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="com" style="color:#93a1a1;">     */</span></code></div><div class="L3" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-java" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">    </span><span class="kwd" style="color:#1e347b;">private</span><span class="pln" style="color:#48484c;"> </span><span class="kwd" style="color:#1e347b;">final</span><span class="pln" style="color:#48484c;"> </span><span class="typ" style="color:teal;">Handler</span><span class="pln" style="color:#48484c;"> mProviderHandler </span><span class="pun" style="color:#93a1a1;">=</span><span class="pln" style="color:#48484c;"> </span><span class="kwd" style="color:#1e347b;">new</span><span class="pln" style="color:#48484c;"> </span><span class="typ" style="color:teal;">Handler</span><span class="pun" style="color:#93a1a1;">(</span><span class="typ" style="color:teal;">Looper</span><span class="pun" style="color:#93a1a1;">.</span><span class="pln" style="color:#48484c;">getMainLooper</span><span class="pun" style="color:#93a1a1;">())</span><span class="pln" style="color:#48484c;"> </span><span class="pun" style="color:#93a1a1;">{</span></code></div><div class="L4" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-java" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">        </span><span class="lit" style="color:#195f91;">@Override</span></code></div><div class="L5" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-java" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">        </span><span class="kwd" style="color:#1e347b;">public</span><span class="pln" style="color:#48484c;"> </span><span class="kwd" style="color:#1e347b;">void</span><span class="pln" style="color:#48484c;"> handleMessage</span><span class="pun" style="color:#93a1a1;">(</span><span class="typ" style="color:teal;">Message</span><span class="pln" style="color:#48484c;"> msg</span><span class="pun" style="color:#93a1a1;">)</span><span class="pln" style="color:#48484c;"> </span><span class="pun" style="color:#93a1a1;">{</span></code></div><div class="L6" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-java" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">            </span><span class="kwd" style="color:#1e347b;">switch</span><span class="pln" style="color:#48484c;"> </span><span class="pun" style="color:#93a1a1;">(</span><span class="pln" style="color:#48484c;">msg</span><span class="pun" style="color:#93a1a1;">.</span><span class="pln" style="color:#48484c;">what</span><span class="pun" style="color:#93a1a1;">)</span><span class="pln" style="color:#48484c;"> </span><span class="pun" style="color:#93a1a1;">{</span></code></div><div class="L7" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-java" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">                <span style="color:#1e347b;">...</span></span></code></div><div class="L7" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-java" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">                </span><span class="kwd" style="color:#1e347b;">case</span><span class="pln" style="color:#48484c;"> <span style="background-color:rgb(192,192,192)">MSG_SEND_SESSION_MODIFY_RESPONSE</span></span><span class="pun" style="color:#93a1a1;">:</span></code></div><div class="L8" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-java" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">                    onSendSessionModifyResponse</span><span class="pun" style="color:#93a1a1;">((</span><span class="typ" style="color:teal;">VideoProfile</span><span class="pun" style="color:#93a1a1;">)</span><span class="pln" style="color:#48484c;"> msg</span><span class="pun" style="color:#93a1a1;">.</span><span class="pln" style="color:#48484c;">obj</span><span class="pun" style="color:#93a1a1;">);</span><span class="com" style="color:#93a1a1;">//6i</span></code></div><div class="L9" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-java" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">                    </span><span class="kwd" style="color:#1e347b;">break</span><span class="pun" style="color:#93a1a1;">;</span></code></div></div>

vendor/qcom/proprietary/telephony-apps/ims/

高通私有代码,又略。

关键log

MT收到receive,time out,accept,reject

收到升级请求
<div class="linenums" style="margin:0px; padding-left:30px!important; color:rgb(30,52,123)"><div class="L0" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-html" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">收到升级请求</span></code></div><div class="L1" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-html" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">06-21 16:01:14.945 13623-14690/com.android.phone D/ImsSenderRxr: responseModifyCall  1  3 2 callSubState 0 videoPauseState2 mediaId-1 Local Ability  Peer Ability  Cause code 0 0[SUB0]</span></code></div><div class="L2" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-html" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">06-21 16:01:14.945 13623-14690/com.android.phone D/ImsSenderRxr: [UNSL]< UNSOL_MODIFY_CALL  1  3 2 callSubState 0 videoPauseState2 mediaId-1 Local Ability  Peer Ability  Cause code 0 0[SUB0]</span></code></div><div class="L3" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><span style="color:#48484c;">06-21 16:01:14.946 13623-13623/com.android.phone D/ImsServiceSub: handleCallModifyRequest( 1  3 2 callSubState 0 videoPauseState2 mediaId-1 Local Ability  Peer Ability  Cause code 0 0)</span></div><div class="L4" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><span style="color:#48484c;">06-21 16:01:14.946 13623-13623/com.android.phone D/VideoCall_ImsCallModification: onReceivedCallModify( 1  3 2 callSubState 0 videoPauseState2 mediaId-1 Local Ability  Peer Ability  Cause code 0 0)</span></div><div class="L5" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-html" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">06-21 16:01:14.947 13623-13623/com.android.phone D/VideoCall_ImsCallModification: validateIncomingModifyConnectionType newCallType = 3</span></code></div><div class="L6" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-html" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">06-21 16:01:14.947 13623-13623/com.android.phone D/VideoCall_ImsCallModification: validateIncomingModifyConnectionType modifyToCurrCallType = false isIndexValid = true isLowBattery = false</span></code></div><div class="L7" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><span style="color:#48484c;">06-21 16:01:14.948 13623-13623/com.android.phone D/VideoCall_ImsVideoCallProviderImpl: (1) onCallTypeChanged session= callid= 1 mediaId=3 mState= 4 mDc=id=1,ACTIVE,toa=145,norm,mo,0,voc,noevp,,cli=1,,3Ca</span></div><div class="L8" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><span style="color:#48484c;">06-21 16:01:14.953 19129-19129/com.android.dialer D/InCall: InCallVideoCallCallback -  onSessionModifyRequestReceived videoProfile=[VideoProfile videoState = Audio Tx Rx videoQuality = 4]</span></div><div class="L9" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-html" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">06-21 16:01:14.955 19129-19129/com.android.dialer D/InCall: InCallVideoCallCallbackNotifier - upgradeToVideoRequest call = [Call_0, ACTIVE, [Capabilities: CAPABILITY_HOLD CAPABILITY_SUPPORT_HOLD CAPABILI</span></code></div></div>

收到升级后不相应,让请求超时
这里不会下发消息,而是会收到消息
<div class="linenums" style="margin:0px; padding-left:30px!important; color:rgb(30,52,123)"><div class="L0" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-html" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">06-21 16:01:29.972 13623-14690/com.android.phone D/ImsSenderRxr: responseModifyCall  1  3 2 callSubState 0 videoPauseState2 mediaId-1 Local Ability  Peer Ability  Cause code 0 7[SUB0]</span></code></div><div class="L1" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-html" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">06-21 16:01:29.972 13623-14690/com.android.phone D/ImsSenderRxr: [UNSL]< UNSOL_MODIFY_CALL  1  3 2 callSubState 0 videoPauseState2 mediaId-1 Local Ability  Peer Ability  Cause code 0 7[SUB0]</span></code></div><div class="L2" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><span style="color:#48484c;">06-21 16:01:29.972 13623-13623/com.android.phone D/ImsServiceSub: handleCallModifyRequest( 1  3 2 callSubState 0 videoPauseState2 mediaId-1 Local Ability  Peer Ability  Cause code 0 7)</span></div><div class="L3" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><span style="color:#48484c;">06-21 16:01:29.972 13623-13623/com.android.phone D/VideoCall_ImsCallModification: onReceivedCallModify( 1  3 2 callSubState 0 videoPauseState2 mediaId-1 Local Ability  Peer Ability  Cause code 0 7)</span></div><div class="L4" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-html" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">06-21 16:01:29.973 13623-13623/com.android.phone D/VideoCall_ImsVideoCallProviderImpl: (1) onCallTypeChanged session= callid= 1 mediaId=3 mState= 4 mDc=id=1,ACTIVE,toa=145,norm,mo,0,voc,noevp,,cli=</span></code></div><div class="L5" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-html" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">06-21 16:01:29.973 13623-13623/com.android.phone D/VideoCall_ImsCallModification: clearPendingModify imsconn=org.codeaurora.ims.ImsCallModification@18a5871</span></code></div><div class="L6" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><span style="color:#48484c;">06-21 16:01:29.975 19129-19129/com.android.dialer D/InCall: InCallVideoCallCallback - </span><span style="color:#48484c;background-color:rgb(192,192,192)">onSessionModifyResponseReceived </span><span style="color:#48484c;">status=4 requestedProfile=[VideoProfile videoState = Audio Tx Rx videoQuality =</span></div><div class="L7" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-html" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">06-21 16:01:30.033 19129-19129/com.android.dialer D/InCall: VideoPauseController - VideoPauseController:onUpgradeToVideoFail status: 4call: [Call_0, ACTIVE, [Capabilities: CAPABILITY_HOLD CAPABILIT</span></code></div></div>
跟收到升级请求的log相比,过了15秒后有,
06-21 16:01:29.975 19129-19129/com.android.dialer D/InCall: InCallVideoCallCallback - onSessionModifyResponseReceivedstatus=4 requestedProfile=[VideoProfile videoState = Audio Tx Rx videoQuality =
这个4表示收到的消息是VideoProvider.SESSION_MODIFY_REQUEST_TIMED_OUT(4),而在MO方收到的则是VideoProvider.SESSION_MODIFY_REQUEST_REJECTED_BY_REMOTE(5),可见MT区分reject和超时,MO不区分

收到升级请求后接受
<div class="linenums" style="margin:0px; padding-left:30px!important; color:rgb(30,52,123)"><div class="L0" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><span style="color:#48484c;">//accept 接受</span></div><div class="L2" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-html" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">06-25 20:04:31.268 3289-3289/com.android.phone D/ImsSenderRxr: [0101]> MODIFY_CALL_CONFIRM[SUB1]</span></code></div><div class="L3" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-html" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">06-25 20:04:31.336 3289-4294/com.android.phone D/ImsSenderRxr: [0101]< MODIFY_CALL_CONFIRM [SUB1]</span></code></div><div class="L4" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-html" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">06-25 20:04:31.337 3289-3289/com.android.phone D/VideoCall_ImsCallModification: EVENT_MODIFY_CALL_CONFIRM_DONE received</span></code></div></div>

收到升级请求后拒绝
<div class="linenums" style="margin:0px; padding-left:30px!important; color:rgb(30,52,123)"><div class="L0" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-html" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">//reject (decline)</span></code></div><div class="L1" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-html" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">07-12 11:37:01.614 4701-4701/com.android.phone V/ImsSenderRxr: modifyCallConfirm callModify=  1  0 2 callSubState 0 videoPauseState2 mediaId-1 Local Ability  Peer Ability  Cause code 0 0[SUB1]</span></code></div><div class="L2" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-html" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">07-12 11:37:01.616 4701-4701/com.android.phone V/ImsSenderRxr: setCallModify callModify=  1  0 2 callSubState 0 videoPauseState2 mediaId-1 Local Ability  Peer Ability  Cause code 0 0[SUB1]</span></code></div><div class="L3" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-html" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">07-12 11:37:01.618 4701-4701/com.android.phone D/ImsSenderRxr: [0027]> <span style="background-color:rgb(192,192,192)">MODIFY_CALL_CONFIRM</span>[SUB1]</span></code></div><div class="L4" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><span style="color:#48484c;">07-12 11:37:01.663 4701-5516/com.android.phone D/ImsSenderRxr: [0027]< </span><span style="color:#48484c;background-color:rgb(192,192,192)">MODIFY_CALL_CONFIRM </span><span style="color:#48484c;">error: 2</span></div><div class="L0" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-html" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">07-12 11:37:01.664 4701-4701/com.android.phone D/VideoCall_ImsCallModification: EVENT_MODIFY_CALL_CONFIRM_DONE received</span></code></div></div>
这里有一行log
07-12 11:37:01.614 4701-4701/com.android.phone V/ImsSenderRxr: modifyCallConfirm callModify=  1  0 2 callSubState 0 videoPauseState2 mediaId-1 Local Ability  Peer Ability  Cause code 0 0[SUB1]
注意callModify=  1  0 2,数据来自
CallModify.java 
<div class="linenums" style="margin:0px; padding-left:30px!important; color:rgb(30,52,123)"><div class="L0" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-java" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;"> </span><span class="lit" style="color:#195f91;">@Override</span></code></div><div class="L1" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-java" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">    </span><span class="kwd" style="color:#1e347b;">public</span><span class="pln" style="color:#48484c;"> </span><span class="typ" style="color:teal;">String</span><span class="pln" style="color:#48484c;"> toString</span><span class="pun" style="color:#93a1a1;">()</span><span class="pln" style="color:#48484c;"> </span><span class="pun" style="color:#93a1a1;">{</span></code></div><div class="L2" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-java" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">        </span><span class="kwd" style="color:#1e347b;">return</span><span class="pln" style="color:#48484c;"> </span><span class="pun" style="color:#93a1a1;">(</span><span class="str" style="color:#dd1144;">" "</span><span class="pln" style="color:#48484c;"> </span><span class="pun" style="color:#93a1a1;">+</span><span class="pln" style="color:#48484c;"> call_index</span></code></div><div class="L3" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-java" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">                </span><span class="pun" style="color:#93a1a1;">+</span><span class="pln" style="color:#48484c;"> </span><span class="str" style="color:#dd1144;">" "</span><span class="pln" style="color:#48484c;"> </span><span class="pun" style="color:#93a1a1;">+</span><span class="pln" style="color:#48484c;"> call_details</span></code></div><div class="L4" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-java" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">                </span><span class="pun" style="color:#93a1a1;">+</span><span class="pln" style="color:#48484c;"> </span><span class="str" style="color:#dd1144;">" "</span><span class="pln" style="color:#48484c;"> </span><span class="pun" style="color:#93a1a1;">+</span><span class="pln" style="color:#48484c;"> error</span><span class="pun" style="color:#93a1a1;">);</span></code></div><div class="L5" style="margin:0px; color:rgb(190,190,197); line-height:18px; padding-left:12px!important; list-style-type:decimal!important"><code class="language-java" style="margin:8px 0px; font-family:Consolas,'Liberation Mono',Menlo,Courier,monospace; word-wrap:break-word"><span class="pln" style="color:#48484c;">    </span><span class="pun" style="color:#93a1a1;">}</span></code></div></div>
其中第二个表示CallType,3为视频,0为语音,这体现的是拒绝。更详细和更多的参数解释,以后会专门写一篇博客。

小结

这篇好像没什么要总结的,我们看懂就好了,这个流程的代码不需要我们动。
0 0