Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5fb38bc9 authored by Automerger Merge Worker's avatar Automerger Merge Worker Committed by Android (Google) Code Review
Browse files

Merge "Merge "Change the threshold for RSSNR from 10*db to db" into rvc-dev...

Merge "Merge "Change the threshold for RSSNR from 10*db to db" into rvc-dev am: 46ff3835" into rvc-dev-plus-aosp
parents c6fc7c6c 2a3cc13e
Loading
Loading
Loading
Loading
+7 −9
Original line number Diff line number Diff line
@@ -2857,14 +2857,12 @@ public class CarrierConfigManager {
    /**
     * A list of 4 customized LTE Reference Signal Signal to Noise Ratio (RSSNR) thresholds.
     *
     * 4 threshold integers must be within the boundaries [-200, 300], and the levels are:
     *     "NONE: [-200, threshold1)"
     * 4 threshold integers must be within the boundaries [-20 dB, 30 dB], and the levels are:
     *     "NONE: [-20, threshold1)"
     *     "POOR: [threshold1, threshold2)"
     *     "MODERATE: [threshold2, threshold3)"
     *     "GOOD:  [threshold3, threshold4)"
     *     "EXCELLENT:  [threshold4, 300]"
     * Note: the unit of the values is 10*db; it is derived by multiplying 10 on the original dB
     * value reported by modem.
     *     "EXCELLENT:  [threshold4, 30]"
     *
     * This key is considered invalid if the format is violated. If the key is invalid or
     * not configured, a default value set will apply.
@@ -4237,10 +4235,10 @@ public class CarrierConfigManager {
                });
        sDefaults.putIntArray(KEY_LTE_RSSNR_THRESHOLDS_INT_ARRAY,
                new int[] {
                        -30, /* SIGNAL_STRENGTH_POOR */
                        10,  /* SIGNAL_STRENGTH_MODERATE */
                        45,  /* SIGNAL_STRENGTH_GOOD */
                        130  /* SIGNAL_STRENGTH_GREAT */
                        -3, /* SIGNAL_STRENGTH_POOR */
                        1,  /* SIGNAL_STRENGTH_MODERATE */
                        5,  /* SIGNAL_STRENGTH_GOOD */
                        13  /* SIGNAL_STRENGTH_GREAT */
                });
        sDefaults.putIntArray(KEY_WCDMA_RSCP_THRESHOLDS_INT_ARRAY,
                new int[] {
+11 −7
Original line number Diff line number Diff line
@@ -118,7 +118,7 @@ public final class CellSignalStrengthLte extends CellSignalStrength implements P
     * @param rssi in dBm [-113,-51], UNKNOWN
     * @param rsrp in dBm [-140,-43], UNKNOWN
     * @param rsrq in dB [-34, 3], UNKNOWN
     * @param rssnr in 10*dB [-200, +300], UNKNOWN
     * @param rssnr in dB [-20, +30], UNKNOWN
     * @param cqi [0, 15], UNKNOWN
     * @param timingAdvance [0, 1282], UNKNOWN
     *
@@ -131,7 +131,7 @@ public final class CellSignalStrengthLte extends CellSignalStrength implements P
        mSignalStrength = mRssi;
        mRsrp = inRangeOrUnavailable(rsrp, -140, -43);
        mRsrq = inRangeOrUnavailable(rsrq, -34, 3);
        mRssnr = inRangeOrUnavailable(rssnr, -200, 300);
        mRssnr = inRangeOrUnavailable(rssnr, -20, 30);
        mCqi = inRangeOrUnavailable(cqi, 0, 15);
        mTimingAdvance = inRangeOrUnavailable(timingAdvance, 0, 1282);
        updateLevel(null, null);
@@ -143,7 +143,7 @@ public final class CellSignalStrengthLte extends CellSignalStrength implements P
        this(convertRssiAsuToDBm(lte.signalStrength),
                lte.rsrp != CellInfo.UNAVAILABLE ? -lte.rsrp : lte.rsrp,
                lte.rsrq != CellInfo.UNAVAILABLE ? -lte.rsrq : lte.rsrq,
                lte.rssnr, lte.cqi, lte.timingAdvance);
                convertRssnrUnitFromTenDbToDB(lte.rssnr), lte.cqi, lte.timingAdvance);
    }

    /** @hide */
@@ -208,10 +208,10 @@ public final class CellSignalStrengthLte extends CellSignalStrength implements P
    };
    // Lifted from Default carrier configs and max range of RSSNR
    private static final int[] sRssnrThresholds = new int[] {
            -30, /* SIGNAL_STRENGTH_POOR */
            10,  /* SIGNAL_STRENGTH_MODERATE */
            45,  /* SIGNAL_STRENGTH_GOOD */
            130  /* SIGNAL_STRENGTH_GREAT */
            -3, /* SIGNAL_STRENGTH_POOR */
            1,  /* SIGNAL_STRENGTH_MODERATE */
            5,  /* SIGNAL_STRENGTH_GOOD */
            13  /* SIGNAL_STRENGTH_GREAT */
    };
    private static final int sRsrpBoost = 0;

@@ -556,6 +556,10 @@ public final class CellSignalStrengthLte extends CellSignalStrength implements P
        Rlog.w(LOG_TAG, s);
    }

    private static int convertRssnrUnitFromTenDbToDB(int rssnr) {
        return rssnr / 10;
    }

    private static int convertRssiAsuToDBm(int rssiAsu) {
        if (rssiAsu == SIGNAL_STRENGTH_LTE_RSSI_ASU_UNKNOWN) {
            return CellInfo.UNAVAILABLE;