Builder
class Builder
kotlin.Any | |
↳ | android.telecom.PhoneAccount.Builder |
Helper class for creating a PhoneAccount
.
Summary
Public constructors | |
---|---|
Builder(accountHandle: PhoneAccountHandle!, label: CharSequence!) Creates a builder with the specified |
|
Builder(phoneAccount: PhoneAccount!) Creates an instance of the |
Public methods | |
---|---|
open PhoneAccount.Builder! |
addSupportedUriScheme(uriScheme: String!) Specifies an additional URI scheme supported by the |
open PhoneAccount! |
build() Creates an instance of a |
open PhoneAccount.Builder |
Clears a previously set simultaneous calling restriction set when |
open PhoneAccount.Builder! |
setAddress(value: Uri!) Sets the address. |
open PhoneAccount.Builder! |
setCapabilities(value: Int) Sets the capabilities. |
open PhoneAccount.Builder! |
Specifies the extras associated with the |
open PhoneAccount.Builder! |
setHighlightColor(value: Int) Sets the highlight color. |
open PhoneAccount.Builder! |
Sets the icon. |
open PhoneAccount.Builder! |
setShortDescription(value: CharSequence!) Sets the short description. |
open PhoneAccount.Builder |
Restricts the ability of this |
open PhoneAccount.Builder! |
setSubscriptionAddress(value: Uri!) Sets the subscription address. |
open PhoneAccount.Builder! |
setSupportedUriSchemes(uriSchemes: MutableList<String!>!) Specifies the URI schemes supported by the |
Public constructors
Builder
Builder(
accountHandle: PhoneAccountHandle!,
label: CharSequence!)
Creates a builder with the specified PhoneAccountHandle
and label.
Note: each CharSequence or String field is limited to 256 characters. This check is enforced when registering the PhoneAccount via TelecomManager#registerPhoneAccount(PhoneAccount)
and will cause an IllegalArgumentException
to be thrown if the character field limit is over 256.
Builder
Builder(phoneAccount: PhoneAccount!)
Creates an instance of the PhoneAccount.Builder
from an existing PhoneAccount
.
Parameters | |
---|---|
phoneAccount |
PhoneAccount!: The PhoneAccount used to initialize the builder. |
Public methods
addSupportedUriScheme
open fun addSupportedUriScheme(uriScheme: String!): PhoneAccount.Builder!
Specifies an additional URI scheme supported by the PhoneAccount
.
Each URI scheme is limited to 256 characters. Adding a scheme over 256 characters will cause an IllegalArgumentException
to be thrown when the account is registered.
Parameters | |
---|---|
uriScheme |
String!: The URI scheme. |
Return | |
---|---|
PhoneAccount.Builder! |
The builder. |
build
open fun build(): PhoneAccount!
Creates an instance of a PhoneAccount
based on the current builder settings.
Return | |
---|---|
PhoneAccount! |
The PhoneAccount . |
clearSimultaneousCallingRestriction
open fun clearSimultaneousCallingRestriction(): PhoneAccount.Builder
Clears a previously set simultaneous calling restriction set when PhoneAccount.Builder#Builder(PhoneAccount)
is used to create a new PhoneAccount from an existing one.
Return | |
---|---|
PhoneAccount.Builder |
The Builder used to set up the new PhoneAccount. This value cannot be null . |
setAddress
open fun setAddress(value: Uri!): PhoneAccount.Builder!
Sets the address. See PhoneAccount#getAddress
.
Note: The entire URI value is limited to 256 characters. This check is enforced when registering the PhoneAccount via TelecomManager#registerPhoneAccount(PhoneAccount)
and will cause an IllegalArgumentException
to be thrown if URI is over 256.
Parameters | |
---|---|
value |
Uri!: The address of the phone account. |
Return | |
---|---|
PhoneAccount.Builder! |
The builder. |
setCapabilities
open fun setCapabilities(value: Int): PhoneAccount.Builder!
Sets the capabilities. See PhoneAccount#getCapabilities
.
Parameters | |
---|---|
value |
Int: The capabilities to set. |
Return | |
---|---|
PhoneAccount.Builder! |
The builder. |
setExtras
open fun setExtras(extras: Bundle!): PhoneAccount.Builder!
Specifies the extras associated with the PhoneAccount
.
PhoneAccount
s only support extra values of type: String
, Integer
, and Boolean
. Extras which are not of these types are ignored.
Note: Each Bundle (Key, Value) String field is limited to 256 characters. Additionally, the bundle is limited to 100 (Key, Value) pairs total. This check is enforced when registering the PhoneAccount via TelecomManager#registerPhoneAccount(PhoneAccount)
and will cause an IllegalArgumentException
to be thrown if the character field limit is over 256 or more than 100 (Key, Value) pairs are in the Bundle.
Parameters | |
---|---|
extras |
Bundle!: |
Return | |
---|---|
PhoneAccount.Builder! |
setHighlightColor
open fun setHighlightColor(value: Int): PhoneAccount.Builder!
Sets the highlight color. See PhoneAccount#getHighlightColor
.
Parameters | |
---|---|
value |
Int: The highlight color. |
Return | |
---|---|
PhoneAccount.Builder! |
The builder. |
setIcon
open fun setIcon(icon: Icon!): PhoneAccount.Builder!
Sets the icon. See PhoneAccount#getIcon
.
Note: An IllegalArgumentException
if the Icon cannot be written to memory. This check is enforced when registering the PhoneAccount via TelecomManager#registerPhoneAccount(PhoneAccount)
Parameters | |
---|---|
icon |
Icon!: The icon to set. |
setShortDescription
open fun setShortDescription(value: CharSequence!): PhoneAccount.Builder!
Sets the short description. See PhoneAccount#getShortDescription
.
Note: Each CharSequence or String field is limited to 256 characters. This check is enforced when registering the PhoneAccount via TelecomManager#registerPhoneAccount(PhoneAccount)
and will cause an IllegalArgumentException
to be thrown if the character field limit is over 256.
Parameters | |
---|---|
value |
CharSequence!: The short description. |
Return | |
---|---|
PhoneAccount.Builder! |
The builder. |
setSimultaneousCallingRestriction
open fun setSimultaneousCallingRestriction(handles: MutableSet<PhoneAccountHandle!>): PhoneAccount.Builder
Restricts the ability of this PhoneAccount
to ONLY support simultaneous calling with the other PhoneAccountHandle
s in this Set.
If two or more PhoneAccount
s support calling simultaneously, it means that Telecom allows the user to place additional outgoing calls and receive additional incoming calls using other PhoneAccount
s while this PhoneAccount also has one or more active calls.
If this setter method is never called or cleared using clearSimultaneousCallingRestriction()
, there is no restriction and all PhoneAccount
s registered to Telecom by this package support simultaneous calling. If this setter is called and set as an empty Set, then this PhoneAccount
does not support simultaneous calling with any other PhoneAccount
s registered by the same application.
Note: Simultaneous calling restrictions can only be placed on PhoneAccount
s that were registered by the same application. Simultaneous calling across applications is always possible as long as the Connection
supports hold. If a PhoneAccountHandle
is included here and the package name doesn't match this application's package name, TelecomManager#registerPhoneAccount(PhoneAccount)
will throw a SecurityException
.
Parameters | |
---|---|
handles |
MutableSet<PhoneAccountHandle!>: The other PhoneAccountHandle s that support calling simultaneously with this one. Use clearSimultaneousCallingRestriction() to remove the restriction and allow simultaneous calling to be supported across all PhoneAccount s registered by this package. This value cannot be null . |
Return | |
---|---|
PhoneAccount.Builder |
The Builder used to set up the new PhoneAccount. This value cannot be null . |
setSubscriptionAddress
open fun setSubscriptionAddress(value: Uri!): PhoneAccount.Builder!
Sets the subscription address. See PhoneAccount#getSubscriptionAddress
.
Parameters | |
---|---|
value |
Uri!: The subscription address. |
Return | |
---|---|
PhoneAccount.Builder! |
The builder. |
setSupportedUriSchemes
open fun setSupportedUriSchemes(uriSchemes: MutableList<String!>!): PhoneAccount.Builder!
Specifies the URI schemes supported by the PhoneAccount
.
A max of 10 URI schemes can be added per account. Additionally, each URI scheme is limited to 256 characters. Adding more than 10 URI schemes or 256 characters on any scheme will cause an IllegalArgumentException
to be thrown when the account is registered.
Parameters | |
---|---|
uriSchemes |
MutableList<String!>!: The URI schemes. |
Return | |
---|---|
PhoneAccount.Builder! |
The builder. |