Search in sources :

Example 1 with RadioResponseInfo

use of android.hardware.radio.V1_0.RadioResponseInfo in project android_frameworks_opt_telephony by LineageOS.

the class RILTest method createFakeRadioResponseInfo.

private static RadioResponseInfo createFakeRadioResponseInfo(int serial, int error, int type) {
    RadioResponseInfo respInfo = new RadioResponseInfo();
    respInfo.serial = serial;
    respInfo.error = error;
    respInfo.type = type;
    return respInfo;
}
Also used : RadioResponseInfo(android.hardware.radio.V1_0.RadioResponseInfo)

Example 2 with RadioResponseInfo

use of android.hardware.radio.V1_0.RadioResponseInfo in project android_frameworks_opt_telephony by LineageOS.

the class RadioResponse method responseDataCallList.

private void responseDataCallList(RadioResponseInfo responseInfo, ArrayList<SetupDataCallResult> dataCallResultList) {
    RILRequest rr = mRil.processResponse(responseInfo);
    if (rr != null) {
        ArrayList<DataCallResponse> dcResponseList = new ArrayList<>();
        for (SetupDataCallResult dcResult : dataCallResultList) {
            dcResponseList.add(RIL.convertDataCallResult(dcResult));
        }
        if (responseInfo.error == RadioError.NONE) {
            sendMessageResponse(rr.mResult, dcResponseList);
        }
        mRil.processResponseDone(rr, responseInfo, dcResponseList);
    }
}
Also used : DataCallResponse(com.android.internal.telephony.dataconnection.DataCallResponse) ArrayList(java.util.ArrayList) SetupDataCallResult(android.hardware.radio.V1_0.SetupDataCallResult)

Example 3 with RadioResponseInfo

use of android.hardware.radio.V1_0.RadioResponseInfo in project android_frameworks_opt_telephony by LineageOS.

the class RILTest method verifyRILErrorResponse.

private static void verifyRILErrorResponse(RIL ril, int serial, int requestType, int error) {
    RadioResponseInfo responseInfo = createFakeRadioResponseInfo(serial, error, RadioResponseType.SOLICITED);
    RILRequest rr = ril.processResponse(responseInfo);
    assertNotNull(rr);
    assertEquals(serial, rr.getSerial());
    assertEquals(requestType, rr.getRequest());
    assertTrue(ril.getWakeLock(RIL.FOR_WAKELOCK).isHeld());
    ril.processResponseDone(rr, responseInfo, null);
    assertEquals(0, ril.getRilRequestList().size());
    assertFalse(ril.getWakeLock(RIL.FOR_WAKELOCK).isHeld());
}
Also used : RadioResponseInfo(android.hardware.radio.V1_0.RadioResponseInfo)

Example 4 with RadioResponseInfo

use of android.hardware.radio.V1_0.RadioResponseInfo in project android_frameworks_opt_telephony by LineageOS.

the class RILTest method verifyRILUnsupportedResponse.

private static void verifyRILUnsupportedResponse(RIL ril, int serial, int requestType, Consumer<RILRequest> unsupportedResponseEmulator) {
    RadioResponseInfo responseInfo = createFakeRadioResponseInfo(serial, RadioError.REQUEST_NOT_SUPPORTED, RadioResponseType.SOLICITED);
    RILRequest rr = ril.processResponse(responseInfo);
    assertNotNull(rr);
    assertEquals(serial, rr.getSerial());
    assertEquals(requestType, rr.getRequest());
    assertTrue(ril.getWakeLock(RIL.FOR_WAKELOCK).isHeld());
    unsupportedResponseEmulator.accept(rr);
    ril.processResponseDone(rr, responseInfo, null);
    assertEquals(1, ril.getRilRequestList().size());
    assertTrue(ril.getWakeLock(RIL.FOR_WAKELOCK).isHeld());
}
Also used : RadioResponseInfo(android.hardware.radio.V1_0.RadioResponseInfo)

Example 5 with RadioResponseInfo

use of android.hardware.radio.V1_0.RadioResponseInfo in project android_frameworks_opt_telephony by LineageOS.

the class RILTest method verifyRILResponse.

private static void verifyRILResponse(RIL ril, int serial, int requestType) {
    RadioResponseInfo responseInfo = createFakeRadioResponseInfo(serial, RadioError.NONE, RadioResponseType.SOLICITED);
    RILRequest rr = ril.processResponse(responseInfo);
    assertNotNull(rr);
    assertEquals(serial, rr.getSerial());
    assertEquals(requestType, rr.getRequest());
    assertTrue(ril.getWakeLock(RIL.FOR_WAKELOCK).isHeld());
    ril.processResponseDone(rr, responseInfo, null);
    assertEquals(0, ril.getRilRequestList().size());
    assertFalse(ril.getWakeLock(RIL.FOR_WAKELOCK).isHeld());
}
Also used : RadioResponseInfo(android.hardware.radio.V1_0.RadioResponseInfo)

Aggregations

RadioResponseInfo (android.hardware.radio.V1_0.RadioResponseInfo)4 SetupDataCallResult (android.hardware.radio.V1_0.SetupDataCallResult)1 DataCallResponse (com.android.internal.telephony.dataconnection.DataCallResponse)1 ArrayList (java.util.ArrayList)1