use of android.telephony.CellSignalStrengthTdscdma in project android_frameworks_opt_telephony by LineageOS.
the class CellSignalStrengthTdscdmaTest method testConstructor.
@SmallTest
public void testConstructor() {
CellSignalStrengthTdscdma css = new CellSignalStrengthTdscdma(RSSI, BER, RSCP);
assertEquals(RSSI, css.getRssi());
assertEquals(BER, css.getBitErrorRate());
assertEquals(RSCP, css.getRscp());
}
use of android.telephony.CellSignalStrengthTdscdma in project android_frameworks_opt_telephony by LineageOS.
the class CellSignalStrengthTdscdmaTest method testParcel.
@SmallTest
public void testParcel() {
CellSignalStrengthTdscdma css = new CellSignalStrengthTdscdma(-1, -1, -1);
Parcel p = Parcel.obtain();
css.writeToParcel(p, 0);
p.setDataPosition(0);
CellSignalStrengthTdscdma newCss = CellSignalStrengthTdscdma.CREATOR.createFromParcel(p);
assertEquals(css, newCss);
}
use of android.telephony.CellSignalStrengthTdscdma in project android_frameworks_opt_telephony by LineageOS.
the class CellSignalStrengthTdscdmaTest method testLevel.
@SmallTest
public void testLevel() {
CellSignalStrengthTdscdma css = new CellSignalStrengthTdscdma(RSSI, BER, RSCP);
assertEquals(1, /* POOR */
css.getLevel());
}
use of android.telephony.CellSignalStrengthTdscdma in project android_frameworks_opt_telephony by LineageOS.
the class CellSignalStrengthTdscdmaTest method testInvalidConstructor.
@SmallTest
public void testInvalidConstructor() {
CellSignalStrengthTdscdma css = new CellSignalStrengthTdscdma(-1, -1, -1);
assertEquals(CellInfo.UNAVAILABLE, css.getRssi());
assertEquals(CellInfo.UNAVAILABLE, css.getBitErrorRate());
assertEquals(CellInfo.UNAVAILABLE, css.getRscp());
}
use of android.telephony.CellSignalStrengthTdscdma 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