SignalStrength
public
class
SignalStrength
extends Object
implements
Parcelable
| java.lang.Object | |
| ↳ | android.telephony.SignalStrength |
Contains phone signal strength related information.
Summary
Constants | |
|---|---|
int |
INVALID
Indicates the invalid measures of signal strength. |
Inherited constants |
|---|
Fields | |
|---|---|
public
static
final
Creator<SignalStrength> |
CREATOR
|
Public methods | |
|---|---|
int
|
describeContents()
|
boolean
|
equals(Object o)
Indicates whether some other object is "equal to" this one. |
int
|
getCdmaDbm()
This method was deprecated
in API level 29.
this information should be retrieved from
|
int
|
getCdmaEcio()
This method was deprecated
in API level 29.
this information should be retrieved from
|
<T extends CellSignalStrength>
List<T>
|
getCellSignalStrengths(Class<T> clazz)
Returns a List of CellSignalStrength Components of this SignalStrength Report. |
List<CellSignalStrength>
|
getCellSignalStrengths()
Returns a List of CellSignalStrength Components of this SignalStrength Report. |
int
|
getEvdoDbm()
This method was deprecated
in API level 29.
this information should be retrieved from
|
int
|
getEvdoEcio()
This method was deprecated
in API level 29.
this information should be retrieved from
|
int
|
getEvdoSnr()
This method was deprecated
in API level 29.
this information should be retrieved from
|
int
|
getGsmBitErrorRate()
This method was deprecated
in API level 29.
this information should be retrieved from
|
int
|
getGsmSignalStrength()
This method was deprecated
in API level 29.
this information should be retrieved from
|
int
|
getLevel()
Retrieve an abstract level value for the overall signal strength. |
long
|
getTimestampMillis()
|
int
|
hashCode()
Returns a hash code value for the object. |
boolean
|
isGsm()
This method was deprecated
in API level 29.
This method returns true if there are any 3gpp type SignalStrength elements in
this SignalStrength report or if the report contains no valid SignalStrength
information. Instead callers should use
|
String
|
toString()
Returns a string representation of the object. |
void
|
writeToParcel(Parcel out, int flags)
|
Inherited methods | |
|---|---|
Constants
INVALID
public static final int INVALID
Indicates the invalid measures of signal strength.
For example, this can be returned by getEvdoDbm() or getCdmaDbm()
Constant Value: 2147483647 (0x7fffffff)
Fields
Public methods
describeContents
public int describeContents ()
| 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
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.
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 the signal strengths are the same |
getCdmaDbm
public int getCdmaDbm ()
This method was deprecated
in API level 29.
this information should be retrieved from
CellSignalStrengthCdma#getCdmaDbm.
Get the CDMA RSSI value in dBm
| Returns | |
|---|---|
int |
the CDMA RSSI value or INVALID if invalid |
getCdmaEcio
public int getCdmaEcio ()
This method was deprecated
in API level 29.
this information should be retrieved from
CellSignalStrengthCdma#getCdmaEcio.
Get the CDMA Ec/Io value in dB*10
| Returns | |
|---|---|
int |
|
getCellSignalStrengths
public List<T> getCellSignalStrengths (Class<T> clazz)
Returns a List of CellSignalStrength Components of this SignalStrength Report.
Use this API to access underlying
CellSignalStrength objects that provide more
granular information about the SignalStrength report. Only valid (non-empty)
CellSignalStrengths will be returned. The order of any returned elements is not guaranteed,
and the list may contain more than one instance of a CellSignalStrength type.
| Parameters | |
|---|---|
clazz |
Class: a class type that extends
CellSignalStrength to filter possible
return values.
This value cannot be null. |
| Returns | |
|---|---|
List<T> |
a List of CellSignalStrength or an empty List if there are no valid measurements.
This value cannot be null. |
getCellSignalStrengths
public List<CellSignalStrength> getCellSignalStrengths ()
Returns a List of CellSignalStrength Components of this SignalStrength Report.
Use this API to access underlying
CellSignalStrength objects that provide more
granular information about the SignalStrength report. Only valid (non-empty)
CellSignalStrengths will be returned. The order of any returned elements is not guaranteed,
and the list may contain more than one instance of a CellSignalStrength type.
| Returns | |
|---|---|
List<CellSignalStrength> |
a List of CellSignalStrength or an empty List if there are no valid measurements.
This value cannot be null. |
getEvdoDbm
public int getEvdoDbm ()
This method was deprecated
in API level 29.
this information should be retrieved from
CellSignalStrengthCdma#getEvdoDbm.
Get the EVDO RSSI value in dBm
| Returns | |
|---|---|
int |
the EVDO RSSI value or INVALID if invalid |
getEvdoEcio
public int getEvdoEcio ()
This method was deprecated
in API level 29.
this information should be retrieved from
CellSignalStrengthCdma#getEvdoEcio.
Get the EVDO Ec/Io value in dB*10
| Returns | |
|---|---|
int |
|
getEvdoSnr
public int getEvdoSnr ()
This method was deprecated
in API level 29.
this information should be retrieved from
CellSignalStrengthCdma#getEvdoSnr.
Get the signal to noise ratio. Valid values are 0-8. 8 is the highest.
| Returns | |
|---|---|
int |
|
getGsmBitErrorRate
public int getGsmBitErrorRate ()
This method was deprecated
in API level 29.
this information should be retrieved from
CellSignalStrengthGsm#getBitErrorRate.
Get the GSM bit error rate (0-7, 99) as defined in TS 27.007 8.5
| Returns | |
|---|---|
int |
|
getGsmSignalStrength
public int getGsmSignalStrength ()
This method was deprecated
in API level 29.
this information should be retrieved from
CellSignalStrengthGsm#getAsuLevel.
Get the GSM RSSI in ASU. Asu is calculated based on 3GPP RSRP. Refer to 3GPP 27.007 (Ver 10.3.0) Sec 8.69
| Returns | |
|---|---|
int |
RSSI in ASU 0..31, 99, or UNAVAILABLE |
getLevel
public int getLevel ()
Retrieve an abstract level value for the overall signal strength.
| Returns | |
|---|---|
int |
a single integer from 0 to 4 representing the general signal quality. This may take into account many different radio technology inputs. 0 represents very poor signal strength while 4 represents a very strong signal strength. |
getTimestampMillis
public long getTimestampMillis ()
Value is a non-negative timestamp in the
SystemClock#elapsedRealtime() time base.
| Returns | |
|---|---|
long |
timestamp in milliseconds since boot for SignalStrength.
This timestamp reports the approximate time that the signal was measured and reported
by the modem. It can be used to compare the recency of SignalStrength instances.
Value is a non-negative timestamp in the
SystemClock#elapsedRealtime() time base. |
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
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
equals(Object)method, 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
equals(java.lang.Object)method, 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.
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 |
hash code |
isGsm
public boolean isGsm ()
This method was deprecated
in API level 29.
This method returns true if there are any 3gpp type SignalStrength elements in
this SignalStrength report or if the report contains no valid SignalStrength
information. Instead callers should use
getCellSignalStrengths() to determine which types of information are contained
in the SignalStrength report.
| Returns | |
|---|---|
boolean |
true if this is for GSM |
toString
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 |
string representation. |
writeToParcel
public void writeToParcel (Parcel out, int flags)
| Parameters | |
|---|---|
out |
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 |