PhoneAccount
public
final
class
PhoneAccount
extends Object
implements
Parcelable
java.lang.Object | |
↳ | android.telecom.PhoneAccount |
Represents a distinct method to place or receive a phone call. Apps which can place calls and
want those calls to be integrated into the dialer and in-call UI should build an instance of
this class and register it with the system using TelecomManager
.
TelecomManager
uses registered PhoneAccount
s to present the user with
alternative options when placing a phone call. When building a PhoneAccount
, the app
should supply a valid PhoneAccountHandle
that references the connection service
implementation Telecom will use to interact with the app.
Summary
Nested classes | |
---|---|
class |
PhoneAccount.Builder
Helper class for creating a |
Constants | |
---|---|
int |
CAPABILITY_ADHOC_CONFERENCE_CALLING
An adhoc conference call is established by providing a list of addresses to
|
int |
CAPABILITY_CALL_COMPOSER
Flag indicating whether this |
int |
CAPABILITY_CALL_PROVIDER
Flag indicating that this |
int |
CAPABILITY_CALL_SUBJECT
Flag indicating that this |
int |
CAPABILITY_CONNECTION_MANAGER
Flag indicating that this |
int |
CAPABILITY_PLACE_EMERGENCY_CALLS
Flag indicating that this |
int |
CAPABILITY_RTT
Flag indicating that this |
int |
CAPABILITY_SELF_MANAGED
Flag indicating that this |
int |
CAPABILITY_SIM_SUBSCRIPTION
Flag indicating that this |
int |
CAPABILITY_SUPPORTS_CALL_STREAMING
Flag indicating that this voip app |
int |
CAPABILITY_SUPPORTS_TRANSACTIONAL_OPERATIONS
Flag indicating that this |
int |
CAPABILITY_SUPPORTS_VIDEO_CALLING
Flag indicating that this |
int |
CAPABILITY_SUPPORTS_VOICE_CALLING_INDICATIONS
Flag indicating that this |
int |
CAPABILITY_VIDEO_CALLING
Flag indicating that this |
int |
CAPABILITY_VIDEO_CALLING_RELIES_ON_PRESENCE
Flag indicating that for this |
int |
CAPABILITY_VOICE_CALLING_AVAILABLE
Flag indicating that this |
String |
EXTRA_ADD_SELF_MANAGED_CALLS_TO_INCALLSERVICE
Boolean |
String |
EXTRA_ALWAYS_USE_VOIP_AUDIO_MODE
Boolean |
String |
EXTRA_CALL_SUBJECT_CHARACTER_ENCODING
|
String |
EXTRA_CALL_SUBJECT_MAX_LENGTH
|
String |
EXTRA_LOG_SELF_MANAGED_CALLS
Boolean |
String |
EXTRA_SUPPORTS_HANDOVER_FROM
Boolean |
String |
EXTRA_SUPPORTS_HANDOVER_TO
Boolean |
int |
NO_HIGHLIGHT_COLOR
Indicating no hightlight color is set. |
int |
NO_RESOURCE_ID
Indicating no resource ID is set. |
String |
SCHEME_SIP
URI scheme for SIP URIs. |
String |
SCHEME_TEL
URI scheme for telephone number URIs. |
String |
SCHEME_VOICEMAIL
URI scheme for voicemail URIs. |
Inherited constants |
---|
Fields | |
---|---|
public
static
final
Creator<PhoneAccount> |
CREATOR
|
Public methods | |
---|---|
static
PhoneAccount.Builder
|
builder(PhoneAccountHandle accountHandle, CharSequence label)
|
int
|
describeContents()
Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. |
boolean
|
equals(Object o)
Indicates whether some other object is "equal to" this one. |
PhoneAccountHandle
|
getAccountHandle()
The unique identifier of this |
Uri
|
getAddress()
The address (e.g., a phone number) associated with this |
int
|
getCapabilities()
The capabilities of this |
Bundle
|
getExtras()
The extras associated with this |
int
|
getHighlightColor()
A highlight color to use in displaying information about this |
Icon
|
getIcon()
The icon to represent this |
CharSequence
|
getLabel()
A short label describing a |
CharSequence
|
getShortDescription()
A short paragraph describing this |
Set<PhoneAccountHandle>
|
getSimultaneousCallingRestriction()
If a restriction is set (see |
Uri
|
getSubscriptionAddress()
The raw callback number used for this |
List<String>
|
getSupportedUriSchemes()
The URI schemes supported by this |
boolean
|
hasCapabilities(int capability)
Determines if this |
boolean
|
hasSimultaneousCallingRestriction()
Whether or not this |
int
|
hashCode()
Returns a hash code value for the object. |
boolean
|
isEnabled()
Indicates whether the user has enabled this |
boolean
|
supportsUriScheme(String uriScheme)
Determines if the |
PhoneAccount.Builder
|
toBuilder()
Returns a builder initialized with the current |
String
|
toString()
Returns a string representation of the object. |
void
|
writeToParcel(Parcel out, int flags)
Flatten this object in to a Parcel. |
Inherited methods | |
---|---|
Constants
CAPABILITY_ADHOC_CONFERENCE_CALLING
public static final int CAPABILITY_ADHOC_CONFERENCE_CALLING
An adhoc conference call is established by providing a list of addresses to
TelecomManager#startConference(List<Uri>, int videoState)
where the
ConnectionService
is responsible for connecting all indicated participants
to a conference simultaneously.
This is in contrast to conferences formed by merging calls together (e.g. using
Call.mergeConference()
).
Constant Value: 16384 (0x00004000)
CAPABILITY_CALL_COMPOSER
public static final int CAPABILITY_CALL_COMPOSER
Flag indicating whether this PhoneAccount
is capable of supporting the call composer
functionality for enriched calls.
Constant Value: 32768 (0x00008000)
CAPABILITY_CALL_PROVIDER
public static final int CAPABILITY_CALL_PROVIDER
Flag indicating that this PhoneAccount
can make phone calls in place of
traditional SIM-based telephony calls. This account will be treated as a distinct method
for placing calls alongside the traditional SIM-based telephony stack. This flag is
distinct from CAPABILITY_CONNECTION_MANAGER
in that it is not allowed to manage
or place calls from the built-in telephony stack.
Constant Value: 2 (0x00000002)
CAPABILITY_CALL_SUBJECT
public static final int CAPABILITY_CALL_SUBJECT
Flag indicating that this PhoneAccount
supports a subject for Calls. This means a
caller is able to specify a short subject line for an outgoing call. A capable receiving
device displays the call subject on the incoming call screen.
Constant Value: 64 (0x00000040)
CAPABILITY_CONNECTION_MANAGER
public static final int CAPABILITY_CONNECTION_MANAGER
Flag indicating that this PhoneAccount
can act as a connection manager for
other connections. The ConnectionService
associated with this PhoneAccount
will be allowed to manage phone calls including using its own proprietary phone-call
implementation (like VoIP calling) to make calls instead of the telephony stack.
When a user opts to place a call using the SIM-based telephony stack, the
ConnectionService
associated with this PhoneAccount
will be attempted first
if the user has explicitly selected it to be used as the default connection manager.
Constant Value: 1 (0x00000001)
CAPABILITY_PLACE_EMERGENCY_CALLS
public static final int CAPABILITY_PLACE_EMERGENCY_CALLS
Flag indicating that this PhoneAccount
is capable of placing emergency calls.
By default all PSTN PhoneAccount
s are capable of placing emergency calls.
Constant Value: 16 (0x00000010)
CAPABILITY_RTT
public static final int CAPABILITY_RTT
Flag indicating that this PhoneAccount
is capable of making a call with an
RTT (Real-time text) session.
When set, Telecom will attempt to open an RTT session on outgoing calls that specify
that they should be placed with an RTT session , and the in-call app will be displayed
with text entry fields for RTT. Likewise, the in-call app can request that an RTT
session be opened during a call if this bit is set.
Constant Value: 4096 (0x00001000)
CAPABILITY_SELF_MANAGED
public static final int CAPABILITY_SELF_MANAGED
Flag indicating that this PhoneAccount
is responsible for managing its own
Connection
s. This type of PhoneAccount
is ideal for use with standalone
calling apps which do not wish to use the default phone app for Connection
UX,
but which want to leverage the call and audio routing capabilities of the Telecom framework.
When set, Connection
s created by the self-managed ConnectionService
will not
be surfaced to implementations of the InCallService
API. Thus it is the
responsibility of a self-managed ConnectionService
to provide a user interface for
its Connection
s.
Self-managed Connection
s will, however, be displayed on connected Bluetooth devices.
Constant Value: 2048 (0x00000800)
CAPABILITY_SIM_SUBSCRIPTION
public static final int CAPABILITY_SIM_SUBSCRIPTION
Flag indicating that this PhoneAccount
represents a built-in PSTN SIM
subscription.
Only the Android framework can register a PhoneAccount
having this capability.
Constant Value: 4 (0x00000004)
CAPABILITY_SUPPORTS_CALL_STREAMING
public static final int CAPABILITY_SUPPORTS_CALL_STREAMING
Flag indicating that this voip app PhoneAccount
supports the call streaming session
to stream call audio to another remote device via streaming app.
See also:
Constant Value: 524288 (0x00080000)
CAPABILITY_SUPPORTS_TRANSACTIONAL_OPERATIONS
public static final int CAPABILITY_SUPPORTS_TRANSACTIONAL_OPERATIONS
Flag indicating that this PhoneAccount
supports the use TelecomManager APIs that
utilize OutcomeReceiver
s or Consumer
s.
Be aware, if this capability is set, CAPABILITY_SELF_MANAGED
will be amended by
Telecom when this PhoneAccount
is registered via
TelecomManager.registerPhoneAccount(PhoneAccount)
.
OutcomeReceiver
s and Consumer
s represent
transactional operations because the operation can succeed or fail. An app wishing to use
transactional operations should define behavior for a successful and failed TelecomManager
API call.
See also:
Constant Value: 262144 (0x00040000)
CAPABILITY_SUPPORTS_VIDEO_CALLING
public static final int CAPABILITY_SUPPORTS_VIDEO_CALLING
Flag indicating that this PhoneAccount
supports video calling.
This is not an indication that the PhoneAccount
is currently able to make a video
call, but rather that it has the ability to make video calls (but not necessarily at this
time).
Whether a PhoneAccount
can make a video call is ultimately controlled by
CAPABILITY_VIDEO_CALLING
, which indicates whether the PhoneAccount
is
currently capable of making a video call. Consider a case where, for example, a
PhoneAccount
supports making video calls (e.g.
CAPABILITY_SUPPORTS_VIDEO_CALLING
), but a current lack of network connectivity
prevents video calls from being made (e.g. CAPABILITY_VIDEO_CALLING
).
Constant Value: 1024 (0x00000400)
CAPABILITY_SUPPORTS_VOICE_CALLING_INDICATIONS
public static final int CAPABILITY_SUPPORTS_VOICE_CALLING_INDICATIONS
Flag indicating that this PhoneAccount
provides SIM-based voice calls, potentially as
an over-the-top solution such as wi-fi calling.
Similar to CAPABILITY_SUPPORTS_VIDEO_CALLING
, this capability indicates this
PhoneAccount
has the ability to make voice calls (but not necessarily at this time).
Whether this PhoneAccount
can make a voice call is ultimately controlled by CAPABILITY_VOICE_CALLING_AVAILABLE
, which indicates whether this PhoneAccount
is
currently capable of making a voice call. Consider a case where, for example, a PhoneAccount
supports making voice calls (e.g. CAPABILITY_SUPPORTS_VOICE_CALLING_INDICATIONS
), but a current lack of network connectivity
prevents voice calls from being made (e.g. CAPABILITY_VOICE_CALLING_AVAILABLE
).
In order to declare this capability, this PhoneAccount
must also declare CAPABILITY_SIM_SUBSCRIPTION
or CAPABILITY_CONNECTION_MANAGER
and satisfy the
associated requirements.
Constant Value: 65536 (0x00010000)
CAPABILITY_VIDEO_CALLING
public static final int CAPABILITY_VIDEO_CALLING
Flag indicating that this PhoneAccount
is currently able to place video calls.
See also CAPABILITY_SUPPORTS_VIDEO_CALLING
which indicates whether the
PhoneAccount
supports placing video calls.
Constant Value: 8 (0x00000008)
CAPABILITY_VIDEO_CALLING_RELIES_ON_PRESENCE
public static final int CAPABILITY_VIDEO_CALLING_RELIES_ON_PRESENCE
Flag indicating that for this PhoneAccount
, the ability to make a video call to a
number relies on presence. Should only be set if the PhoneAccount
also has
CAPABILITY_VIDEO_CALLING
.
Note: As of Android 12, using the
ContactsContract.DataColumns.CARRIER_PRESENCE_VT_CAPABLE
bit on the
ContactsContract.DataColumns.CARRIER_PRESENCE
column to indicate whether
a contact's phone number supports video calling has been deprecated and should only be used
on devices where CarrierConfigManager.KEY_USE_RCS_PRESENCE_BOOL
is set. On newer
devices, applications must use RcsUceAdapter
instead to
determine whether or not a contact's phone number supports carrier video calling.
Constant Value: 256 (0x00000100)
CAPABILITY_VOICE_CALLING_AVAILABLE
public static final int CAPABILITY_VOICE_CALLING_AVAILABLE
Flag indicating that this PhoneAccount
is currently able to place SIM-based
voice calls, similar to CAPABILITY_VIDEO_CALLING
.
See also CAPABILITY_SUPPORTS_VOICE_CALLING_INDICATIONS
, which indicates whether
the PhoneAccount
supports placing SIM-based voice calls or not.
In order to declare this capability, this PhoneAccount
must also declare CAPABILITY_SIM_SUBSCRIPTION
or CAPABILITY_CONNECTION_MANAGER
and satisfy the
associated requirements.
Constant Value: 131072 (0x00020000)
EXTRA_ADD_SELF_MANAGED_CALLS_TO_INCALLSERVICE
public static final String EXTRA_ADD_SELF_MANAGED_CALLS_TO_INCALLSERVICE
Boolean PhoneAccount
extras key (see PhoneAccount.getExtras()
) which
indicates whether a Self-managed PhoneAccount
want to expose its calls to all
InCallService
which declares the metadata
TelecomManager.METADATA_INCLUDE_SELF_MANAGED_CALLS
.
Constant Value: "android.telecom.extra.ADD_SELF_MANAGED_CALLS_TO_INCALLSERVICE"
EXTRA_ALWAYS_USE_VOIP_AUDIO_MODE
public static final String EXTRA_ALWAYS_USE_VOIP_AUDIO_MODE
Boolean PhoneAccount
extras key (see PhoneAccount.getExtras()
) which
indicates that all calls from this PhoneAccount
should be treated as VoIP calls
rather than cellular calls by the Telecom audio handling logic.
Constant Value: "android.telecom.extra.ALWAYS_USE_VOIP_AUDIO_MODE"
EXTRA_CALL_SUBJECT_CHARACTER_ENCODING
public static final String EXTRA_CALL_SUBJECT_CHARACTER_ENCODING
PhoneAccount
extras key (see PhoneAccount.getExtras()
) which determines the
character encoding to be used when determining the length of messages.
The user interface can use this when determining the number of characters the user may type
in a call subject. If empty-string, the call subject message size limit will be enforced on
a 1:1 basis. That is, each character will count towards the messages size limit as a single
character. If a character encoding is specified, the message size limit will be based on the
number of bytes in the message per the specified encoding. See
EXTRA_CALL_SUBJECT_MAX_LENGTH
for more information on the call subject maximum
length.
Constant Value: "android.telecom.extra.CALL_SUBJECT_CHARACTER_ENCODING"
EXTRA_CALL_SUBJECT_MAX_LENGTH
public static final String EXTRA_CALL_SUBJECT_MAX_LENGTH
PhoneAccount
extras key (see PhoneAccount.getExtras()
) which determines the
maximum permitted length of a call subject specified via the
TelecomManager.EXTRA_CALL_SUBJECT
extra on an
Intent.ACTION_CALL
intent. Ultimately a ConnectionService
is
responsible for enforcing the maximum call subject length when sending the message, however
this extra is provided so that the user interface can proactively limit the length of the
call subject as the user types it.
Constant Value: "android.telecom.extra.CALL_SUBJECT_MAX_LENGTH"
EXTRA_LOG_SELF_MANAGED_CALLS
public static final String EXTRA_LOG_SELF_MANAGED_CALLS
Boolean PhoneAccount
extras key (see PhoneAccount.getExtras()
) which
indicates whether a Self-Managed PhoneAccount
should log its calls to the call log.
Self-Managed PhoneAccount
s are responsible for their own notifications, so the system
will not create a notification when a missed call is logged.
By default, Self-Managed PhoneAccount
s do not log their calls to the call log.
Setting this extra to true
provides a means for them to log their calls.
Note: Only calls where the Call.Details.getHandle()
Uri.getScheme()
is
SCHEME_SIP
or SCHEME_TEL
will be logged at the current time.
Constant Value: "android.telecom.extra.LOG_SELF_MANAGED_CALLS"
EXTRA_SUPPORTS_HANDOVER_FROM
public static final String EXTRA_SUPPORTS_HANDOVER_FROM
Boolean PhoneAccount
extras key (see PhoneAccount.getExtras()
) which
indicates whether this PhoneAccount
is capable of supporting a request to handover a
connection from this PhoneAccount
to another PhoneAccount
.
(see android.telecom.Call#handoverTo()
) which specifies
EXTRA_SUPPORTS_HANDOVER_TO
.
A handover request is initiated by the user from the default dialer app to indicate a desire
to handover a call from one PhoneAccount
/ConnectionService
to another.
Constant Value: "android.telecom.extra.SUPPORTS_HANDOVER_FROM"
EXTRA_SUPPORTS_HANDOVER_TO
public static final String EXTRA_SUPPORTS_HANDOVER_TO
Boolean PhoneAccount
extras key (see PhoneAccount.getExtras()
) which
indicates whether this PhoneAccount
is capable of supporting a request to handover a
connection (see android.telecom.Call#handoverTo()
) to this PhoneAccount
from
a PhoneAccount
specifying EXTRA_SUPPORTS_HANDOVER_FROM
.
A handover request is initiated by the user from the default dialer app to indicate a desire
to handover a call from one PhoneAccount
/ConnectionService
to another.
Constant Value: "android.telecom.extra.SUPPORTS_HANDOVER_TO"
NO_HIGHLIGHT_COLOR
public static final int NO_HIGHLIGHT_COLOR
Indicating no hightlight color is set.
Constant Value: 0 (0x00000000)
NO_RESOURCE_ID
public static final int NO_RESOURCE_ID
Indicating no resource ID is set.
Constant Value: -1 (0xffffffff)
SCHEME_SIP
public static final String SCHEME_SIP
URI scheme for SIP URIs.
Constant Value: "sip"
SCHEME_TEL
public static final String SCHEME_TEL
URI scheme for telephone number URIs.
Constant Value: "tel"
SCHEME_VOICEMAIL
public static final String SCHEME_VOICEMAIL
URI scheme for voicemail URIs.
Constant Value: "voicemail"
Fields
Public methods
builder
public static PhoneAccount.Builder builder (PhoneAccountHandle accountHandle, CharSequence label)
Parameters | |
---|---|
accountHandle |
PhoneAccountHandle |
label |
CharSequence |
Returns | |
---|---|
PhoneAccount.Builder |
describeContents
public int describeContents ()
Describe the kinds of special objects contained in this Parcelable
instance's marshaled representation. For example, if the object will
include a file descriptor in the output of writeToParcel(android.os.Parcel, int)
,
the return value of this method must include the
CONTENTS_FILE_DESCRIPTOR
bit.
Returns | |
---|---|
int |
a bitmask indicating the set of special object types marshaled
by this Parcelable object instance.
Value is either 0 or CONTENTS_FILE_DESCRIPTOR |
equals
public boolean equals (Object o)
Indicates whether some other object is "equal to" this one.
The equals
method implements an equivalence relation
on non-null object references:
- It is reflexive: for any non-null reference value
x
,x.equals(x)
should returntrue
. - It is symmetric: for any non-null reference values
x
andy
,x.equals(y)
should returntrue
if and only ify.equals(x)
returnstrue
. - It is transitive: for any non-null reference values
x
,y
, andz
, ifx.equals(y)
returnstrue
andy.equals(z)
returnstrue
, thenx.equals(z)
should returntrue
. - It is consistent: for any non-null reference values
x
andy
, multiple invocations ofx.equals(y)
consistently returntrue
or consistently returnfalse
, provided no information used inequals
comparisons on the objects is modified. - For any non-null reference value
x
,x.equals(null)
should returnfalse
.
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.
Parameters | |
---|---|
o |
Object : the reference object with which to compare. |
Returns | |
---|---|
boolean |
true if this object is the same as the obj
argument; false otherwise. |
getAccountHandle
public PhoneAccountHandle getAccountHandle ()
The unique identifier of this PhoneAccount
.
Returns | |
---|---|
PhoneAccountHandle |
A PhoneAccountHandle . |
getAddress
public Uri getAddress ()
The address (e.g., a phone number) associated with this PhoneAccount
. This
represents the destination from which outgoing calls using this PhoneAccount
will appear to come, if applicable, and the destination to which incoming calls using this
PhoneAccount
may be addressed.
Returns | |
---|---|
Uri |
A address expressed as a Uri , for example, a phone number. |
getCapabilities
public int getCapabilities ()
The capabilities of this PhoneAccount
.
Returns | |
---|---|
int |
A bit field of flags describing this PhoneAccount 's capabilities. |
getExtras
public Bundle getExtras ()
The extras associated with this PhoneAccount
.
A ConnectionService
may provide implementation specific information about the
PhoneAccount
via the extras.
Returns | |
---|---|
Bundle |
The extras. |
getHighlightColor
public int getHighlightColor ()
A highlight color to use in displaying information about this PhoneAccount
.
Returns | |
---|---|
int |
A hexadecimal color value. |
getIcon
public Icon getIcon ()
The icon to represent this PhoneAccount
.
Returns | |
---|---|
Icon |
The icon. |
getLabel
public CharSequence getLabel ()
A short label describing a PhoneAccount
.
Returns | |
---|---|
CharSequence |
A label for this PhoneAccount . |
getShortDescription
public CharSequence getShortDescription ()
A short paragraph describing this PhoneAccount
.
Returns | |
---|---|
CharSequence |
A description for this PhoneAccount . |
getSimultaneousCallingRestriction
public Set<PhoneAccountHandle> getSimultaneousCallingRestriction ()
If a restriction is set (see hasSimultaneousCallingRestriction()
), this method
returns the Set of PhoneAccountHandle
s that are allowed to support calls
simultaneously with this PhoneAccount
.
If this PhoneAccount
is busy with one or more ongoing calls, a restriction is set on
this PhoneAccount (see hasSimultaneousCallingRestriction()
to check), and a new
incoming or outgoing call is received or placed on a PhoneAccount that is not in this Set,
Telecom will reject or cancel the pending call in favor of keeping the ongoing call alive.
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.
Returns | |
---|---|
Set<PhoneAccountHandle> |
the Set of PhoneAccountHandle s that this PhoneAccount supports
simultaneous calls with.
This value cannot be null . |
Throws | |
---|---|
IllegalStateException |
If there is no restriction set on this PhoneAccount
and this method is called. Whether or not there is a restriction can be checked using
hasSimultaneousCallingRestriction() . |
getSubscriptionAddress
public Uri getSubscriptionAddress ()
The raw callback number used for this PhoneAccount
, as distinct from
getAddress()
. For the majority of PhoneAccount
s this should be registered
as null
. It is used by the system for SIM-based PhoneAccount
registration
where TelephonyManager.setLine1NumberForDisplay(String, String)
has been used to alter the callback number.
Returns | |
---|---|
Uri |
The subscription number, suitable for display to the user. |
getSupportedUriSchemes
public List<String> getSupportedUriSchemes ()
The URI schemes supported by this PhoneAccount
.
Returns | |
---|---|
List<String> |
The URI schemes. |
hasCapabilities
public boolean hasCapabilities (int capability)
Determines if this PhoneAccount
has a capabilities specified by the passed in
bit mask.
Parameters | |
---|---|
capability |
int : The capabilities to check. |
Returns | |
---|---|
boolean |
true if the phone account has the capability. |
hasSimultaneousCallingRestriction
public boolean hasSimultaneousCallingRestriction ()
Whether or not this PhoneAccount
contains a simultaneous calling restriction on it.
Returns | |
---|---|
boolean |
true if this PhoneAccount contains a simultaneous calling restriction,
false if it does not. Use getSimultaneousCallingRestriction() to query which
other PhoneAccount s support simultaneous calling with this one. |
hashCode
public int hashCode ()
Returns a hash code value for the object. This method is
supported for the benefit of hash tables such as those provided by
HashMap
.
The general contract of hashCode
is:
- Whenever it is invoked on the same object more than once during
an execution of a Java application, the
hashCode
method must consistently return the same integer, provided no information used inequals
comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application. - If two objects are equal according to the
equals
method, then calling thehashCode
method on each of the two objects must produce the same integer result. - It is not required that if two objects are unequal
according to the
equals
method, then calling thehashCode
method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns | |
---|---|
int |
a hash code value for this object. |
isEnabled
public boolean isEnabled ()
Indicates whether the user has enabled this PhoneAccount
or not. This value is only
populated for PhoneAccount
s returned by TelecomManager.getPhoneAccount
.
Returns | |
---|---|
boolean |
true if the account is enabled by the user, false otherwise. |
supportsUriScheme
public boolean supportsUriScheme (String uriScheme)
Determines if the PhoneAccount
supports calls to/from addresses with a specified URI
scheme.
Parameters | |
---|---|
uriScheme |
String : The URI scheme to check. |
Returns | |
---|---|
boolean |
true if the PhoneAccount supports calls to/from addresses with the
specified URI scheme. |
toBuilder
public PhoneAccount.Builder toBuilder ()
Returns a builder initialized with the current PhoneAccount
instance.
Returns | |
---|---|
PhoneAccount.Builder |
The builder. |
toString
public String toString ()
Returns a string representation of the object.
Returns | |
---|---|
String |
a string representation of the object. |
writeToParcel
public void writeToParcel (Parcel out, int flags)
Flatten this object in to a Parcel.
Parameters | |
---|---|
out |
Parcel : The Parcel in which the object should be written.
This value cannot be null . |
flags |
int : Additional flags about how the object should be written.
May be 0 or Parcelable.PARCELABLE_WRITE_RETURN_VALUE .
Value is either 0 or a combination of Parcelable.PARCELABLE_WRITE_RETURN_VALUE , and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2024-12-18 UTC.