use of android.telephony.CellIdentityTdscdma in project android_frameworks_opt_telephony by LineageOS.
the class CellIdentityTest method testGetMccMncString.
@SmallTest
public void testGetMccMncString() {
List<CellIdentity> identities = new ArrayList<>(5);
CellIdentityGsm gsm = new CellIdentityGsm(MAX_LAC, MAX_CID, MAX_ARFCN, MAX_BSIC, MCC_STR, MNC_STR, null, null, Collections.emptyList());
identities.add(gsm);
CellIdentityCdma cdma = new CellIdentityCdma(NETWORK_ID, SYSTEM_ID, BASESTATION_ID, LONGITUDE, LATITUDE, ALPHA_LONG, ALPHA_SHORT);
identities.add(cdma);
CellIdentity lte = new CellIdentityLte(CI, PCI, TAC, EARFCN, BANDS, BANDWIDTH, MCC_STR, MNC_STR, ALPHA_LONG, ALPHA_SHORT, Collections.emptyList(), null);
identities.add(lte);
CellIdentityWcdma wcdma = new CellIdentityWcdma(MAX_LAC, MAX_CID, PSC, UARFCN, MCC_STR, MNC_STR, ALPHA_LONG, ALPHA_SHORT, Collections.emptyList(), null);
identities.add(wcdma);
CellIdentityTdscdma tdscdma = new CellIdentityTdscdma(MCC_STR, MNC_STR, MAX_LAC, MAX_CID, CPID, UARFCN, ALPHA_LONG, ALPHA_SHORT, Collections.emptyList(), null);
identities.add(tdscdma);
CellIdentityNr nr = new CellIdentityNr(PCI, TAC, EARFCN, BANDS, MCC_STR, MNC_STR, CI, ALPHA_LONG, ALPHA_SHORT, Collections.emptyList());
identities.add(nr);
for (CellIdentity identity : identities) {
final String mccStr = identity.getMccString();
final String mncStr = identity.getMncString();
if (identity instanceof CellIdentityCdma) {
assertNull(mccStr);
assertNull(mncStr);
} else {
assertEquals(MCC_STR, mccStr);
assertEquals(MNC_STR, mncStr);
}
}
}
use of android.telephony.CellIdentityTdscdma in project android_frameworks_opt_telephony by LineageOS.
the class CellIdentityTdscdmaTest method testConstructor.
@SmallTest
public void testConstructor() {
CellIdentityTdscdma ci = new CellIdentityTdscdma(MCC_STR, MNC_STR, LAC, CID, CPID, UARFCN, ALPHA_LONG, ALPHA_SHORT, Collections.emptyList(), null);
assertEquals(MCC_STR, ci.getMccString());
assertEquals(MNC_STR, ci.getMncString());
assertEquals(LAC, ci.getLac());
assertEquals(CID, ci.getCid());
assertEquals(CPID, ci.getCpid());
assertEquals(UARFCN, ci.getChannelNumber());
assertEquals(UARFCN, ci.getUarfcn());
assertEquals(ALPHA_LONG, ci.getOperatorAlphaLong());
assertEquals(ALPHA_SHORT, ci.getOperatorAlphaShort());
String globalCi = MCC_STR + MNC_STR + Integer.toString(LAC, 16) + Integer.toString(CID, 16);
assertEquals(globalCi, ci.getGlobalCellId());
}
use of android.telephony.CellIdentityTdscdma in project android_frameworks_opt_telephony by LineageOS.
the class CellIdentityTdscdmaTest method testParcel.
@SmallTest
public void testParcel() {
CellIdentityTdscdma ci = new CellIdentityTdscdma(MCC_STR, MNC_STR, LAC, CID, UARFCN, CPID, ALPHA_LONG, ALPHA_SHORT, Collections.emptyList(), null);
Parcel p = Parcel.obtain();
ci.writeToParcel(p, 0);
p.setDataPosition(0);
CellIdentityTdscdma newCi = CellIdentityTdscdma.CREATOR.createFromParcel(p);
assertEquals(ci, newCi);
}
use of android.telephony.CellIdentityTdscdma 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);
}
use of android.telephony.CellIdentityTdscdma in project android_frameworks_opt_telephony by LineageOS.
the class RILTest method testCellIdentityTdscdma_1_5_CsgInfo.
@Test
public void testCellIdentityTdscdma_1_5_CsgInfo() {
android.hardware.radio.V1_5.CellIdentityTdscdma halCellIdentity = new android.hardware.radio.V1_5.CellIdentityTdscdma();
initializeCellIdentityTdscdma_1_5(halCellIdentity, false, true);
CellIdentityTdscdma cellIdentity = new CellIdentityTdscdma(halCellIdentity);
assertEquals(CSG_INDICATION, cellIdentity.getClosedSubscriberGroupInfo().getCsgIndicator());
assertEquals(HOME_NODEB_NAME, cellIdentity.getClosedSubscriberGroupInfo().getHomeNodebName());
assertEquals(CSG_IDENTITY, cellIdentity.getClosedSubscriberGroupInfo().getCsgIdentity());
}
Aggregations