Search in sources :

Example 11 with IRadio

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

the class RIL method setLinkCapacityReportingCriteria.

@Override
public void setLinkCapacityReportingCriteria(int hysteresisMs, int hysteresisDlKbps, int hysteresisUlKbps, int[] thresholdsDlKbps, int[] thresholdsUlKbps, int ran, Message result) {
    IRadio radioProxy = getRadioProxy(result);
    if (radioProxy != null) {
        RILRequest rr = obtainRequest(RIL_REQUEST_SET_LINK_CAPACITY_REPORTING_CRITERIA, result, mRILDefaultWorkSource);
        if (RILJ_LOGD) {
            riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
        }
        try {
            if (mRadioVersion.greaterOrEqual(RADIO_HAL_VERSION_1_5)) {
                android.hardware.radio.V1_5.IRadio radioProxy15 = (android.hardware.radio.V1_5.IRadio) radioProxy;
                radioProxy15.setLinkCapacityReportingCriteria_1_5(rr.mSerial, hysteresisMs, hysteresisDlKbps, hysteresisUlKbps, primitiveArrayToArrayList(thresholdsDlKbps), primitiveArrayToArrayList(thresholdsUlKbps), convertAntToHalAnt(ran));
            } else if (mRadioVersion.greaterOrEqual(RADIO_HAL_VERSION_1_2)) {
                android.hardware.radio.V1_2.IRadio radioProxy12 = (android.hardware.radio.V1_2.IRadio) radioProxy;
                if (ran == AccessNetworkType.NGRAN) {
                    throw new RuntimeException("NGRAN unsupported on IRadio version 1.2.");
                }
                radioProxy12.setLinkCapacityReportingCriteria(rr.mSerial, hysteresisMs, hysteresisDlKbps, hysteresisUlKbps, primitiveArrayToArrayList(thresholdsDlKbps), primitiveArrayToArrayList(thresholdsUlKbps), convertAntToHalAnt(ran));
            } else {
                riljLoge("setLinkCapacityReportingCriteria ignored on IRadio version less " + "than 1.2");
            }
        } catch (RemoteException | RuntimeException e) {
            handleRadioProxyExceptionForRR(rr, "setLinkCapacityReportingCriteria", e);
        }
    }
}
Also used : IRadio(android.hardware.radio.V1_0.IRadio) RemoteException(android.os.RemoteException)

Example 12 with IRadio

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

the class RIL method setGsmBroadcastConfig.

@Override
public void setGsmBroadcastConfig(SmsBroadcastConfigInfo[] config, Message result) {
    IRadio radioProxy = getRadioProxy(result);
    if (radioProxy != null) {
        RILRequest rr = obtainRequest(RIL_REQUEST_GSM_SET_BROADCAST_CONFIG, result, mRILDefaultWorkSource);
        if (RILJ_LOGD) {
            riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " with " + config.length + " configs : ");
            for (int i = 0; i < config.length; i++) {
                riljLog(config[i].toString());
            }
        }
        ArrayList<GsmBroadcastSmsConfigInfo> configs = new ArrayList<>();
        int numOfConfig = config.length;
        GsmBroadcastSmsConfigInfo info;
        for (int i = 0; i < numOfConfig; i++) {
            info = new GsmBroadcastSmsConfigInfo();
            info.fromServiceId = config[i].getFromServiceId();
            info.toServiceId = config[i].getToServiceId();
            info.fromCodeScheme = config[i].getFromCodeScheme();
            info.toCodeScheme = config[i].getToCodeScheme();
            info.selected = config[i].isSelected();
            configs.add(info);
        }
        try {
            radioProxy.setGsmBroadcastConfig(rr.mSerial, configs);
        } catch (RemoteException | RuntimeException e) {
            handleRadioProxyExceptionForRR(rr, "setGsmBroadcastConfig", e);
        }
    }
}
Also used : IRadio(android.hardware.radio.V1_0.IRadio) ArrayList(java.util.ArrayList) GsmBroadcastSmsConfigInfo(android.hardware.radio.V1_0.GsmBroadcastSmsConfigInfo) RemoteException(android.os.RemoteException)

Example 13 with IRadio

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

the class RIL method deactivateDataCall.

@Override
public void deactivateDataCall(int cid, int reason, Message result) {
    IRadio radioProxy = getRadioProxy(result);
    if (radioProxy != null) {
        RILRequest rr = obtainRequest(RIL_REQUEST_DEACTIVATE_DATA_CALL, result, mRILDefaultWorkSource);
        if (RILJ_LOGD) {
            riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " cid = " + cid + " reason = " + reason);
        }
        try {
            if (mRadioVersion.greaterOrEqual(RADIO_HAL_VERSION_1_2)) {
                android.hardware.radio.V1_2.IRadio radioProxy12 = (android.hardware.radio.V1_2.IRadio) radioProxy;
                radioProxy12.deactivateDataCall_1_2(rr.mSerial, cid, reason);
            } else {
                radioProxy.deactivateDataCall(rr.mSerial, cid, (reason == DataService.REQUEST_REASON_SHUTDOWN));
            }
            mMetrics.writeRilDeactivateDataCall(mPhoneId, rr.mSerial, cid, reason);
        } catch (RemoteException | RuntimeException e) {
            handleRadioProxyExceptionForRR(rr, "deactivateDataCall", e);
        }
    }
}
Also used : IRadio(android.hardware.radio.V1_0.IRadio) RemoteException(android.os.RemoteException)

Example 14 with IRadio

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

the class RIL method iccTransmitApduBasicChannel.

@Override
public void iccTransmitApduBasicChannel(int cla, int instruction, int p1, int p2, int p3, String data, Message result) {
    IRadio radioProxy = getRadioProxy(result);
    if (radioProxy != null) {
        RILRequest rr = obtainRequest(RIL_REQUEST_SIM_TRANSMIT_APDU_BASIC, result, mRILDefaultWorkSource);
        if (RILJ_LOGD) {
            if (TelephonyUtils.IS_DEBUGGABLE) {
                riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + 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(0, cla, instruction, p1, p2, p3, data);
        try {
            radioProxy.iccTransmitApduBasicChannel(rr.mSerial, msg);
        } catch (RemoteException | RuntimeException e) {
            handleRadioProxyExceptionForRR(rr, "iccTransmitApduBasicChannel", e);
        }
    }
}
Also used : IRadio(android.hardware.radio.V1_0.IRadio) SimApdu(android.hardware.radio.V1_0.SimApdu) RemoteException(android.os.RemoteException)

Example 15 with IRadio

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

the class RIL method acknowledgeLastIncomingCdmaSms.

@Override
public void acknowledgeLastIncomingCdmaSms(boolean success, int cause, Message result) {
    IRadio radioProxy = getRadioProxy(result);
    if (radioProxy != null) {
        RILRequest rr = obtainRequest(RIL_REQUEST_CDMA_SMS_ACKNOWLEDGE, result, mRILDefaultWorkSource);
        if (RILJ_LOGD) {
            riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " success = " + success + " cause = " + cause);
        }
        CdmaSmsAck msg = new CdmaSmsAck();
        msg.errorClass = success ? 0 : 1;
        msg.smsCauseCode = cause;
        try {
            radioProxy.acknowledgeLastIncomingCdmaSms(rr.mSerial, msg);
        } catch (RemoteException | RuntimeException e) {
            handleRadioProxyExceptionForRR(rr, "acknowledgeLastIncomingCdmaSms", e);
        }
    }
}
Also used : IRadio(android.hardware.radio.V1_0.IRadio) RemoteException(android.os.RemoteException) CdmaSmsAck(android.hardware.radio.V1_0.CdmaSmsAck)

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