Search in sources :

Example 1 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 radioTechnology, DataProfile dataProfile, boolean isRoaming, boolean allowRoaming, Message result) {
    IRadio radioProxy = getRadioProxy(result);
    if (radioProxy != null) {
        RILRequest rr = obtainRequest(RIL_REQUEST_SETUP_DATA_CALL, result, mRILDefaultWorkSource);
        // Convert to HAL data profile
        DataProfileInfo dpi = convertToHalDataProfile(dataProfile);
        if (RILJ_LOGD) {
            riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + ",radioTechnology=" + radioTechnology + ",isRoaming=" + isRoaming + ",allowRoaming=" + allowRoaming + "," + dataProfile);
        }
        try {
            radioProxy.setupDataCall(rr.mSerial, radioTechnology, dpi, dataProfile.modemCognitive, allowRoaming, isRoaming);
            mMetrics.writeRilSetupDataCall(mPhoneId, rr.mSerial, radioTechnology, dpi.profileId, dpi.apn, dpi.authType, dpi.protocol);
        } catch (RemoteException | RuntimeException e) {
            handleRadioProxyExceptionForRR(rr, "setupDataCall", e);
        }
    }
}
Also used : IRadio(android.hardware.radio.V1_0.IRadio) DataProfileInfo(android.hardware.radio.V1_0.DataProfileInfo) RemoteException(android.os.RemoteException)

Example 2 with IRadio

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

the class RIL method setAllowedCarriers.

@Override
public void setAllowedCarriers(List<CarrierIdentifier> carriers, Message result) {
    checkNotNull(carriers, "Allowed carriers list cannot be null.");
    IRadio radioProxy = getRadioProxy(result);
    if (radioProxy != null) {
        RILRequest rr = obtainRequest(RIL_REQUEST_SET_ALLOWED_CARRIERS, result, mRILDefaultWorkSource);
        if (RILJ_LOGD) {
            String logStr = "";
            for (int i = 0; i < carriers.size(); i++) {
                logStr = logStr + carriers.get(i) + " ";
            }
            riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " carriers = " + logStr);
        }
        boolean allAllowed;
        if (carriers.size() == 0) {
            allAllowed = true;
        } else {
            allAllowed = false;
        }
        CarrierRestrictions carrierList = new CarrierRestrictions();
        for (CarrierIdentifier ci : carriers) {
            /* allowed carriers */
            Carrier c = new Carrier();
            c.mcc = convertNullToEmptyString(ci.getMcc());
            c.mnc = convertNullToEmptyString(ci.getMnc());
            int matchType = CarrierIdentifier.MatchType.ALL;
            String matchData = null;
            if (!TextUtils.isEmpty(ci.getSpn())) {
                matchType = CarrierIdentifier.MatchType.SPN;
                matchData = ci.getSpn();
            } else if (!TextUtils.isEmpty(ci.getImsi())) {
                matchType = CarrierIdentifier.MatchType.IMSI_PREFIX;
                matchData = ci.getImsi();
            } else if (!TextUtils.isEmpty(ci.getGid1())) {
                matchType = CarrierIdentifier.MatchType.GID1;
                matchData = ci.getGid1();
            } else if (!TextUtils.isEmpty(ci.getGid2())) {
                matchType = CarrierIdentifier.MatchType.GID2;
                matchData = ci.getGid2();
            }
            c.matchType = matchType;
            c.matchData = convertNullToEmptyString(matchData);
            carrierList.allowedCarriers.add(c);
        }
        try {
            radioProxy.setAllowedCarriers(rr.mSerial, allAllowed, carrierList);
        } catch (RemoteException | RuntimeException e) {
            handleRadioProxyExceptionForRR(rr, "setAllowedCarriers", e);
        }
    }
}
Also used : IRadio(android.hardware.radio.V1_0.IRadio) CarrierRestrictions(android.hardware.radio.V1_0.CarrierRestrictions) CarrierIdentifier(android.service.carrier.CarrierIdentifier) Carrier(android.hardware.radio.V1_0.Carrier) RemoteException(android.os.RemoteException)

Example 3 with IRadio

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

the class RIL method dial.

@Override
public void dial(String address, int clirMode, UUSInfo uusInfo, Message result) {
    IRadio radioProxy = getRadioProxy(result);
    if (radioProxy != null) {
        RILRequest rr = obtainRequest(RIL_REQUEST_DIAL, result, mRILDefaultWorkSource);
        Dial dialInfo = new Dial();
        dialInfo.address = convertNullToEmptyString(address);
        dialInfo.clir = clirMode;
        if (uusInfo != null) {
            UusInfo info = new UusInfo();
            info.uusType = uusInfo.getType();
            info.uusDcs = uusInfo.getDcs();
            info.uusData = new String(uusInfo.getUserData());
            dialInfo.uusInfo.add(info);
        }
        if (RILJ_LOGD) {
            // Do not log function arg for privacy
            riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
        }
        try {
            radioProxy.dial(rr.mSerial, dialInfo);
        } catch (RemoteException | RuntimeException e) {
            handleRadioProxyExceptionForRR(rr, "dial", e);
        }
    }
}
Also used : IRadio(android.hardware.radio.V1_0.IRadio) Dial(android.hardware.radio.V1_0.Dial) UusInfo(android.hardware.radio.V1_0.UusInfo) RemoteException(android.os.RemoteException)

Example 4 with IRadio

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

the class RIL method getNeighboringCids.

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

Example 5 with IRadio

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

the class RIL method nvWriteItem.

@Override
public void nvWriteItem(int itemId, String itemValue, Message result) {
    IRadio radioProxy = getRadioProxy(result);
    if (radioProxy != null) {
        RILRequest rr = obtainRequest(RIL_REQUEST_NV_WRITE_ITEM, result, mRILDefaultWorkSource);
        if (RILJ_LOGD) {
            riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " itemId = " + itemId + " itemValue = " + itemValue);
        }
        NvWriteItem item = new NvWriteItem();
        item.itemId = itemId;
        item.value = convertNullToEmptyString(itemValue);
        try {
            radioProxy.nvWriteItem(rr.mSerial, item);
        } catch (RemoteException | RuntimeException e) {
            handleRadioProxyExceptionForRR(rr, "nvWriteItem", e);
        }
    }
}
Also used : IRadio(android.hardware.radio.V1_0.IRadio) NvWriteItem(android.hardware.radio.V1_0.NvWriteItem) 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