Search in sources :

Example 1 with BarringInfo

use of android.telephony.BarringInfo in project android_frameworks_opt_telephony by LineageOS.

the class RadioResponse method getBarringInfoResponse.

/**
 * @param responseInfo Response info struct containing response type, serial no. and error.
 * @param cellIdentity CellIdentity for the barringInfos.
 * @param barringInfos List of BarringInfo for all the barring service types.
 */
public void getBarringInfoResponse(RadioResponseInfo responseInfo, android.hardware.radio.V1_5.CellIdentity cellIdentity, ArrayList<android.hardware.radio.V1_5.BarringInfo> barringInfos) {
    RILRequest rr = mRil.processResponse(responseInfo);
    if (rr != null) {
        BarringInfo bi = BarringInfo.create(cellIdentity, barringInfos);
        if (responseInfo.error == RadioError.NONE) {
            sendMessageResponse(rr.mResult, bi);
            // notify all registrants for the possible barring info change
            mRil.mBarringInfoChangedRegistrants.notifyRegistrants(new AsyncResult(null, bi, null));
        }
        mRil.processResponseDone(rr, responseInfo, bi);
    }
}
Also used : BarringInfo(android.telephony.BarringInfo) AsyncResult(android.os.AsyncResult)

Example 2 with BarringInfo

use of android.telephony.BarringInfo in project android_frameworks_opt_telephony by LineageOS.

the class RadioIndication method barringInfoChanged.

/**
 * Indicate that BarringInfo has changed for the current cell and user.
 *
 * @param cellIdentity a CellIdentity the CellIdentity of the Cell
 * @param barringInfos the updated barring information from the current cell, filtered for the
 *        current PLMN and access class / access category.
 */
public void barringInfoChanged(int indicationType, android.hardware.radio.V1_5.CellIdentity cellIdentity, ArrayList<android.hardware.radio.V1_5.BarringInfo> barringInfos) {
    mRil.processIndication(indicationType);
    if (cellIdentity == null || barringInfos == null) {
        AnomalyReporter.reportAnomaly(UUID.fromString("645b16bb-c930-4c1c-9c5d-568696542e05"), "Invalid barringInfoChanged indication");
        mRil.riljLoge("Invalid barringInfoChanged indication");
        return;
    }
    CellIdentity ci = CellIdentity.create(cellIdentity);
    BarringInfo cbi = BarringInfo.create(cellIdentity, barringInfos);
    mRil.mBarringInfoChangedRegistrants.notifyRegistrants(new AsyncResult(null, cbi, null));
}
Also used : CellIdentity(android.telephony.CellIdentity) BarringInfo(android.telephony.BarringInfo) AsyncResult(android.os.AsyncResult)

Example 3 with BarringInfo

use of android.telephony.BarringInfo in project android_frameworks_opt_telephony by LineageOS.

the class BarringInfoTest method testConditionalBarringCheck.

/**
 * Test that when conditional barring is active, the service is considered barred
 */
@Test
public void testConditionalBarringCheck() {
    BarringInfo condInfo = new BarringInfo(null, getBarringServiceInfos(false));
    assertFalse(condInfo.getBarringServiceInfo(BarringInfo.BARRING_SERVICE_TYPE_MMTEL_VIDEO).isBarred());
    condInfo = new BarringInfo(null, getBarringServiceInfos(true));
    assertTrue(condInfo.getBarringServiceInfo(BarringInfo.BARRING_SERVICE_TYPE_MMTEL_VIDEO).isBarred());
}
Also used : BarringInfo(android.telephony.BarringInfo) Test(org.junit.Test)

Example 4 with BarringInfo

use of android.telephony.BarringInfo in project android_frameworks_opt_telephony by LineageOS.

the class BarringInfoTest method testParcel.

/**
 * Test that parceling works correctly
 */
@Test
public void testParcel() {
    BarringInfo info = new BarringInfo(null, getBarringServiceInfos());
    Parcel parcel = Parcel.obtain();
    info.writeToParcel(parcel, 0);
    parcel.setDataPosition(0);
    BarringInfo fromParcel = BarringInfo.CREATOR.createFromParcel(parcel);
    assertEquals(fromParcel, info);
}
Also used : Parcel(android.os.Parcel) BarringInfo(android.telephony.BarringInfo) Test(org.junit.Test)

Example 5 with BarringInfo

use of android.telephony.BarringInfo in project android_frameworks_opt_telephony by LineageOS.

the class BarringInfoTest method testEquals.

/**
 * Test that equality checks are correctly implemented
 */
@Test
public void testEquals() {
    BarringInfo lhs = new BarringInfo(null, getBarringServiceInfos(false));
    BarringInfo rhs = new BarringInfo(null, getBarringServiceInfos(false));
    assertEquals(lhs, rhs);
    rhs = new BarringInfo(null, getBarringServiceInfos(true));
    assertNotEquals(lhs, rhs);
}
Also used : BarringInfo(android.telephony.BarringInfo) Test(org.junit.Test)

Aggregations

BarringInfo (android.telephony.BarringInfo)8 Test (org.junit.Test)5 AsyncResult (android.os.AsyncResult)3 BarringServiceInfo (android.telephony.BarringInfo.BarringServiceInfo)2 Message (android.os.Message)1 Parcel (android.os.Parcel)1 PersistableBundle (android.os.PersistableBundle)1 RegistrantList (android.os.RegistrantList)1 CarrierConfigManager (android.telephony.CarrierConfigManager)1 CellIdentity (android.telephony.CellIdentity)1 Pair (android.util.Pair)1 ImsManager (com.android.ims.ImsManager)1 GsmMmiCode (com.android.internal.telephony.gsm.GsmMmiCode)1 SuppServiceNotification (com.android.internal.telephony.gsm.SuppServiceNotification)1 IccException (com.android.internal.telephony.uicc.IccException)1 IccVmNotSupportedException (com.android.internal.telephony.uicc.IccVmNotSupportedException)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1