Search in sources :

Example 1 with NrSignalStrength

use of android.hardware.radio.V1_4.NrSignalStrength 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 NrSignalStrength

use of android.hardware.radio.V1_4.NrSignalStrength in project android_frameworks_opt_telephony by LineageOS.

the class CellSignalStrengthNrTest method testUnavailableValueWithHal.

@Test
public void testUnavailableValueWithHal() {
    // GIVEN an instance of NrSignalStrength
    NrSignalStrength nrSignalStrength = new NrSignalStrength();
    nrSignalStrength.csiRsrp = CellInfo.UNAVAILABLE;
    nrSignalStrength.csiRsrq = CellInfo.UNAVAILABLE;
    nrSignalStrength.csiSinr = CellInfo.UNAVAILABLE;
    nrSignalStrength.ssRsrp = CellInfo.UNAVAILABLE;
    nrSignalStrength.ssRsrq = CellInfo.UNAVAILABLE;
    nrSignalStrength.ssSinr = CellInfo.UNAVAILABLE;
    // THEN the get method should return unavailable value
    CellSignalStrengthNr css = new CellSignalStrengthNr(nrSignalStrength);
    assertThat(css.getCsiRsrp()).isEqualTo(CellInfo.UNAVAILABLE);
    assertThat(css.getCsiRsrq()).isEqualTo(CellInfo.UNAVAILABLE);
    assertThat(css.getCsiSinr()).isEqualTo(CellInfo.UNAVAILABLE);
    assertThat(css.getSsRsrp()).isEqualTo(CellInfo.UNAVAILABLE);
    assertThat(css.getSsRsrq()).isEqualTo(CellInfo.UNAVAILABLE);
    assertThat(css.getSsSinr()).isEqualTo(CellInfo.UNAVAILABLE);
    assertThat(css.getDbm()).isEqualTo(CellInfo.UNAVAILABLE);
}
Also used : NrSignalStrength(android.hardware.radio.V1_4.NrSignalStrength) CellSignalStrengthNr(android.telephony.CellSignalStrengthNr) Test(org.junit.Test)

Aggregations

NrSignalStrength (android.hardware.radio.V1_4.NrSignalStrength)2 CellSignalStrengthNr (android.telephony.CellSignalStrengthNr)2 Test (org.junit.Test)2