Search in sources :

Example 16 with IRadio

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

the class RIL method sendUSSD.

@Override
public void sendUSSD(String ussd, Message result) {
    IRadio radioProxy = getRadioProxy(result);
    if (radioProxy != null) {
        RILRequest rr = obtainRequest(RIL_REQUEST_SEND_USSD, result, mRILDefaultWorkSource);
        if (RILJ_LOGD) {
            String logUssd = "*******";
            if (RILJ_LOGV)
                logUssd = ussd;
            riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " ussd = " + logUssd);
        }
        try {
            radioProxy.sendUssd(rr.mSerial, convertNullToEmptyString(ussd));
        } catch (RemoteException | RuntimeException e) {
            handleRadioProxyExceptionForRR(rr, "sendUSSD", e);
        }
    }
}
Also used : IRadio(android.hardware.radio.V1_0.IRadio) RemoteException(android.os.RemoteException)

Example 17 with IRadio

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

the class RIL method getModemStatus.

@Override
public void getModemStatus(Message result) {
    IRadio radioProxy = getRadioProxy(result);
    if (mRadioVersion.less(RADIO_HAL_VERSION_1_3)) {
        if (RILJ_LOGV)
            riljLog("getModemStatus: not supported.");
        if (result != null) {
            AsyncResult.forMessage(result, null, CommandException.fromRilErrno(REQUEST_NOT_SUPPORTED));
            result.sendToTarget();
        }
        return;
    }
    android.hardware.radio.V1_3.IRadio radioProxy13 = (android.hardware.radio.V1_3.IRadio) radioProxy;
    if (radioProxy13 != null) {
        RILRequest rr = obtainRequest(RIL_REQUEST_GET_MODEM_STATUS, result, mRILDefaultWorkSource);
        if (RILJ_LOGD) {
            riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
        }
        try {
            radioProxy13.getModemStackStatus(rr.mSerial);
        } catch (RemoteException | RuntimeException e) {
            handleRadioProxyExceptionForRR(rr, "getModemStatus", e);
        }
    }
}
Also used : IRadio(android.hardware.radio.V1_0.IRadio) RemoteException(android.os.RemoteException)

Example 18 with IRadio

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

the class RIL method setupDataCall.

@Override
public void setupDataCall(int accessNetworkType, DataProfile dataProfile, boolean isRoaming, boolean allowRoaming, int reason, LinkProperties linkProperties, Message result) {
    IRadio radioProxy = getRadioProxy(result);
    if (radioProxy != null) {
        RILRequest rr = obtainRequest(RIL_REQUEST_SETUP_DATA_CALL, result, mRILDefaultWorkSource);
        ArrayList<String> addresses = new ArrayList<>();
        ArrayList<String> dnses = new ArrayList<>();
        if (linkProperties != null) {
            for (InetAddress address : linkProperties.getAddresses()) {
                addresses.add(address.getHostAddress());
            }
            for (InetAddress dns : linkProperties.getDnsServers()) {
                dnses.add(dns.getHostAddress());
            }
        }
        try {
            if (mRadioVersion.greaterOrEqual(RADIO_HAL_VERSION_1_5)) {
                // IRadio V1.5
                android.hardware.radio.V1_5.IRadio radioProxy15 = (android.hardware.radio.V1_5.IRadio) radioProxy;
                // Convert to HAL data profile
                android.hardware.radio.V1_5.DataProfileInfo dpi = convertToHalDataProfile15(dataProfile);
                ArrayList<android.hardware.radio.V1_5.LinkAddress> addresses15 = new ArrayList<>();
                if (linkProperties != null) {
                    for (LinkAddress la : linkProperties.getAllLinkAddresses()) {
                        android.hardware.radio.V1_5.LinkAddress linkAddress = new android.hardware.radio.V1_5.LinkAddress();
                        linkAddress.address = la.getAddress().getHostAddress();
                        linkAddress.properties = la.getFlags();
                        linkAddress.deprecationTime = la.getDeprecationTime();
                        linkAddress.expirationTime = la.getExpirationTime();
                        addresses15.add(linkAddress);
                    }
                }
                if (RILJ_LOGD) {
                    riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + ",accessNetworkType=" + AccessNetworkType.toString(accessNetworkType) + ",isRoaming=" + isRoaming + ",allowRoaming=" + allowRoaming + "," + dataProfile + ",addresses=" + addresses15 + ",dnses=" + dnses);
                }
                radioProxy15.setupDataCall_1_5(rr.mSerial, accessNetworkType, dpi, allowRoaming, reason, addresses15, dnses);
            } else if (mRadioVersion.greaterOrEqual(RADIO_HAL_VERSION_1_4)) {
                // IRadio V1.4
                android.hardware.radio.V1_4.IRadio radioProxy14 = (android.hardware.radio.V1_4.IRadio) radioProxy;
                // Convert to HAL data profile
                android.hardware.radio.V1_4.DataProfileInfo dpi = convertToHalDataProfile14(dataProfile);
                if (RILJ_LOGD) {
                    riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + ",accessNetworkType=" + AccessNetworkType.toString(accessNetworkType) + ",isRoaming=" + isRoaming + ",allowRoaming=" + allowRoaming + "," + dataProfile + ",addresses=" + addresses + ",dnses=" + dnses);
                }
                radioProxy14.setupDataCall_1_4(rr.mSerial, accessNetworkType, dpi, allowRoaming, reason, addresses, dnses);
            } else if (mRadioVersion.greaterOrEqual(RADIO_HAL_VERSION_1_2)) {
                // IRadio V1.2 and IRadio V1.3
                android.hardware.radio.V1_2.IRadio radioProxy12 = (android.hardware.radio.V1_2.IRadio) radioProxy;
                // Convert to HAL data profile
                android.hardware.radio.V1_0.DataProfileInfo dpi = convertToHalDataProfile10(dataProfile);
                if (RILJ_LOGD) {
                    riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + ",accessNetworkType=" + AccessNetworkType.toString(accessNetworkType) + ",isRoaming=" + isRoaming + ",allowRoaming=" + allowRoaming + "," + dataProfile + ",addresses=" + addresses + ",dnses=" + dnses);
                }
                radioProxy12.setupDataCall_1_2(rr.mSerial, accessNetworkType, dpi, dataProfile.isPersistent(), allowRoaming, isRoaming, reason, addresses, dnses);
            } else {
                // IRadio V1.0 and IRadio V1.1
                // Convert to HAL data profile
                android.hardware.radio.V1_0.DataProfileInfo dpi = convertToHalDataProfile10(dataProfile);
                // Getting data RAT here is just a workaround to support the older 1.0
                // vendor RIL. The new data service interface passes access network type
                // instead of RAT for setup data request. It is impossible to convert access
                // network type back to RAT here, so we directly get the data RAT from
                // phone.
                int dataRat = ServiceState.RIL_RADIO_TECHNOLOGY_UNKNOWN;
                Phone phone = PhoneFactory.getPhone(mPhoneId);
                if (phone != null) {
                    ServiceState ss = phone.getServiceState();
                    if (ss != null) {
                        dataRat = ss.getRilDataRadioTechnology();
                    }
                }
                if (RILJ_LOGD) {
                    riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + ",dataRat=" + dataRat + ",isRoaming=" + isRoaming + ",allowRoaming=" + allowRoaming + "," + dataProfile);
                }
                radioProxy.setupDataCall(rr.mSerial, dataRat, dpi, dataProfile.isPersistent(), allowRoaming, isRoaming);
            }
        } catch (RemoteException | RuntimeException e) {
            handleRadioProxyExceptionForRR(rr, "setupDataCall", e);
        }
    }
}
Also used : ArrayList(java.util.ArrayList) LinkAddress(android.net.LinkAddress) ServiceState(android.telephony.ServiceState) IRadio(android.hardware.radio.V1_0.IRadio) RemoteException(android.os.RemoteException) InetAddress(java.net.InetAddress)

Example 19 with IRadio

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

the class RIL method getCellInfoList.

@Override
public void getCellInfoList(Message result, WorkSource workSource) {
    workSource = getDeafultWorkSourceIfInvalid(workSource);
    IRadio radioProxy = getRadioProxy(result);
    if (radioProxy != null) {
        RILRequest rr = obtainRequest(RIL_REQUEST_GET_CELL_INFO_LIST, result, workSource);
        if (RILJ_LOGD) {
            riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
        }
        try {
            radioProxy.getCellInfoList(rr.mSerial);
        } catch (RemoteException | RuntimeException e) {
            handleRadioProxyExceptionForRR(rr, "getCellInfoList", e);
        }
    }
}
Also used : IRadio(android.hardware.radio.V1_0.IRadio) RemoteException(android.os.RemoteException)

Example 20 with IRadio

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

the class RIL method setUiccSubscription.

@Override
public void setUiccSubscription(int appIndex, boolean activate, Message result) {
    IRadio radioProxy = getRadioProxy(result);
    if (radioProxy != null) {
        RILRequest rr = obtainRequest(RIL_REQUEST_SET_UICC_SUBSCRIPTION, result, mRILDefaultWorkSource);
        if (RILJ_LOGD) {
            riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " appIndex: " + appIndex + " activate: " + activate);
        }
        SelectUiccSub info = new SelectUiccSub();
        info.slot = mPhoneId;
        info.appIndex = appIndex;
        info.subType = mPhoneId;
        info.actStatus = activate ? 1 : 0;
        try {
            radioProxy.setUiccSubscription(rr.mSerial, info);
        } catch (RemoteException | RuntimeException e) {
            handleRadioProxyExceptionForRR(rr, "setUiccSubscription", e);
        }
    }
}
Also used : IRadio(android.hardware.radio.V1_0.IRadio) SelectUiccSub(android.hardware.radio.V1_0.SelectUiccSub) 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