use of android.hardware.radio.V1_5.IRadio in project android_frameworks_opt_telephony by LineageOS.
the class RIL method sendImsCdmaSms.
@Override
public void sendImsCdmaSms(byte[] 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.CDMA_PHONE;
msg.retry = (byte) retry >= 1 ? true : false;
msg.messageRef = messageRef;
CdmaSmsMessage cdmaMsg = new CdmaSmsMessage();
constructCdmaSendSmsRilRequest(cdmaMsg, pdu);
msg.cdmaMessage.add(cdmaMsg);
try {
radioProxy.sendImsSms(rr.mSerial, msg);
mMetrics.writeRilSendSms(mPhoneId, rr.mSerial, SmsSession.Event.Tech.SMS_IMS, SmsSession.Event.Format.SMS_FORMAT_3GPP2);
} catch (RemoteException | RuntimeException e) {
handleRadioProxyExceptionForRR(rr, "sendImsCdmaSms", e);
}
}
}
use of android.hardware.radio.V1_5.IRadio in project android_frameworks_opt_telephony by LineageOS.
the class RIL method nvWriteCdmaPrl.
@Override
public void nvWriteCdmaPrl(byte[] preferredRoamingList, Message result) {
IRadio radioProxy = getRadioProxy(result);
if (radioProxy != null) {
RILRequest rr = obtainRequest(RIL_REQUEST_NV_WRITE_CDMA_PRL, result, mRILDefaultWorkSource);
if (RILJ_LOGD) {
riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " PreferredRoamingList = 0x" + IccUtils.bytesToHexString(preferredRoamingList));
}
ArrayList<Byte> arrList = new ArrayList<>();
for (int i = 0; i < preferredRoamingList.length; i++) {
arrList.add(preferredRoamingList[i]);
}
try {
radioProxy.nvWriteCdmaPrl(rr.mSerial, arrList);
} catch (RemoteException | RuntimeException e) {
handleRadioProxyExceptionForRR(rr, "nvWriteCdmaPrl", e);
}
}
}
use of android.hardware.radio.V1_5.IRadio in project android_frameworks_opt_telephony by LineageOS.
the class RIL method setRadioCapability.
@Override
public void setRadioCapability(RadioCapability rc, Message response) {
IRadio radioProxy = getRadioProxy(response);
if (radioProxy != null) {
RILRequest rr = obtainRequest(RIL_REQUEST_SET_RADIO_CAPABILITY, response, mRILDefaultWorkSource);
if (RILJ_LOGD) {
riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " RadioCapability = " + rc.toString());
}
android.hardware.radio.V1_0.RadioCapability halRc = new android.hardware.radio.V1_0.RadioCapability();
halRc.session = rc.getSession();
halRc.phase = rc.getPhase();
halRc.raf = rc.getRadioAccessFamily();
halRc.logicalModemUuid = convertNullToEmptyString(rc.getLogicalModemUuid());
halRc.status = rc.getStatus();
try {
radioProxy.setRadioCapability(rr.mSerial, halRc);
} catch (Exception e) {
handleRadioProxyExceptionForRR(rr, "setRadioCapability", e);
}
}
}
use of android.hardware.radio.V1_5.IRadio in project android_frameworks_opt_telephony by LineageOS.
the class RIL method setNetworkSelectionModeManual.
@Override
public void setNetworkSelectionModeManual(String operatorNumeric, int ran, Message result) {
IRadio radioProxy = getRadioProxy(result);
if (radioProxy != null) {
RILRequest rr = obtainRequest(RIL_REQUEST_SET_NETWORK_SELECTION_MANUAL, result, mRILDefaultWorkSource);
if (mUseOldMncMccFormat && !TextUtils.isEmpty(operatorNumeric)) {
operatorNumeric += "+";
}
try {
int halRan = convertAntToRan(ran);
if (mRadioVersion.greaterOrEqual(RADIO_HAL_VERSION_1_5)) {
android.hardware.radio.V1_5.IRadio radioProxy15 = (android.hardware.radio.V1_5.IRadio) radioProxy;
if (RILJ_LOGD) {
riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " operatorNumeric = " + operatorNumeric + ", ran = " + halRan);
}
radioProxy15.setNetworkSelectionModeManual_1_5(rr.mSerial, convertNullToEmptyString(operatorNumeric), halRan);
} else {
if (RILJ_LOGD) {
riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " operatorNumeric = " + operatorNumeric);
}
radioProxy.setNetworkSelectionModeManual(rr.mSerial, convertNullToEmptyString(operatorNumeric));
}
} catch (RemoteException | RuntimeException e) {
handleRadioProxyExceptionForRR(rr, "setNetworkSelectionModeManual", e);
}
}
}
use of android.hardware.radio.V1_5.IRadio in project android_frameworks_opt_telephony by LineageOS.
the class RIL method setDataProfile.
@Override
public void setDataProfile(DataProfile[] dps, boolean isRoaming, Message result) {
IRadio radioProxy = getRadioProxy(result);
if (radioProxy != null) {
RILRequest rr = null;
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;
rr = obtainRequest(RIL_REQUEST_SET_DATA_PROFILE, result, mRILDefaultWorkSource);
ArrayList<android.hardware.radio.V1_5.DataProfileInfo> dpis = new ArrayList<>();
for (DataProfile dp : dps) {
dpis.add(convertToHalDataProfile15(dp));
}
if (RILJ_LOGD) {
riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " with data profiles : ");
for (DataProfile profile : dps) {
riljLog(profile.toString());
}
}
radioProxy15.setDataProfile_1_5(rr.mSerial, dpis);
} 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;
rr = obtainRequest(RIL_REQUEST_SET_DATA_PROFILE, result, mRILDefaultWorkSource);
ArrayList<android.hardware.radio.V1_4.DataProfileInfo> dpis = new ArrayList<>();
for (DataProfile dp : dps) {
dpis.add(convertToHalDataProfile14(dp));
}
if (RILJ_LOGD) {
riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " with data profiles : ");
for (DataProfile profile : dps) {
riljLog(profile.toString());
}
}
radioProxy14.setDataProfile_1_4(rr.mSerial, dpis);
} else {
// V1.0, 1.1, 1,2 and 1.3
ArrayList<android.hardware.radio.V1_0.DataProfileInfo> dpis = new ArrayList<>();
for (DataProfile dp : dps) {
// (a.k.a modem cognitive) bit set to true.
if (dp.isPersistent()) {
dpis.add(convertToHalDataProfile10(dp));
}
}
if (!dpis.isEmpty()) {
rr = obtainRequest(RIL_REQUEST_SET_DATA_PROFILE, result, mRILDefaultWorkSource);
if (RILJ_LOGD) {
riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " with data profiles : ");
for (DataProfile profile : dps) {
riljLog(profile.toString());
}
}
radioProxy.setDataProfile(rr.mSerial, dpis, isRoaming);
}
}
} catch (RemoteException | RuntimeException e) {
handleRadioProxyExceptionForRR(rr, "setDataProfile", e);
}
}
}
Aggregations