diff options
author | Uma Maheswari Ramalingam <umam@codeaurora.org> | 2012-08-09 11:59:17 -0700 |
---|---|---|
committer | Uma Maheswari Ramalingam <umam@codeaurora.org> | 2012-08-09 12:16:09 -0700 |
commit | 9efcac5782b93564d47c1687e67e85849c72afed (patch) | |
tree | a95a305d70c67f98362d01974531b4322c475c4f /libril | |
parent | 18cb387015842420fb5afa6fdc6484c6ef3c490c (diff) | |
download | android_hardware_ril-9efcac5782b93564d47c1687e67e85849c72afed.tar.gz android_hardware_ril-9efcac5782b93564d47c1687e67e85849c72afed.tar.bz2 android_hardware_ril-9efcac5782b93564d47c1687e67e85849c72afed.zip |
Workaround for LTE RSRP -ve values in Signal
Ril version 6 and below sends negative values
for lte rsrp in signalstrength.
Workaround to maintain backward compatibility
and convert this to positive
values in compliance with ril.h
Support for processing all fields in
SignalStrength in reference-ril
Change-Id: I4d480aa2f607cd617b18681f722de246a7894348
Diffstat (limited to 'libril')
-rw-r--r-- | libril/ril.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/libril/ril.cpp b/libril/ril.cpp index b8aba01..e3f7e41 100644 --- a/libril/ril.cpp +++ b/libril/ril.cpp @@ -1995,6 +1995,15 @@ static int responseRilSignalStrength(Parcel &p, p.writeInt32(p_cur->EVDO_SignalStrength.signalNoiseRatio); if (responselen >= sizeof (RIL_SignalStrength_v6)) { p.writeInt32(p_cur->LTE_SignalStrength.signalStrength); + + /* + * ril version <=6 receives negative values for rsrp + * workaround for backward compatibility + */ + p_cur->LTE_SignalStrength.rsrp = + ((s_callbacks.version <= 6) && (p_cur->LTE_SignalStrength.rsrp < 0 )) ? + -(p_cur->LTE_SignalStrength.rsrp) : p_cur->LTE_SignalStrength.rsrp; + p.writeInt32(p_cur->LTE_SignalStrength.rsrp); p.writeInt32(p_cur->LTE_SignalStrength.rsrq); p.writeInt32(p_cur->LTE_SignalStrength.rssnr); |