summaryrefslogtreecommitdiffstats
path: root/telephony
diff options
context:
space:
mode:
authordhacker29 <davidhackerdvm@gmail.com>2012-09-29 07:13:05 -0500
committerGerrit Code Review <gerrit@review.cyanogenmod.com>2012-12-24 00:18:29 -0800
commit2552c8c4a7b92c3a4a603c740f4626fe603a74e7 (patch)
treece541c5a083a79ff1ae9bdeed63f292c827ce504 /telephony
parent95a2ec80c9a3ee358426fd70e8e61b53a17842e6 (diff)
downloadframeworks_base-2552c8c4a7b92c3a4a603c740f4626fe603a74e7.zip
frameworks_base-2552c8c4a7b92c3a4a603c740f4626fe603a74e7.tar.gz
frameworks_base-2552c8c4a7b92c3a4a603c740f4626fe603a74e7.tar.bz2
Framework: Fix GSM signal strength
Certain OEM gsm ril libs send back a bogus value for LTE signal that causes SignalStrength.java to default to LTE and report incorrect signal values. Use prop value ro.telephony.ril.v3=signalstrength to get proper GSM signal reading on certain devices. Change-Id: Ibb23d7b3a2d21001ccbbc6ebfbdc3c5248f18cfc Signed-off-by: dhacker29 <davidhackerdvm@gmail.com>
Diffstat (limited to 'telephony')
-rw-r--r--telephony/java/android/telephony/SignalStrength.java19
1 files changed, 16 insertions, 3 deletions
diff --git a/telephony/java/android/telephony/SignalStrength.java b/telephony/java/android/telephony/SignalStrength.java
index 3f9fc0a..1951a32 100644
--- a/telephony/java/android/telephony/SignalStrength.java
+++ b/telephony/java/android/telephony/SignalStrength.java
@@ -19,6 +19,7 @@ package android.telephony;
import android.os.Bundle;
import android.os.Parcel;
import android.os.Parcelable;
+import android.os.SystemProperties;
import android.util.Log;
/**
@@ -435,6 +436,15 @@ public class SignalStrength implements Parcelable {
return mLteCqi;
}
+ public boolean needsOldRilFeature(String feature) {
+ String[] features = SystemProperties.get("ro.telephony.ril.v3", "").split(",");
+ for (String found: features) {
+ if (found.equals(feature))
+ return true;
+ }
+ return false;
+ }
+
/**
* Get signal level as an int from 0..4
*
@@ -444,8 +454,9 @@ public class SignalStrength implements Parcelable {
int level;
if (isGsm) {
+ boolean oldRil = needsOldRilFeature("signalstrength");
level = getLteLevel();
- if (level == SIGNAL_STRENGTH_NONE_OR_UNKNOWN) {
+ if (level == SIGNAL_STRENGTH_NONE_OR_UNKNOWN || oldRil) {
level = getGsmLevel();
}
} else {
@@ -474,7 +485,8 @@ public class SignalStrength implements Parcelable {
public int getAsuLevel() {
int asuLevel;
if (isGsm) {
- if (getLteLevel() == SIGNAL_STRENGTH_NONE_OR_UNKNOWN) {
+ boolean oldRil = needsOldRilFeature("signalstrength");
+ if (getLteLevel() == SIGNAL_STRENGTH_NONE_OR_UNKNOWN || oldRil) {
asuLevel = getGsmAsuLevel();
} else {
asuLevel = getLteAsuLevel();
@@ -506,7 +518,8 @@ public class SignalStrength implements Parcelable {
int dBm;
if(isGsm()) {
- if (getLteLevel() == SIGNAL_STRENGTH_NONE_OR_UNKNOWN) {
+ boolean oldRil = needsOldRilFeature("signalstrength");
+ if (getLteLevel() == SIGNAL_STRENGTH_NONE_OR_UNKNOWN || oldRil) {
dBm = getGsmDbm();
} else {
dBm = getLteDbm();