Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4b5a9351 authored by Shareef Ali's avatar Shareef Ali Committed by Gerrit Code Review
Browse files

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
parent 3dbc6cae
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -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();