summaryrefslogtreecommitdiffstats
path: root/src/java/com/android/internal/telephony/SamsungExynos4RIL.java
diff options
context:
space:
mode:
authorcodeworkx <codeworkx@cyanogenmod.org>2013-01-23 15:56:15 +0000
committercodeworkx <codeworkx@cyanogenmod.org>2013-01-23 16:14:50 +0000
commitfa2c24a134300a3ede09e02d3d007f41c9a58740 (patch)
tree1265a50367fa8554726e364a2de02f08af12e1e4 /src/java/com/android/internal/telephony/SamsungExynos4RIL.java
parent75d2663a939fba0556e79946957ef3ddb7ad5d4b (diff)
downloadframeworks_opt_telephony-fa2c24a134300a3ede09e02d3d007f41c9a58740.zip
frameworks_opt_telephony-fa2c24a134300a3ede09e02d3d007f41c9a58740.tar.gz
frameworks_opt_telephony-fa2c24a134300a3ede09e02d3d007f41c9a58740.tar.bz2
SamsungExynos4RIL: provide a fallback solution if signalstrength is invalid
Change-Id: Ib533b15feb4f56c00f1ce3c7baff5e0e73255e6c
Diffstat (limited to 'src/java/com/android/internal/telephony/SamsungExynos4RIL.java')
-rw-r--r--src/java/com/android/internal/telephony/SamsungExynos4RIL.java20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/java/com/android/internal/telephony/SamsungExynos4RIL.java b/src/java/com/android/internal/telephony/SamsungExynos4RIL.java
index 50b7d48..cf9fd4b 100644
--- a/src/java/com/android/internal/telephony/SamsungExynos4RIL.java
+++ b/src/java/com/android/internal/telephony/SamsungExynos4RIL.java
@@ -855,25 +855,25 @@ public class SamsungExynos4RIL extends RIL implements CommandsInterface {
*/
int mGsmSignalStrength = response[0]; // Valid values are (0-31, 99) as defined in TS 27.007 8.5
+ Log.d(LOG_TAG, "responseSignalStrength (raw): gsmSignalStrength=" + mGsmSignalStrength);
+ mGsmSignalStrength = mGsmSignalStrength & 0xff; // Get the first 8 bits
+ Log.d(LOG_TAG, "responseSignalStrength (corrected): gsmSignalStrength=" + mGsmSignalStrength);
- if (mIsGBModem) {
- int mCdmaDbm = response[2];
- Log.d(LOG_TAG, "responseSignalStrength (unmodified): gsmSignalStrength=" + mGsmSignalStrength);
+ /* if mGsmSignalStrength isn't a valid value, use mCdmaDbm as fallback */
+ if (mGsmSignalStrength < 0 || (mGsmSignalStrength > 31 && response[0] != 99)) {
+ int mCdmaDbm = response[2];
+ Log.d(LOG_TAG, "responseSignalStrength-fallback (raw): gsmSignalStrength=" + mCdmaDbm);
if (mCdmaDbm < 0) {
mGsmSignalStrength = 99;
- } else if (mCdmaDbm > 31) {
+ } else if (mCdmaDbm > 31 && mCdmaDbm != 99) {
mGsmSignalStrength = 31;
} else {
mGsmSignalStrength = mCdmaDbm;
}
-
- Log.d(LOG_TAG, "responseSignalStrength (corrected): gsmSignalStrength=" + mGsmSignalStrength);
- } else {
- Log.d(LOG_TAG, "responseSignalStrength (unmodified): gsmSignalStrength=" + mGsmSignalStrength);
- mGsmSignalStrength = mGsmSignalStrength & 0xff; // Get the first 8 bits
- Log.d(LOG_TAG, "responseSignalStrength (corrected): gsmSignalStrength=" + mGsmSignalStrength);
+ Log.d(LOG_TAG, "responseSignalStrength-fallback (corrected): gsmSignalStrength=" + mGsmSignalStrength);
}
+
SignalStrength signalStrength = new SignalStrength(mGsmSignalStrength, response[1], response[2],
response[3], response[4], response[5], response[6], isGsm);