use of android.telephony.CellIdentityTdscdma in project android_frameworks_opt_telephony by LineageOS.
the class RILTest method testCellIdentityTdscdma_1_5_MultiPlmn.
@Test
public void testCellIdentityTdscdma_1_5_MultiPlmn() {
android.hardware.radio.V1_5.CellIdentityTdscdma halCellIdentity = new android.hardware.radio.V1_5.CellIdentityTdscdma();
initializeCellIdentityTdscdma_1_5(halCellIdentity, true, false);
CellIdentityTdscdma cellIdentity = new CellIdentityTdscdma(halCellIdentity);
Set<String> additionalPlmns = new HashSet<>();
Collections.addAll(additionalPlmns, ADDITIONAL_PLMNS);
assertEquals(cellIdentity.getAdditionalPlmns(), additionalPlmns);
}
use of android.telephony.CellIdentityTdscdma in project android_frameworks_opt_telephony by LineageOS.
the class ServiceStateTrackerTest method testGetCidFromCellIdentity.
@Test
public void testGetCidFromCellIdentity() throws Exception {
CellIdentity gsmCi = new CellIdentityGsm(0, 1, 0, 0, "", "", "", "", Collections.emptyList());
CellIdentity wcdmaCi = new CellIdentityWcdma(0, 2, 0, 0, "", "", "", "", Collections.emptyList(), null);
CellIdentity tdscdmaCi = new CellIdentityTdscdma("", "", 0, 3, 0, 0, "", "", Collections.emptyList(), null);
CellIdentity lteCi = new CellIdentityLte(0, 0, 4, 0, 0);
CellIdentity nrCi = new CellIdentityNr(0, 0, 0, new int[] {}, "", "", 5, "", "", Collections.emptyList());
Method method = ServiceStateTracker.class.getDeclaredMethod("getCidFromCellIdentity", CellIdentity.class);
method.setAccessible(true);
assertEquals(1, (long) method.invoke(mSST, gsmCi));
assertEquals(2, (long) method.invoke(mSST, wcdmaCi));
assertEquals(3, (long) method.invoke(mSST, tdscdmaCi));
assertEquals(4, (long) method.invoke(mSST, lteCi));
assertEquals(5, (long) method.invoke(mSST, nrCi));
}
use of android.telephony.CellIdentityTdscdma in project android_frameworks_opt_telephony by LineageOS.
the class CellIdentityTdscdmaTest method testParcelWithUnknowMccMnc.
@SmallTest
public void testParcelWithUnknowMccMnc() {
CellIdentityTdscdma ci = new CellIdentityTdscdma(null, null, LAC, CID, CPID, UARFCN, ALPHA_LONG, ALPHA_SHORT, Collections.emptyList(), null);
Parcel p = Parcel.obtain();
p.writeInt(CellInfo.TYPE_TDSCDMA);
p.writeString(String.valueOf(Integer.MAX_VALUE));
p.writeString(String.valueOf(Integer.MAX_VALUE));
p.writeString(ALPHA_LONG);
p.writeString(ALPHA_SHORT);
p.writeInt(LAC);
p.writeInt(CID);
p.writeInt(CPID);
p.writeInt(UARFCN);
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 CellIdentityTdscdmaTest method testDefaultConstructor.
@SmallTest
public void testDefaultConstructor() {
CellIdentityTdscdma ci = new CellIdentityTdscdma();
assertNull(ci.getMccString());
assertNull(ci.getMncString());
assertEquals(CellInfo.UNAVAILABLE, ci.getLac());
assertEquals(CellInfo.UNAVAILABLE, ci.getCid());
assertEquals(CellInfo.UNAVAILABLE, ci.getCpid());
assertEquals(CellInfo.UNAVAILABLE, ci.getChannelNumber());
assertEquals(CellInfo.UNAVAILABLE, ci.getUarfcn());
assertNull(ci.getOperatorAlphaLong());
assertNull(ci.getOperatorAlphaShort());
assertNull(ci.getGlobalCellId());
}
use of android.telephony.CellIdentityTdscdma in project android_frameworks_opt_telephony by LineageOS.
the class CellIdentityTdscdmaTest method testParcelWithInvalidMccMnc.
@SmallTest
public void testParcelWithInvalidMccMnc() {
final String invalidMcc = "randomStuff";
final String invalidMnc = "randomStuff";
CellIdentityTdscdma ci = new CellIdentityTdscdma(null, null, LAC, CID, CPID, UARFCN, ALPHA_LONG, ALPHA_SHORT, Collections.emptyList(), null);
Parcel p = Parcel.obtain();
p.writeInt(CellInfo.TYPE_TDSCDMA);
p.writeString(invalidMcc);
p.writeString(invalidMnc);
p.writeString(ALPHA_LONG);
p.writeString(ALPHA_SHORT);
p.writeInt(LAC);
p.writeInt(CID);
p.writeInt(CPID);
p.writeInt(UARFCN);
p.setDataPosition(0);
CellIdentityTdscdma newCi = CellIdentityTdscdma.CREATOR.createFromParcel(p);
assertEquals(ci, newCi);
}
Aggregations