Search in sources :

Example 61 with IRadio

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);
    }
}
Also used : IRadio(android.hardware.radio.V1_0.IRadio) CdmaSmsMessage(android.hardware.radio.V1_0.CdmaSmsMessage) RemoteException(android.os.RemoteException)

Example 62 with IRadio

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);
        }
    }
}
Also used : IRadio(android.hardware.radio.V1_0.IRadio) SimApdu(android.hardware.radio.V1_0.SimApdu) RemoteException(android.os.RemoteException)

Example 63 with IRadio

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);
            }
        }
    }
}
Also used : IRadio(android.hardware.radio.V1_0.IRadio) RemoteException(android.os.RemoteException)

Aggregations

IRadio (android.hardware.radio.V1_0.IRadio)63 RemoteException (android.os.RemoteException)63 ArrayList (java.util.ArrayList)6 CdmaSmsMessage (android.hardware.radio.V1_0.CdmaSmsMessage)5 GsmSmsMessage (android.hardware.radio.V1_0.GsmSmsMessage)5 ImsSmsMessage (android.hardware.radio.V1_0.ImsSmsMessage)4 CdmaSmsWriteArgs (android.hardware.radio.V1_0.CdmaSmsWriteArgs)3 Dial (android.hardware.radio.V1_0.Dial)3 UusInfo (android.hardware.radio.V1_0.UusInfo)3 CarrierRestrictions (android.hardware.radio.V1_0.CarrierRestrictions)2 NvWriteItem (android.hardware.radio.V1_0.NvWriteItem)2 SimApdu (android.hardware.radio.V1_0.SimApdu)2 Message (android.os.Message)2 RadioAccessSpecifier (android.telephony.RadioAccessSpecifier)2 InetAddress (java.net.InetAddress)2 Carrier (android.hardware.radio.V1_0.Carrier)1 CdmaBroadcastSmsConfigInfo (android.hardware.radio.V1_0.CdmaBroadcastSmsConfigInfo)1 CdmaSmsAck (android.hardware.radio.V1_0.CdmaSmsAck)1 DataProfileInfo (android.hardware.radio.V1_0.DataProfileInfo)1 GsmBroadcastSmsConfigInfo (android.hardware.radio.V1_0.GsmBroadcastSmsConfigInfo)1