PhoneAccount.Builder
public
static
class
PhoneAccount.Builder
extends Object
java.lang.Object | |
↳ | android.telecom.PhoneAccount.Builder |
Helper class for creating a PhoneAccount
.
Summary
Public constructors | |
---|---|
Builder(PhoneAccountHandle accountHandle, CharSequence label)
Creates a builder with the specified |
|
Builder(PhoneAccount phoneAccount)
Creates an instance of the |
Public methods | |
---|---|
PhoneAccount.Builder
|
addSupportedUriScheme(String uriScheme)
Specifies an additional URI scheme supported by the |
PhoneAccount
|
build()
Creates an instance of a |
PhoneAccount.Builder
|
setAddress(Uri value)
Sets the address. |
PhoneAccount.Builder
|
setCapabilities(int value)
Sets the capabilities. |
PhoneAccount.Builder
|
setExtras(Bundle extras)
Specifies the extras associated with the |
PhoneAccount.Builder
|
setHighlightColor(int value)
Sets the highlight color. |
PhoneAccount.Builder
|
setIcon(Icon icon)
Sets the icon. |
PhoneAccount.Builder
|
setShortDescription(CharSequence value)
Sets the short description. |
PhoneAccount.Builder
|
setSubscriptionAddress(Uri value)
Sets the subscription address. |
PhoneAccount.Builder
|
setSupportedUriSchemes(List<String> uriSchemes)
Specifies the URI schemes supported by the |
Inherited methods | |
---|---|
Public constructors
Builder
public Builder (PhoneAccountHandle accountHandle, CharSequence label)
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.
Parameters | |
---|---|
accountHandle |
PhoneAccountHandle |
label |
CharSequence |
Builder
public 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
public PhoneAccount.Builder addSupportedUriScheme (String uriScheme)
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. |
Returns | |
---|---|
PhoneAccount.Builder |
The builder. |
build
public PhoneAccount build ()
Creates an instance of a PhoneAccount
based on the current builder settings.
Returns | |
---|---|
PhoneAccount |
The PhoneAccount . |
setAddress
public PhoneAccount.Builder setAddress (Uri value)
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. |
Returns | |
---|---|
PhoneAccount.Builder |
The builder. |
setCapabilities
public PhoneAccount.Builder setCapabilities (int value)
Sets the capabilities. See PhoneAccount#getCapabilities
.
Parameters | |
---|---|
value |
int : The capabilities to set. |
Returns | |
---|---|
PhoneAccount.Builder |
The builder. |
setExtras
public PhoneAccount.Builder setExtras (Bundle extras)
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.
Returns | |
---|---|
PhoneAccount.Builder |
setHighlightColor
public PhoneAccount.Builder setHighlightColor (int value)
Sets the highlight color. See PhoneAccount#getHighlightColor
.
Parameters | |
---|---|
value |
int : The highlight color. |
Returns | |
---|---|
PhoneAccount.Builder |
The builder. |
setIcon
public PhoneAccount.Builder setIcon (Icon icon)
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. |
Returns | |
---|---|
PhoneAccount.Builder |
setShortDescription
public PhoneAccount.Builder setShortDescription (CharSequence value)
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. |
Returns | |
---|---|
PhoneAccount.Builder |
The builder. |
setSubscriptionAddress
public PhoneAccount.Builder setSubscriptionAddress (Uri value)
Sets the subscription address. See PhoneAccount#getSubscriptionAddress
.
Parameters | |
---|---|
value |
Uri : The subscription address. |
Returns | |
---|---|
PhoneAccount.Builder |
The builder. |
setSupportedUriSchemes
public PhoneAccount.Builder setSupportedUriSchemes (List<String> uriSchemes)
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 |
List : The URI schemes. |
Returns | |
---|---|
PhoneAccount.Builder |
The builder. |