android 7.0 拨打接听蓝牙电话code流程

来源:互联网 发布:subnautica mac 编辑:程序博客网 时间:2024/05/17 03:17

由于android7.0增加了车载新特性,在car模块实现了蓝牙电话功能,蓝牙电话架构与5.0相比有比较大的改动, 下面是拨打电话与接电话code流程:

拨打电话流程(outgoing call)

1. com.android.car.dialer.DialerFragment.callButton.onClick();
2. com.android.car.dialer.telecom.UiCallManager.safePlaceCall(String number, boolean bluetoothRequired);
3. com.android.car.dialer.telecom.embedded.TelecomUiCallManager.placeCall(String number);

4. android.telecom.TelecomManager.placeCall(Uri address, Bundle extras);

5. com.android.server.telecom.TelecomServiceImpl.placeCall(Uri handle, Bundle extras, String callingPackage);

6. com.android.server.telecom.components.UserCallIntentProcessor.processIntent(Intent intent, String callingPackageName, boolean canCallNonEmergency)
      .processOutgoingCallIntent(Intent intent, String callingPackageName, boolean canCallNonEmergency).sendBroadcastToReceiver(Intent intent);
7. com.android.server.telecom.components.PrimaryCallReceiver.onReceive();
8. com.android.server.telecom.CallIntentProcessor.processIntent(Intent intent).processOutgoingCallIntent(Context context, CallsManager callsManager, Intent intent);
9. com.android.server.telecom.CallsManager.startOutgoingCall(Uri handle, PhoneAccountHandle phoneAccountHandle, Bundle extras, UserHandle initiatingUser);
10.com.android.server.telecom.NewOutgoingCallIntentBroadcaster.processIntent()
      .broadcastIntent(Intent originalCallIntent, String number, boolean receiverRequired, UserHandle targetUser);
11.com.android.server.telecom.NewOutgoingCallBroadcastIntentReceiver.onReceive();
12.com.android.server.telecom.CallsManager.placeOutgoingCall(Call call, Uri handle, GatewayInfo gatewayInfo, boolean speakerphoneOn, int videoState);

13.com.android.server.telecom.Call.startCreateConnection(PhoneAccountRegistrar phoneAccountRegistrar);
14.com.android.server.telecom.CreateConnectionProcessor.process().attemptNextPhoneAccount();
15.com.android.server.telecom.ConnectionServiceWrapper(extends ServiceBinder).createConnection(final Call call, final CreateConnectionResponse response);
16.com.android.server.telecom.ServiceBinder.bind(BindCallback callback, Call call);
17.com.android.server.telecom.ConnectionServiceWrapper.setServiceInterface(IBinder binder);
18.com.android.server.telecom.ConnectionServiceWrapper.BindCallback.onSuccess();

19.com.android.internal.telecom.IConnectionService(.aidl).createConnection(PhoneAccountHandle connectionManagerPhoneAccount,
          String id, ConnectionRequest request, boolean isIncoming, boolean isUnknown);
20.android.telecom.ConnectionService.createConnection(final PhoneAccountHandle callManagerAccount,
            final String callId, final ConnectionRequest request, boolean isIncoming, boolean isUnknown);
            
21.com.android.bluetooth.hfpclient.connserv.HfpClientConnectionService
            .onCreateOutgoingConnection(PhoneAccountHandle connectionManagerAccount, ConnectionRequest request)
            .buildConnection(BluetoothDevice device, BluetoothHeadsetClientCall call, Uri number);
22.com.android.bluetooth.hfpclient.connserv.HfpClientConnection.HfpClientConnection(Context context, BluetoothDevice device, BluetoothHeadsetClient client, Uri number);

23.android.bluetooth.BluetoothHeadsetClient.dial(BluetoothDevice device, String number);

24.com.android.bluetooth.hfpclient.HeadsetClientService.dial(BluetoothDevice device, String number);


接电话流程(answer call)
1. com.android.car.dialer.telecom.embedded.TelecomUiCallManager.answerCall(UiCall uiCall);
2. android.telecom.Call.answer(0);
3. android.telecom.InCallAdapter.answerCall(mTelecomCallId, videoState);
 
4. com.android.server.telecom.InCallAdapter.answerCall(String callId, int videoState);
5. com.android.server.telecom.CallsManager.answerCall(Call call, int videoState);
6. com.android.server.telecom.Call.answer(int videoState);
7. com.android.server.telecom.ConnectionServiceWrapper.answer(this, videoState);
 
*8. android.telecom.ConnectionService.answer(String callId);
   (com.android.bluetooth.hfpclient.connserv.HfpClientConnectionService)
*9. android.telecom.Connection(HfpClientConnection).onAnswer();
   (com.android.bluetooth.hfpclient.connserv.HfpClientConnection.onAnswer())
    
10.android.bluetooth.BluetoothHeadsetClient.acceptCall(BluetoothDevice device, int flag);
 
11.com.android.bluetooth.hfpclient.HeadsetClientService.acceptCall(BluetoothDevice device, int flag);

0 0