Share via


ConnectionService.OnCreateIncomingHandoverConnection Method

Definition

Called by Telecom to request that a ConnectionService creates an instance of an incoming handover Connection.

[Android.Runtime.Register("onCreateIncomingHandoverConnection", "(Landroid/telecom/PhoneAccountHandle;Landroid/telecom/ConnectionRequest;)Landroid/telecom/Connection;", "GetOnCreateIncomingHandoverConnection_Landroid_telecom_PhoneAccountHandle_Landroid_telecom_ConnectionRequest_Handler", ApiSince=28)]
public virtual Android.Telecom.Connection? OnCreateIncomingHandoverConnection (Android.Telecom.PhoneAccountHandle? fromPhoneAccountHandle, Android.Telecom.ConnectionRequest? request);
[<Android.Runtime.Register("onCreateIncomingHandoverConnection", "(Landroid/telecom/PhoneAccountHandle;Landroid/telecom/ConnectionRequest;)Landroid/telecom/Connection;", "GetOnCreateIncomingHandoverConnection_Landroid_telecom_PhoneAccountHandle_Landroid_telecom_ConnectionRequest_Handler", ApiSince=28)>]
abstract member OnCreateIncomingHandoverConnection : Android.Telecom.PhoneAccountHandle * Android.Telecom.ConnectionRequest -> Android.Telecom.Connection
override this.OnCreateIncomingHandoverConnection : Android.Telecom.PhoneAccountHandle * Android.Telecom.ConnectionRequest -> Android.Telecom.Connection

Parameters

fromPhoneAccountHandle
PhoneAccountHandle

PhoneAccountHandle associated with the ConnectionService which needs to handover the call.

request
ConnectionRequest

Details about the call which needs to be handover.

Returns

Connection instance corresponding to the handover call.

Attributes

Remarks

Called by Telecom to request that a ConnectionService creates an instance of an incoming handover Connection.

A call handover is the process where an ongoing call is transferred from one app (i.e. ConnectionService to another app. The user could, for example, choose to continue a mobile network call in a video calling app. The mobile network call via the Telephony stack is referred to as the source of the handover, and the video calling app is referred to as the destination.

When considering a handover scenario the <em>initiating</em> device is where a user initiated the handover process (e.g. by calling android.telecom.Call#handoverTo( PhoneAccountHandle, int, Bundle), and the other device is considered the <em>receiving</em> device.

This method is called on the destination app on the <em>receiving</em> device when the destination app calls TelecomManager#acceptHandover(Uri, int, PhoneAccountHandle) to accept an incoming handover from the <em>initiating</em> device.

For a full discussion of the handover process and the APIs involved, see android.telecom.Call#handoverTo(PhoneAccountHandle, int, Bundle).

Implementations of this method should return an instance of Connection which represents the handover. The code below shows an example of how this is done.

{@code
            public Connection onCreateIncomingHandoverConnection(PhoneAccountHandle
                fromPhoneAccountHandle, ConnectionRequest request) {
              // Given that your app requested to accept the handover, you should not return null here.
              MyConnection connection = new MyConnection();
              connection.setAddress(request.getAddress(), TelecomManager.PRESENTATION_ALLOWED);
              connection.setVideoState(request.getVideoState());
              return connection;
            }
            }

Java documentation for android.telecom.ConnectionService.onCreateIncomingHandoverConnection(android.telecom.PhoneAccountHandle, android.telecom.ConnectionRequest).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to