Search in sources :

Example 1 with CellSignalStrengthNr

use of android.telephony.CellSignalStrengthNr in project android_frameworks_opt_telephony by LineageOS.

the class CellSignalStrengthNrTest method testGetMethodWithHal.

@Test
public void testGetMethodWithHal() {
    // GIVEN an instance of NrSignalStrength with some positive values
    NrSignalStrength nrSignalStrength = new NrSignalStrength();
    nrSignalStrength.csiRsrp = -CSIRSRP;
    nrSignalStrength.csiRsrq = -CSIRSRQ;
    nrSignalStrength.csiSinr = CSISINR;
    nrSignalStrength.ssRsrp = -SSRSRP;
    nrSignalStrength.ssRsrq = -SSRSRQ;
    nrSignalStrength.ssSinr = SSSINR;
    // THEN the get method should return the correct value
    CellSignalStrengthNr css = new CellSignalStrengthNr(nrSignalStrength);
    assertThat(css.getCsiRsrp()).isEqualTo(CSIRSRP);
    assertThat(css.getCsiRsrq()).isEqualTo(CSIRSRQ);
    assertThat(css.getCsiSinr()).isEqualTo(CSISINR);
    assertThat(css.getSsRsrp()).isEqualTo(SSRSRP);
    assertThat(css.getSsRsrq()).isEqualTo(SSRSRQ);
    assertThat(css.getSsSinr()).isEqualTo(SSSINR);
    assertThat(css.getDbm()).isEqualTo(SSRSRP);
}
Also used : NrSignalStrength(android.hardware.radio.V1_4.NrSignalStrength) CellSignalStrengthNr(android.telephony.CellSignalStrengthNr) Test(org.junit.Test)

Example 2 with CellSignalStrengthNr

use of android.telephony.CellSignalStrengthNr in project android_frameworks_opt_telephony by LineageOS.

the class CellSignalStrengthNrTest method testAusLevel_validValue.

@Test
public void testAusLevel_validValue() {
    // GIVEN an instance of CellSignalStrengthNr with valid csirsrp
    CellSignalStrengthNr css = new CellSignalStrengthNr(CSIRSRP, CSIRSRQ, CSISINR, SSRSRP, SSRSRQ, SSSINR);
    // THEN the asu level is in range [0, 97]
    assertThat(css.getAsuLevel()).isIn(Range.range(0, BoundType.CLOSED, 97, BoundType.CLOSED));
}
Also used : CellSignalStrengthNr(android.telephony.CellSignalStrengthNr) Test(org.junit.Test)

Example 3 with CellSignalStrengthNr

use of android.telephony.CellSignalStrengthNr in project android_frameworks_opt_telephony by LineageOS.

the class CellSignalStrengthNrTest method testGetMethod.

@Test
public void testGetMethod() {
    // GIVEN an instance of CellSignalStrengthNr
    CellSignalStrengthNr css = new CellSignalStrengthNr(CSIRSRP, CSIRSRQ, CSISINR, SSRSRP, SSRSRQ, SSSINR);
    // THEN the get method should return correct value
    assertThat(css.getCsiRsrp()).isEqualTo(CSIRSRP);
    assertThat(css.getCsiRsrq()).isEqualTo(CSIRSRQ);
    assertThat(css.getCsiSinr()).isEqualTo(CSISINR);
    assertThat(css.getSsRsrp()).isEqualTo(SSRSRP);
    assertThat(css.getSsRsrq()).isEqualTo(SSRSRQ);
    assertThat(css.getSsSinr()).isEqualTo(SSSINR);
    assertThat(css.getDbm()).isEqualTo(SSRSRP);
}
Also used : CellSignalStrengthNr(android.telephony.CellSignalStrengthNr) Test(org.junit.Test)

Example 4 with CellSignalStrengthNr

use of android.telephony.CellSignalStrengthNr in project android_frameworks_opt_telephony by LineageOS.

the class CellSignalStrengthNrTest method testEquals_sameParameters.

@Test
public void testEquals_sameParameters() {
    // GIVEN an instance of CellSignalStrengthNr and another object with the same parameters
    CellSignalStrengthNr css = new CellSignalStrengthNr(CSIRSRP, CSIRSRQ, CSISINR, SSRSRP, SSRSRQ, SSSINR);
    CellSignalStrengthNr anotherCss = new CellSignalStrengthNr(CSIRSRP, CSIRSRQ, CSISINR, SSRSRP, SSRSRQ, SSSINR);
    // THEN this two objects are equivalent
    assertThat(css).isEqualTo(anotherCss);
}
Also used : CellSignalStrengthNr(android.telephony.CellSignalStrengthNr) Test(org.junit.Test)

Example 5 with CellSignalStrengthNr

use of android.telephony.CellSignalStrengthNr in project android_frameworks_opt_telephony by LineageOS.

the class CellSignalStrengthNrTest method testSignalLevel_validValue.

@Test
public void testSignalLevel_validValue() {
    for (int ssRsrp = -140; ssRsrp <= -44; ssRsrp++) {
        // GIVEN an instance of CellSignalStrengthNr with valid csirsrp
        CellSignalStrengthNr css = new CellSignalStrengthNr(CSIRSRP, CSIRSRQ, CSISINR, ssRsrp, SSRSRQ, SSSINR);
        // THEN the signal level is valid
        assertThat(css.getLevel()).isIn(Range.range(CellSignalStrength.SIGNAL_STRENGTH_NONE_OR_UNKNOWN, BoundType.CLOSED, CellSignalStrength.SIGNAL_STRENGTH_GREAT, BoundType.CLOSED));
    }
}
Also used : CellSignalStrengthNr(android.telephony.CellSignalStrengthNr) Test(org.junit.Test)

Aggregations

CellSignalStrengthNr (android.telephony.CellSignalStrengthNr)24 Test (org.junit.Test)21 CellSignalStrengthCdma (android.telephony.CellSignalStrengthCdma)13 CellSignalStrengthGsm (android.telephony.CellSignalStrengthGsm)13 CellSignalStrengthLte (android.telephony.CellSignalStrengthLte)13 CellSignalStrengthTdscdma (android.telephony.CellSignalStrengthTdscdma)13 CellSignalStrengthWcdma (android.telephony.CellSignalStrengthWcdma)13 SignalStrength (android.telephony.SignalStrength)13 CellSignalStrength (android.telephony.CellSignalStrength)10 FlakyTest (androidx.test.filters.FlakyTest)8 MediumTest (android.test.suitebuilder.annotation.MediumTest)6 SmallTest (android.test.suitebuilder.annotation.SmallTest)6 PersistableBundle (android.os.PersistableBundle)3 NrSignalStrength (android.hardware.radio.V1_4.NrSignalStrength)2 SmallTest (androidx.test.filters.SmallTest)2 Parcel (android.os.Parcel)1 CallQuality (android.telephony.CallQuality)1 CellIdentityNr (android.telephony.CellIdentityNr)1 CellInfo (android.telephony.CellInfo)1 CellInfoNr (android.telephony.CellInfoNr)1