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);
}
}
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));
}
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());
}
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);
}
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);
}
Aggregations