Search in sources :

Example 1 with CellInfoNr

use of android.telephony.CellInfoNr 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)

Aggregations

CellIdentityNr (android.telephony.CellIdentityNr)1 CellInfo (android.telephony.CellInfo)1 CellInfoNr (android.telephony.CellInfoNr)1 CellSignalStrengthNr (android.telephony.CellSignalStrengthNr)1 FlakyTest (androidx.test.filters.FlakyTest)1 ArrayList (java.util.ArrayList)1 Test (org.junit.Test)1