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);
}
}
}
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);
}
}
}
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();
}
}
}
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();
}
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);
}
}
}
Aggregations