# Print output for @column tags ?>
public
final
class
EmergencyNumber
extends Object
implements
Parcelable,
Comparable<EmergencyNumber>
java.lang.Object | |
↳ | 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.
Constants | |
---|---|
int |
EMERGENCY_CALL_ROUTING_EMERGENCY
Indicates the radio or IMS implementation must handle the call through emergency routing. |
int |
EMERGENCY_CALL_ROUTING_NORMAL
Indicates the radio or IMS implementation must handle the call through normal call routing. |
int |
EMERGENCY_CALL_ROUTING_UNKNOWN
Indicated the framework does not know whether an emergency call should be placed using emergency or normal call routing. |
int |
EMERGENCY_NUMBER_SOURCE_DATABASE
Bit-field which indicates the number is from the platform-maintained database. |
int |
EMERGENCY_NUMBER_SOURCE_DEFAULT
Bit-field which indicates the number is available as default. |
int |
EMERGENCY_NUMBER_SOURCE_MODEM_CONFIG
Bit-field which indicates the number is from the modem config. |
int |
EMERGENCY_NUMBER_SOURCE_NETWORK_SIGNALING
Bit-field which indicates the number is from the network signaling. |
int |
EMERGENCY_NUMBER_SOURCE_SIM
Bit-field which indicates the number is from the sim. |
int |
EMERGENCY_SERVICE_CATEGORY_AIEC
Bit-field that indicates Emergency Service Category for Automatically Initiated eCall (AIeC) Reference: 3gpp 22.101, Section 10 - Emergency Calls |
int |
EMERGENCY_SERVICE_CATEGORY_AMBULANCE
Bit-field that indicates Emergency Service Category for Ambulance. |
int |
EMERGENCY_SERVICE_CATEGORY_FIRE_BRIGADE
Bit-field that indicates Emergency Service Category for Fire Brigade. |
int |
EMERGENCY_SERVICE_CATEGORY_MARINE_GUARD
Bit-field that indicates Emergency Service Category for Marine Guard. |
int |
EMERGENCY_SERVICE_CATEGORY_MIEC
Bit-field that indicates Emergency Service Category for Manually Initiated eCall (MIeC) Reference: 3gpp 22.101, Section 10 - Emergency Calls |
int |
EMERGENCY_SERVICE_CATEGORY_MOUNTAIN_RESCUE
Bit-field that indicates Emergency Service Category for Mountain Rescue. |
int |
EMERGENCY_SERVICE_CATEGORY_POLICE
Bit-field that indicates Emergency Service Category for Police. |
int |
EMERGENCY_SERVICE_CATEGORY_UNSPECIFIED
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 |
---|
Fields | |
---|---|
public
static
final
Creator<EmergencyNumber> |
CREATOR
|
Public methods | |
---|---|
int
|
compareTo(EmergencyNumber emergencyNumber)
Compare the display priority for this emergency number and the supplied emergency number. |
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. |
String
|
getCountryIso()
Get the country code string (lowercase character) in ISO 3166 format of the emergency number. |
int
|
getEmergencyCallRouting()
Returns the emergency call routing information. |
List<Integer>
|
getEmergencyNumberSources()
Returns a list of sources of the emergency number. |
List<Integer>
|
getEmergencyServiceCategories()
Returns the emergency service categories of the emergency number. |
List<String>
|
getEmergencyUrns()
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
|
getNumber()
Get the dialing number of the emergency number. |
int
|
hashCode()
Returns a hash code value for the object. |
boolean
|
isFromSources(int sources)
Checks if the emergency number is from the specified emergency number source(s). |
boolean
|
isInEmergencyServiceCategories(int categories)
Checks if the emergency number is in the supplied emergency service category(s). |
String
|
toString()
Returns a string representation of the object. |
void
|
writeToParcel(Parcel dest, int flags)
Flatten this object in to a Parcel. |
Inherited methods | |
---|---|
public static final int EMERGENCY_CALL_ROUTING_EMERGENCY
Indicates the radio or IMS implementation must handle the call through emergency routing.
Constant Value: 1 (0x00000001)
public static final int EMERGENCY_CALL_ROUTING_NORMAL
Indicates the radio or IMS implementation must handle the call through normal call routing.
Constant Value: 2 (0x00000002)
public static final int EMERGENCY_CALL_ROUTING_UNKNOWN
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.
Constant Value: 0 (0x00000000)
public static final int EMERGENCY_NUMBER_SOURCE_DATABASE
Bit-field which indicates the number is from the platform-maintained database.
Constant Value: 16 (0x00000010)
public static final int EMERGENCY_NUMBER_SOURCE_DEFAULT
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
Constant Value: 8 (0x00000008)
public static final int EMERGENCY_NUMBER_SOURCE_MODEM_CONFIG
Bit-field which indicates the number is from the modem config.
Constant Value: 4 (0x00000004)
public static final int EMERGENCY_NUMBER_SOURCE_NETWORK_SIGNALING
Bit-field which indicates the number is from the network signaling. Reference: 3gpp 22.101, Section 10 - Emergency Calls
Constant Value: 1 (0x00000001)
public static final int EMERGENCY_NUMBER_SOURCE_SIM
Bit-field which indicates the number is from the sim. Reference: 3gpp 22.101, Section 10 - Emergency Calls
Constant Value: 2 (0x00000002)
public static final int EMERGENCY_SERVICE_CATEGORY_AIEC
Bit-field that indicates Emergency Service Category for Automatically Initiated eCall (AIeC) Reference: 3gpp 22.101, Section 10 - Emergency Calls
Constant Value: 64 (0x00000040)
public static final int EMERGENCY_SERVICE_CATEGORY_AMBULANCE
Bit-field that indicates Emergency Service Category for Ambulance. Reference: 3gpp 22.101, Section 10 - Emergency Calls
Constant Value: 2 (0x00000002)
public static final int EMERGENCY_SERVICE_CATEGORY_FIRE_BRIGADE
Bit-field that indicates Emergency Service Category for Fire Brigade. Reference: 3gpp 22.101, Section 10 - Emergency Calls
Constant Value: 4 (0x00000004)
public static final int EMERGENCY_SERVICE_CATEGORY_MARINE_GUARD
Bit-field that indicates Emergency Service Category for Marine Guard. Reference: 3gpp 22.101, Section 10 - Emergency Calls
Constant Value: 8 (0x00000008)
public static final int EMERGENCY_SERVICE_CATEGORY_MIEC
Bit-field that indicates Emergency Service Category for Manually Initiated eCall (MIeC) Reference: 3gpp 22.101, Section 10 - Emergency Calls
Constant Value: 32 (0x00000020)
public static final int EMERGENCY_SERVICE_CATEGORY_MOUNTAIN_RESCUE
Bit-field that indicates Emergency Service Category for Mountain Rescue. Reference: 3gpp 22.101, Section 10 - Emergency Calls
Constant Value: 16 (0x00000010)
public static final int EMERGENCY_SERVICE_CATEGORY_POLICE
Bit-field that indicates Emergency Service Category for Police. Reference: 3gpp 22.101, Section 10 - Emergency Calls
Constant Value: 1 (0x00000001)
public static final int EMERGENCY_SERVICE_CATEGORY_UNSPECIFIED
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
Constant Value: 0 (0x00000000)
public int compareTo (EmergencyNumber emergencyNumber)
Compare the display priority for this emergency number and the supplied emergency number.
Parameters | |
---|---|
emergencyNumber |
EmergencyNumber : the supplied emergency number
This value cannot be null . |
Returns | |
---|---|
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. |
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 |
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:
x
, x.equals(x)
should return
true
.
x
and y
, x.equals(y)
should return true
if and only if
y.equals(x)
returns true
.
x
, y
, and z
, if
x.equals(y)
returns true
and
y.equals(z)
returns true
, then
x.equals(z)
should return true
.
x
and y
, multiple invocations of
x.equals(y)
consistently return true
or consistently return false
, provided no
information used in equals
comparisons on the
objects is modified.
x
,
x.equals(null)
should return false
.
The equals
method for class Object
implements
the most discriminating possible equivalence relation on objects;
that is, for any non-null reference values x
and
y
, this method returns true
if and only
if x
and y
refer to the same object
(x == y
has the value true
).
Note that it is generally necessary to override the hashCode
method whenever this method is overridden, so as to maintain the
general contract for the hashCode
method, which states
that equal objects must have equal hash codes.
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. |
public String getCountryIso ()
Get the country code string (lowercase character) in ISO 3166 format of the emergency number.
Returns | |
---|---|
String |
the country code string (lowercase character) in ISO 3166 format.
This value cannot be null . |
public int getEmergencyCallRouting ()
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.
Returns | |
---|---|
int |
the emergency call routing requirement
Value is EMERGENCY_CALL_ROUTING_UNKNOWN , EMERGENCY_CALL_ROUTING_EMERGENCY , or EMERGENCY_CALL_ROUTING_NORMAL |
public List<Integer> getEmergencyNumberSources ()
Returns a list of sources of the emergency number.
Returns | |
---|---|
List<Integer> |
a list of emergency number sources
This value cannot be null . |
public List<Integer> getEmergencyServiceCategories ()
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.
Returns | |
---|---|
List<Integer> |
a list of the emergency service categories
This value cannot be null . |
public List<String> getEmergencyUrns ()
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
Returns | |
---|---|
List<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 . |
public String getMnc ()
Get the Mobile Network Code of the emergency number.
Returns | |
---|---|
String |
the Mobile Network Code of the emergency number.
This value cannot be null . |
public String getNumber ()
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
.
Returns | |
---|---|
String |
the dialing number.
This value cannot be null . |
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:
hashCode
method
must consistently return the same integer, provided no information
used in equals
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.
equals(Object)
method, then calling the hashCode
method on each of
the two objects must produce the same integer result.
equals(java.lang.Object)
method, then calling the hashCode
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.
As much as is reasonably practical, the hashCode method defined by
class Object
does return distinct integers for distinct
objects. (This is typically implemented by converting the internal
address of the object into an integer, but this implementation
technique is not required by the
Java™ programming language.)
Returns | |
---|---|
int |
a hash code value for this object. |
public boolean isFromSources (int sources)
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 EMERGENCY_NUMBER_SOURCE_NETWORK_SIGNALING , EMERGENCY_NUMBER_SOURCE_SIM , EMERGENCY_NUMBER_SOURCE_DATABASE , EMERGENCY_NUMBER_SOURCE_MODEM_CONFIG , and EMERGENCY_NUMBER_SOURCE_DEFAULT |
Returns | |
---|---|
boolean |
true if the emergency number is from the specified emergency number
source(s); false otherwise. |
public boolean isInEmergencyServiceCategories (int categories)
Checks if the emergency number is in the supplied emergency service category(s).
Parameters | |
---|---|
categories |
int : - the supplied emergency service categories
Value is either 0 or a combination of EMERGENCY_SERVICE_CATEGORY_UNSPECIFIED , EMERGENCY_SERVICE_CATEGORY_POLICE , EMERGENCY_SERVICE_CATEGORY_AMBULANCE , EMERGENCY_SERVICE_CATEGORY_FIRE_BRIGADE , EMERGENCY_SERVICE_CATEGORY_MARINE_GUARD , EMERGENCY_SERVICE_CATEGORY_MOUNTAIN_RESCUE , EMERGENCY_SERVICE_CATEGORY_MIEC , and EMERGENCY_SERVICE_CATEGORY_AIEC |
Returns | |
---|---|
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. |
public String toString ()
Returns a string representation of the object. In general, the
toString
method returns a string that
"textually represents" this object. The result should
be a concise but informative representation that is easy for a
person to read.
It is recommended that all subclasses override this method.
The toString
method for class Object
returns a string consisting of the name of the class of which the
object is an instance, the at-sign character `@
', and
the unsigned hexadecimal representation of the hash code of the
object. In other words, this method returns a string equal to the
value of:
getClass().getName() + '@' + Integer.toHexString(hashCode())
Returns | |
---|---|
String |
a string representation of the object. |
public void writeToParcel (Parcel dest, int flags)
Flatten this object in to a Parcel.
Parameters | |
---|---|
dest |
Parcel : The Parcel in which the object should be written. |
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 |