Search in sources :

Example 31 with IRadio

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

the class RIL method sendImsCdmaSms.

@Override
public void sendImsCdmaSms(byte[] pdu, int retry, int messageRef, Message result) {
    IRadio radioProxy = getRadioProxy(result);
    if (radioProxy != null) {
        RILRequest rr = obtainRequest(RIL_REQUEST_IMS_SEND_SMS, result, mRILDefaultWorkSource);
        // Do not log function args for privacy
        if (RILJ_LOGD)
            riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
        ImsSmsMessage msg = new ImsSmsMessage();
        msg.tech = RILConstants.CDMA_PHONE;
        msg.retry = (byte) retry >= 1 ? true : false;
        msg.messageRef = messageRef;
        CdmaSmsMessage cdmaMsg = new CdmaSmsMessage();
        constructCdmaSendSmsRilRequest(cdmaMsg, pdu);
        msg.cdmaMessage.add(cdmaMsg);
        try {
            radioProxy.sendImsSms(rr.mSerial, msg);
            mMetrics.writeRilSendSms(mPhoneId, rr.mSerial, SmsSession.Event.Tech.SMS_IMS, SmsSession.Event.Format.SMS_FORMAT_3GPP2);
        } catch (RemoteException | RuntimeException e) {
            handleRadioProxyExceptionForRR(rr, "sendImsCdmaSms", e);
        }
    }
}
Also used : IRadio(android.hardware.radio.V1_0.IRadio) CdmaSmsMessage(android.hardware.radio.V1_0.CdmaSmsMessage) ImsSmsMessage(android.hardware.radio.V1_0.ImsSmsMessage) RemoteException(android.os.RemoteException)

Example 32 with IRadio

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

the class RIL method nvWriteCdmaPrl.

@Override
public void nvWriteCdmaPrl(byte[] preferredRoamingList, Message result) {
    IRadio radioProxy = getRadioProxy(result);
    if (radioProxy != null) {
        RILRequest rr = obtainRequest(RIL_REQUEST_NV_WRITE_CDMA_PRL, result, mRILDefaultWorkSource);
        if (RILJ_LOGD) {
            riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " PreferredRoamingList = 0x" + IccUtils.bytesToHexString(preferredRoamingList));
        }
        ArrayList<Byte> arrList = new ArrayList<>();
        for (int i = 0; i < preferredRoamingList.length; i++) {
            arrList.add(preferredRoamingList[i]);
        }
        try {
            radioProxy.nvWriteCdmaPrl(rr.mSerial, arrList);
        } catch (RemoteException | RuntimeException e) {
            handleRadioProxyExceptionForRR(rr, "nvWriteCdmaPrl", e);
        }
    }
}
Also used : IRadio(android.hardware.radio.V1_0.IRadio) ArrayList(java.util.ArrayList) RemoteException(android.os.RemoteException)

Example 33 with IRadio

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

the class RIL method setRadioCapability.

@Override
public void setRadioCapability(RadioCapability rc, Message response) {
    IRadio radioProxy = getRadioProxy(response);
    if (radioProxy != null) {
        RILRequest rr = obtainRequest(RIL_REQUEST_SET_RADIO_CAPABILITY, response, mRILDefaultWorkSource);
        if (RILJ_LOGD) {
            riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " RadioCapability = " + rc.toString());
        }
        android.hardware.radio.V1_0.RadioCapability halRc = new android.hardware.radio.V1_0.RadioCapability();
        halRc.session = rc.getSession();
        halRc.phase = rc.getPhase();
        halRc.raf = rc.getRadioAccessFamily();
        halRc.logicalModemUuid = convertNullToEmptyString(rc.getLogicalModemUuid());
        halRc.status = rc.getStatus();
        try {
            radioProxy.setRadioCapability(rr.mSerial, halRc);
        } catch (Exception e) {
            handleRadioProxyExceptionForRR(rr, "setRadioCapability", e);
        }
    }
}
Also used : IRadio(android.hardware.radio.V1_0.IRadio) RemoteException(android.os.RemoteException) IOException(java.io.IOException) NoSuchElementException(java.util.NoSuchElementException)

Example 34 with IRadio

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

the class RIL method setNetworkSelectionModeManual.

@Override
public void setNetworkSelectionModeManual(String operatorNumeric, int ran, Message result) {
    IRadio radioProxy = getRadioProxy(result);
    if (radioProxy != null) {
        RILRequest rr = obtainRequest(RIL_REQUEST_SET_NETWORK_SELECTION_MANUAL, result, mRILDefaultWorkSource);
        if (mUseOldMncMccFormat && !TextUtils.isEmpty(operatorNumeric)) {
            operatorNumeric += "+";
        }
        try {
            int halRan = convertAntToRan(ran);
            if (mRadioVersion.greaterOrEqual(RADIO_HAL_VERSION_1_5)) {
                android.hardware.radio.V1_5.IRadio radioProxy15 = (android.hardware.radio.V1_5.IRadio) radioProxy;
                if (RILJ_LOGD) {
                    riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " operatorNumeric = " + operatorNumeric + ", ran = " + halRan);
                }
                radioProxy15.setNetworkSelectionModeManual_1_5(rr.mSerial, convertNullToEmptyString(operatorNumeric), halRan);
            } else {
                if (RILJ_LOGD) {
                    riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " operatorNumeric = " + operatorNumeric);
                }
                radioProxy.setNetworkSelectionModeManual(rr.mSerial, convertNullToEmptyString(operatorNumeric));
            }
        } catch (RemoteException | RuntimeException e) {
            handleRadioProxyExceptionForRR(rr, "setNetworkSelectionModeManual", e);
        }
    }
}
Also used : IRadio(android.hardware.radio.V1_0.IRadio) RemoteException(android.os.RemoteException)

Example 35 with IRadio

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

the class RIL method setDataProfile.

@Override
public void setDataProfile(DataProfile[] dps, boolean isRoaming, Message result) {
    IRadio radioProxy = getRadioProxy(result);
    if (radioProxy != null) {
        RILRequest rr = null;
        try {
            if (mRadioVersion.greaterOrEqual(RADIO_HAL_VERSION_1_5)) {
                // V1.5
                android.hardware.radio.V1_5.IRadio radioProxy15 = (android.hardware.radio.V1_5.IRadio) radioProxy;
                rr = obtainRequest(RIL_REQUEST_SET_DATA_PROFILE, result, mRILDefaultWorkSource);
                ArrayList<android.hardware.radio.V1_5.DataProfileInfo> dpis = new ArrayList<>();
                for (DataProfile dp : dps) {
                    dpis.add(convertToHalDataProfile15(dp));
                }
                if (RILJ_LOGD) {
                    riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " with data profiles : ");
                    for (DataProfile profile : dps) {
                        riljLog(profile.toString());
                    }
                }
                radioProxy15.setDataProfile_1_5(rr.mSerial, dpis);
            } else if (mRadioVersion.greaterOrEqual(RADIO_HAL_VERSION_1_4)) {
                // V1.4
                android.hardware.radio.V1_4.IRadio radioProxy14 = (android.hardware.radio.V1_4.IRadio) radioProxy;
                rr = obtainRequest(RIL_REQUEST_SET_DATA_PROFILE, result, mRILDefaultWorkSource);
                ArrayList<android.hardware.radio.V1_4.DataProfileInfo> dpis = new ArrayList<>();
                for (DataProfile dp : dps) {
                    dpis.add(convertToHalDataProfile14(dp));
                }
                if (RILJ_LOGD) {
                    riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " with data profiles : ");
                    for (DataProfile profile : dps) {
                        riljLog(profile.toString());
                    }
                }
                radioProxy14.setDataProfile_1_4(rr.mSerial, dpis);
            } else {
                // V1.0, 1.1, 1,2 and 1.3
                ArrayList<android.hardware.radio.V1_0.DataProfileInfo> dpis = new ArrayList<>();
                for (DataProfile dp : dps) {
                    // (a.k.a modem cognitive) bit set to true.
                    if (dp.isPersistent()) {
                        dpis.add(convertToHalDataProfile10(dp));
                    }
                }
                if (!dpis.isEmpty()) {
                    rr = obtainRequest(RIL_REQUEST_SET_DATA_PROFILE, result, mRILDefaultWorkSource);
                    if (RILJ_LOGD) {
                        riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " with data profiles : ");
                        for (DataProfile profile : dps) {
                            riljLog(profile.toString());
                        }
                    }
                    radioProxy.setDataProfile(rr.mSerial, dpis, isRoaming);
                }
            }
        } catch (RemoteException | RuntimeException e) {
            handleRadioProxyExceptionForRR(rr, "setDataProfile", e);
        }
    }
}
Also used : ArrayList(java.util.ArrayList) IRadio(android.hardware.radio.V1_0.IRadio) DataProfile(android.telephony.data.DataProfile) 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