通话界面需响应底层通知进行界面修改的情况

需要通话界面响应改动的两大类情况

1.InCallServiceImpl继承InCallService重写几个重要方法(由这些方法通知InCallPresent,再由InCallPresent通知其它Present)

public void onCallAudioStateChanged(CallAudioState audioState)
public void onBringToForeground(boolean showDialpad)
public void onCallAdded(Call call)
public void onCallRemoved(Call call)
public void onCanAddCallChanged(boolean canAddCall)
public IBinder onBind(Intent intent)
public boolean onUnbind(Intent intent)


2.InCallUI的Call.java文件实现并注册的android.telecom.Call.Callback()(如果是VideoCall,还有VideoCall.Callback)

 public void onStateChanged(Call call, int state)

 public void onParentChanged(Call call, Call parent) 
 
 public void onChildrenChanged(Call call, List<Call> children)
 
 public void onDetailsChanged(Call call, Call.Details details)
 
 public void onCannedTextResponsesLoaded(Call call, List<String> cannedTextResponses)
        
 public void onPostDialWait(Call call, String remainingPostDialSequence)
 
 public void onVideoCallChanged(Call call, VideoCall videoCall) 

 public void onCallDestroyed(Call call)

 public void onConferenceableCallsChanged(Call call, List<Call> conferenceableCalls) 
 
 public void onConnectionEvent(Call call, String event, Bundle extras)
 


 
 

 精通以上各个方法的含义,你就可以尝试自己去写通话apk了
 ------------------------------------------------------------------------------------------------------------------------------------
 
得到通知后都直接或间接通过调用CallList中的方法通知本地观察者进行相应处理,
CallList提供了接口让观察者自己去实现来处理相应功能或界面需求。
    1.主要针对一路或多路通话的共有特性元素修改。
   

 /**
     * Listener interface for any class that wants to be notified of changes
     * to the call list.
     */
    public interface Listener {
        
        public void onIncomingCall(Call call);

        /
        public void onUpgradeToVideo(Call call);

        /**
         * Called anytime there are changes to the call list.  The change can be switching call
         * states, updating information, etc. This method will NOT be called for new incoming
         * calls and for calls that switch to disconnected state. Listeners must add actions
         * to those method implementations if they want to deal with those actions.
         */
        public void onCallListChange(CallList callList);

        
        public void onDisconnect(Call call);

    }


    
    
    2.主要针对其中一路通话所独占的特性元素修改。(大部分实现该接口的onCallChanged方法中没干任何事情,主要是为了实现视频通话与语音通话切换时会调用的onSessionModificationStateChange方法)
    

public interface CallUpdateListener {
        // TODO: refactor and limit arg to be call state.  Caller info is not needed.
        public void onCallChanged(Call call);

        /**
         * Notifies of a change to the session modification state for a call.
         *
         * @param sessionModificationState The new session modification state.
         */
        public void onSessionModificationStateChange(Call call, int sessionModificationState);

        /**
         * Notifies of a change to the last forwarded number for a call.
         */
        public void onLastForwardedNumberChange();

        /**
         * Notifies of a change to the child number for a call.
         */
        public void onChildNumberChange();
    }

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值