Added in API level 23

PhoneAccountHandle


class PhoneAccountHandle : Parcelable
kotlin.Any
   ↳ android.telecom.PhoneAccountHandle

The unique identifier for a PhoneAccount. A PhoneAccountHandle is made of two parts:

  • The component name of the associated connection service.
  • A string identifier that is unique across PhoneAccountHandles with the same component name. Apps registering PhoneAccountHandles should ensure that the getId() provided does not expose personally identifying information. A ConnectionService should use an opaque token as the PhoneAccountHandle identifier.
Note: This Class requires a non-null ComponentName and UserHandle to operate properly. Passing in invalid parameters will generate a log warning. See PhoneAccount, TelecomManager.

Summary

Inherited constants
Public constructors
PhoneAccountHandle(componentName: ComponentName, id: String)

Creates a new PhoneAccountHandle.

PhoneAccountHandle(componentName: ComponentName, id: String, userHandle: UserHandle)

Creates a new PhoneAccountHandle.

Public methods
Int

Boolean
equals(other: Any?)

ComponentName!

The ComponentName of the connection service which is responsible for making phone calls using this PhoneAccountHandle.

String!

A string that uniquely distinguishes this particular PhoneAccountHandle from all the others supported by the connection service that created it.

UserHandle!

Int

String

Unit
writeToParcel(out: Parcel, flags: Int)

Properties
static Parcelable.Creator<PhoneAccountHandle!>

Public constructors

PhoneAccountHandle

Added in API level 23
PhoneAccountHandle(
    componentName: ComponentName,
    id: String)

Creates a new PhoneAccountHandle.

Parameters
componentName ComponentName: The ComponentName of the ConnectionService which services this PhoneAccountHandle. This value cannot be null.
id String: A string identifier that is unique across PhoneAccountHandles with the same component name. Apps registering PhoneAccountHandles should ensure that the ID provided does not expose personally identifying information. A ConnectionService should use an opaque token as the PhoneAccountHandle identifier.

Note: Each 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. This value cannot be null.

PhoneAccountHandle

Added in API level 23
PhoneAccountHandle(
    componentName: ComponentName,
    id: String,
    userHandle: UserHandle)

Creates a new PhoneAccountHandle.

Parameters
componentName ComponentName: The ComponentName of the ConnectionService which services this PhoneAccountHandle. This value cannot be null.
id String: A string identifier that is unique across PhoneAccountHandles with the same component name. Apps registering PhoneAccountHandles should ensure that the ID provided does not expose personally identifying information. A ConnectionService should use an opaque token as the PhoneAccountHandle identifier. This value cannot be null.
userHandle UserHandle: The UserHandle associated with this PhoneAccountHandle.

Note: Each 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. This value cannot be null.

Public methods

describeContents

Added in API level 23
fun describeContents(): Int
Return
Int a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or android.os.Parcelable#CONTENTS_FILE_DESCRIPTOR

equals

Added in API level 23
fun equals(other: Any?): Boolean
Parameters
obj the reference object with which to compare.
Return
Boolean true if this object is the same as the obj argument; false otherwise.

getComponentName

Added in API level 23
fun getComponentName(): ComponentName!

The ComponentName of the connection service which is responsible for making phone calls using this PhoneAccountHandle.

Return
ComponentName! A suitable ComponentName.

getId

Added in API level 23
fun getId(): String!

A string that uniquely distinguishes this particular PhoneAccountHandle from all the others supported by the connection service that created it.

A connection service must select identifiers that are stable for the lifetime of their users' relationship with their service, across many Android devices. The identifier should be a stable opaque token which uniquely identifies the user within the service. Depending on how a service chooses to operate, a bad set of identifiers might be an increasing series of integers (0, 1, 2, ...) that are generated locally on each phone and could collide with values generated on other phones or after a data wipe of a given phone.

Important: A non-unique identifier could cause non-deterministic call-log backup/restore behavior.

Return
String! A service-specific unique opaque identifier for this PhoneAccountHandle.

getUserHandle

Added in API level 23
fun getUserHandle(): UserHandle!
Return
UserHandle! the UserHandle to use when connecting to this PhoneAccount.

hashCode

Added in API level 23
fun hashCode(): Int
Return
Int a hash code value for this object.

toString

Added in API level 23
fun toString(): String
Return
String a string representation of the object.

writeToParcel

Added in API level 23
fun writeToParcel(
    out: Parcel,
    flags: Int
): Unit
Parameters
dest 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_WRITE_RETURN_VALUE. Value is either 0 or a combination of android.os.Parcelable#PARCELABLE_WRITE_RETURN_VALUE, and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES

Properties

CREATOR

Added in API level 23
static val CREATOR: Parcelable.Creator<PhoneAccountHandle!>