Search in sources :

Example 41 with IRadio

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

the class RIL method sendImsGsmSms.

@Override
public void sendImsGsmSms(String smscPdu, String 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.GSM_PHONE;
        msg.retry = (byte) retry >= 1 ? true : false;
        msg.messageRef = messageRef;
        GsmSmsMessage gsmMsg = constructGsmSendSmsRilRequest(smscPdu, pdu);
        msg.gsmMessage.add(gsmMsg);
        try {
            radioProxy.sendImsSms(rr.mSerial, msg);
            mMetrics.writeRilSendSms(mPhoneId, rr.mSerial, SmsSession.Event.Tech.SMS_IMS, SmsSession.Event.Format.SMS_FORMAT_3GPP);
        } catch (RemoteException | RuntimeException e) {
            handleRadioProxyExceptionForRR(rr, "sendImsGsmSms", e);
        }
    }
}
Also used : IRadio(android.hardware.radio.V1_0.IRadio) ImsSmsMessage(android.hardware.radio.V1_0.ImsSmsMessage) RemoteException(android.os.RemoteException) GsmSmsMessage(android.hardware.radio.V1_0.GsmSmsMessage)

Example 42 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, boolean isEmergencyCall, EmergencyNumber emergencyNumberInfo, boolean hasKnownUserIntentEmergency, int clirMode, UUSInfo uusInfo, Message result) {
    if (isEmergencyCall && mRadioVersion.greaterOrEqual(RADIO_HAL_VERSION_1_4) && emergencyNumberInfo != null) {
        emergencyDial(address, emergencyNumberInfo, hasKnownUserIntentEmergency, clirMode, uusInfo, result);
        return;
    }
    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 43 with IRadio

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

the class RIL method setCarrierInfoForImsiEncryption.

@Override
public void setCarrierInfoForImsiEncryption(ImsiEncryptionInfo imsiEncryptionInfo, Message result) {
    checkNotNull(imsiEncryptionInfo, "ImsiEncryptionInfo cannot be null.");
    IRadio radioProxy = getRadioProxy(result);
    if (radioProxy != null) {
        if (mRadioVersion.greaterOrEqual(RADIO_HAL_VERSION_1_1)) {
            android.hardware.radio.V1_1.IRadio radioProxy11 = (android.hardware.radio.V1_1.IRadio) radioProxy;
            RILRequest rr = obtainRequest(RIL_REQUEST_SET_CARRIER_INFO_IMSI_ENCRYPTION, result, mRILDefaultWorkSource);
            if (RILJ_LOGD)
                riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
            try {
                android.hardware.radio.V1_1.ImsiEncryptionInfo halImsiInfo = new android.hardware.radio.V1_1.ImsiEncryptionInfo();
                halImsiInfo.mnc = imsiEncryptionInfo.getMnc();
                halImsiInfo.mcc = imsiEncryptionInfo.getMcc();
                halImsiInfo.keyIdentifier = imsiEncryptionInfo.getKeyIdentifier();
                if (imsiEncryptionInfo.getExpirationTime() != null) {
                    halImsiInfo.expirationTime = imsiEncryptionInfo.getExpirationTime().getTime();
                }
                for (byte b : imsiEncryptionInfo.getPublicKey().getEncoded()) {
                    halImsiInfo.carrierKey.add(new Byte(b));
                }
                radioProxy11.setCarrierInfoForImsiEncryption(rr.mSerial, halImsiInfo);
            } catch (RemoteException | RuntimeException e) {
                handleRadioProxyExceptionForRR(rr, "setCarrierInfoForImsiEncryption", e);
            }
        } else if (result != null) {
            AsyncResult.forMessage(result, null, CommandException.fromRilErrno(REQUEST_NOT_SUPPORTED));
            result.sendToTarget();
        }
    }
}
Also used : ImsiEncryptionInfo(android.telephony.ImsiEncryptionInfo) IRadio(android.hardware.radio.V1_0.IRadio) RemoteException(android.os.RemoteException)

Example 44 with IRadio

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

the class RIL method sendAck.

/**
 * Function to send ack and acquire related wakelock
 */
private void sendAck() {
    // TODO: Remove rr and clean up acquireWakelock for response and ack
    RILRequest rr = RILRequest.obtain(RIL_RESPONSE_ACKNOWLEDGEMENT, null, mRILDefaultWorkSource);
    acquireWakeLock(rr, RIL.FOR_ACK_WAKELOCK);
    IRadio radioProxy = getRadioProxy(null);
    if (radioProxy != null) {
        try {
            radioProxy.responseAcknowledgement();
        } catch (RemoteException | RuntimeException e) {
            handleRadioProxyExceptionForRR(rr, "sendAck", e);
            riljLoge("sendAck: " + e);
        }
    } else {
        Rlog.e(RILJ_LOG_TAG, "Error trying to send ack, radioProxy = null");
    }
    rr.release();
}
Also used : IRadio(android.hardware.radio.V1_0.IRadio) RemoteException(android.os.RemoteException)

Example 45 with IRadio

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

the class RIL method setInitialAttachApn.

@Override
public void setInitialAttachApn(DataProfile dataProfile, boolean isRoaming, Message result) {
    IRadio radioProxy = getRadioProxy(result);
    if (radioProxy != null) {
        RILRequest rr = obtainRequest(RIL_REQUEST_SET_INITIAL_ATTACH_APN, result, mRILDefaultWorkSource);
        if (RILJ_LOGD) {
            riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + dataProfile);
        }
        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;
                radioProxy15.setInitialAttachApn_1_5(rr.mSerial, convertToHalDataProfile15(dataProfile));
            } 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;
                radioProxy14.setInitialAttachApn_1_4(rr.mSerial, convertToHalDataProfile14(dataProfile));
            } else {
                // v1.3, v1.2, v1.1, and v1.0
                radioProxy.setInitialAttachApn(rr.mSerial, convertToHalDataProfile10(dataProfile), dataProfile.isPersistent(), isRoaming);
            }
        } catch (RemoteException | RuntimeException e) {
            handleRadioProxyExceptionForRR(rr, "setInitialAttachApn", e);
        }
    }
}
Also used : 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