summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShareef Ali <shareefalis@cyanogenmod.org>2013-07-16 17:33:20 -0500
committerGerrit Code Review <gerrit@cyanogenmod.org>2013-07-20 23:46:29 -0700
commit4b5a9351023125ee664c585786a3511e4a91c311 (patch)
tree2942af32cffb8b3830e538246cbc3043186657e2
parent3dbc6cae3ecc6356be8f046a1ed0194613570da5 (diff)
downloadframeworks_base-4b5a9351023125ee664c585786a3511e4a91c311.zip
frameworks_base-4b5a9351023125ee664c585786a3511e4a91c311.tar.gz
frameworks_base-4b5a9351023125ee664c585786a3511e4a91c311.tar.bz2
Signal strength: add more checks to signal strength,
so it doesn't fall under the range of poor signal and automatically assumes a gsm signal, actually checks if all values are true and not valid then pass it on to lte or gsm. This fixes cases when gsm signal is not valid and lte is active. When lte is active and shows a really weak and gsm signal is not avalible due some broken vendor ril or just running cdma lte and a few others senario creates this issue. Change-Id: If9c5dc1a969605cd1eeb9218de02a9f8dbbd3ae1
-rw-r--r--telephony/java/android/telephony/SignalStrength.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/telephony/java/android/telephony/SignalStrength.java b/telephony/java/android/telephony/SignalStrength.java
index f801010..098a3a5 100644
--- a/telephony/java/android/telephony/SignalStrength.java
+++ b/telephony/java/android/telephony/SignalStrength.java
@@ -455,9 +455,10 @@ public class SignalStrength implements Parcelable {
int level;
if (isGsm) {
+ boolean lteChecks = (getLteRsrp() == INVALID && getLteRsrq() == INVALID && getLteRssnr() == INVALID && getLteSignalStrenght() == 99);
boolean oldRil = needsOldRilFeature("signalstrength");
level = getLteLevel();
- if (level == SIGNAL_STRENGTH_NONE_OR_UNKNOWN || oldRil) {
+ if ((level == SIGNAL_STRENGTH_NONE_OR_UNKNOWN && getGsmAsuLevel() != 99 && lteChecks) || oldRil) {
level = getGsmLevel();
}
} else {
@@ -487,7 +488,8 @@ public class SignalStrength implements Parcelable {
int asuLevel;
if (isGsm) {
boolean oldRil = needsOldRilFeature("signalstrength");
- if (getLteLevel() == SIGNAL_STRENGTH_NONE_OR_UNKNOWN || oldRil) {
+ boolean lteChecks = (getLteRsrp() == INVALID && getLteRsrq() == INVALID && getLteRssnr() == INVALID && getLteSignalStrenght() == 99);
+ if ((getLteLevel() == SIGNAL_STRENGTH_NONE_OR_UNKNOWN && getGsmAsuLevel() != 99 && lteChecks) || oldRil) {
asuLevel = getGsmAsuLevel();
} else {
asuLevel = getLteAsuLevel();
@@ -520,7 +522,8 @@ public class SignalStrength implements Parcelable {
if(isGsm()) {
boolean oldRil = needsOldRilFeature("signalstrength");
- if (getLteLevel() == SIGNAL_STRENGTH_NONE_OR_UNKNOWN || oldRil) {
+ boolean lteChecks = (getLteRsrp() == INVALID && getLteRsrq() == INVALID && getLteRssnr() == INVALID && getLteSignalStrenght() == 99);
+ if ((getLteLevel() == SIGNAL_STRENGTH_NONE_OR_UNKNOWN && getGsmAsuLevel() != 99 && lteChecks) || oldRil) {
dBm = getGsmDbm();
} else {
dBm = getLteDbm();