Search in sources :

Example 6 with CellLocation

use of android.telephony.CellLocation in project assertj-android by square.

the class TelephonyManagerAssert method hasCellLocation.

public TelephonyManagerAssert hasCellLocation(CellLocation cellLocation) {
    isNotNull();
    CellLocation actualCellLocation = actual.getCellLocation();
    //
    assertThat(actualCellLocation).overridingErrorMessage("Expected cell location <%s> but was <%s>.", cellLocation, //
    actualCellLocation).isEqualTo(cellLocation);
    return this;
}
Also used : CellLocation(android.telephony.CellLocation)

Example 7 with CellLocation

use of android.telephony.CellLocation in project XobotOS by xamarin.

the class GsmDataConnectionTracker method getCellLocationId.

private int getCellLocationId() {
    int cid = -1;
    CellLocation loc = mPhone.getCellLocation();
    if (loc != null) {
        if (loc instanceof GsmCellLocation) {
            cid = ((GsmCellLocation) loc).getCid();
        } else if (loc instanceof CdmaCellLocation) {
            cid = ((CdmaCellLocation) loc).getBaseStationId();
        }
    }
    return cid;
}
Also used : CdmaCellLocation(android.telephony.cdma.CdmaCellLocation) GsmCellLocation(android.telephony.gsm.GsmCellLocation) CellLocation(android.telephony.CellLocation) CdmaCellLocation(android.telephony.cdma.CdmaCellLocation) GsmCellLocation(android.telephony.gsm.GsmCellLocation)

Aggregations

CellLocation (android.telephony.CellLocation)7 CdmaCellLocation (android.telephony.cdma.CdmaCellLocation)3 GsmCellLocation (android.telephony.gsm.GsmCellLocation)3 TelephonyManager (android.telephony.TelephonyManager)2 SharedPreferences (android.content.SharedPreferences)1 Realm (io.realm.Realm)1 Cleanup (lombok.Cleanup)1 Test (org.junit.Test)1