diff options
author | Jaime Lopez <jaimel@codeaurora.org> | 2013-10-01 12:47:29 -0700 |
---|---|---|
committer | Wink Saville <wink@google.com> | 2013-10-11 05:05:49 -0700 |
commit | dbf09ffed27b35cf310e3c53402edf0f56f5e7d1 (patch) | |
tree | d8eb9c368515207cdbc629a0475f9e415f0c0496 /telephony/java/android | |
parent | caaefaeab705a7c9c800670278e5c2b85ba09b28 (diff) | |
download | frameworks_base-dbf09ffed27b35cf310e3c53402edf0f56f5e7d1.zip frameworks_base-dbf09ffed27b35cf310e3c53402edf0f56f5e7d1.tar.gz frameworks_base-dbf09ffed27b35cf310e3c53402edf0f56f5e7d1.tar.bz2 |
Telephony: Read signal strength values as expected
Telephony framework expects Lte rsrp and rsrq, as well
as dbm and ecio values for cdma and evdoe to be negative.
RIL Interface provides positive values.
Fix that by changing the constructor from Parcel to
also multiply by -1
Writing to parcel also modified for consistency
Bug: 10440827
Change-Id: I6a8112a5b343c5e6c6dc12332a6e9a489b093cc1
Diffstat (limited to 'telephony/java/android')
-rw-r--r-- | telephony/java/android/telephony/CellSignalStrengthCdma.java | 21 | ||||
-rw-r--r-- | telephony/java/android/telephony/CellSignalStrengthLte.java | 12 |
2 files changed, 21 insertions, 12 deletions
diff --git a/telephony/java/android/telephony/CellSignalStrengthCdma.java b/telephony/java/android/telephony/CellSignalStrengthCdma.java index 190fea2..c945094 100644 --- a/telephony/java/android/telephony/CellSignalStrengthCdma.java +++ b/telephony/java/android/telephony/CellSignalStrengthCdma.java @@ -331,10 +331,12 @@ public final class CellSignalStrengthCdma extends CellSignalStrength implements @Override public void writeToParcel(Parcel dest, int flags) { if (DBG) log("writeToParcel(Parcel, int): " + toString()); - dest.writeInt(mCdmaDbm); - dest.writeInt(mCdmaEcio); - dest.writeInt(mEvdoDbm); - dest.writeInt(mEvdoEcio); + // Need to multiply CdmaDbm, CdmaEcio, EvdoDbm and EvdoEcio by -1 + // to ensure consistency when reading values written here + dest.writeInt(mCdmaDbm * -1); + dest.writeInt(mCdmaEcio * -1); + dest.writeInt(mEvdoDbm * -1); + dest.writeInt(mEvdoEcio * -1); dest.writeInt(mEvdoSnr); } @@ -343,10 +345,13 @@ public final class CellSignalStrengthCdma extends CellSignalStrength implements * where the TYPE_LTE token is already been processed. */ private CellSignalStrengthCdma(Parcel in) { - mCdmaDbm = in.readInt(); - mCdmaEcio = in.readInt(); - mEvdoDbm = in.readInt(); - mEvdoEcio = in.readInt(); + // CdmaDbm, CdmaEcio, EvdoDbm and EvdoEcio are written into + // the parcel as positive values. + // Need to convert into negative values + mCdmaDbm = in.readInt() * -1; + mCdmaEcio = in.readInt() * -1; + mEvdoDbm = in.readInt() * -1; + mEvdoEcio = in.readInt() * -1; mEvdoSnr = in.readInt(); if (DBG) log("CellSignalStrengthCdma(Parcel): " + toString()); } diff --git a/telephony/java/android/telephony/CellSignalStrengthLte.java b/telephony/java/android/telephony/CellSignalStrengthLte.java index b456bb3..5a1559a 100644 --- a/telephony/java/android/telephony/CellSignalStrengthLte.java +++ b/telephony/java/android/telephony/CellSignalStrengthLte.java @@ -247,8 +247,10 @@ public final class CellSignalStrengthLte extends CellSignalStrength implements P public void writeToParcel(Parcel dest, int flags) { if (DBG) log("writeToParcel(Parcel, int): " + toString()); dest.writeInt(mSignalStrength); - dest.writeInt(mRsrp); - dest.writeInt(mRsrq); + // Need to multiply rsrp and rsrq by -1 + // to ensure consistency when reading values written here + dest.writeInt(mRsrp * -1); + dest.writeInt(mRsrq * -1); dest.writeInt(mRssnr); dest.writeInt(mCqi); dest.writeInt(mTimingAdvance); @@ -260,8 +262,10 @@ public final class CellSignalStrengthLte extends CellSignalStrength implements P */ private CellSignalStrengthLte(Parcel in) { mSignalStrength = in.readInt(); - mRsrp = in.readInt(); - mRsrq = in.readInt(); + // rsrp and rsrq are written into the parcel as positive values. + // Need to convert into negative values + mRsrp = in.readInt() * -1; + mRsrq = in.readInt() * -1; mRssnr = in.readInt(); mCqi = in.readInt(); mTimingAdvance = in.readInt(); |