Loading telephony/java/android/telephony/CarrierConfigManager.java +8 −3 Original line number Original line Diff line number Diff line Loading @@ -1815,7 +1815,14 @@ public class CarrierConfigManager { "check_pricing_with_carrier_data_roaming_bool"; "check_pricing_with_carrier_data_roaming_bool"; /** /** * List of thresholds of RSRP for determining the display level of LTE signal bar. * A list of 4 LTE RSRP thresholds above which a signal level is considered POOR, * MODERATE, GOOD, or EXCELLENT, to be used in SignalStrength reporting. * * Note that the min and max thresholds are fixed at -140 and -44, as explained in * TS 136.133 9.1.4 - RSRP Measurement Report Mapping. * <p> * See SignalStrength#MAX_LTE_RSRP and SignalStrength#MIN_LTE_RSRP. Any signal level outside * these boundaries is considered invalid. * @hide * @hide */ */ public static final String KEY_LTE_RSRP_THRESHOLDS_INT_ARRAY = public static final String KEY_LTE_RSRP_THRESHOLDS_INT_ARRAY = Loading Loading @@ -2136,12 +2143,10 @@ public class CarrierConfigManager { sDefaults.putBoolean(KEY_CHECK_PRICING_WITH_CARRIER_FOR_DATA_ROAMING_BOOL, false); sDefaults.putBoolean(KEY_CHECK_PRICING_WITH_CARRIER_FOR_DATA_ROAMING_BOOL, false); sDefaults.putIntArray(KEY_LTE_RSRP_THRESHOLDS_INT_ARRAY, sDefaults.putIntArray(KEY_LTE_RSRP_THRESHOLDS_INT_ARRAY, new int[] { new int[] { -140, /* SIGNAL_STRENGTH_NONE_OR_UNKNOWN */ -128, /* SIGNAL_STRENGTH_POOR */ -128, /* SIGNAL_STRENGTH_POOR */ -118, /* SIGNAL_STRENGTH_MODERATE */ -118, /* SIGNAL_STRENGTH_MODERATE */ -108, /* SIGNAL_STRENGTH_GOOD */ -108, /* SIGNAL_STRENGTH_GOOD */ -98, /* SIGNAL_STRENGTH_GREAT */ -98, /* SIGNAL_STRENGTH_GREAT */ -44 }); }); } } Loading telephony/java/android/telephony/SignalStrength.java +23 −14 Original line number Original line Diff line number Diff line Loading @@ -62,7 +62,9 @@ public class SignalStrength implements Parcelable { */ */ public static final int INVALID = Integer.MAX_VALUE; 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 = 4; private static final int MAX_LTE_RSRP = -44; private static final int MIN_LTE_RSRP = -140; /** Parameters reported by the Radio */ /** 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 Loading @@ -86,7 +88,8 @@ public class SignalStrength implements Parcelable { // onSignalStrengthResult. // 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. Note that the // min and max are fixed at MIN_LTE_RSRP (-140) and MAX_LTE_RSRP (-44). private int mLteRsrpThresholds[] = new int[LTE_RSRP_THRESHOLDS_NUM]; private int mLteRsrpThresholds[] = new int[LTE_RSRP_THRESHOLDS_NUM]; /** /** Loading Loading @@ -324,7 +327,8 @@ public class SignalStrength implements Parcelable { // TS 36.214 Physical Layer Section 5.1.3, TS 36.331 RRC // TS 36.214 Physical Layer Section 5.1.3, TS 36.331 RRC mLteSignalStrength = (mLteSignalStrength >= 0) ? mLteSignalStrength : 99; mLteSignalStrength = (mLteSignalStrength >= 0) ? mLteSignalStrength : 99; mLteRsrp = ((mLteRsrp >= 44) && (mLteRsrp <= 140)) ? -mLteRsrp : SignalStrength.INVALID; mLteRsrp = ((-mLteRsrp >= MIN_LTE_RSRP) && (-mLteRsrp <= MAX_LTE_RSRP)) ? -mLteRsrp : SignalStrength.INVALID; mLteRsrq = ((mLteRsrq >= 3) && (mLteRsrq <= 20)) ? -mLteRsrq : SignalStrength.INVALID; mLteRsrq = ((mLteRsrq >= 3) && (mLteRsrq <= 20)) ? -mLteRsrq : SignalStrength.INVALID; mLteRssnr = ((mLteRssnr >= -200) && (mLteRssnr <= 300)) ? mLteRssnr mLteRssnr = ((mLteRssnr >= -200) && (mLteRssnr <= 300)) ? mLteRssnr : SignalStrength.INVALID; : SignalStrength.INVALID; Loading Loading @@ -740,24 +744,29 @@ public class SignalStrength implements Parcelable { */ */ public int getLteLevel() { public int getLteLevel() { /* /* * TS 36.214 Physical Layer Section 5.1.3 TS 36.331 RRC RSSI = received * TS 36.214 Physical Layer Section 5.1.3 * signal + noise RSRP = reference signal dBm RSRQ = quality of signal * TS 36.331 RRC * dB= Number of Resource blocksxRSRP/RSSI SNR = gain=signal/noise ratio * * = -10log P1/P2 dB * RSSI = received signal + noise * RSRP = reference signal dBm * RSRQ = quality of signal dB = Number of Resource blocks*RSRP/RSSI * SNR = gain = signal/noise ratio = -10log P1/P2 dB */ */ int rssiIconLevel = SIGNAL_STRENGTH_NONE_OR_UNKNOWN, rsrpIconLevel = -1, snrIconLevel = -1; int rssiIconLevel = SIGNAL_STRENGTH_NONE_OR_UNKNOWN, rsrpIconLevel = -1, snrIconLevel = -1; if (mLteRsrp > mLteRsrpThresholds[5]) { if (mLteRsrp > MAX_LTE_RSRP || mLteRsrp < MIN_LTE_RSRP) { rsrpIconLevel = -1; if (mLteRsrp != INVALID) { } else if (mLteRsrp >= (mLteRsrpThresholds[4] - mLteRsrpBoost)) { Log.wtf(LOG_TAG, "getLteLevel - invalid lte rsrp: mLteRsrp=" + mLteRsrp); rsrpIconLevel = SIGNAL_STRENGTH_GREAT; } } else if (mLteRsrp >= (mLteRsrpThresholds[3] - mLteRsrpBoost)) { } else if (mLteRsrp >= (mLteRsrpThresholds[3] - mLteRsrpBoost)) { rsrpIconLevel = SIGNAL_STRENGTH_GOOD; rsrpIconLevel = SIGNAL_STRENGTH_GREAT; } else if (mLteRsrp >= (mLteRsrpThresholds[2] - mLteRsrpBoost)) { } else if (mLteRsrp >= (mLteRsrpThresholds[2] - mLteRsrpBoost)) { rsrpIconLevel = SIGNAL_STRENGTH_MODERATE; rsrpIconLevel = SIGNAL_STRENGTH_GOOD; } else if (mLteRsrp >= (mLteRsrpThresholds[1] - mLteRsrpBoost)) { } else if (mLteRsrp >= (mLteRsrpThresholds[1] - mLteRsrpBoost)) { rsrpIconLevel = SIGNAL_STRENGTH_MODERATE; } else if (mLteRsrp >= (mLteRsrpThresholds[0] - mLteRsrpBoost)) { rsrpIconLevel = SIGNAL_STRENGTH_POOR; rsrpIconLevel = SIGNAL_STRENGTH_POOR; } else if (mLteRsrp >= mLteRsrpThresholds[0]) { } else { rsrpIconLevel = SIGNAL_STRENGTH_NONE_OR_UNKNOWN; rsrpIconLevel = SIGNAL_STRENGTH_NONE_OR_UNKNOWN; } } Loading Loading
telephony/java/android/telephony/CarrierConfigManager.java +8 −3 Original line number Original line Diff line number Diff line Loading @@ -1815,7 +1815,14 @@ public class CarrierConfigManager { "check_pricing_with_carrier_data_roaming_bool"; "check_pricing_with_carrier_data_roaming_bool"; /** /** * List of thresholds of RSRP for determining the display level of LTE signal bar. * A list of 4 LTE RSRP thresholds above which a signal level is considered POOR, * MODERATE, GOOD, or EXCELLENT, to be used in SignalStrength reporting. * * Note that the min and max thresholds are fixed at -140 and -44, as explained in * TS 136.133 9.1.4 - RSRP Measurement Report Mapping. * <p> * See SignalStrength#MAX_LTE_RSRP and SignalStrength#MIN_LTE_RSRP. Any signal level outside * these boundaries is considered invalid. * @hide * @hide */ */ public static final String KEY_LTE_RSRP_THRESHOLDS_INT_ARRAY = public static final String KEY_LTE_RSRP_THRESHOLDS_INT_ARRAY = Loading Loading @@ -2136,12 +2143,10 @@ public class CarrierConfigManager { sDefaults.putBoolean(KEY_CHECK_PRICING_WITH_CARRIER_FOR_DATA_ROAMING_BOOL, false); sDefaults.putBoolean(KEY_CHECK_PRICING_WITH_CARRIER_FOR_DATA_ROAMING_BOOL, false); sDefaults.putIntArray(KEY_LTE_RSRP_THRESHOLDS_INT_ARRAY, sDefaults.putIntArray(KEY_LTE_RSRP_THRESHOLDS_INT_ARRAY, new int[] { new int[] { -140, /* SIGNAL_STRENGTH_NONE_OR_UNKNOWN */ -128, /* SIGNAL_STRENGTH_POOR */ -128, /* SIGNAL_STRENGTH_POOR */ -118, /* SIGNAL_STRENGTH_MODERATE */ -118, /* SIGNAL_STRENGTH_MODERATE */ -108, /* SIGNAL_STRENGTH_GOOD */ -108, /* SIGNAL_STRENGTH_GOOD */ -98, /* SIGNAL_STRENGTH_GREAT */ -98, /* SIGNAL_STRENGTH_GREAT */ -44 }); }); } } Loading
telephony/java/android/telephony/SignalStrength.java +23 −14 Original line number Original line Diff line number Diff line Loading @@ -62,7 +62,9 @@ public class SignalStrength implements Parcelable { */ */ public static final int INVALID = Integer.MAX_VALUE; 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 = 4; private static final int MAX_LTE_RSRP = -44; private static final int MIN_LTE_RSRP = -140; /** Parameters reported by the Radio */ /** 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 Loading @@ -86,7 +88,8 @@ public class SignalStrength implements Parcelable { // onSignalStrengthResult. // 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. Note that the // min and max are fixed at MIN_LTE_RSRP (-140) and MAX_LTE_RSRP (-44). private int mLteRsrpThresholds[] = new int[LTE_RSRP_THRESHOLDS_NUM]; private int mLteRsrpThresholds[] = new int[LTE_RSRP_THRESHOLDS_NUM]; /** /** Loading Loading @@ -324,7 +327,8 @@ public class SignalStrength implements Parcelable { // TS 36.214 Physical Layer Section 5.1.3, TS 36.331 RRC // TS 36.214 Physical Layer Section 5.1.3, TS 36.331 RRC mLteSignalStrength = (mLteSignalStrength >= 0) ? mLteSignalStrength : 99; mLteSignalStrength = (mLteSignalStrength >= 0) ? mLteSignalStrength : 99; mLteRsrp = ((mLteRsrp >= 44) && (mLteRsrp <= 140)) ? -mLteRsrp : SignalStrength.INVALID; mLteRsrp = ((-mLteRsrp >= MIN_LTE_RSRP) && (-mLteRsrp <= MAX_LTE_RSRP)) ? -mLteRsrp : SignalStrength.INVALID; mLteRsrq = ((mLteRsrq >= 3) && (mLteRsrq <= 20)) ? -mLteRsrq : SignalStrength.INVALID; mLteRsrq = ((mLteRsrq >= 3) && (mLteRsrq <= 20)) ? -mLteRsrq : SignalStrength.INVALID; mLteRssnr = ((mLteRssnr >= -200) && (mLteRssnr <= 300)) ? mLteRssnr mLteRssnr = ((mLteRssnr >= -200) && (mLteRssnr <= 300)) ? mLteRssnr : SignalStrength.INVALID; : SignalStrength.INVALID; Loading Loading @@ -740,24 +744,29 @@ public class SignalStrength implements Parcelable { */ */ public int getLteLevel() { public int getLteLevel() { /* /* * TS 36.214 Physical Layer Section 5.1.3 TS 36.331 RRC RSSI = received * TS 36.214 Physical Layer Section 5.1.3 * signal + noise RSRP = reference signal dBm RSRQ = quality of signal * TS 36.331 RRC * dB= Number of Resource blocksxRSRP/RSSI SNR = gain=signal/noise ratio * * = -10log P1/P2 dB * RSSI = received signal + noise * RSRP = reference signal dBm * RSRQ = quality of signal dB = Number of Resource blocks*RSRP/RSSI * SNR = gain = signal/noise ratio = -10log P1/P2 dB */ */ int rssiIconLevel = SIGNAL_STRENGTH_NONE_OR_UNKNOWN, rsrpIconLevel = -1, snrIconLevel = -1; int rssiIconLevel = SIGNAL_STRENGTH_NONE_OR_UNKNOWN, rsrpIconLevel = -1, snrIconLevel = -1; if (mLteRsrp > mLteRsrpThresholds[5]) { if (mLteRsrp > MAX_LTE_RSRP || mLteRsrp < MIN_LTE_RSRP) { rsrpIconLevel = -1; if (mLteRsrp != INVALID) { } else if (mLteRsrp >= (mLteRsrpThresholds[4] - mLteRsrpBoost)) { Log.wtf(LOG_TAG, "getLteLevel - invalid lte rsrp: mLteRsrp=" + mLteRsrp); rsrpIconLevel = SIGNAL_STRENGTH_GREAT; } } else if (mLteRsrp >= (mLteRsrpThresholds[3] - mLteRsrpBoost)) { } else if (mLteRsrp >= (mLteRsrpThresholds[3] - mLteRsrpBoost)) { rsrpIconLevel = SIGNAL_STRENGTH_GOOD; rsrpIconLevel = SIGNAL_STRENGTH_GREAT; } else if (mLteRsrp >= (mLteRsrpThresholds[2] - mLteRsrpBoost)) { } else if (mLteRsrp >= (mLteRsrpThresholds[2] - mLteRsrpBoost)) { rsrpIconLevel = SIGNAL_STRENGTH_MODERATE; rsrpIconLevel = SIGNAL_STRENGTH_GOOD; } else if (mLteRsrp >= (mLteRsrpThresholds[1] - mLteRsrpBoost)) { } else if (mLteRsrp >= (mLteRsrpThresholds[1] - mLteRsrpBoost)) { rsrpIconLevel = SIGNAL_STRENGTH_MODERATE; } else if (mLteRsrp >= (mLteRsrpThresholds[0] - mLteRsrpBoost)) { rsrpIconLevel = SIGNAL_STRENGTH_POOR; rsrpIconLevel = SIGNAL_STRENGTH_POOR; } else if (mLteRsrp >= mLteRsrpThresholds[0]) { } else { rsrpIconLevel = SIGNAL_STRENGTH_NONE_OR_UNKNOWN; rsrpIconLevel = SIGNAL_STRENGTH_NONE_OR_UNKNOWN; } } Loading