Search in sources :

Example 36 with IRadio

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

the class RIL method areUiccApplicationsEnabled.

/**
 * Whether uicc applications are enabled or not.
 *
 * @param onCompleteMessage a Message to return to the requester
 */
@Override
public void areUiccApplicationsEnabled(Message onCompleteMessage) {
    IRadio radioProxy = getRadioProxy(onCompleteMessage);
    if (radioProxy == null)
        return;
    if (mRadioVersion.less(RADIO_HAL_VERSION_1_5)) {
        if (onCompleteMessage != null) {
            AsyncResult.forMessage(onCompleteMessage, null, CommandException.fromRilErrno(REQUEST_NOT_SUPPORTED));
            onCompleteMessage.sendToTarget();
        }
        return;
    }
    android.hardware.radio.V1_5.IRadio radioProxy15 = (android.hardware.radio.V1_5.IRadio) radioProxy;
    RILRequest rr = obtainRequest(RIL_REQUEST_GET_UICC_APPLICATIONS_ENABLEMENT, onCompleteMessage, mRILDefaultWorkSource);
    if (RILJ_LOGD)
        riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
    try {
        radioProxy15.areUiccApplicationsEnabled(rr.mSerial);
    } catch (RemoteException | RuntimeException e) {
        handleRadioProxyExceptionForRR(rr, "areUiccApplicationsEnabled", e);
    }
}
Also used : IRadio(android.hardware.radio.V1_0.IRadio) RemoteException(android.os.RemoteException)

Example 37 with IRadio

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

the class RIL method getModemActivityInfo.

@Override
public void getModemActivityInfo(Message result) {
    IRadio radioProxy = getRadioProxy(result);
    if (radioProxy != null) {
        RILRequest rr = obtainRequest(RIL_REQUEST_GET_ACTIVITY_INFO, result, mRILDefaultWorkSource);
        if (RILJ_LOGD) {
            riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
        }
        try {
            radioProxy.getModemActivityInfo(rr.mSerial);
            Message msg = mRilHandler.obtainMessage(EVENT_BLOCKING_RESPONSE_TIMEOUT);
            msg.obj = null;
            msg.arg1 = rr.mSerial;
            mRilHandler.sendMessageDelayed(msg, DEFAULT_BLOCKING_MESSAGE_RESPONSE_TIMEOUT_MS);
        } catch (RemoteException | RuntimeException e) {
            handleRadioProxyExceptionForRR(rr, "getModemActivityInfo", e);
        }
    }
}
Also used : IRadio(android.hardware.radio.V1_0.IRadio) Message(android.os.Message) CdmaSmsMessage(android.hardware.radio.V1_0.CdmaSmsMessage) GsmSmsMessage(android.hardware.radio.V1_0.GsmSmsMessage) ImsSmsMessage(android.hardware.radio.V1_0.ImsSmsMessage) RemoteException(android.os.RemoteException)

Example 38 with IRadio

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

the class RIL method stopNetworkScan.

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

Example 39 with IRadio

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

the class RIL method startNattKeepalive.

@Override
public void startNattKeepalive(int contextId, KeepalivePacketData packetData, int intervalMillis, Message result) {
    checkNotNull(packetData, "KeepaliveRequest cannot be null.");
    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_START_KEEPALIVE, result, mRILDefaultWorkSource);
    if (RILJ_LOGD)
        riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
    try {
        android.hardware.radio.V1_1.KeepaliveRequest req = new android.hardware.radio.V1_1.KeepaliveRequest();
        req.cid = contextId;
        if (packetData.getDstAddress() instanceof Inet4Address) {
            req.type = android.hardware.radio.V1_1.KeepaliveType.NATT_IPV4;
        } else if (packetData.getDstAddress() instanceof Inet6Address) {
            req.type = android.hardware.radio.V1_1.KeepaliveType.NATT_IPV6;
        } else {
            AsyncResult.forMessage(result, null, CommandException.fromRilErrno(INVALID_ARGUMENTS));
            result.sendToTarget();
            return;
        }
        final InetAddress srcAddress = packetData.getSrcAddress();
        final InetAddress dstAddress = packetData.getDstAddress();
        appendPrimitiveArrayToArrayList(srcAddress.getAddress(), req.sourceAddress);
        req.sourcePort = packetData.getSrcPort();
        appendPrimitiveArrayToArrayList(dstAddress.getAddress(), req.destinationAddress);
        req.destinationPort = packetData.getDstPort();
        req.maxKeepaliveIntervalMillis = intervalMillis;
        radioProxy11.startKeepalive(rr.mSerial, req);
    } catch (RemoteException | RuntimeException e) {
        handleRadioProxyExceptionForRR(rr, "startNattKeepalive", e);
    }
}
Also used : Inet4Address(java.net.Inet4Address) Inet6Address(java.net.Inet6Address) IRadio(android.hardware.radio.V1_0.IRadio) RemoteException(android.os.RemoteException) InetAddress(java.net.InetAddress)

Example 40 with IRadio

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

the class RIL method writeSmsToSim.

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

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