Condividi tramite


ConnectionService.OnCreateOutgoingHandoverConnection Method

Definition

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

[Android.Runtime.Register("onCreateOutgoingHandoverConnection", "(Landroid/telecom/PhoneAccountHandle;Landroid/telecom/ConnectionRequest;)Landroid/telecom/Connection;", "GetOnCreateOutgoingHandoverConnection_Landroid_telecom_PhoneAccountHandle_Landroid_telecom_ConnectionRequest_Handler", ApiSince=28)]
public virtual Android.Telecom.Connection? OnCreateOutgoingHandoverConnection (Android.Telecom.PhoneAccountHandle? fromPhoneAccountHandle, Android.Telecom.ConnectionRequest? request);
[<Android.Runtime.Register("onCreateOutgoingHandoverConnection", "(Landroid/telecom/PhoneAccountHandle;Landroid/telecom/ConnectionRequest;)Landroid/telecom/Connection;", "GetOnCreateOutgoingHandoverConnection_Landroid_telecom_PhoneAccountHandle_Landroid_telecom_ConnectionRequest_Handler", ApiSince=28)>]
abstract member OnCreateOutgoingHandoverConnection : Android.Telecom.PhoneAccountHandle * Android.Telecom.ConnectionRequest -> Android.Telecom.Connection
override this.OnCreateOutgoingHandoverConnection : 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 to handover.

Returns

Connection instance corresponding to the handover call.

Attributes

Remarks

Called by Telecom to request that a ConnectionService creates an instance of an outgoing 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 ConnectionService on <em>initiating</em> device when the user initiates a handover request from one app to another. The user request originates in the InCallService via android.telecom.Call#handoverTo(PhoneAccountHandle, int, Bundle).

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. If your app does not wish to accept a handover to it at this time, you can return null. The code below shows an example of how this is done.

{@code
            public Connection onCreateIncomingHandoverConnection(PhoneAccountHandle
                fromPhoneAccountHandle, ConnectionRequest request) {
              if (!isHandoverAvailable()) {
                  return null;
              }
              MyConnection connection = new MyConnection();
              connection.setAddress(request.getAddress(), TelecomManager.PRESENTATION_ALLOWED);
              connection.setVideoState(request.getVideoState());
              return connection;
            }
            }

Java documentation for android.telecom.ConnectionService.onCreateOutgoingHandoverConnection(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