Cleanup SignalStrength Parcel
Clean up the SignalStrength parcel. This CL removes redundant constructors, simplifies the overall initialization process, and stratifies the components of the parcel into 2 separate parts: the strength values from RIL, and the config values provided by the platform. Bug: 72116430 Test: runtest frameworks-telephony Change-Id: Id7d2339362270b3911e96094275e1e545d6b581c
This commit is contained in:
@@ -51,12 +51,15 @@ public class SignalStrength implements Parcelable {
|
|||||||
"none", "poor", "moderate", "good", "great"
|
"none", "poor", "moderate", "good", "great"
|
||||||
};
|
};
|
||||||
|
|
||||||
/** @hide */
|
/**
|
||||||
//Use int max, as -1 is a valid value in signal strength
|
* Use Integer.MAX_VALUE because -1 is a valid value in signal strength.
|
||||||
public static final int INVALID = 0x7FFFFFFF;
|
* @hide
|
||||||
|
*/
|
||||||
|
public static final int INVALID = Integer.MAX_VALUE;
|
||||||
|
|
||||||
private static final int LTE_RSRP_THRESHOLDS_NUM = 6;
|
private static final int LTE_RSRP_THRESHOLDS_NUM = 6;
|
||||||
|
|
||||||
|
/** Parameters reported by the Radio */
|
||||||
private int mGsmSignalStrength; // Valid values are (0-31, 99) as defined in TS 27.007 8.5
|
private int mGsmSignalStrength; // Valid values are (0-31, 99) as defined in TS 27.007 8.5
|
||||||
private int mGsmBitErrorRate; // bit error rate (0-7, 99) as defined in TS 27.007 8.5
|
private int mGsmBitErrorRate; // bit error rate (0-7, 99) as defined in TS 27.007 8.5
|
||||||
private int mCdmaDbm; // This value is the RSSI value
|
private int mCdmaDbm; // This value is the RSSI value
|
||||||
@@ -69,11 +72,13 @@ public class SignalStrength implements Parcelable {
|
|||||||
private int mLteRsrq;
|
private int mLteRsrq;
|
||||||
private int mLteRssnr;
|
private int mLteRssnr;
|
||||||
private int mLteCqi;
|
private int mLteCqi;
|
||||||
private int mLteRsrpBoost; // offset to be reduced from the rsrp threshold while calculating
|
|
||||||
// signal strength level
|
|
||||||
private int mTdScdmaRscp;
|
private int mTdScdmaRscp;
|
||||||
|
|
||||||
private boolean isGsm; // This value is set by the ServiceStateTracker onSignalStrengthResult
|
/** Parameters from the framework */
|
||||||
|
private int mLteRsrpBoost; // offset to be reduced from the rsrp threshold while calculating
|
||||||
|
// signal strength level
|
||||||
|
private boolean mIsGsm; // This value is set by the ServiceStateTracker
|
||||||
|
// onSignalStrengthResult.
|
||||||
private boolean mUseOnlyRsrpForLteLevel; // Use only RSRP for the number of LTE signal bar.
|
private boolean mUseOnlyRsrpForLteLevel; // Use only RSRP for the number of LTE signal bar.
|
||||||
|
|
||||||
// The threshold of LTE RSRP for determining the display level of LTE signal bar.
|
// The threshold of LTE RSRP for determining the display level of LTE signal bar.
|
||||||
@@ -103,28 +108,12 @@ public class SignalStrength implements Parcelable {
|
|||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
public SignalStrength() {
|
public SignalStrength() {
|
||||||
mGsmSignalStrength = 99;
|
this(true);
|
||||||
mGsmBitErrorRate = -1;
|
|
||||||
mCdmaDbm = -1;
|
|
||||||
mCdmaEcio = -1;
|
|
||||||
mEvdoDbm = -1;
|
|
||||||
mEvdoEcio = -1;
|
|
||||||
mEvdoSnr = -1;
|
|
||||||
mLteSignalStrength = 99;
|
|
||||||
mLteRsrp = INVALID;
|
|
||||||
mLteRsrq = INVALID;
|
|
||||||
mLteRssnr = INVALID;
|
|
||||||
mLteCqi = INVALID;
|
|
||||||
mLteRsrpBoost = 0;
|
|
||||||
mTdScdmaRscp = INVALID;
|
|
||||||
isGsm = true;
|
|
||||||
mUseOnlyRsrpForLteLevel = false;
|
|
||||||
setLteRsrpThresholds(getDefaultLteRsrpThresholds());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This constructor is used to create SignalStrength with default
|
* This constructor is used to create SignalStrength with default
|
||||||
* values and set the isGsmFlag with the value passed in the input
|
* values and set the gsmFlag with the value passed in the input
|
||||||
*
|
*
|
||||||
* @param gsmFlag true if Gsm Phone,false if Cdma phone
|
* @param gsmFlag true if Gsm Phone,false if Cdma phone
|
||||||
* @return newly created SignalStrength
|
* @return newly created SignalStrength
|
||||||
@@ -143,134 +132,26 @@ public class SignalStrength implements Parcelable {
|
|||||||
mLteRsrq = INVALID;
|
mLteRsrq = INVALID;
|
||||||
mLteRssnr = INVALID;
|
mLteRssnr = INVALID;
|
||||||
mLteCqi = INVALID;
|
mLteCqi = INVALID;
|
||||||
mLteRsrpBoost = 0;
|
|
||||||
mTdScdmaRscp = INVALID;
|
mTdScdmaRscp = INVALID;
|
||||||
isGsm = gsmFlag;
|
mLteRsrpBoost = 0;
|
||||||
|
mIsGsm = gsmFlag;
|
||||||
mUseOnlyRsrpForLteLevel = false;
|
mUseOnlyRsrpForLteLevel = false;
|
||||||
setLteRsrpThresholds(getDefaultLteRsrpThresholds());
|
setLteRsrpThresholds(getDefaultLteRsrpThresholds());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor with all fields present
|
||||||
*
|
*
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
public SignalStrength(int gsmSignalStrength, int gsmBitErrorRate,
|
public SignalStrength(
|
||||||
|
int gsmSignalStrength, int gsmBitErrorRate,
|
||||||
int cdmaDbm, int cdmaEcio,
|
int cdmaDbm, int cdmaEcio,
|
||||||
int evdoDbm, int evdoEcio, int evdoSnr,
|
int evdoDbm, int evdoEcio, int evdoSnr,
|
||||||
int lteSignalStrength, int lteRsrp, int lteRsrq, int lteRssnr, int lteCqi,
|
int lteSignalStrength, int lteRsrp, int lteRsrq, int lteRssnr, int lteCqi,
|
||||||
int lteRsrpBoost, int tdScdmaRscp, boolean gsmFlag, boolean lteLevelBaseOnRsrp) {
|
int tdScdmaRscp,
|
||||||
initialize(gsmSignalStrength, gsmBitErrorRate, cdmaDbm, cdmaEcio,
|
// values Added by config
|
||||||
evdoDbm, evdoEcio, evdoSnr, lteSignalStrength, lteRsrp,
|
int lteRsrpBoost, boolean gsmFlag, boolean lteLevelBaseOnRsrp) {
|
||||||
lteRsrq, lteRssnr, lteCqi, lteRsrpBoost, gsmFlag, lteLevelBaseOnRsrp);
|
|
||||||
mTdScdmaRscp = tdScdmaRscp;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructor
|
|
||||||
*
|
|
||||||
* @hide
|
|
||||||
*/
|
|
||||||
public SignalStrength(int gsmSignalStrength, int gsmBitErrorRate,
|
|
||||||
int cdmaDbm, int cdmaEcio,
|
|
||||||
int evdoDbm, int evdoEcio, int evdoSnr,
|
|
||||||
int lteSignalStrength, int lteRsrp, int lteRsrq, int lteRssnr, int lteCqi,
|
|
||||||
int tdScdmaRscp, boolean gsmFlag) {
|
|
||||||
initialize(gsmSignalStrength, gsmBitErrorRate, cdmaDbm, cdmaEcio,
|
|
||||||
evdoDbm, evdoEcio, evdoSnr, lteSignalStrength, lteRsrp,
|
|
||||||
lteRsrq, lteRssnr, lteCqi, 0, gsmFlag, false);
|
|
||||||
mTdScdmaRscp = tdScdmaRscp;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructor
|
|
||||||
*
|
|
||||||
* @hide
|
|
||||||
*/
|
|
||||||
public SignalStrength(int gsmSignalStrength, int gsmBitErrorRate,
|
|
||||||
int cdmaDbm, int cdmaEcio,
|
|
||||||
int evdoDbm, int evdoEcio, int evdoSnr,
|
|
||||||
int lteSignalStrength, int lteRsrp, int lteRsrq, int lteRssnr, int lteCqi,
|
|
||||||
boolean gsmFlag) {
|
|
||||||
initialize(gsmSignalStrength, gsmBitErrorRate, cdmaDbm, cdmaEcio,
|
|
||||||
evdoDbm, evdoEcio, evdoSnr, lteSignalStrength, lteRsrp,
|
|
||||||
lteRsrq, lteRssnr, lteCqi, 0, gsmFlag, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Constructor
|
|
||||||
*
|
|
||||||
* @hide
|
|
||||||
*/
|
|
||||||
public SignalStrength(int gsmSignalStrength, int gsmBitErrorRate,
|
|
||||||
int cdmaDbm, int cdmaEcio,
|
|
||||||
int evdoDbm, int evdoEcio, int evdoSnr,
|
|
||||||
boolean gsmFlag) {
|
|
||||||
initialize(gsmSignalStrength, gsmBitErrorRate, cdmaDbm, cdmaEcio,
|
|
||||||
evdoDbm, evdoEcio, evdoSnr, 99, INVALID,
|
|
||||||
INVALID, INVALID, INVALID, 0, gsmFlag, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Copy constructors
|
|
||||||
*
|
|
||||||
* @param s Source SignalStrength
|
|
||||||
*
|
|
||||||
* @hide
|
|
||||||
*/
|
|
||||||
public SignalStrength(SignalStrength s) {
|
|
||||||
copyFrom(s);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Initialize gsm/cdma values, sets lte values to defaults.
|
|
||||||
*
|
|
||||||
* @param gsmSignalStrength
|
|
||||||
* @param gsmBitErrorRate
|
|
||||||
* @param cdmaDbm
|
|
||||||
* @param cdmaEcio
|
|
||||||
* @param evdoDbm
|
|
||||||
* @param evdoEcio
|
|
||||||
* @param evdoSnr
|
|
||||||
* @param gsm
|
|
||||||
*
|
|
||||||
* @hide
|
|
||||||
*/
|
|
||||||
public void initialize(int gsmSignalStrength, int gsmBitErrorRate,
|
|
||||||
int cdmaDbm, int cdmaEcio,
|
|
||||||
int evdoDbm, int evdoEcio, int evdoSnr,
|
|
||||||
boolean gsm) {
|
|
||||||
initialize(gsmSignalStrength, gsmBitErrorRate, cdmaDbm, cdmaEcio,
|
|
||||||
evdoDbm, evdoEcio, evdoSnr, 99, INVALID,
|
|
||||||
INVALID, INVALID, INVALID, 0, gsm, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Initialize all the values
|
|
||||||
*
|
|
||||||
* @param gsmSignalStrength
|
|
||||||
* @param gsmBitErrorRate
|
|
||||||
* @param cdmaDbm
|
|
||||||
* @param cdmaEcio
|
|
||||||
* @param evdoDbm
|
|
||||||
* @param evdoEcio
|
|
||||||
* @param evdoSnr
|
|
||||||
* @param lteSignalStrength
|
|
||||||
* @param lteRsrp
|
|
||||||
* @param lteRsrq
|
|
||||||
* @param lteRssnr
|
|
||||||
* @param lteCqi
|
|
||||||
* @param lteRsrpBoost
|
|
||||||
* @param gsm
|
|
||||||
* @param useOnlyRsrpForLteLevel
|
|
||||||
*
|
|
||||||
* @hide
|
|
||||||
*/
|
|
||||||
public void initialize(int gsmSignalStrength, int gsmBitErrorRate,
|
|
||||||
int cdmaDbm, int cdmaEcio,
|
|
||||||
int evdoDbm, int evdoEcio, int evdoSnr,
|
|
||||||
int lteSignalStrength, int lteRsrp, int lteRsrq, int lteRssnr, int lteCqi,
|
|
||||||
int lteRsrpBoost, boolean gsm, boolean useOnlyRsrpForLteLevel) {
|
|
||||||
mGsmSignalStrength = gsmSignalStrength;
|
mGsmSignalStrength = gsmSignalStrength;
|
||||||
mGsmBitErrorRate = gsmBitErrorRate;
|
mGsmBitErrorRate = gsmBitErrorRate;
|
||||||
mCdmaDbm = cdmaDbm;
|
mCdmaDbm = cdmaDbm;
|
||||||
@@ -283,15 +164,40 @@ public class SignalStrength implements Parcelable {
|
|||||||
mLteRsrq = lteRsrq;
|
mLteRsrq = lteRsrq;
|
||||||
mLteRssnr = lteRssnr;
|
mLteRssnr = lteRssnr;
|
||||||
mLteCqi = lteCqi;
|
mLteCqi = lteCqi;
|
||||||
mLteRsrpBoost = lteRsrpBoost;
|
|
||||||
mTdScdmaRscp = INVALID;
|
mTdScdmaRscp = INVALID;
|
||||||
isGsm = gsm;
|
mLteRsrpBoost = lteRsrpBoost;
|
||||||
mUseOnlyRsrpForLteLevel = useOnlyRsrpForLteLevel;
|
mIsGsm = gsmFlag;
|
||||||
|
mUseOnlyRsrpForLteLevel = lteLevelBaseOnRsrp;
|
||||||
setLteRsrpThresholds(getDefaultLteRsrpThresholds());
|
setLteRsrpThresholds(getDefaultLteRsrpThresholds());
|
||||||
if (DBG) log("initialize: " + toString());
|
if (DBG) log("initialize: " + toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor for only values provided by Radio HAL
|
||||||
|
*
|
||||||
|
* @hide
|
||||||
|
*/
|
||||||
|
public SignalStrength(int gsmSignalStrength, int gsmBitErrorRate,
|
||||||
|
int cdmaDbm, int cdmaEcio,
|
||||||
|
int evdoDbm, int evdoEcio, int evdoSnr,
|
||||||
|
int lteSignalStrength, int lteRsrp, int lteRsrq, int lteRssnr, int lteCqi,
|
||||||
|
int tdScdmaRscp) {
|
||||||
|
this(gsmSignalStrength, gsmBitErrorRate, cdmaDbm, cdmaEcio,
|
||||||
|
evdoDbm, evdoEcio, evdoSnr, lteSignalStrength, lteRsrp,
|
||||||
|
lteRsrq, lteRssnr, lteCqi, tdScdmaRscp, 0, true, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Copy constructors
|
||||||
|
*
|
||||||
|
* @param s Source SignalStrength
|
||||||
|
*
|
||||||
|
* @hide
|
||||||
|
*/
|
||||||
|
public SignalStrength(SignalStrength s) {
|
||||||
|
copyFrom(s);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
@@ -308,9 +214,9 @@ public class SignalStrength implements Parcelable {
|
|||||||
mLteRsrq = s.mLteRsrq;
|
mLteRsrq = s.mLteRsrq;
|
||||||
mLteRssnr = s.mLteRssnr;
|
mLteRssnr = s.mLteRssnr;
|
||||||
mLteCqi = s.mLteCqi;
|
mLteCqi = s.mLteCqi;
|
||||||
mLteRsrpBoost = s.mLteRsrpBoost;
|
|
||||||
mTdScdmaRscp = s.mTdScdmaRscp;
|
mTdScdmaRscp = s.mTdScdmaRscp;
|
||||||
isGsm = s.isGsm;
|
mLteRsrpBoost = s.mLteRsrpBoost;
|
||||||
|
mIsGsm = s.mIsGsm;
|
||||||
mUseOnlyRsrpForLteLevel = s.mUseOnlyRsrpForLteLevel;
|
mUseOnlyRsrpForLteLevel = s.mUseOnlyRsrpForLteLevel;
|
||||||
setLteRsrpThresholds(s.mLteRsrpThresholds);
|
setLteRsrpThresholds(s.mLteRsrpThresholds);
|
||||||
}
|
}
|
||||||
@@ -335,40 +241,11 @@ public class SignalStrength implements Parcelable {
|
|||||||
mLteRsrq = in.readInt();
|
mLteRsrq = in.readInt();
|
||||||
mLteRssnr = in.readInt();
|
mLteRssnr = in.readInt();
|
||||||
mLteCqi = in.readInt();
|
mLteCqi = in.readInt();
|
||||||
mLteRsrpBoost = in.readInt();
|
|
||||||
mTdScdmaRscp = in.readInt();
|
mTdScdmaRscp = in.readInt();
|
||||||
isGsm = (in.readInt() != 0);
|
mLteRsrpBoost = in.readInt();
|
||||||
mUseOnlyRsrpForLteLevel = (in.readInt() != 0);
|
mIsGsm = in.readBoolean();
|
||||||
for (int i = 0; i < LTE_RSRP_THRESHOLDS_NUM; i++) {
|
mUseOnlyRsrpForLteLevel = in.readBoolean();
|
||||||
mLteRsrpThresholds[i] = in.readInt();
|
in.readIntArray(mLteRsrpThresholds);
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Make a SignalStrength object from the given parcel as passed up by
|
|
||||||
* the ril which does not have isGsm. isGsm will be changed by ServiceStateTracker
|
|
||||||
* so the default is a don't care.
|
|
||||||
*
|
|
||||||
* @hide
|
|
||||||
*/
|
|
||||||
public static SignalStrength makeSignalStrengthFromRilParcel(Parcel in) {
|
|
||||||
if (DBG) log("Size of signalstrength parcel:" + in.dataSize());
|
|
||||||
|
|
||||||
SignalStrength ss = new SignalStrength();
|
|
||||||
ss.mGsmSignalStrength = in.readInt();
|
|
||||||
ss.mGsmBitErrorRate = in.readInt();
|
|
||||||
ss.mCdmaDbm = in.readInt();
|
|
||||||
ss.mCdmaEcio = in.readInt();
|
|
||||||
ss.mEvdoDbm = in.readInt();
|
|
||||||
ss.mEvdoEcio = in.readInt();
|
|
||||||
ss.mEvdoSnr = in.readInt();
|
|
||||||
ss.mLteSignalStrength = in.readInt();
|
|
||||||
ss.mLteRsrp = in.readInt();
|
|
||||||
ss.mLteRsrq = in.readInt();
|
|
||||||
ss.mLteRssnr = in.readInt();
|
|
||||||
ss.mLteCqi = in.readInt();
|
|
||||||
ss.mTdScdmaRscp = in.readInt();
|
|
||||||
return ss;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -387,13 +264,11 @@ public class SignalStrength implements Parcelable {
|
|||||||
out.writeInt(mLteRsrq);
|
out.writeInt(mLteRsrq);
|
||||||
out.writeInt(mLteRssnr);
|
out.writeInt(mLteRssnr);
|
||||||
out.writeInt(mLteCqi);
|
out.writeInt(mLteCqi);
|
||||||
out.writeInt(mLteRsrpBoost);
|
|
||||||
out.writeInt(mTdScdmaRscp);
|
out.writeInt(mTdScdmaRscp);
|
||||||
out.writeInt(isGsm ? 1 : 0);
|
out.writeInt(mLteRsrpBoost);
|
||||||
out.writeInt(mUseOnlyRsrpForLteLevel ? 1 : 0);
|
out.writeBoolean(mIsGsm);
|
||||||
for (int i = 0; i < LTE_RSRP_THRESHOLDS_NUM; i++) {
|
out.writeBoolean(mUseOnlyRsrpForLteLevel);
|
||||||
out.writeInt(mLteRsrpThresholds[i]);
|
out.writeIntArray(mLteRsrpThresholds);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -456,24 +331,24 @@ public class SignalStrength implements Parcelable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fix {@link #isGsm} based on the signal strength data.
|
* Fix {@link #mIsGsm} based on the signal strength data.
|
||||||
*
|
*
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
public void fixType() {
|
public void fixType() {
|
||||||
isGsm = getCdmaRelatedSignalStrength() == SIGNAL_STRENGTH_NONE_OR_UNKNOWN;
|
mIsGsm = getCdmaRelatedSignalStrength() == SIGNAL_STRENGTH_NONE_OR_UNKNOWN;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param true - Gsm, Lte phones
|
* @param true - Gsm, Lte phones
|
||||||
* false - Cdma phones
|
* false - Cdma phones
|
||||||
*
|
*
|
||||||
* Used by voice phone to set the isGsm
|
* Used by voice phone to set the mIsGsm
|
||||||
* flag
|
* flag
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
public void setGsm(boolean gsmFlag) {
|
public void setGsm(boolean gsmFlag) {
|
||||||
isGsm = gsmFlag;
|
mIsGsm = gsmFlag;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -604,7 +479,7 @@ public class SignalStrength implements Parcelable {
|
|||||||
* while 4 represents a very strong signal strength.
|
* while 4 represents a very strong signal strength.
|
||||||
*/
|
*/
|
||||||
public int getLevel() {
|
public int getLevel() {
|
||||||
int level = isGsm ? getGsmRelatedSignalStrength() : getCdmaRelatedSignalStrength();
|
int level = mIsGsm ? getGsmRelatedSignalStrength() : getCdmaRelatedSignalStrength();
|
||||||
if (DBG) log("getLevel=" + level);
|
if (DBG) log("getLevel=" + level);
|
||||||
return level;
|
return level;
|
||||||
}
|
}
|
||||||
@@ -616,7 +491,7 @@ public class SignalStrength implements Parcelable {
|
|||||||
*/
|
*/
|
||||||
public int getAsuLevel() {
|
public int getAsuLevel() {
|
||||||
int asuLevel = 0;
|
int asuLevel = 0;
|
||||||
if (isGsm) {
|
if (mIsGsm) {
|
||||||
if (getLteLevel() == SIGNAL_STRENGTH_NONE_OR_UNKNOWN) {
|
if (getLteLevel() == SIGNAL_STRENGTH_NONE_OR_UNKNOWN) {
|
||||||
if (getTdScdmaLevel() == SIGNAL_STRENGTH_NONE_OR_UNKNOWN) {
|
if (getTdScdmaLevel() == SIGNAL_STRENGTH_NONE_OR_UNKNOWN) {
|
||||||
asuLevel = getGsmAsuLevel();
|
asuLevel = getGsmAsuLevel();
|
||||||
@@ -966,7 +841,7 @@ public class SignalStrength implements Parcelable {
|
|||||||
* @return true if this is for GSM
|
* @return true if this is for GSM
|
||||||
*/
|
*/
|
||||||
public boolean isGsm() {
|
public boolean isGsm() {
|
||||||
return this.isGsm;
|
return this.mIsGsm;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1038,7 +913,7 @@ public class SignalStrength implements Parcelable {
|
|||||||
+ (mEvdoDbm * primeNum) + (mEvdoEcio * primeNum) + (mEvdoSnr * primeNum)
|
+ (mEvdoDbm * primeNum) + (mEvdoEcio * primeNum) + (mEvdoSnr * primeNum)
|
||||||
+ (mLteSignalStrength * primeNum) + (mLteRsrp * primeNum)
|
+ (mLteSignalStrength * primeNum) + (mLteRsrp * primeNum)
|
||||||
+ (mLteRsrq * primeNum) + (mLteRssnr * primeNum) + (mLteCqi * primeNum)
|
+ (mLteRsrq * primeNum) + (mLteRssnr * primeNum) + (mLteCqi * primeNum)
|
||||||
+ (mLteRsrpBoost * primeNum) + (mTdScdmaRscp * primeNum) + (isGsm ? 1 : 0)
|
+ (mLteRsrpBoost * primeNum) + (mTdScdmaRscp * primeNum) + (mIsGsm ? 1 : 0)
|
||||||
+ (mUseOnlyRsrpForLteLevel ? 1 : 0) + (Arrays.hashCode(mLteRsrpThresholds)));
|
+ (mUseOnlyRsrpForLteLevel ? 1 : 0) + (Arrays.hashCode(mLteRsrpThresholds)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1073,7 +948,7 @@ public class SignalStrength implements Parcelable {
|
|||||||
&& mLteCqi == s.mLteCqi
|
&& mLteCqi == s.mLteCqi
|
||||||
&& mLteRsrpBoost == s.mLteRsrpBoost
|
&& mLteRsrpBoost == s.mLteRsrpBoost
|
||||||
&& mTdScdmaRscp == s.mTdScdmaRscp
|
&& mTdScdmaRscp == s.mTdScdmaRscp
|
||||||
&& isGsm == s.isGsm
|
&& mIsGsm == s.mIsGsm
|
||||||
&& mUseOnlyRsrpForLteLevel == s.mUseOnlyRsrpForLteLevel
|
&& mUseOnlyRsrpForLteLevel == s.mUseOnlyRsrpForLteLevel
|
||||||
&& Arrays.equals(mLteRsrpThresholds, s.mLteRsrpThresholds));
|
&& Arrays.equals(mLteRsrpThresholds, s.mLteRsrpThresholds));
|
||||||
}
|
}
|
||||||
@@ -1098,7 +973,7 @@ public class SignalStrength implements Parcelable {
|
|||||||
+ " " + mLteCqi
|
+ " " + mLteCqi
|
||||||
+ " " + mLteRsrpBoost
|
+ " " + mLteRsrpBoost
|
||||||
+ " " + mTdScdmaRscp
|
+ " " + mTdScdmaRscp
|
||||||
+ " " + (isGsm ? "gsm|lte" : "cdma")
|
+ " " + (mIsGsm ? "gsm|lte" : "cdma")
|
||||||
+ " " + (mUseOnlyRsrpForLteLevel ? "use_only_rsrp_for_lte_level" :
|
+ " " + (mUseOnlyRsrpForLteLevel ? "use_only_rsrp_for_lte_level" :
|
||||||
"use_rsrp_and_rssnr_for_lte_level")
|
"use_rsrp_and_rssnr_for_lte_level")
|
||||||
+ " " + (Arrays.toString(mLteRsrpThresholds)));
|
+ " " + (Arrays.toString(mLteRsrpThresholds)));
|
||||||
@@ -1153,10 +1028,10 @@ public class SignalStrength implements Parcelable {
|
|||||||
mLteRsrq = m.getInt("LteRsrq");
|
mLteRsrq = m.getInt("LteRsrq");
|
||||||
mLteRssnr = m.getInt("LteRssnr");
|
mLteRssnr = m.getInt("LteRssnr");
|
||||||
mLteCqi = m.getInt("LteCqi");
|
mLteCqi = m.getInt("LteCqi");
|
||||||
mLteRsrpBoost = m.getInt("lteRsrpBoost");
|
mLteRsrpBoost = m.getInt("LteRsrpBoost");
|
||||||
mTdScdmaRscp = m.getInt("TdScdma");
|
mTdScdmaRscp = m.getInt("TdScdma");
|
||||||
isGsm = m.getBoolean("isGsm");
|
mIsGsm = m.getBoolean("IsGsm");
|
||||||
mUseOnlyRsrpForLteLevel = m.getBoolean("useOnlyRsrpForLteLevel");
|
mUseOnlyRsrpForLteLevel = m.getBoolean("UseOnlyRsrpForLteLevel");
|
||||||
ArrayList<Integer> lteRsrpThresholds = m.getIntegerArrayList("lteRsrpThresholds");
|
ArrayList<Integer> lteRsrpThresholds = m.getIntegerArrayList("lteRsrpThresholds");
|
||||||
for (int i = 0; i < lteRsrpThresholds.size(); i++) {
|
for (int i = 0; i < lteRsrpThresholds.size(); i++) {
|
||||||
mLteRsrpThresholds[i] = lteRsrpThresholds.get(i);
|
mLteRsrpThresholds[i] = lteRsrpThresholds.get(i);
|
||||||
@@ -1182,10 +1057,10 @@ public class SignalStrength implements Parcelable {
|
|||||||
m.putInt("LteRsrq", mLteRsrq);
|
m.putInt("LteRsrq", mLteRsrq);
|
||||||
m.putInt("LteRssnr", mLteRssnr);
|
m.putInt("LteRssnr", mLteRssnr);
|
||||||
m.putInt("LteCqi", mLteCqi);
|
m.putInt("LteCqi", mLteCqi);
|
||||||
m.putInt("lteRsrpBoost", mLteRsrpBoost);
|
m.putInt("LteRsrpBoost", mLteRsrpBoost);
|
||||||
m.putInt("TdScdma", mTdScdmaRscp);
|
m.putInt("TdScdma", mTdScdmaRscp);
|
||||||
m.putBoolean("isGsm", isGsm);
|
m.putBoolean("IsGsm", mIsGsm);
|
||||||
m.putBoolean("useOnlyRsrpForLteLevel", mUseOnlyRsrpForLteLevel);
|
m.putBoolean("UseOnlyRsrpForLteLevel", mUseOnlyRsrpForLteLevel);
|
||||||
ArrayList<Integer> lteRsrpThresholds = new ArrayList<Integer>();
|
ArrayList<Integer> lteRsrpThresholds = new ArrayList<Integer>();
|
||||||
for (int value : mLteRsrpThresholds) {
|
for (int value : mLteRsrpThresholds) {
|
||||||
lteRsrpThresholds.add(value);
|
lteRsrpThresholds.add(value);
|
||||||
|
|||||||
Reference in New Issue
Block a user