use of android.telephony.CellIdentityGsm in project android_frameworks_opt_telephony by LineageOS.
the class CellIdentityGsmTest method testConstructorWithEmptyMccMnc.
@SmallTest
public void testConstructorWithEmptyMccMnc() {
CellIdentityGsm ci = new CellIdentityGsm(LAC, CID, ARFCN, BSIC, null, null, ALPHA_LONG, ALPHA_SHORT, Collections.emptyList());
assertEquals(Integer.MAX_VALUE, ci.getMcc());
assertEquals(Integer.MAX_VALUE, ci.getMnc());
assertNull(ci.getMccString());
assertNull(ci.getMncString());
assertNull(ci.getMobileNetworkOperator());
assertNull(ci.getGlobalCellId());
ci = new CellIdentityGsm(LAC, CID, ARFCN, BSIC, MCC_STR, null, ALPHA_LONG, ALPHA_SHORT, Collections.emptyList());
assertEquals(MCC, ci.getMcc());
assertEquals(Integer.MAX_VALUE, ci.getMnc());
assertEquals(MCC_STR, ci.getMccString());
assertNull(ci.getMncString());
assertNull(ci.getMobileNetworkOperator());
assertNull(ci.getGlobalCellId());
ci = new CellIdentityGsm(LAC, CID, ARFCN, BSIC, null, MNC_STR, ALPHA_LONG, ALPHA_SHORT, Collections.emptyList());
assertEquals(MNC, ci.getMnc());
assertEquals(Integer.MAX_VALUE, ci.getMcc());
assertEquals(MNC_STR, ci.getMncString());
assertNull(ci.getMccString());
assertNull(ci.getMobileNetworkOperator());
assertNull(ci.getGlobalCellId());
ci = new CellIdentityGsm(LAC, CID, ARFCN, BSIC, "", "", ALPHA_LONG, ALPHA_SHORT, Collections.emptyList());
assertEquals(Integer.MAX_VALUE, ci.getMcc());
assertEquals(Integer.MAX_VALUE, ci.getMnc());
assertNull(ci.getMccString());
assertNull(ci.getMncString());
assertNull(ci.getMobileNetworkOperator());
assertNull(ci.getGlobalCellId());
}
use of android.telephony.CellIdentityGsm in project android_frameworks_opt_telephony by LineageOS.
the class CellIdentityGsmTest method testParcelWithInvalidMccMnc.
@SmallTest
public void testParcelWithInvalidMccMnc() {
final String invalidMcc = "randomStuff";
final String invalidMnc = "randomStuff";
CellIdentityGsm ci = new CellIdentityGsm(LAC, CID, ARFCN, BSIC, null, null, ALPHA_LONG, ALPHA_SHORT, Collections.emptyList());
Parcel p = Parcel.obtain();
ci.writeToParcel(p, 0);
p.setDataPosition(0);
CellIdentityGsm newCi = CellIdentityGsm.CREATOR.createFromParcel(p);
assertEquals(ci, newCi);
}
use of android.telephony.CellIdentityGsm in project android_frameworks_opt_telephony by LineageOS.
the class CellIdentityGsmTest method testParcel.
@SmallTest
public void testParcel() {
CellIdentityGsm ci = new CellIdentityGsm(LAC, CID, ARFCN, BSIC, MCC_STR, MNC_STR, ALPHA_LONG, ALPHA_SHORT, Collections.emptyList());
Parcel p = Parcel.obtain();
ci.writeToParcel(p, 0);
p.setDataPosition(0);
CellIdentityGsm newCi = CellIdentityGsm.CREATOR.createFromParcel(p);
assertEquals(ci, newCi);
}
use of android.telephony.CellIdentityGsm in project android_frameworks_opt_telephony by LineageOS.
the class CellIdentityGsmTest method testConstructorWithTwoDigitMnc.
@SmallTest
public void testConstructorWithTwoDigitMnc() {
final String mncWithTwoDigit = "61";
CellIdentityGsm ci = new CellIdentityGsm(LAC, CID, ARFCN, BSIC, MCC_STR, mncWithTwoDigit, ALPHA_LONG, ALPHA_SHORT, Collections.emptyList());
assertEquals(MCC, ci.getMcc());
assertEquals(61, ci.getMnc());
assertEquals(MCC_STR, ci.getMccString());
assertEquals(mncWithTwoDigit, ci.getMncString());
assertEquals(MCC_STR + mncWithTwoDigit, ci.getMobileNetworkOperator());
String globalCi = MCC_STR + mncWithTwoDigit + Integer.toString(LAC, 16) + Integer.toString(CID, 16);
assertEquals(globalCi, ci.getGlobalCellId());
}
use of android.telephony.CellIdentityGsm in project android_frameworks_opt_telephony by LineageOS.
the class CellIdentityGsmTest method testParcelWithUnknowMccMnc.
@SmallTest
public void testParcelWithUnknowMccMnc() {
CellIdentityGsm ci = new CellIdentityGsm(LAC, CID, ARFCN, BSIC, null, null, ALPHA_LONG, ALPHA_SHORT, Collections.emptyList());
Parcel p = Parcel.obtain();
ci.writeToParcel(p, 0);
p.setDataPosition(0);
CellIdentityGsm newCi = CellIdentityGsm.CREATOR.createFromParcel(p);
assertEquals(ci, newCi);
}
Aggregations