TelecomManager.AddNewIncomingCall(PhoneAccountHandle, Bundle) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Registers a new incoming call.
[Android.Runtime.Register("addNewIncomingCall", "(Landroid/telecom/PhoneAccountHandle;Landroid/os/Bundle;)V", "GetAddNewIncomingCall_Landroid_telecom_PhoneAccountHandle_Landroid_os_Bundle_Handler", ApiSince=23)]
public virtual void AddNewIncomingCall (Android.Telecom.PhoneAccountHandle? phoneAccount, Android.OS.Bundle? extras);
[<Android.Runtime.Register("addNewIncomingCall", "(Landroid/telecom/PhoneAccountHandle;Landroid/os/Bundle;)V", "GetAddNewIncomingCall_Landroid_telecom_PhoneAccountHandle_Landroid_os_Bundle_Handler", ApiSince=23)>]
abstract member AddNewIncomingCall : Android.Telecom.PhoneAccountHandle * Android.OS.Bundle -> unit
override this.AddNewIncomingCall : Android.Telecom.PhoneAccountHandle * Android.OS.Bundle -> unit
Parameters
- phoneAccount
- PhoneAccountHandle
A PhoneAccountHandle
registered with
#registerPhoneAccount
.
- extras
- Bundle
A bundle that will be passed through to
ConnectionService#onCreateIncomingConnection
.
- Attributes
Remarks
Registers a new incoming call. A ConnectionService
should invoke this method when it has an incoming call. For managed ConnectionService
s, the specified PhoneAccountHandle
must have been registered with #registerPhoneAccount
and the user must have enabled the corresponding PhoneAccount
. This can be checked using #getPhoneAccount
. Self-managed ConnectionService
s must have android.Manifest.permission#MANAGE_OWN_CALLS
to add a new incoming call.
Specify the address associated with the incoming call using #EXTRA_INCOMING_CALL_ADDRESS
. If an incoming call is from an anonymous source, omit this extra and ensure you specify a valid number presentation via Connection#setAddress(Uri, int)
on the Connection
instance you return in your ConnectionService#onCreateIncomingConnection(PhoneAccountHandle, ConnectionRequest)
implementation.
The incoming call you are adding is assumed to have a video state of VideoProfile#STATE_AUDIO_ONLY
, unless the extra value #EXTRA_INCOMING_VIDEO_STATE
is specified.
Once invoked, this method will cause the system to bind to the ConnectionService
associated with the PhoneAccountHandle
and request additional information about the call (See ConnectionService#onCreateIncomingConnection
) before starting the incoming call UI.
For a managed ConnectionService
, a SecurityException
will be thrown if either the PhoneAccountHandle
does not correspond to a registered PhoneAccount
or the associated PhoneAccount
is not currently enabled by the user.
For a self-managed ConnectionService
, a SecurityException
will be thrown if the PhoneAccount
has PhoneAccount#CAPABILITY_SELF_MANAGED
and the calling app does not have android.Manifest.permission#MANAGE_OWN_CALLS
.
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.