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

Commit e0f9c868 authored by Rambo Wang's avatar Rambo Wang
Browse files

Update the SignalStrengthControllerTest UT to use valid threshold

The test cases verifies that, a NR SSRSRP value of -44 can be
a level GREAT for the default system threshold, but also can be
a level of POOR,if system threshold is overrided.

But the overrided threshold values used in this test case is
out of valid scope of SSRSRP (-140, -44) which trigger
an exception when tested with Radio HAL 2.0 UT.

To fix it, update the test SSRSRP value to be -64 and the overrided
system threshold values to be in valid scope.

All other UT cases are also checked to make sure no similar issue.

Bug: 230342465
Test: atest SignalStrengthControllerTest (with radio HAL 2.0 UT)
Merged-In: Ide60679b92c42e0225719f320544c8dd635e7bba
Change-Id: Ide60679b92c42e0225719f320544c8dd635e7bba
(cherry picked from commit 02e20131)
parent caecb9fb
Loading
Loading
Loading
Loading
+5 −7
Original line number Diff line number Diff line
@@ -50,7 +50,6 @@ import android.testing.TestableLooper;

import org.junit.After;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mockito;
@@ -578,7 +577,6 @@ public class SignalStrengthControllerTest extends TelephonyTest {
                mSsc.getSignalStrength().getLevel());
    }

    @Ignore("b/230342465. Upgrade this test case to HAL 2.0")
    @Test
    public void test5gNrSignalStrengthReportingCriteria_ConfiguredThresholds() {
        SignalStrength ss = new SignalStrength(
@@ -591,7 +589,7 @@ public class SignalStrengthControllerTest extends TelephonyTest {
                        -139, /** csiRsrp NONE */
                        -20, /** csiRsrq NONE */
                        -23, /** CsiSinr NONE */
                        -44, /** SsRsrp SIGNAL_STRENGTH_GREAT */
                        -64, /** SsRsrp SIGNAL_STRENGTH_GREAT */
                        -20, /** SsRsrq NONE */
                        -23) /** SsSinr NONE */
        );
@@ -606,10 +604,10 @@ public class SignalStrengthControllerTest extends TelephonyTest {
        assertEquals(CellSignalStrength.SIGNAL_STRENGTH_GREAT, mSsc.getSignalStrength().getLevel());

        int[] nrSsRsrpThresholds = {
                -45, // SIGNAL_STRENGTH_POOR
                -40, // SIGNAL_STRENGTH_MODERATE
                -37, // SIGNAL_STRENGTH_GOOD
                -34,  // SIGNAL_STRENGTH_GREAT
                -110, /* SIGNAL_STRENGTH_POOR */
                -60, /* SIGNAL_STRENGTH_MODERATE */
                -55, /* SIGNAL_STRENGTH_GOOD */
                -45,  /* SIGNAL_STRENGTH_GREAT */
        };
        mBundle.putIntArray(CarrierConfigManager.KEY_5G_NR_SSRSRP_THRESHOLDS_INT_ARRAY,
                nrSsRsrpThresholds);