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 constructors | |
---|---|
SignalStrength(SignalStrength s)
This constructor is used to create a copy of an existing SignalStrength object. |
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 constructors
SignalStrength
public SignalStrength (SignalStrength s)
This constructor is used to create a copy of an existing SignalStrength object.
Parameters | |
---|---|
s |
SignalStrength : Source SignalStrength
This value cannot be null . |
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
x
andy
,x.equals(y)
should returntrue
if and only ify.equals(x)
returnstrue
. - It is transitive: for any non-null reference values
x
,y
, andz
, ifx.equals(y)
returnstrue
andy.equals(z)
returnstrue
, thenx.equals(z)
should returntrue
. - It is consistent: for any non-null reference values
x
andy
, multiple invocations ofx.equals(y)
consistently returntrue
or consistently returnfalse
, provided no information used inequals
comparisons 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 | |
---|---|
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
hashCode
method must consistently return the same integer, provided no information used inequals
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. - If two objects are equal according to the
equals
method, then calling thehashCode
method 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
method, then calling thehashCode
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.
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.
Returns | |
---|---|
String |
string representation. |
writeToParcel
public void writeToParcel (Parcel out, int flags)
Parameters | |
---|---|
out |
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.PARCELABLE_WRITE_RETURN_VALUE .
Value is either 0 or a combination of Parcelable.PARCELABLE_WRITE_RETURN_VALUE , and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES |