Search in sources :

Example 1 with SimApdu

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

the class RIL method iccTransmitApduBasicChannel.

@Override
public void iccTransmitApduBasicChannel(int cla, int instruction, int p1, int p2, int p3, String data, Message result) {
    IRadio radioProxy = getRadioProxy(result);
    if (radioProxy != null) {
        RILRequest rr = obtainRequest(RIL_REQUEST_SIM_TRANSMIT_APDU_BASIC, result, mRILDefaultWorkSource);
        if (RILJ_LOGD) {
            if (TelephonyUtils.IS_DEBUGGABLE) {
                riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + String.format(" cla = 0x%02X ins = 0x%02X", cla, instruction) + String.format(" p1 = 0x%02X p2 = 0x%02X p3 = 0x%02X", p1, p2, p3) + " data = " + data);
            } else {
                riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
            }
        }
        SimApdu msg = createSimApdu(0, cla, instruction, p1, p2, p3, data);
        try {
            radioProxy.iccTransmitApduBasicChannel(rr.mSerial, msg);
        } catch (RemoteException | RuntimeException e) {
            handleRadioProxyExceptionForRR(rr, "iccTransmitApduBasicChannel", e);
        }
    }
}
Also used : IRadio(android.hardware.radio.V1_0.IRadio) SimApdu(android.hardware.radio.V1_0.SimApdu) RemoteException(android.os.RemoteException)

Example 2 with SimApdu

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

the class RIL method createSimApdu.

private SimApdu createSimApdu(int channel, int cla, int instruction, int p1, int p2, int p3, String data) {
    SimApdu msg = new SimApdu();
    msg.sessionId = channel;
    msg.cla = cla;
    msg.instruction = instruction;
    msg.p1 = p1;
    msg.p2 = p2;
    msg.p3 = p3;
    msg.data = convertNullToEmptyString(data);
    return msg;
}
Also used : SimApdu(android.hardware.radio.V1_0.SimApdu)

Example 3 with SimApdu

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

the class RIL method iccTransmitApduLogicalChannel.

@Override
public void iccTransmitApduLogicalChannel(int channel, int cla, int instruction, int p1, int p2, int p3, String data, Message result) {
    if (channel <= 0) {
        throw new RuntimeException("Invalid channel in iccTransmitApduLogicalChannel: " + channel);
    }
    IRadio radioProxy = getRadioProxy(result);
    if (radioProxy != null) {
        RILRequest rr = obtainRequest(RIL_REQUEST_SIM_TRANSMIT_APDU_CHANNEL, result, mRILDefaultWorkSource);
        if (RILJ_LOGD) {
            if (TelephonyUtils.IS_DEBUGGABLE) {
                riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + String.format(" channel = %d", channel) + String.format(" cla = 0x%02X ins = 0x%02X", cla, instruction) + String.format(" p1 = 0x%02X p2 = 0x%02X p3 = 0x%02X", p1, p2, p3) + " data = " + data);
            } else {
                riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
            }
        }
        SimApdu msg = createSimApdu(channel, cla, instruction, p1, p2, p3, data);
        try {
            radioProxy.iccTransmitApduLogicalChannel(rr.mSerial, msg);
        } catch (RemoteException | RuntimeException e) {
            handleRadioProxyExceptionForRR(rr, "iccTransmitApduLogicalChannel", e);
        }
    }
}
Also used : IRadio(android.hardware.radio.V1_0.IRadio) SimApdu(android.hardware.radio.V1_0.SimApdu) RemoteException(android.os.RemoteException)

Aggregations

SimApdu (android.hardware.radio.V1_0.SimApdu)3 IRadio (android.hardware.radio.V1_0.IRadio)2 RemoteException (android.os.RemoteException)2