use of android.telephony.CellIdentityCdma in project android_frameworks_opt_telephony by LineageOS.
the class GsmCdmaPhoneTest method testGetCellLocation.
@Test
@SmallTest
public void testGetCellLocation() {
// GSM
CellIdentity cellLocation = new CellIdentityGsm();
WorkSource workSource = new WorkSource(Process.myUid(), mContext.getPackageName());
doReturn(cellLocation).when(mSST).getCellIdentity();
assertEquals(cellLocation, mPhoneUT.getCellIdentity());
// Switch to CDMA
switchToCdma();
CellIdentityCdma cdmaCellLocation = new CellIdentityCdma();
doReturn(cdmaCellLocation).when(mSST).getCellIdentity();
CellIdentityCdma actualCellLocation = (CellIdentityCdma) mPhoneUT.getCellIdentity();
assertEquals(actualCellLocation, cdmaCellLocation);
}
use of android.telephony.CellIdentityCdma in project android_frameworks_opt_telephony by LineageOS.
the class CellIdentityTest method testParcel.
@SmallTest
public void testParcel() {
CellIdentity ci = new CellIdentityLte(CI, PCI, TAC, EARFCN, BANDS, BANDWIDTH, MCC_STR, MNC_STR, ALPHA_LONG, ALPHA_SHORT, Collections.emptyList(), null);
Parcel p = Parcel.obtain();
ci.writeToParcel(p, 0);
p.setDataPosition(0);
CellIdentity newCi = CellIdentity.CREATOR.createFromParcel(p);
assertEquals(ci, newCi);
ci = new CellIdentityCdma(NETWORK_ID, SYSTEM_ID, BASESTATION_ID, LONGITUDE, LATITUDE, ALPHA_LONG, ALPHA_SHORT);
p = Parcel.obtain();
ci.writeToParcel(p, 0);
p.setDataPosition(0);
newCi = CellIdentity.CREATOR.createFromParcel(p);
assertEquals(ci, newCi);
}
Aggregations