EmergencyNumber
class EmergencyNumber : Comparable<EmergencyNumber!>, Parcelable
kotlin.Any | |
↳ | android.telephony.emergency.EmergencyNumber |
A parcelable class that wraps and retrieves the information of number, service category(s) and country code for a specific emergency number.
Summary
Constants | |
---|---|
static Int |
Indicates the radio or IMS implementation must handle the call through emergency routing. |
static Int |
Indicates the radio or IMS implementation must handle the call through normal call routing. |
static Int |
Indicated the framework does not know whether an emergency call should be placed using emergency or normal call routing. |
static Int |
Bit-field which indicates the number is from the platform-maintained database. |
static Int |
Bit-field which indicates the number is available as default. |
static Int |
Bit-field which indicates the number is from the modem config. |
static Int |
Bit-field which indicates the number is from the network signaling. |
static Int |
Bit-field which indicates the number is from the sim. |
static Int |
Bit-field that indicates Emergency Service Category for Automatically Initiated eCall (AIeC) Reference: 3gpp 22. |
static Int |
Bit-field that indicates Emergency Service Category for Ambulance. |
static Int |
Bit-field that indicates Emergency Service Category for Fire Brigade. |
static Int |
Bit-field that indicates Emergency Service Category for Marine Guard. |
static Int |
Bit-field that indicates Emergency Service Category for Manually Initiated eCall (MIeC) Reference: 3gpp 22. |
static Int |
Bit-field that indicates Emergency Service Category for Mountain Rescue. |
static Int |
Bit-field that indicates Emergency Service Category for Police. |
static Int |
Emergency Service Category UNSPECIFIED (General emergency call, all categories) bit-field indicates that no specific services are associated with this emergency number; if the emergency number is specified, it has one or more defined emergency service categories. |
Inherited constants | |
---|---|
Public methods | |
---|---|
Int |
compareTo(other: EmergencyNumber) Compare the display priority for this emergency number and the supplied emergency number. |
Int | |
Boolean | |
String |
Get the country code string (lowercase character) in ISO 3166 format of the emergency number. |
Int |
Returns the emergency call routing information. |
MutableList<Int!> |
Returns a list of sources of the emergency number. |
MutableList<Int!> |
Returns the emergency service categories of the emergency number. |
MutableList<String!> |
Returns the list of emergency Uniform Resources Names (URN) of the emergency number. |
String |
getMnc() Get the Mobile Network Code of the emergency number. |
String |
Get the dialing number of the emergency number. |
Int |
hashCode() |
Boolean |
isFromSources(sources: Int) Checks if the emergency number is from the specified emergency number source(s). |
Boolean |
isInEmergencyServiceCategories(categories: Int) Checks if the emergency number is in the supplied emergency service category(s). |
String |
toString() |
Unit |
writeToParcel(dest: Parcel, flags: Int) |
Properties | |
---|---|
static Parcelable.Creator<EmergencyNumber!> |
Constants
EMERGENCY_CALL_ROUTING_EMERGENCY
static val EMERGENCY_CALL_ROUTING_EMERGENCY: Int
Indicates the radio or IMS implementation must handle the call through emergency routing.
Value: 1
EMERGENCY_CALL_ROUTING_NORMAL
static val EMERGENCY_CALL_ROUTING_NORMAL: Int
Indicates the radio or IMS implementation must handle the call through normal call routing.
Value: 2
EMERGENCY_CALL_ROUTING_UNKNOWN
static val EMERGENCY_CALL_ROUTING_UNKNOWN: Int
Indicated the framework does not know whether an emergency call should be placed using emergency or normal call routing. This means the underlying radio or IMS implementation is free to determine for itself how to route the call.
Value: 0
EMERGENCY_NUMBER_SOURCE_DATABASE
static val EMERGENCY_NUMBER_SOURCE_DATABASE: Int
Bit-field which indicates the number is from the platform-maintained database.
Value: 16
EMERGENCY_NUMBER_SOURCE_DEFAULT
static val EMERGENCY_NUMBER_SOURCE_DEFAULT: Int
Bit-field which indicates the number is available as default. 112, 911 must always be available; additionally, 000, 08, 110, 999, 118 and 119 must be available when sim is not present. Reference: 3gpp 22.101, Section 10 - Emergency Calls
Value: 8
EMERGENCY_NUMBER_SOURCE_MODEM_CONFIG
static val EMERGENCY_NUMBER_SOURCE_MODEM_CONFIG: Int
Bit-field which indicates the number is from the modem config.
Value: 4
EMERGENCY_NUMBER_SOURCE_NETWORK_SIGNALING
static val EMERGENCY_NUMBER_SOURCE_NETWORK_SIGNALING: Int
Bit-field which indicates the number is from the network signaling. Reference: 3gpp 22.101, Section 10 - Emergency Calls
Value: 1
EMERGENCY_NUMBER_SOURCE_SIM
static val EMERGENCY_NUMBER_SOURCE_SIM: Int
Bit-field which indicates the number is from the sim. Reference: 3gpp 22.101, Section 10 - Emergency Calls
Value: 2
EMERGENCY_SERVICE_CATEGORY_AIEC
static val EMERGENCY_SERVICE_CATEGORY_AIEC: Int
Bit-field that indicates Emergency Service Category for Automatically Initiated eCall (AIeC) Reference: 3gpp 22.101, Section 10 - Emergency Calls
Value: 64
EMERGENCY_SERVICE_CATEGORY_AMBULANCE
static val EMERGENCY_SERVICE_CATEGORY_AMBULANCE: Int
Bit-field that indicates Emergency Service Category for Ambulance. Reference: 3gpp 22.101, Section 10 - Emergency Calls
Value: 2
EMERGENCY_SERVICE_CATEGORY_FIRE_BRIGADE
static val EMERGENCY_SERVICE_CATEGORY_FIRE_BRIGADE: Int
Bit-field that indicates Emergency Service Category for Fire Brigade. Reference: 3gpp 22.101, Section 10 - Emergency Calls
Value: 4
EMERGENCY_SERVICE_CATEGORY_MARINE_GUARD
static val EMERGENCY_SERVICE_CATEGORY_MARINE_GUARD: Int
Bit-field that indicates Emergency Service Category for Marine Guard. Reference: 3gpp 22.101, Section 10 - Emergency Calls
Value: 8
EMERGENCY_SERVICE_CATEGORY_MIEC
static val EMERGENCY_SERVICE_CATEGORY_MIEC: Int
Bit-field that indicates Emergency Service Category for Manually Initiated eCall (MIeC) Reference: 3gpp 22.101, Section 10 - Emergency Calls
Value: 32
EMERGENCY_SERVICE_CATEGORY_MOUNTAIN_RESCUE
static val EMERGENCY_SERVICE_CATEGORY_MOUNTAIN_RESCUE: Int
Bit-field that indicates Emergency Service Category for Mountain Rescue. Reference: 3gpp 22.101, Section 10 - Emergency Calls
Value: 16
EMERGENCY_SERVICE_CATEGORY_POLICE
static val EMERGENCY_SERVICE_CATEGORY_POLICE: Int
Bit-field that indicates Emergency Service Category for Police. Reference: 3gpp 22.101, Section 10 - Emergency Calls
Value: 1
EMERGENCY_SERVICE_CATEGORY_UNSPECIFIED
static val EMERGENCY_SERVICE_CATEGORY_UNSPECIFIED: Int
Emergency Service Category UNSPECIFIED (General emergency call, all categories) bit-field indicates that no specific services are associated with this emergency number; if the emergency number is specified, it has one or more defined emergency service categories. Reference: 3gpp 22.101, Section 10 - Emergency Calls
Value: 0
Public methods
compareTo
fun compareTo(other: EmergencyNumber): Int
Compare the display priority for this emergency number and the supplied emergency number.
Parameters | |
---|---|
o |
the object to be compared. |
emergencyNumber |
the supplied emergency number This value cannot be null . |
Return | |
---|---|
Int |
a negative value if the supplied emergency number has a lower display priority; a positive value if the supplied emergency number has a higher display priority; 0 if both have equal display priority. |
Exceptions | |
---|---|
java.lang.NullPointerException |
if the specified object is null |
java.lang.ClassCastException |
if the specified object's type prevents it from being compared to this object. |
describeContents
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
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. |
getCountryIso
fun getCountryIso(): String
Get the country code string (lowercase character) in ISO 3166 format of the emergency number.
Return | |
---|---|
String |
the country code string (lowercase character) in ISO 3166 format. This value cannot be null . |
getEmergencyCallRouting
fun getEmergencyCallRouting(): Int
Returns the emergency call routing information.
Some regions require some emergency numbers which are not routed using typical emergency call processing, but are instead placed as regular phone calls. The emergency call routing field provides information about how an emergency call will be routed when it is placed.
Return | |
---|---|
Int |
the emergency call routing requirement Value is android.telephony.emergency.EmergencyNumber#EMERGENCY_CALL_ROUTING_UNKNOWN , android.telephony.emergency.EmergencyNumber#EMERGENCY_CALL_ROUTING_EMERGENCY , or android.telephony.emergency.EmergencyNumber#EMERGENCY_CALL_ROUTING_NORMAL |
getEmergencyNumberSources
fun getEmergencyNumberSources(): MutableList<Int!>
Returns a list of sources of the emergency number.
Return | |
---|---|
MutableList<Int!> |
a list of emergency number sources This value cannot be null . |
getEmergencyServiceCategories
fun getEmergencyServiceCategories(): MutableList<Int!>
Returns the emergency service categories of the emergency number. Note: if the emergency number is in EMERGENCY_SERVICE_CATEGORY_UNSPECIFIED
, only EMERGENCY_SERVICE_CATEGORY_UNSPECIFIED
is returned and it means the number is in all categories.
Return | |
---|---|
MutableList<Int!> |
a list of the emergency service categories This value cannot be null . |
getEmergencyUrns
fun getEmergencyUrns(): MutableList<String!>
Returns the list of emergency Uniform Resources Names (URN) of the emergency number. For example, urn:service:sos
is the generic URN for contacting emergency services of all type. Reference: 3gpp 24.503, Section 5.1.6.8.1 - General; RFC 5031
Return | |
---|---|
MutableList<String!> |
list of emergency Uniform Resources Names (URN) or an empty list if the emergency number does not have a specified emergency Uniform Resource Name. This value cannot be null . |
getMnc
fun getMnc(): String
Get the Mobile Network Code of the emergency number.
Return | |
---|---|
String |
the Mobile Network Code of the emergency number. This value cannot be null . |
getNumber
fun getNumber(): String
Get the dialing number of the emergency number. The character in the number string is only the dial pad character('0'-'9', '*', '+', or '#'). For example: 911. If the number starts with carrier prefix, the carrier prefix is configured in CarrierConfigManager.KEY_EMERGENCY_NUMBER_PREFIX_STRING_ARRAY
.
Return | |
---|---|
String |
the dialing number. This value cannot be null . |
isFromSources
fun isFromSources(sources: Int): Boolean
Checks if the emergency number is from the specified emergency number source(s).
Parameters | |
---|---|
sources |
Int: - the supplied emergency number sources Value is either 0 or a combination of android.telephony.emergency.EmergencyNumber#EMERGENCY_NUMBER_SOURCE_NETWORK_SIGNALING , android.telephony.emergency.EmergencyNumber#EMERGENCY_NUMBER_SOURCE_SIM , android.telephony.emergency.EmergencyNumber#EMERGENCY_NUMBER_SOURCE_DATABASE , android.telephony.emergency.EmergencyNumber#EMERGENCY_NUMBER_SOURCE_MODEM_CONFIG , and android.telephony.emergency.EmergencyNumber#EMERGENCY_NUMBER_SOURCE_DEFAULT |
Return | |
---|---|
Boolean |
true if the emergency number is from the specified emergency number source(s); false otherwise. |
isInEmergencyServiceCategories
fun isInEmergencyServiceCategories(categories: Int): Boolean
Checks if the emergency number is in the supplied emergency service category(s).
Return | |
---|---|
Boolean |
true if the emergency number is in the specified emergency service category(s) or if its emergency service category is EMERGENCY_SERVICE_CATEGORY_UNSPECIFIED ; false otherwise. |
toString
fun toString(): String
Return | |
---|---|
String |
a string representation of the object. |
writeToParcel
fun writeToParcel(
dest: Parcel,
flags: Int
): Unit
Parameters | |
---|---|
dest |
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_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 |