DisconnectCause
class DisconnectCause : Parcelable
| kotlin.Any | |
| ↳ | android.telecom.DisconnectCause |
Describes the cause of a disconnected call. This always includes a code describing the generic cause of the disconnect. Optionally, it may include a label and/or description to display to the user. It is the responsibility of the ConnectionService to provide localized versions of the label and description. It also may contain a reason for the disconnect, which is intended for logging and not for display to the user.
Summary
| Constants | |
|---|---|
| static Int |
Disconnected because the user did not locally answer the incoming call, but it was answered on another device where the call was ringing. |
| static Int |
Disconnected because the other party was busy. |
| static Int |
Disconnected because the call was pulled from the current device to another device. |
| static Int |
Disconnected because it has been canceled. |
| static Int |
Disconnected because the connection manager did not support the call. |
| static Int |
Disconnected because there was an error, such as a problem with the network. |
| static Int |
Disconnected because of a local user-initiated action, such as hanging up. |
| static Int |
Disconnected because there was no response to an incoming call. |
| static Int |
Disconnected for reason not described by other disconnect codes. |
| static String |
This reason is set when a call is ended in order to place an emergency call when a |
| static String |
Reason code (returned via |
| static String |
Reason code (returned via |
| static String |
Reason code (returned via |
| static Int |
Disconnected because the user rejected an incoming call. |
| static Int |
Disconnected because the remote party hung up an ongoing call, or because an outgoing call was not answered by the remote party. |
| static Int |
Disconnected because of a restriction on placing the call, such as dialing in airplane mode. |
| static Int |
Disconnected because of an unknown or unspecified reason. |
| Inherited constants | |
|---|---|
| Public constructors | |
|---|---|
DisconnectCause(code: Int)Creates a new DisconnectCause. |
|
DisconnectCause(code: Int, label: CharSequence!, description: CharSequence!, reason: String!)Creates a new DisconnectCause. |
|
DisconnectCause(code: Int, label: CharSequence!, description: CharSequence!, reason: String!, toneToPlay: Int)Creates a new DisconnectCause. |
|
DisconnectCause(code: Int, reason: String!)Creates a new DisconnectCause. |
|
| Public methods | |
|---|---|
| Int |
Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. |
| Boolean |
Indicates whether some other object is "equal to" this one. |
| Int |
getCode()Returns the code for the reason for this disconnect. |
| CharSequence! |
Returns a description which explains the reason for the disconnect cause and is for display in the user interface. |
| CharSequence! |
getLabel()Returns a short label which explains the reason for the disconnect cause and is for display in the user interface. |
| String! |
Returns an explanation of the reason for the disconnect. |
| Int |
getTone()Returns the tone to play when disconnected. |
| Int |
hashCode()Returns a hash code value for the object. |
| String |
toString()Returns a string representation of the object. |
| Unit |
writeToParcel(destination: Parcel, flags: Int)Flatten this object in to a Parcel. |
| Properties | |
|---|---|
| static Parcelable.Creator<DisconnectCause!> | |
Constants
ANSWERED_ELSEWHERE
static val ANSWERED_ELSEWHERE: Int
Disconnected because the user did not locally answer the incoming call, but it was answered on another device where the call was ringing.
Value: 11BUSY
static val BUSY: Int
Disconnected because the other party was busy.
Value: 7CALL_PULLED
static val CALL_PULLED: Int
Disconnected because the call was pulled from the current device to another device.
Value: 12CANCELED
static val CANCELED: Int
Disconnected because it has been canceled.
Value: 4CONNECTION_MANAGER_NOT_SUPPORTED
static val CONNECTION_MANAGER_NOT_SUPPORTED: Int
Disconnected because the connection manager did not support the call. The call will be tried again without a connection manager. See PhoneAccount.CAPABILITY_CONNECTION_MANAGER.
Value: 10ERROR
static val ERROR: Int
Disconnected because there was an error, such as a problem with the network.
Value: 1LOCAL
static val LOCAL: Int
Disconnected because of a local user-initiated action, such as hanging up.
Value: 2MISSED
static val MISSED: Int
Disconnected because there was no response to an incoming call.
Value: 5OTHER
static val OTHER: Int
Disconnected for reason not described by other disconnect codes.
Value: 9REASON_EMERGENCY_CALL_PLACED
static val REASON_EMERGENCY_CALL_PLACED: String
This reason is set when a call is ended in order to place an emergency call when a PhoneAccount doesn't support holding an ongoing call to place an emergency call. This reason string should only be associated with the LOCAL disconnect code returned from getCode().
Value: "REASON_EMERGENCY_CALL_PLACED"REASON_EMULATING_SINGLE_CALL
static val REASON_EMULATING_SINGLE_CALL: String
Reason code (returned via getReason()), which indicates that the connection service is setting the call's state to Call.STATE_DISCONNECTED because it is internally changing the representation of an IMS conference call to simulate a single-party call. This reason code is only used for communication between a ConnectionService and Telecom and should not be surfaced to the user.
Value: "EMULATING_SINGLE_CALL"REASON_IMS_ACCESS_BLOCKED
static val REASON_IMS_ACCESS_BLOCKED: String
Reason code (returned via getReason()), which indicates that the call was disconnected because IMS access is blocked.
Value: "REASON_IMS_ACCESS_BLOCKED"REASON_WIFI_ON_BUT_WFC_OFF
static val REASON_WIFI_ON_BUT_WFC_OFF: String
Reason code (returned via getReason()) which indicates that a call could not be completed because the cellular radio is off or out of service, the device is connected to a wifi network, but the user has not enabled wifi calling.
Value: "REASON_WIFI_ON_BUT_WFC_OFF"REJECTED
static val REJECTED: Int
Disconnected because the user rejected an incoming call.
Value: 6REMOTE
static val REMOTE: Int
Disconnected because the remote party hung up an ongoing call, or because an outgoing call was not answered by the remote party.
Value: 3RESTRICTED
static val RESTRICTED: Int
Disconnected because of a restriction on placing the call, such as dialing in airplane mode.
Value: 8UNKNOWN
static val UNKNOWN: Int
Disconnected because of an unknown or unspecified reason.
Value: 0Public constructors
DisconnectCause
DisconnectCause(code: Int)
Creates a new DisconnectCause.
| Parameters | |
|---|---|
code |
Int: The code for the disconnect cause. Value is one of the following: |
DisconnectCause
DisconnectCause(
code: Int,
label: CharSequence!,
description: CharSequence!,
reason: String!)
Creates a new DisconnectCause.
| Parameters | |
|---|---|
code |
Int: The code for the disconnect cause. Value is one of the following: |
label |
CharSequence!: The localized label to show to the user to explain the disconnect. |
description |
CharSequence!: The localized description to show to the user to explain the disconnect. |
reason |
String!: The reason for the disconnect. |
DisconnectCause
DisconnectCause(
code: Int,
label: CharSequence!,
description: CharSequence!,
reason: String!,
toneToPlay: Int)
Creates a new DisconnectCause.
| Parameters | |
|---|---|
code |
Int: The code for the disconnect cause. Value is one of the following: |
label |
CharSequence!: The localized label to show to the user to explain the disconnect. |
description |
CharSequence!: The localized description to show to the user to explain the disconnect. |
reason |
String!: The reason for the disconnect. |
toneToPlay |
Int: The tone to play on disconnect, as defined in ToneGenerator. |
DisconnectCause
DisconnectCause(
code: Int,
reason: String!)
Creates a new DisconnectCause.
| Parameters | |
|---|---|
code |
Int: The code for the disconnect cause. Value is one of the following: |
reason |
String!: The reason for the disconnect. |
Public methods
describeContents
fun describeContents(): Int
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.
| Return | |
|---|---|
Int |
a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or
|
equals
fun equals(other: Any?): Boolean
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
xandy,x.equals(y)should returntrueif and only ify.equals(x)returnstrue. - It is transitive: for any non-null reference values
x,y, andz, ifx.equals(y)returnstrueandy.equals(z)returnstrue, thenx.equals(z)should returntrue. - It is consistent: for any non-null reference values
xandy, multiple invocations ofx.equals(y)consistently returntrueor consistently returnfalse, provided no information used inequalscomparisons 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 | |
|---|---|
obj |
the reference object with which to compare. |
| Return | |
|---|---|
Boolean |
true if this object is the same as the obj argument; false otherwise. |
getCode
fun getCode(): Int
Returns the code for the reason for this disconnect.
| Return | |
|---|---|
Int |
The disconnect code. Value is one of the following: |
getDescription
fun getDescription(): CharSequence!
Returns a description which explains the reason for the disconnect cause and is for display in the user interface. This optional text is generally a longer and more descriptive version of getLabel, however it can exist even if getLabel is empty. The In-Call UI should display this relatively prominently; the traditional implementation displays this as an alert dialog. The ConnectionService is responsible for providing and localizing this message. If there is no string provided, returns null.
| Return | |
|---|---|
CharSequence! |
The disconnect description. |
getLabel
fun getLabel(): CharSequence!
Returns a short label which explains the reason for the disconnect cause and is for display in the user interface. If not null, it is expected that the In-Call UI should display this text where it would normally display the call state ("Dialing", "Disconnected") and is therefore expected to be relatively small. The ConnectionService is responsible for providing and localizing this label. If there is no string provided, returns null.
| Return | |
|---|---|
CharSequence! |
The disconnect label. |
getReason
fun getReason(): String!
Returns an explanation of the reason for the disconnect. This is not intended for display to the user and is used mainly for logging.
| Return | |
|---|---|
String! |
The disconnect reason. |
getTone
fun getTone(): Int
Returns the tone to play when disconnected.
| Return | |
|---|---|
Int |
the tone as defined in ToneGenerator to play when disconnected. |
hashCode
fun hashCode(): Int
Returns a hash code value for the object. This method is supported for the benefit of hash tables such as those provided by java.util.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
hashCodemethod must consistently return the same integer, provided no information used inequalscomparisons 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
equalsmethod, then calling thehashCodemethod 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
equalsmethod, then calling thehashCodemethod 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.
| Return | |
|---|---|
Int |
a hash code value for this object. |
toString
fun toString(): String
Returns a string representation of the object.
| Return | |
|---|---|
String |
a string representation of the object. |
writeToParcel
fun writeToParcel(
destination: Parcel,
flags: Int
): Unit
Flatten this object in to a Parcel.
| 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 the following:
|