Loading api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -42273,6 +42273,7 @@ package android.telephony { method public int getLevel(); method public int getRsrp(); method public int getRsrq(); method public int getRssi(); method public int getRssnr(); method public int getTimingAdvance(); method public void writeToParcel(android.os.Parcel, int); telephony/java/android/telephony/CellSignalStrengthLte.java +55 −10 Original line number Diff line number Diff line Loading @@ -31,8 +31,27 @@ public final class CellSignalStrengthLte extends CellSignalStrength implements P private static final String LOG_TAG = "CellSignalStrengthLte"; private static final boolean DBG = false; /** * Indicates the unknown or undetectable RSSI value in ASU. * * Reference: TS 27.007 8.5 - Signal quality +CSQ */ private static final int SIGNAL_STRENGTH_LTE_RSSI_ASU_UNKNOWN = 99; /** * Indicates the maximum valid RSSI value in ASU. * * Reference: TS 27.007 8.5 - Signal quality +CSQ */ private static final int SIGNAL_STRENGTH_LTE_RSSI_VALID_ASU_MAX_VALUE = 31; /** * Indicates the minimum valid RSSI value in ASU. * * Reference: TS 27.007 8.5 - Signal quality +CSQ */ private static final int SIGNAL_STRENGTH_LTE_RSSI_VALID_ASU_MIN_VALUE = 0; @UnsupportedAppUsage private int mSignalStrength; private int mRssi; @UnsupportedAppUsage private int mRsrp; @UnsupportedAppUsage Loading @@ -51,9 +70,9 @@ public final class CellSignalStrengthLte extends CellSignalStrength implements P } /** @hide */ public CellSignalStrengthLte(int signalStrength, int rsrp, int rsrq, int rssnr, int cqi, public CellSignalStrengthLte(int rssi, int rsrp, int rsrq, int rssnr, int cqi, int timingAdvance) { mSignalStrength = signalStrength; mRssi = convertRssiAsuToDBm(rssi); mRsrp = rsrp; mRsrq = rsrq; mRssnr = rssnr; Loading @@ -68,7 +87,7 @@ public final class CellSignalStrengthLte extends CellSignalStrength implements P /** @hide */ protected void copyFrom(CellSignalStrengthLte s) { mSignalStrength = s.mSignalStrength; mRssi = s.mRssi; mRsrp = s.mRsrp; mRsrq = s.mRsrq; mRssnr = s.mRssnr; Loading @@ -85,7 +104,7 @@ public final class CellSignalStrengthLte extends CellSignalStrength implements P /** @hide */ @Override public void setDefaultValues() { mSignalStrength = CellInfo.UNAVAILABLE; mRssi = CellInfo.UNAVAILABLE; mRsrp = CellInfo.UNAVAILABLE; mRsrq = CellInfo.UNAVAILABLE; mRssnr = CellInfo.UNAVAILABLE; Loading Loading @@ -141,6 +160,19 @@ public final class CellSignalStrengthLte extends CellSignalStrength implements P return mRsrq; } /** * Get Received Signal Strength Indication (RSSI) in dBm * * The value range is [-113, -51] inclusively or {@link CellInfo#UNAVAILABLE} if unavailable. * * Reference: TS 27.007 8.5 Signal quality +CSQ * * @return the RSSI if available or {@link CellInfo#UNAVAILABLE} if unavailable. */ public int getRssi() { return mRssi; } /** * Get reference signal signal-to-noise ratio * Loading Loading @@ -210,7 +242,7 @@ public final class CellSignalStrengthLte extends CellSignalStrength implements P @Override public int hashCode() { return Objects.hash(mSignalStrength, mRsrp, mRsrq, mRssnr, mCqi, mTimingAdvance); return Objects.hash(mRssi, mRsrp, mRsrq, mRssnr, mCqi, mTimingAdvance); } @Override Loading @@ -227,7 +259,7 @@ public final class CellSignalStrengthLte extends CellSignalStrength implements P return false; } return mSignalStrength == s.mSignalStrength return mRssi == s.mRssi && mRsrp == s.mRsrp && mRsrq == s.mRsrq && mRssnr == s.mRssnr Loading @@ -241,7 +273,7 @@ public final class CellSignalStrengthLte extends CellSignalStrength implements P @Override public String toString() { return "CellSignalStrengthLte:" + " ss=" + mSignalStrength + " rssi(dBm)=" + mRssi + " rsrp=" + mRsrp + " rsrq=" + mRsrq + " rssnr=" + mRssnr Loading @@ -253,7 +285,7 @@ public final class CellSignalStrengthLte extends CellSignalStrength implements P @Override public void writeToParcel(Parcel dest, int flags) { if (DBG) log("writeToParcel(Parcel, int): " + toString()); dest.writeInt(mSignalStrength); dest.writeInt(mRssi); // Need to multiply rsrp and rsrq by -1 // to ensure consistency when reading values written here // unless the values are invalid Loading @@ -269,7 +301,7 @@ public final class CellSignalStrengthLte extends CellSignalStrength implements P * where the token is already been processed. */ private CellSignalStrengthLte(Parcel in) { mSignalStrength = in.readInt(); mRssi = convertRssiAsuToDBm(in.readInt()); // rsrp and rsrq are written into the parcel as positive values. // Need to convert into negative values unless the values are invalid mRsrp = in.readInt(); Loading Loading @@ -309,4 +341,17 @@ public final class CellSignalStrengthLte extends CellSignalStrength implements P private static void log(String s) { Rlog.w(LOG_TAG, s); } private static int convertRssiAsuToDBm(int rssiAsu) { if (rssiAsu != SIGNAL_STRENGTH_LTE_RSSI_ASU_UNKNOWN && (rssiAsu < SIGNAL_STRENGTH_LTE_RSSI_VALID_ASU_MIN_VALUE || rssiAsu > SIGNAL_STRENGTH_LTE_RSSI_VALID_ASU_MAX_VALUE)) { Rlog.e(LOG_TAG, "convertRssiAsuToDBm: invalid RSSI in ASU=" + rssiAsu); return CellInfo.UNAVAILABLE; } if (rssiAsu == SIGNAL_STRENGTH_LTE_RSSI_ASU_UNKNOWN) { return CellInfo.UNAVAILABLE; } return -113 + (2 * rssiAsu); } } Loading
api/current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -42273,6 +42273,7 @@ package android.telephony { method public int getLevel(); method public int getRsrp(); method public int getRsrq(); method public int getRssi(); method public int getRssnr(); method public int getTimingAdvance(); method public void writeToParcel(android.os.Parcel, int);
telephony/java/android/telephony/CellSignalStrengthLte.java +55 −10 Original line number Diff line number Diff line Loading @@ -31,8 +31,27 @@ public final class CellSignalStrengthLte extends CellSignalStrength implements P private static final String LOG_TAG = "CellSignalStrengthLte"; private static final boolean DBG = false; /** * Indicates the unknown or undetectable RSSI value in ASU. * * Reference: TS 27.007 8.5 - Signal quality +CSQ */ private static final int SIGNAL_STRENGTH_LTE_RSSI_ASU_UNKNOWN = 99; /** * Indicates the maximum valid RSSI value in ASU. * * Reference: TS 27.007 8.5 - Signal quality +CSQ */ private static final int SIGNAL_STRENGTH_LTE_RSSI_VALID_ASU_MAX_VALUE = 31; /** * Indicates the minimum valid RSSI value in ASU. * * Reference: TS 27.007 8.5 - Signal quality +CSQ */ private static final int SIGNAL_STRENGTH_LTE_RSSI_VALID_ASU_MIN_VALUE = 0; @UnsupportedAppUsage private int mSignalStrength; private int mRssi; @UnsupportedAppUsage private int mRsrp; @UnsupportedAppUsage Loading @@ -51,9 +70,9 @@ public final class CellSignalStrengthLte extends CellSignalStrength implements P } /** @hide */ public CellSignalStrengthLte(int signalStrength, int rsrp, int rsrq, int rssnr, int cqi, public CellSignalStrengthLte(int rssi, int rsrp, int rsrq, int rssnr, int cqi, int timingAdvance) { mSignalStrength = signalStrength; mRssi = convertRssiAsuToDBm(rssi); mRsrp = rsrp; mRsrq = rsrq; mRssnr = rssnr; Loading @@ -68,7 +87,7 @@ public final class CellSignalStrengthLte extends CellSignalStrength implements P /** @hide */ protected void copyFrom(CellSignalStrengthLte s) { mSignalStrength = s.mSignalStrength; mRssi = s.mRssi; mRsrp = s.mRsrp; mRsrq = s.mRsrq; mRssnr = s.mRssnr; Loading @@ -85,7 +104,7 @@ public final class CellSignalStrengthLte extends CellSignalStrength implements P /** @hide */ @Override public void setDefaultValues() { mSignalStrength = CellInfo.UNAVAILABLE; mRssi = CellInfo.UNAVAILABLE; mRsrp = CellInfo.UNAVAILABLE; mRsrq = CellInfo.UNAVAILABLE; mRssnr = CellInfo.UNAVAILABLE; Loading Loading @@ -141,6 +160,19 @@ public final class CellSignalStrengthLte extends CellSignalStrength implements P return mRsrq; } /** * Get Received Signal Strength Indication (RSSI) in dBm * * The value range is [-113, -51] inclusively or {@link CellInfo#UNAVAILABLE} if unavailable. * * Reference: TS 27.007 8.5 Signal quality +CSQ * * @return the RSSI if available or {@link CellInfo#UNAVAILABLE} if unavailable. */ public int getRssi() { return mRssi; } /** * Get reference signal signal-to-noise ratio * Loading Loading @@ -210,7 +242,7 @@ public final class CellSignalStrengthLte extends CellSignalStrength implements P @Override public int hashCode() { return Objects.hash(mSignalStrength, mRsrp, mRsrq, mRssnr, mCqi, mTimingAdvance); return Objects.hash(mRssi, mRsrp, mRsrq, mRssnr, mCqi, mTimingAdvance); } @Override Loading @@ -227,7 +259,7 @@ public final class CellSignalStrengthLte extends CellSignalStrength implements P return false; } return mSignalStrength == s.mSignalStrength return mRssi == s.mRssi && mRsrp == s.mRsrp && mRsrq == s.mRsrq && mRssnr == s.mRssnr Loading @@ -241,7 +273,7 @@ public final class CellSignalStrengthLte extends CellSignalStrength implements P @Override public String toString() { return "CellSignalStrengthLte:" + " ss=" + mSignalStrength + " rssi(dBm)=" + mRssi + " rsrp=" + mRsrp + " rsrq=" + mRsrq + " rssnr=" + mRssnr Loading @@ -253,7 +285,7 @@ public final class CellSignalStrengthLte extends CellSignalStrength implements P @Override public void writeToParcel(Parcel dest, int flags) { if (DBG) log("writeToParcel(Parcel, int): " + toString()); dest.writeInt(mSignalStrength); dest.writeInt(mRssi); // Need to multiply rsrp and rsrq by -1 // to ensure consistency when reading values written here // unless the values are invalid Loading @@ -269,7 +301,7 @@ public final class CellSignalStrengthLte extends CellSignalStrength implements P * where the token is already been processed. */ private CellSignalStrengthLte(Parcel in) { mSignalStrength = in.readInt(); mRssi = convertRssiAsuToDBm(in.readInt()); // rsrp and rsrq are written into the parcel as positive values. // Need to convert into negative values unless the values are invalid mRsrp = in.readInt(); Loading Loading @@ -309,4 +341,17 @@ public final class CellSignalStrengthLte extends CellSignalStrength implements P private static void log(String s) { Rlog.w(LOG_TAG, s); } private static int convertRssiAsuToDBm(int rssiAsu) { if (rssiAsu != SIGNAL_STRENGTH_LTE_RSSI_ASU_UNKNOWN && (rssiAsu < SIGNAL_STRENGTH_LTE_RSSI_VALID_ASU_MIN_VALUE || rssiAsu > SIGNAL_STRENGTH_LTE_RSSI_VALID_ASU_MAX_VALUE)) { Rlog.e(LOG_TAG, "convertRssiAsuToDBm: invalid RSSI in ASU=" + rssiAsu); return CellInfo.UNAVAILABLE; } if (rssiAsu == SIGNAL_STRENGTH_LTE_RSSI_ASU_UNKNOWN) { return CellInfo.UNAVAILABLE; } return -113 + (2 * rssiAsu); } }