Search in sources :

Example 1 with CellInfoTdscdma

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

the class RILTest method testConvertHalCellInfoListForTdscdma.

@Test
public void testConvertHalCellInfoListForTdscdma() {
    android.hardware.radio.V1_2.CellInfoTdscdma cellinfo = new android.hardware.radio.V1_2.CellInfoTdscdma();
    initializeCellIdentityTdscdma_1_2(cellinfo.cellIdentityTdscdma);
    cellinfo.signalStrengthTdscdma.signalStrength = RSSI_ASU;
    cellinfo.signalStrengthTdscdma.bitErrorRate = BIT_ERROR_RATE;
    cellinfo.signalStrengthTdscdma.rscp = RSCP_ASU;
    android.hardware.radio.V1_2.CellInfo record = new android.hardware.radio.V1_2.CellInfo();
    record.cellInfoType = TYPE_TD_SCDMA;
    record.registered = false;
    record.timeStampType = RIL_TIMESTAMP_TYPE_OEM_RIL;
    record.timeStamp = TIMESTAMP;
    record.tdscdma.add(cellinfo);
    ArrayList<android.hardware.radio.V1_2.CellInfo> records = new ArrayList<android.hardware.radio.V1_2.CellInfo>();
    records.add(record);
    ArrayList<CellInfo> ret = RIL.convertHalCellInfoList_1_2(records);
    assertEquals(1, ret.size());
    CellInfoTdscdma cellInfoTdscdma = (CellInfoTdscdma) ret.get(0);
    CellInfoTdscdma expected = new CellInfoTdscdma();
    expected.setRegistered(false);
    expected.setTimeStamp(TIMESTAMP);
    expected.setCellConnectionStatus(CellInfo.CONNECTION_NONE);
    CellIdentityTdscdma ci = new CellIdentityTdscdma(MCC_STR, MNC_STR, LAC, CID, PSC, UARFCN, ALPHA_LONG, ALPHA_SHORT, Collections.emptyList(), null);
    CellSignalStrengthTdscdma cs = new CellSignalStrengthTdscdma(RSSI, BIT_ERROR_RATE, RSCP);
    expected.setCellIdentity(ci);
    expected.setCellSignalStrength(cs);
    // override the timestamp
    cellInfoTdscdma.setTimeStamp(TIMESTAMP);
    assertEquals(expected, cellInfoTdscdma);
}
Also used : ArrayList(java.util.ArrayList) CellSignalStrengthTdscdma(android.telephony.CellSignalStrengthTdscdma) CellInfoTdscdma(android.telephony.CellInfoTdscdma) CellIdentityTdscdma(android.telephony.CellIdentityTdscdma) CellInfo(android.telephony.CellInfo) FlakyTest(androidx.test.filters.FlakyTest) Test(org.junit.Test)

Aggregations

CellIdentityTdscdma (android.telephony.CellIdentityTdscdma)1 CellInfo (android.telephony.CellInfo)1 CellInfoTdscdma (android.telephony.CellInfoTdscdma)1 CellSignalStrengthTdscdma (android.telephony.CellSignalStrengthTdscdma)1 FlakyTest (androidx.test.filters.FlakyTest)1 ArrayList (java.util.ArrayList)1 Test (org.junit.Test)1