Search in sources :

Example 6 with CellSignalStrengthNr

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

the class CellSignalStrengthNrTest method testAsuLevel_invalidValue.

@Test
public void testAsuLevel_invalidValue() {
    // GIVEN an instance of CellSignalStrengthNr with invalid csirsrp
    CellSignalStrengthNr css = new CellSignalStrengthNr(CSIRSRP, CSIRSRQ, CSISINR, INVALID_SSRSRP, SSRSRQ, SSSINR);
    // THEN the asu level is unknown
    assertThat(css.getAsuLevel()).isEqualTo(CellSignalStrengthNr.UNKNOWN_ASU_LEVEL);
}
Also used : CellSignalStrengthNr(android.telephony.CellSignalStrengthNr) Test(org.junit.Test)

Example 7 with CellSignalStrengthNr

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

the class CellSignalStrengthNrTest method testSignalLevel_invalidValue.

@Test
public void testSignalLevel_invalidValue() {
    // GIVEN an instance of CellSignalStrengthNr with invalid csirsrp
    CellSignalStrengthNr css = new CellSignalStrengthNr(CSIRSRP, CSIRSRQ, CSISINR, INVALID_SSRSRP, SSRSRQ, SSSINR);
    // THEN the signal level is unknown
    assertThat(css.getLevel()).isEqualTo(CellSignalStrength.SIGNAL_STRENGTH_NONE_OR_UNKNOWN);
}
Also used : CellSignalStrengthNr(android.telephony.CellSignalStrengthNr) Test(org.junit.Test)

Example 8 with CellSignalStrengthNr

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

the class RILTest method testConvertHalCellInfoList_1_4ForNr.

@Test
public void testConvertHalCellInfoList_1_4ForNr() {
    android.hardware.radio.V1_4.CellInfoNr cellinfo = new android.hardware.radio.V1_4.CellInfoNr();
    cellinfo.cellidentity.nci = CI;
    cellinfo.cellidentity.pci = PCI;
    cellinfo.cellidentity.tac = TAC;
    cellinfo.cellidentity.nrarfcn = NRARFCN;
    cellinfo.cellidentity.mcc = MCC_STR;
    cellinfo.cellidentity.mnc = MNC_STR;
    cellinfo.cellidentity.operatorNames.alphaLong = ALPHA_LONG;
    cellinfo.cellidentity.operatorNames.alphaShort = ALPHA_SHORT;
    cellinfo.signalStrength.ssRsrp = RSRP;
    cellinfo.signalStrength.ssRsrq = RSRQ;
    cellinfo.signalStrength.ssSinr = SIGNAL_NOISE_RATIO;
    cellinfo.signalStrength.csiRsrp = RSRP;
    cellinfo.signalStrength.csiRsrq = RSRQ;
    cellinfo.signalStrength.csiSinr = SIGNAL_NOISE_RATIO;
    android.hardware.radio.V1_4.CellInfo record = new android.hardware.radio.V1_4.CellInfo();
    record.info.nr(cellinfo);
    ArrayList<android.hardware.radio.V1_4.CellInfo> records = new ArrayList<>();
    records.add(record);
    ArrayList<CellInfo> ret = RIL.convertHalCellInfoList_1_4(records);
    CellInfoNr cellInfoNr = (CellInfoNr) ret.get(0);
    CellIdentityNr cellIdentityNr = (CellIdentityNr) cellInfoNr.getCellIdentity();
    CellSignalStrengthNr signalStrengthNr = (CellSignalStrengthNr) cellInfoNr.getCellSignalStrength();
    CellIdentityNr expectedCellIdentity = new CellIdentityNr(PCI, TAC, NRARFCN, new int[] {}, MCC_STR, MNC_STR, CI, ALPHA_LONG, ALPHA_SHORT, Collections.emptyList());
    CellSignalStrengthNr expectedSignalStrength = new CellSignalStrengthNr(-RSRP, -RSRQ, SIGNAL_NOISE_RATIO, -RSRP, -RSRQ, SIGNAL_NOISE_RATIO);
    assertEquals(expectedCellIdentity, cellIdentityNr);
    assertEquals(expectedSignalStrength, signalStrengthNr);
}
Also used : CellSignalStrengthNr(android.telephony.CellSignalStrengthNr) ArrayList(java.util.ArrayList) CellIdentityNr(android.telephony.CellIdentityNr) CellInfo(android.telephony.CellInfo) CellInfoNr(android.telephony.CellInfoNr) FlakyTest(androidx.test.filters.FlakyTest) Test(org.junit.Test)

Example 9 with CellSignalStrengthNr

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

the class ServiceStateTrackerTest method test5gNrSignalStrengthReportingCriteria_ConfiguredThresholds.

@Test
public void test5gNrSignalStrengthReportingCriteria_ConfiguredThresholds() {
    SignalStrength ss = new SignalStrength(new CellSignalStrengthCdma(), new CellSignalStrengthGsm(), new CellSignalStrengthWcdma(), new CellSignalStrengthTdscdma(), new CellSignalStrengthLte(), new CellSignalStrengthNr(-139, /**
     * csiRsrp NONE
     */
    -20, /**
     * csiRsrq NONE
     */
    -23, /**
     * CsiSinr NONE
     */
    -44, /**
     * SsRsrp SIGNAL_STRENGTH_GREAT
     */
    -20, /**
     * SsRsrq NONE
     */
    -23));
    // SSRSRP = 1 << 0
    mBundle.putInt(CarrierConfigManager.KEY_PARAMETERS_USE_FOR_5G_NR_SIGNAL_BAR_INT, CellSignalStrengthNr.USE_SSRSRP);
    sendCarrierConfigUpdate();
    mSimulatedCommands.setSignalStrength(ss);
    mSimulatedCommands.notifySignalStrength();
    waitForLastHandlerAction(mSSTTestHandler.getThreadHandler());
    assertEquals(CellSignalStrength.SIGNAL_STRENGTH_GREAT, sst.getSignalStrength().getLevel());
    int[] nrSsRsrpThresholds = { // SIGNAL_STRENGTH_POOR
    -45, // SIGNAL_STRENGTH_MODERATE
    -40, // SIGNAL_STRENGTH_GOOD
    -37, // SIGNAL_STRENGTH_GREAT
    -34 };
    mBundle.putIntArray(CarrierConfigManager.KEY_5G_NR_SSRSRP_THRESHOLDS_INT_ARRAY, nrSsRsrpThresholds);
    mBundle.putInt(CarrierConfigManager.KEY_PARAMETERS_USE_FOR_5G_NR_SIGNAL_BAR_INT, CellSignalStrengthNr.USE_SSRSRP);
    sendCarrierConfigUpdate();
    mSimulatedCommands.setSignalStrength(ss);
    mSimulatedCommands.notifySignalStrength();
    waitForLastHandlerAction(mSSTTestHandler.getThreadHandler());
    assertEquals(CellSignalStrength.SIGNAL_STRENGTH_POOR, sst.getSignalStrength().getLevel());
}
Also used : CellSignalStrengthLte(android.telephony.CellSignalStrengthLte) CellSignalStrengthGsm(android.telephony.CellSignalStrengthGsm) CellSignalStrengthNr(android.telephony.CellSignalStrengthNr) CellSignalStrengthWcdma(android.telephony.CellSignalStrengthWcdma) CellSignalStrengthTdscdma(android.telephony.CellSignalStrengthTdscdma) CellSignalStrengthCdma(android.telephony.CellSignalStrengthCdma) CellSignalStrength(android.telephony.CellSignalStrength) SignalStrength(android.telephony.SignalStrength) FlakyTest(androidx.test.filters.FlakyTest) MediumTest(android.test.suitebuilder.annotation.MediumTest) SmallTest(android.test.suitebuilder.annotation.SmallTest) Test(org.junit.Test)

Example 10 with CellSignalStrengthNr

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

the class ServiceStateTrackerTest method test5gNrSignalStrengthReportingCriteria_UseSsRsrpAndSsRsrq.

@Test
public void test5gNrSignalStrengthReportingCriteria_UseSsRsrpAndSsRsrq() {
    SignalStrength ss = new SignalStrength(new CellSignalStrengthCdma(), new CellSignalStrengthGsm(), new CellSignalStrengthWcdma(), new CellSignalStrengthTdscdma(), new CellSignalStrengthLte(), new CellSignalStrengthNr(-139, /**
     * csiRsrp NONE
     */
    -20, /**
     * csiRsrq NONE
     */
    -23, /**
     * CsiSinr NONE
     */
    -44, /**
     * SsRsrp SIGNAL_STRENGTH_GREAT
     */
    -32, /**
     * SsRsrq NONE
     */
    -23));
    // SSRSRP = 1 << 0 | SSSINR = 1 << 2
    mBundle.putInt(CarrierConfigManager.KEY_PARAMETERS_USE_FOR_5G_NR_SIGNAL_BAR_INT, CellSignalStrengthNr.USE_SSRSRP | CellSignalStrengthNr.USE_SSRSRQ);
    sendCarrierConfigUpdate();
    mSimulatedCommands.setSignalStrength(ss);
    mSimulatedCommands.notifySignalStrength();
    waitForLastHandlerAction(mSSTTestHandler.getThreadHandler());
    assertEquals(CellSignalStrength.SIGNAL_STRENGTH_NONE_OR_UNKNOWN, sst.getSignalStrength().getLevel());
}
Also used : CellSignalStrengthLte(android.telephony.CellSignalStrengthLte) CellSignalStrengthGsm(android.telephony.CellSignalStrengthGsm) CellSignalStrengthNr(android.telephony.CellSignalStrengthNr) CellSignalStrengthWcdma(android.telephony.CellSignalStrengthWcdma) CellSignalStrengthTdscdma(android.telephony.CellSignalStrengthTdscdma) CellSignalStrengthCdma(android.telephony.CellSignalStrengthCdma) CellSignalStrength(android.telephony.CellSignalStrength) SignalStrength(android.telephony.SignalStrength) FlakyTest(androidx.test.filters.FlakyTest) MediumTest(android.test.suitebuilder.annotation.MediumTest) SmallTest(android.test.suitebuilder.annotation.SmallTest) 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