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);
}
Aggregations