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

Commit 0661e05d authored by Nathan Harold's avatar Nathan Harold Committed by Arne Coucheron
Browse files

Fix Issue Where SignalStrengthGsm is null

Need to check for isEmpty() not null when determining
if SignalStrength needs a fixup.

Bug: 135492584
Test: atest RILTest#testFixupSignalStrength10
Change-Id: If140fe7a3521987ef2ab1db8d0a0326ac72d89cf
parent 2bd62cb6
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -5925,7 +5925,7 @@ public class RIL extends BaseCommands implements CommandsInterface {
        List<CellSignalStrengthGsm> gsmList = signalStrength.getCellSignalStrengths(
                CellSignalStrengthGsm.class);
        // If GSM is not the primary type, then bail out; no fixup needed.
        if (gsmList == null || gsmList.get(0) == null || !gsmList.get(0).isValid()) {
        if (gsmList.isEmpty() || !gsmList.get(0).isValid()) {
            return signalStrength;
        }

+11 −0
Original line number Diff line number Diff line
@@ -1924,6 +1924,17 @@ public class RILTest extends TelephonyTest {
                .when(mServiceState).getRilVoiceRadioTechnology();
        result = mRILUnderTest.fixupSignalStrength10(gsmSignalStrength);
        assertEquals(result, gsmSignalStrength);

        // Check that non-GSM non-WCDMA signal strengths are also passed through.
        SignalStrength lteSignalStrength = new SignalStrength(
                new CellSignalStrengthCdma(), new CellSignalStrengthGsm(),
                new CellSignalStrengthWcdma(), new CellSignalStrengthTdscdma(),
                new CellSignalStrengthLte(CellInfo.UNAVAILABLE,
                        -120, -10, CellInfo.UNAVAILABLE, CellInfo.UNAVAILABLE,
                        CellInfo.UNAVAILABLE), new CellSignalStrengthNr());
        SignalStrength lteResult = mRILUnderTest.fixupSignalStrength10(lteSignalStrength);

        assertEquals(lteResult, lteSignalStrength);
    }

    @Test