Merge "Support Signal strength offset"
This commit is contained in:
@@ -1135,6 +1135,22 @@ public class CarrierConfigManager {
|
||||
public static final String KEY_NOTIFY_INTERNATIONAL_CALL_ON_WFC_BOOL =
|
||||
"notify_international_call_on_wfc_bool";
|
||||
|
||||
/**
|
||||
* Offset to be reduced from rsrp threshold while calculating signal strength level.
|
||||
* @hide
|
||||
*/
|
||||
public static final String KEY_LTE_EARFCNS_RSRP_BOOST_INT = "lte_earfcns_rsrp_boost_int";
|
||||
|
||||
/**
|
||||
* List of EARFCN (E-UTRA Absolute Radio Frequency Channel Number,
|
||||
* Reference: 3GPP TS 36.104 5.4.3) inclusive ranges on which lte_rsrp_boost_int
|
||||
* will be applied. Format of the String array is expected to be {"erafcn1_start-earfcn1_end",
|
||||
* "earfcn2_start-earfcn2_end" ... }
|
||||
* @hide
|
||||
*/
|
||||
public static final String KEY_BOOSTED_LTE_EARFCNS_STRING_ARRAY =
|
||||
"boosted_lte_earfcns_string_array";
|
||||
|
||||
/** The default value for every variable. */
|
||||
private final static PersistableBundle sDefaults;
|
||||
|
||||
@@ -1341,6 +1357,8 @@ public class CarrierConfigManager {
|
||||
sDefaults.putBoolean(KEY_EDITABLE_WFC_ROAMING_MODE_BOOL, false);
|
||||
sDefaults.putBoolean(KEY_SUPPORT_3GPP_CALL_FORWARDING_WHILE_ROAMING_BOOL, true);
|
||||
sDefaults.putBoolean(KEY_NOTIFY_INTERNATIONAL_CALL_ON_WFC_BOOL, false);
|
||||
sDefaults.putInt(KEY_LTE_EARFCNS_RSRP_BOOST_INT, 0);
|
||||
sDefaults.putStringArray(KEY_BOOSTED_LTE_EARFCNS_STRING_ARRAY, null);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -243,6 +243,10 @@ public class ServiceState implements Parcelable {
|
||||
|
||||
private boolean mIsUsingCarrierAggregation;
|
||||
|
||||
/* EARFCN stands for E-UTRA Absolute Radio Frequency Channel Number,
|
||||
* Reference: 3GPP TS 36.104 5.4.3 */
|
||||
private int mLteEarfcnRsrpBoost = 0;
|
||||
|
||||
/**
|
||||
* get String description of roaming type
|
||||
* @hide
|
||||
@@ -322,6 +326,7 @@ public class ServiceState implements Parcelable {
|
||||
mIsEmergencyOnly = s.mIsEmergencyOnly;
|
||||
mIsDataRoamingFromRegistration = s.mIsDataRoamingFromRegistration;
|
||||
mIsUsingCarrierAggregation = s.mIsUsingCarrierAggregation;
|
||||
mLteEarfcnRsrpBoost = s.mLteEarfcnRsrpBoost;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -351,6 +356,7 @@ public class ServiceState implements Parcelable {
|
||||
mIsEmergencyOnly = in.readInt() != 0;
|
||||
mIsDataRoamingFromRegistration = in.readInt() != 0;
|
||||
mIsUsingCarrierAggregation = in.readInt() != 0;
|
||||
mLteEarfcnRsrpBoost = in.readInt();
|
||||
}
|
||||
|
||||
public void writeToParcel(Parcel out, int flags) {
|
||||
@@ -377,6 +383,7 @@ public class ServiceState implements Parcelable {
|
||||
out.writeInt(mIsEmergencyOnly ? 1 : 0);
|
||||
out.writeInt(mIsDataRoamingFromRegistration ? 1 : 0);
|
||||
out.writeInt(mIsUsingCarrierAggregation ? 1 : 0);
|
||||
out.writeInt(mLteEarfcnRsrpBoost);
|
||||
}
|
||||
|
||||
public int describeContents() {
|
||||
@@ -814,7 +821,8 @@ public class ServiceState implements Parcelable {
|
||||
+ " DefRoamInd=" + mCdmaDefaultRoamingIndicator
|
||||
+ " EmergOnly=" + mIsEmergencyOnly
|
||||
+ " IsDataRoamingFromRegistration=" + mIsDataRoamingFromRegistration
|
||||
+ " IsUsingCarrierAggregation=" + mIsUsingCarrierAggregation);
|
||||
+ " IsUsingCarrierAggregation=" + mIsUsingCarrierAggregation
|
||||
+ " mLteEarfcnRsrpBoost=" + mLteEarfcnRsrpBoost);
|
||||
}
|
||||
|
||||
private void setNullState(int state) {
|
||||
@@ -842,6 +850,7 @@ public class ServiceState implements Parcelable {
|
||||
mIsEmergencyOnly = false;
|
||||
mIsDataRoamingFromRegistration = false;
|
||||
mIsUsingCarrierAggregation = false;
|
||||
mLteEarfcnRsrpBoost = 0;
|
||||
}
|
||||
|
||||
public void setStateOutOfService() {
|
||||
@@ -1016,6 +1025,7 @@ public class ServiceState implements Parcelable {
|
||||
mIsEmergencyOnly = m.getBoolean("emergencyOnly");
|
||||
mIsDataRoamingFromRegistration = m.getBoolean("isDataRoamingFromRegistration");
|
||||
mIsUsingCarrierAggregation = m.getBoolean("isUsingCarrierAggregation");
|
||||
mLteEarfcnRsrpBoost = m.getInt("LteEarfcnRsrpBoost");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1046,6 +1056,7 @@ public class ServiceState implements Parcelable {
|
||||
m.putBoolean("emergencyOnly", mIsEmergencyOnly);
|
||||
m.putBoolean("isDataRoamingFromRegistration", mIsDataRoamingFromRegistration);
|
||||
m.putBoolean("isUsingCarrierAggregation", mIsUsingCarrierAggregation);
|
||||
m.putInt("LteEarfcnRsrpBoost", mLteEarfcnRsrpBoost);
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
@@ -1080,6 +1091,16 @@ public class ServiceState implements Parcelable {
|
||||
mIsUsingCarrierAggregation = ca;
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public int getLteEarfcnRsrpBoost() {
|
||||
return mLteEarfcnRsrpBoost;
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public void setLteEarfcnRsrpBoost(int LteEarfcnRsrpBoost) {
|
||||
mLteEarfcnRsrpBoost = LteEarfcnRsrpBoost;
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public void setCssIndicator(int css) {
|
||||
this.mCssIndicator = (css != 0);
|
||||
|
||||
@@ -64,6 +64,8 @@ public class SignalStrength implements Parcelable {
|
||||
private int mLteRsrq;
|
||||
private int mLteRssnr;
|
||||
private int mLteCqi;
|
||||
private int mLteRsrpBoost; // offset to be reduced from the rsrp threshold while calculating
|
||||
// signal strength level
|
||||
private int mTdScdmaRscp;
|
||||
|
||||
private boolean isGsm; // This value is set by the ServiceStateTracker onSignalStrengthResult
|
||||
@@ -104,6 +106,7 @@ public class SignalStrength implements Parcelable {
|
||||
mLteRsrq = INVALID;
|
||||
mLteRssnr = INVALID;
|
||||
mLteCqi = INVALID;
|
||||
mLteRsrpBoost = 0;
|
||||
mTdScdmaRscp = INVALID;
|
||||
isGsm = true;
|
||||
}
|
||||
@@ -129,10 +132,27 @@ public class SignalStrength implements Parcelable {
|
||||
mLteRsrq = INVALID;
|
||||
mLteRssnr = INVALID;
|
||||
mLteCqi = INVALID;
|
||||
mLteRsrpBoost = 0;
|
||||
mTdScdmaRscp = INVALID;
|
||||
isGsm = gsmFlag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 lteRsrpBoost, int tdScdmaRscp, boolean gsmFlag) {
|
||||
initialize(gsmSignalStrength, gsmBitErrorRate, cdmaDbm, cdmaEcio,
|
||||
evdoDbm, evdoEcio, evdoSnr, lteSignalStrength, lteRsrp,
|
||||
lteRsrq, lteRssnr, lteCqi, lteRsrpBoost, gsmFlag);
|
||||
mTdScdmaRscp = tdScdmaRscp;
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
@@ -145,7 +165,7 @@ public class SignalStrength implements Parcelable {
|
||||
int tdScdmaRscp, boolean gsmFlag) {
|
||||
initialize(gsmSignalStrength, gsmBitErrorRate, cdmaDbm, cdmaEcio,
|
||||
evdoDbm, evdoEcio, evdoSnr, lteSignalStrength, lteRsrp,
|
||||
lteRsrq, lteRssnr, lteCqi, gsmFlag);
|
||||
lteRsrq, lteRssnr, lteCqi, 0, gsmFlag);
|
||||
mTdScdmaRscp = tdScdmaRscp;
|
||||
}
|
||||
|
||||
@@ -161,7 +181,7 @@ public class SignalStrength implements Parcelable {
|
||||
boolean gsmFlag) {
|
||||
initialize(gsmSignalStrength, gsmBitErrorRate, cdmaDbm, cdmaEcio,
|
||||
evdoDbm, evdoEcio, evdoSnr, lteSignalStrength, lteRsrp,
|
||||
lteRsrq, lteRssnr, lteCqi, gsmFlag);
|
||||
lteRsrq, lteRssnr, lteCqi, 0, gsmFlag);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -175,7 +195,7 @@ public class SignalStrength implements Parcelable {
|
||||
boolean gsmFlag) {
|
||||
initialize(gsmSignalStrength, gsmBitErrorRate, cdmaDbm, cdmaEcio,
|
||||
evdoDbm, evdoEcio, evdoSnr, 99, INVALID,
|
||||
INVALID, INVALID, INVALID, gsmFlag);
|
||||
INVALID, INVALID, INVALID, 0, gsmFlag);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -209,7 +229,7 @@ public class SignalStrength implements Parcelable {
|
||||
boolean gsm) {
|
||||
initialize(gsmSignalStrength, gsmBitErrorRate, cdmaDbm, cdmaEcio,
|
||||
evdoDbm, evdoEcio, evdoSnr, 99, INVALID,
|
||||
INVALID, INVALID, INVALID, gsm);
|
||||
INVALID, INVALID, INVALID, 0, gsm);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -227,6 +247,7 @@ public class SignalStrength implements Parcelable {
|
||||
* @param lteRsrq
|
||||
* @param lteRssnr
|
||||
* @param lteCqi
|
||||
* @param lteRsrpBoost
|
||||
* @param gsm
|
||||
*
|
||||
* @hide
|
||||
@@ -235,7 +256,7 @@ public class SignalStrength implements Parcelable {
|
||||
int cdmaDbm, int cdmaEcio,
|
||||
int evdoDbm, int evdoEcio, int evdoSnr,
|
||||
int lteSignalStrength, int lteRsrp, int lteRsrq, int lteRssnr, int lteCqi,
|
||||
boolean gsm) {
|
||||
int lteRsrpBoost, boolean gsm) {
|
||||
mGsmSignalStrength = gsmSignalStrength;
|
||||
mGsmBitErrorRate = gsmBitErrorRate;
|
||||
mCdmaDbm = cdmaDbm;
|
||||
@@ -248,6 +269,7 @@ public class SignalStrength implements Parcelable {
|
||||
mLteRsrq = lteRsrq;
|
||||
mLteRssnr = lteRssnr;
|
||||
mLteCqi = lteCqi;
|
||||
mLteRsrpBoost = lteRsrpBoost;
|
||||
mTdScdmaRscp = INVALID;
|
||||
isGsm = gsm;
|
||||
if (DBG) log("initialize: " + toString());
|
||||
@@ -269,6 +291,7 @@ public class SignalStrength implements Parcelable {
|
||||
mLteRsrq = s.mLteRsrq;
|
||||
mLteRssnr = s.mLteRssnr;
|
||||
mLteCqi = s.mLteCqi;
|
||||
mLteRsrpBoost = s.mLteRsrpBoost;
|
||||
mTdScdmaRscp = s.mTdScdmaRscp;
|
||||
isGsm = s.isGsm;
|
||||
}
|
||||
@@ -293,6 +316,7 @@ public class SignalStrength implements Parcelable {
|
||||
mLteRsrq = in.readInt();
|
||||
mLteRssnr = in.readInt();
|
||||
mLteCqi = in.readInt();
|
||||
mLteRsrpBoost = in.readInt();
|
||||
mTdScdmaRscp = in.readInt();
|
||||
isGsm = (in.readInt() != 0);
|
||||
}
|
||||
@@ -340,6 +364,7 @@ public class SignalStrength implements Parcelable {
|
||||
out.writeInt(mLteRsrq);
|
||||
out.writeInt(mLteRssnr);
|
||||
out.writeInt(mLteCqi);
|
||||
out.writeInt(mLteRsrpBoost);
|
||||
out.writeInt(mTdScdmaRscp);
|
||||
out.writeInt(isGsm ? 1 : 0);
|
||||
}
|
||||
@@ -415,6 +440,18 @@ public class SignalStrength implements Parcelable {
|
||||
isGsm = gsmFlag;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param lteRsrpBoost - signal strength offset
|
||||
*
|
||||
* Used by phone to set the lte signal strength offset which will be
|
||||
* reduced from rsrp threshold while calculating signal strength level
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
public void setLteRsrpBoost(int lteRsrpBoost) {
|
||||
mLteRsrpBoost = lteRsrpBoost;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the GSM Signal Strength, valid values are (0-31, 99) as defined in TS
|
||||
* 27.007 8.5
|
||||
@@ -490,6 +527,11 @@ public class SignalStrength implements Parcelable {
|
||||
return mLteCqi;
|
||||
}
|
||||
|
||||
/** @hide */
|
||||
public int getLteRsrpBoost() {
|
||||
return mLteRsrpBoost;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve an abstract level value for the overall signal strength.
|
||||
*
|
||||
@@ -793,12 +835,19 @@ public class SignalStrength implements Parcelable {
|
||||
Log.wtf(LOG_TAG, "getLteLevel - config_lteDbmThresholds has invalid num of elements."
|
||||
+ " Cannot evaluate RSRP signal.");
|
||||
} else {
|
||||
if (mLteRsrp > threshRsrp[5]) rsrpIconLevel = -1;
|
||||
else if (mLteRsrp >= threshRsrp[4]) rsrpIconLevel = SIGNAL_STRENGTH_GREAT;
|
||||
else if (mLteRsrp >= threshRsrp[3]) rsrpIconLevel = SIGNAL_STRENGTH_GOOD;
|
||||
else if (mLteRsrp >= threshRsrp[2]) rsrpIconLevel = SIGNAL_STRENGTH_MODERATE;
|
||||
else if (mLteRsrp >= threshRsrp[1]) rsrpIconLevel = SIGNAL_STRENGTH_POOR;
|
||||
else if (mLteRsrp >= threshRsrp[0]) rsrpIconLevel = SIGNAL_STRENGTH_NONE_OR_UNKNOWN;
|
||||
if (mLteRsrp > threshRsrp[5]) {
|
||||
rsrpIconLevel = -1;
|
||||
} else if (mLteRsrp >= (threshRsrp[4] - mLteRsrpBoost)) {
|
||||
rsrpIconLevel = SIGNAL_STRENGTH_GREAT;
|
||||
} else if (mLteRsrp >= (threshRsrp[3] - mLteRsrpBoost)) {
|
||||
rsrpIconLevel = SIGNAL_STRENGTH_GOOD;
|
||||
} else if (mLteRsrp >= (threshRsrp[2] - mLteRsrpBoost)) {
|
||||
rsrpIconLevel = SIGNAL_STRENGTH_MODERATE;
|
||||
} else if (mLteRsrp >= (threshRsrp[1] - mLteRsrpBoost)) {
|
||||
rsrpIconLevel = SIGNAL_STRENGTH_POOR;
|
||||
} else if (mLteRsrp >= threshRsrp[0]) {
|
||||
rsrpIconLevel = SIGNAL_STRENGTH_NONE_OR_UNKNOWN;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -816,7 +865,8 @@ public class SignalStrength implements Parcelable {
|
||||
snrIconLevel = SIGNAL_STRENGTH_NONE_OR_UNKNOWN;
|
||||
|
||||
if (DBG) log("getLTELevel - rsrp:" + mLteRsrp + " snr:" + mLteRssnr + " rsrpIconLevel:"
|
||||
+ rsrpIconLevel + " snrIconLevel:" + snrIconLevel);
|
||||
+ rsrpIconLevel + " snrIconLevel:" + snrIconLevel
|
||||
+ " lteRsrpBoost:" + mLteRsrpBoost);
|
||||
|
||||
/* Choose a measurement type to use for notification */
|
||||
if (snrIconLevel != -1 && rsrpIconLevel != -1) {
|
||||
@@ -939,7 +989,7 @@ public class SignalStrength implements Parcelable {
|
||||
+ (mEvdoDbm * primeNum) + (mEvdoEcio * primeNum) + (mEvdoSnr * primeNum)
|
||||
+ (mLteSignalStrength * primeNum) + (mLteRsrp * primeNum)
|
||||
+ (mLteRsrq * primeNum) + (mLteRssnr * primeNum) + (mLteCqi * primeNum)
|
||||
+ (mTdScdmaRscp * primeNum) + (isGsm ? 1 : 0));
|
||||
+ (mLteRsrpBoost * primeNum) + (mTdScdmaRscp * primeNum) + (isGsm ? 1 : 0));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -971,6 +1021,7 @@ public class SignalStrength implements Parcelable {
|
||||
&& mLteRsrq == s.mLteRsrq
|
||||
&& mLteRssnr == s.mLteRssnr
|
||||
&& mLteCqi == s.mLteCqi
|
||||
&& mLteRsrpBoost == s.mLteRsrpBoost
|
||||
&& mTdScdmaRscp == s.mTdScdmaRscp
|
||||
&& isGsm == s.isGsm);
|
||||
}
|
||||
@@ -993,6 +1044,7 @@ public class SignalStrength implements Parcelable {
|
||||
+ " " + mLteRsrq
|
||||
+ " " + mLteRssnr
|
||||
+ " " + mLteCqi
|
||||
+ " " + mLteRsrpBoost
|
||||
+ " " + mTdScdmaRscp
|
||||
+ " " + (isGsm ? "gsm|lte" : "cdma"));
|
||||
}
|
||||
@@ -1016,6 +1068,7 @@ public class SignalStrength implements Parcelable {
|
||||
mLteRsrq = m.getInt("LteRsrq");
|
||||
mLteRssnr = m.getInt("LteRssnr");
|
||||
mLteCqi = m.getInt("LteCqi");
|
||||
mLteRsrpBoost = m.getInt("lteRsrpBoost");
|
||||
mTdScdmaRscp = m.getInt("TdScdma");
|
||||
isGsm = m.getBoolean("isGsm");
|
||||
}
|
||||
@@ -1039,6 +1092,7 @@ public class SignalStrength implements Parcelable {
|
||||
m.putInt("LteRsrq", mLteRsrq);
|
||||
m.putInt("LteRssnr", mLteRssnr);
|
||||
m.putInt("LteCqi", mLteCqi);
|
||||
m.putInt("lteRsrpBoost", mLteRsrpBoost);
|
||||
m.putInt("TdScdma", mTdScdmaRscp);
|
||||
m.putBoolean("isGsm", isGsm);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user