Search in sources :

Example 6 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) {
    IRadio radioProxy = getRadioProxy(result);
    if (radioProxy != null) {
        RILRequest rr = obtainRequest(RIL_REQUEST_SET_SIM_CARD_POWER, result, mRILDefaultWorkSource);
        if (RILJ_LOGD) {
            riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " " + state);
        }
        android.hardware.radio.V1_1.IRadio radioProxy11 = android.hardware.radio.V1_1.IRadio.castFrom(radioProxy);
        if (radioProxy11 == null) {
            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);
            }
        } else {
            try {
                radioProxy11.setSimCardPower_1_1(rr.mSerial, state);
            } catch (RemoteException | RuntimeException e) {
                handleRadioProxyExceptionForRR(rr, "setSimCardPower", e);
            }
        }
    }
}
Also used : IRadio(android.hardware.radio.V1_0.IRadio) RemoteException(android.os.RemoteException)

Example 7 with IRadio

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

the class RIL method writeSmsToRuim.

@Override
public void writeSmsToRuim(int status, String pdu, Message result) {
    status = translateStatus(status);
    IRadio radioProxy = getRadioProxy(result);
    if (radioProxy != null) {
        RILRequest rr = obtainRequest(RIL_REQUEST_CDMA_WRITE_SMS_TO_RUIM, result, mRILDefaultWorkSource);
        if (RILJ_LOGV) {
            riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " status = " + status);
        }
        CdmaSmsWriteArgs args = new CdmaSmsWriteArgs();
        args.status = status;
        constructCdmaSendSmsRilRequest(args.message, pdu.getBytes());
        try {
            radioProxy.writeSmsToRuim(rr.mSerial, args);
        } catch (RemoteException | RuntimeException e) {
            handleRadioProxyExceptionForRR(rr, "writeSmsToRuim", e);
        }
    }
}
Also used : IRadio(android.hardware.radio.V1_0.IRadio) CdmaSmsWriteArgs(android.hardware.radio.V1_0.CdmaSmsWriteArgs) RemoteException(android.os.RemoteException)

Example 8 with IRadio

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

the class RIL method stopNattKeepalive.

@Override
public void stopNattKeepalive(int sessionHandle, Message result) {
    IRadio radioProxy = getRadioProxy(result);
    if (radioProxy == null)
        return;
    if (mRadioVersion.less(RADIO_HAL_VERSION_1_1)) {
        if (result != null) {
            AsyncResult.forMessage(result, null, CommandException.fromRilErrno(REQUEST_NOT_SUPPORTED));
            result.sendToTarget();
        }
        return;
    }
    android.hardware.radio.V1_1.IRadio radioProxy11 = (android.hardware.radio.V1_1.IRadio) radioProxy;
    RILRequest rr = obtainRequest(RIL_REQUEST_STOP_KEEPALIVE, result, mRILDefaultWorkSource);
    if (RILJ_LOGD)
        riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
    try {
        radioProxy11.stopKeepalive(rr.mSerial, sessionHandle);
    } catch (RemoteException | RuntimeException e) {
        handleRadioProxyExceptionForRR(rr, "stopNattKeepalive", e);
    }
}
Also used : IRadio(android.hardware.radio.V1_0.IRadio) RemoteException(android.os.RemoteException)

Example 9 with IRadio

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

the class RIL method sendSMS.

@Override
public void sendSMS(String smscPdu, String pdu, Message result) {
    IRadio radioProxy = getRadioProxy(result);
    if (radioProxy != null) {
        RILRequest rr = obtainRequest(RIL_REQUEST_SEND_SMS, result, mRILDefaultWorkSource);
        // Do not log function args for privacy
        if (RILJ_LOGD)
            riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
        GsmSmsMessage msg = constructGsmSendSmsRilRequest(smscPdu, pdu);
        try {
            radioProxy.sendSms(rr.mSerial, msg);
            mMetrics.writeRilSendSms(mPhoneId, rr.mSerial, SmsSession.Event.Tech.SMS_GSM, SmsSession.Event.Format.SMS_FORMAT_3GPP);
        } catch (RemoteException | RuntimeException e) {
            handleRadioProxyExceptionForRR(rr, "sendSMS", e);
        }
    }
}
Also used : IRadio(android.hardware.radio.V1_0.IRadio) RemoteException(android.os.RemoteException) GsmSmsMessage(android.hardware.radio.V1_0.GsmSmsMessage)

Example 10 with IRadio

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

the class RIL method getBarringInfo.

/**
 * {@inheritDoc}
 */
@Override
public void getBarringInfo(Message result) {
    IRadio radioProxy = getRadioProxy(result);
    if (radioProxy == null)
        return;
    if (mRadioVersion.less(RADIO_HAL_VERSION_1_5)) {
        if (result != null) {
            AsyncResult.forMessage(result, null, CommandException.fromRilErrno(REQUEST_NOT_SUPPORTED));
            result.sendToTarget();
        }
        return;
    }
    android.hardware.radio.V1_5.IRadio radioProxy15 = (android.hardware.radio.V1_5.IRadio) radioProxy;
    if (radioProxy15 != null) {
        RILRequest rr = obtainRequest(RIL_REQUEST_GET_BARRING_INFO, result, mRILDefaultWorkSource);
        if (RILJ_LOGD)
            riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
        try {
            radioProxy15.getBarringInfo(rr.mSerial);
        } catch (RemoteException | RuntimeException e) {
            handleRadioProxyExceptionForRR(rr, "getBarringInfo", 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