Search in sources :

Example 1 with CellSignalStrengthTdscdma

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());
}
Also used : CellSignalStrengthTdscdma(android.telephony.CellSignalStrengthTdscdma) SmallTest(android.test.suitebuilder.annotation.SmallTest)

Example 2 with CellSignalStrengthTdscdma

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);
}
Also used : Parcel(android.os.Parcel) CellSignalStrengthTdscdma(android.telephony.CellSignalStrengthTdscdma) SmallTest(android.test.suitebuilder.annotation.SmallTest)

Example 3 with CellSignalStrengthTdscdma

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());
}
Also used : CellSignalStrengthTdscdma(android.telephony.CellSignalStrengthTdscdma) SmallTest(android.test.suitebuilder.annotation.SmallTest)

Example 4 with CellSignalStrengthTdscdma

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());
}
Also used : CellSignalStrengthTdscdma(android.telephony.CellSignalStrengthTdscdma) SmallTest(android.test.suitebuilder.annotation.SmallTest)

Example 5 with CellSignalStrengthTdscdma

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

CellSignalStrengthTdscdma (android.telephony.CellSignalStrengthTdscdma)19 CellSignalStrengthCdma (android.telephony.CellSignalStrengthCdma)13 CellSignalStrengthGsm (android.telephony.CellSignalStrengthGsm)13 CellSignalStrengthLte (android.telephony.CellSignalStrengthLte)13 CellSignalStrengthNr (android.telephony.CellSignalStrengthNr)13 CellSignalStrengthWcdma (android.telephony.CellSignalStrengthWcdma)13 SignalStrength (android.telephony.SignalStrength)13 SmallTest (android.test.suitebuilder.annotation.SmallTest)11 Test (org.junit.Test)11 CellSignalStrength (android.telephony.CellSignalStrength)10 FlakyTest (androidx.test.filters.FlakyTest)8 MediumTest (android.test.suitebuilder.annotation.MediumTest)6 PersistableBundle (android.os.PersistableBundle)3 SmallTest (androidx.test.filters.SmallTest)2 Parcel (android.os.Parcel)1 CallQuality (android.telephony.CallQuality)1 CellIdentityTdscdma (android.telephony.CellIdentityTdscdma)1 CellInfo (android.telephony.CellInfo)1 CellInfoTdscdma (android.telephony.CellInfoTdscdma)1 ServiceState (android.telephony.ServiceState)1