Search in sources :

Example 51 with IRadio

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

the class RIL method sendCdmaSms.

@Override
public void sendCdmaSms(byte[] pdu, Message result) {
    IRadio radioProxy = getRadioProxy(result);
    if (radioProxy != null) {
        RILRequest rr = obtainRequest(RIL_REQUEST_CDMA_SEND_SMS, result, mRILDefaultWorkSource);
        // Do not log function arg for privacy
        if (RILJ_LOGD)
            riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
        CdmaSmsMessage msg = new CdmaSmsMessage();
        constructCdmaSendSmsRilRequest(msg, pdu);
        try {
            radioProxy.sendCdmaSms(rr.mSerial, msg);
            mMetrics.writeRilSendSms(mPhoneId, rr.mSerial, SmsSession.Event.Tech.SMS_CDMA, SmsSession.Event.Format.SMS_FORMAT_3GPP2);
        } catch (RemoteException | RuntimeException e) {
            handleRadioProxyExceptionForRR(rr, "sendCdmaSms", e);
        }
    }
}
Also used : IRadio(android.hardware.radio.V1_0.IRadio) CdmaSmsMessage(android.hardware.radio.V1_0.CdmaSmsMessage) RemoteException(android.os.RemoteException)

Example 52 with IRadio

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

the class RIL method enableUiccApplications.

/**
 * Enable or disable uicc applications on the SIM.
 *
 * @param enable whether to enable or disable uicc applications.
 * @param onCompleteMessage a Message to return to the requester
 */
@Override
public void enableUiccApplications(boolean enable, 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_ENABLE_UICC_APPLICATIONS, onCompleteMessage, mRILDefaultWorkSource);
    if (RILJ_LOGD)
        riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
    try {
        radioProxy15.enableUiccApplications(rr.mSerial, enable);
    } catch (RemoteException | RuntimeException e) {
        handleRadioProxyExceptionForRR(rr, "enableUiccApplications", e);
    }
}
Also used : IRadio(android.hardware.radio.V1_0.IRadio) RemoteException(android.os.RemoteException)

Example 53 with IRadio

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

the class RIL method getDataRegistrationState.

@Override
public void getDataRegistrationState(Message result) {
    IRadio radioProxy = getRadioProxy(result);
    if (radioProxy != null) {
        RILRequest rr = obtainRequest(RIL_REQUEST_DATA_REGISTRATION_STATE, result, mRILDefaultWorkSource);
        if (RILJ_LOGD)
            riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
        HalVersion overrideHalVersion = getCompatVersion(RIL_REQUEST_DATA_REGISTRATION_STATE);
        if (RILJ_LOGD) {
            riljLog("getDataRegistrationState: overrideHalVersion=" + overrideHalVersion);
        }
        if ((overrideHalVersion == null || overrideHalVersion.greaterOrEqual(RADIO_HAL_VERSION_1_5)) && mRadioVersion.greaterOrEqual(RADIO_HAL_VERSION_1_5)) {
            final android.hardware.radio.V1_5.IRadio radioProxy15 = (android.hardware.radio.V1_5.IRadio) radioProxy;
            try {
                radioProxy15.getDataRegistrationState_1_5(rr.mSerial);
            } catch (RemoteException | RuntimeException e) {
                handleRadioProxyExceptionForRR(rr, "getDataRegistrationState_1_5", e);
            }
        } else {
            try {
                radioProxy.getDataRegistrationState(rr.mSerial);
            } catch (RemoteException | RuntimeException e) {
                handleRadioProxyExceptionForRR(rr, "getDataRegistrationState", e);
            }
        }
    }
}
Also used : IRadio(android.hardware.radio.V1_0.IRadio) RemoteException(android.os.RemoteException)

Example 54 with IRadio

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

the class RIL method acceptCall.

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

Example 55 with IRadio

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

the class RIL method setSystemSelectionChannels.

@Override
public void setSystemSelectionChannels(@NonNull List<RadioAccessSpecifier> specifiers, Message onComplete) {
    IRadio radioProxy = getRadioProxy(onComplete);
    if (mRadioVersion.less(RADIO_HAL_VERSION_1_3)) {
        if (RILJ_LOGV)
            riljLog("setSystemSelectionChannels: not supported.");
        if (onComplete != null) {
            AsyncResult.forMessage(onComplete, null, CommandException.fromRilErrno(REQUEST_NOT_SUPPORTED));
            onComplete.sendToTarget();
        }
        return;
    }
    RILRequest rr = obtainRequest(RIL_REQUEST_SET_SYSTEM_SELECTION_CHANNELS, onComplete, mRILDefaultWorkSource);
    if (mRadioVersion.less(RADIO_HAL_VERSION_1_5)) {
        android.hardware.radio.V1_3.IRadio radioProxy13 = (android.hardware.radio.V1_3.IRadio) radioProxy;
        if (radioProxy13 != null) {
            if (RILJ_LOGD) {
                riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " setSystemSelectionChannels_1.3= " + specifiers);
            }
            ArrayList<android.hardware.radio.V1_1.RadioAccessSpecifier> halSpecifiers = specifiers.stream().map(this::convertRadioAccessSpecifierToRadioHAL).collect(Collectors.toCollection(ArrayList::new));
            try {
                radioProxy13.setSystemSelectionChannels(rr.mSerial, !halSpecifiers.isEmpty(), halSpecifiers);
            } catch (RemoteException | RuntimeException e) {
                handleRadioProxyExceptionForRR(rr, "setSystemSelectionChannels", e);
            }
        }
    }
    if (mRadioVersion.greaterOrEqual(RADIO_HAL_VERSION_1_5)) {
        android.hardware.radio.V1_5.IRadio radioProxy15 = (android.hardware.radio.V1_5.IRadio) radioProxy;
        if (radioProxy15 != null) {
            if (RILJ_LOGD) {
                riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " setSystemSelectionChannels_1.5= " + specifiers);
            }
            ArrayList<android.hardware.radio.V1_5.RadioAccessSpecifier> halSpecifiers = specifiers.stream().map(this::convertRadioAccessSpecifierToRadioHAL_1_5).collect(Collectors.toCollection(ArrayList::new));
            try {
                radioProxy15.setSystemSelectionChannels_1_5(rr.mSerial, !halSpecifiers.isEmpty(), halSpecifiers);
            } catch (RemoteException | RuntimeException e) {
                handleRadioProxyExceptionForRR(rr, "setSystemSelectionChannels", e);
            }
        }
    }
}
Also used : RadioAccessSpecifier(android.telephony.RadioAccessSpecifier) IRadio(android.hardware.radio.V1_0.IRadio) 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