use of android.hardware.radio.V1_0.IRadio in project android_frameworks_opt_telephony by LineageOS.
the class RIL method sendCdmaSMSExpectMore.
@Override
public void sendCdmaSMSExpectMore(byte[] pdu, Message result) {
if (mRadioVersion.greaterOrEqual(RADIO_HAL_VERSION_1_5)) {
IRadio radioProxy = getRadioProxy(result);
// IRadio V1.5
android.hardware.radio.V1_5.IRadio radioProxy15 = (android.hardware.radio.V1_5.IRadio) radioProxy;
if (radioProxy15 != null) {
RILRequest rr = obtainRequest(RIL_REQUEST_CDMA_SEND_SMS_EXPECT_MORE, result, mRILDefaultWorkSource);
// Do not log function arg for privacy
if (RILJ_LOGD)
riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
CdmaSmsMessage msg = new CdmaSmsMessage();
constructCdmaSendSmsRilRequest(msg, pdu);
try {
radioProxy15.sendCdmaSmsExpectMore(rr.mSerial, msg);
mMetrics.writeRilSendSms(mPhoneId, rr.mSerial, SmsSession.Event.Tech.SMS_CDMA, SmsSession.Event.Format.SMS_FORMAT_3GPP2);
} catch (RemoteException | RuntimeException e) {
handleRadioProxyExceptionForRR(rr, "sendCdmaSMSExpectMore", e);
}
}
} else {
sendCdmaSms(pdu, result);
}
}
use of android.hardware.radio.V1_0.IRadio 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);
}
}
}
use of android.hardware.radio.V1_0.IRadio in project android_frameworks_opt_telephony by LineageOS.
the class RIL method setSimCardPower.
@Override
public void setSimCardPower(int state, Message result, WorkSource workSource) {
workSource = getDeafultWorkSourceIfInvalid(workSource);
IRadio radioProxy = getRadioProxy(result);
if (radioProxy != null) {
RILRequest rr = obtainRequest(RIL_REQUEST_SET_SIM_CARD_POWER, result, workSource);
if (RILJ_LOGD) {
riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " " + state);
}
if (mRadioVersion.greaterOrEqual(RADIO_HAL_VERSION_1_1)) {
try {
android.hardware.radio.V1_1.IRadio radioProxy11 = (android.hardware.radio.V1_1.IRadio) radioProxy;
radioProxy11.setSimCardPower_1_1(rr.mSerial, state);
} catch (RemoteException | RuntimeException e) {
handleRadioProxyExceptionForRR(rr, "setSimCardPower", e);
}
} else {
try {
switch(state) {
case TelephonyManager.CARD_POWER_DOWN:
{
radioProxy.setSimCardPower(rr.mSerial, false);
break;
}
case TelephonyManager.CARD_POWER_UP:
{
radioProxy.setSimCardPower(rr.mSerial, true);
break;
}
default:
{
if (result != null) {
AsyncResult.forMessage(result, null, CommandException.fromRilErrno(REQUEST_NOT_SUPPORTED));
result.sendToTarget();
}
}
}
} catch (RemoteException | RuntimeException e) {
handleRadioProxyExceptionForRR(rr, "setSimCardPower", e);
}
}
}
}
Aggregations