Methods Summary |
---|
public android.telephony.CellSignalStrengthGsm | copy()
return new CellSignalStrengthGsm(this);
|
protected void | copyFrom(android.telephony.CellSignalStrengthGsm s)
mSignalStrength = s.mSignalStrength;
mBitErrorRate = s.mBitErrorRate;
|
public int | describeContents()Implement the Parcelable interface
return 0;
|
public boolean | equals(java.lang.Object o)
CellSignalStrengthGsm s;
try {
s = (CellSignalStrengthGsm) o;
} catch (ClassCastException ex) {
return false;
}
if (o == null) {
return false;
}
return mSignalStrength == s.mSignalStrength && mBitErrorRate == s.mBitErrorRate;
|
public int | getAsuLevel()Get the signal level as an asu value between 0..31, 99 is unknown
Asu is calculated based on 3GPP RSRP. Refer to 3GPP 27.007 (Ver 10.3.0) Sec 8.69
// ASU ranges from 0 to 31 - TS 27.007 Sec 8.5
// asu = 0 (-113dB or less) is very weak
// signal, its better to show 0 bars to the user in such cases.
// asu = 99 is a special case, where the signal strength is unknown.
int level = mSignalStrength;
if (DBG) log("getAsuLevel=" + level);
return level;
|
public int | getDbm()Get the signal strength as dBm
int dBm;
int level = mSignalStrength;
int asu = (level == 99 ? Integer.MAX_VALUE : level);
if (asu != Integer.MAX_VALUE) {
dBm = -113 + (2 * asu);
} else {
dBm = Integer.MAX_VALUE;
}
if (DBG) log("getDbm=" + dBm);
return dBm;
|
public int | getLevel()Get signal level as an int from 0..4
int level;
// ASU ranges from 0 to 31 - TS 27.007 Sec 8.5
// asu = 0 (-113dB or less) is very weak
// signal, its better to show 0 bars to the user in such cases.
// asu = 99 is a special case, where the signal strength is unknown.
int asu = mSignalStrength;
if (asu <= 2 || asu == 99) level = SIGNAL_STRENGTH_NONE_OR_UNKNOWN;
else if (asu >= GSM_SIGNAL_STRENGTH_GREAT) level = SIGNAL_STRENGTH_GREAT;
else if (asu >= GSM_SIGNAL_STRENGTH_GOOD) level = SIGNAL_STRENGTH_GOOD;
else if (asu >= GSM_SIGNAL_STRENGTH_MODERATE) level = SIGNAL_STRENGTH_MODERATE;
else level = SIGNAL_STRENGTH_POOR;
if (DBG) log("getLevel=" + level);
return level;
|
public int | hashCode()
int primeNum = 31;
return (mSignalStrength * primeNum) + (mBitErrorRate * primeNum);
|
public void | initialize(int ss, int ber)Initialize all the values
mSignalStrength = ss;
mBitErrorRate = ber;
|
private static void | log(java.lang.String s)log
Rlog.w(LOG_TAG, s);
|
public void | setDefaultValues()
mSignalStrength = Integer.MAX_VALUE;
mBitErrorRate = Integer.MAX_VALUE;
|
public java.lang.String | toString()
return "CellSignalStrengthGsm:"
+ " ss=" + mSignalStrength
+ " ber=" + mBitErrorRate;
|
public void | writeToParcel(android.os.Parcel dest, int flags)Implement the Parcelable interface
if (DBG) log("writeToParcel(Parcel, int): " + toString());
dest.writeInt(mSignalStrength);
dest.writeInt(mBitErrorRate);
|