use of android.hardware.radio.V1_0.IRadio in project android_frameworks_opt_telephony by LineageOS.
the class RIL method setLinkCapacityReportingCriteria.
@Override
public void setLinkCapacityReportingCriteria(int hysteresisMs, int hysteresisDlKbps, int hysteresisUlKbps, int[] thresholdsDlKbps, int[] thresholdsUlKbps, int ran, Message result) {
IRadio radioProxy = getRadioProxy(result);
if (radioProxy != null) {
RILRequest rr = obtainRequest(RIL_REQUEST_SET_LINK_CAPACITY_REPORTING_CRITERIA, result, mRILDefaultWorkSource);
if (RILJ_LOGD) {
riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
}
try {
if (mRadioVersion.greaterOrEqual(RADIO_HAL_VERSION_1_5)) {
android.hardware.radio.V1_5.IRadio radioProxy15 = (android.hardware.radio.V1_5.IRadio) radioProxy;
radioProxy15.setLinkCapacityReportingCriteria_1_5(rr.mSerial, hysteresisMs, hysteresisDlKbps, hysteresisUlKbps, primitiveArrayToArrayList(thresholdsDlKbps), primitiveArrayToArrayList(thresholdsUlKbps), convertAntToHalAnt(ran));
} else if (mRadioVersion.greaterOrEqual(RADIO_HAL_VERSION_1_2)) {
android.hardware.radio.V1_2.IRadio radioProxy12 = (android.hardware.radio.V1_2.IRadio) radioProxy;
if (ran == AccessNetworkType.NGRAN) {
throw new RuntimeException("NGRAN unsupported on IRadio version 1.2.");
}
radioProxy12.setLinkCapacityReportingCriteria(rr.mSerial, hysteresisMs, hysteresisDlKbps, hysteresisUlKbps, primitiveArrayToArrayList(thresholdsDlKbps), primitiveArrayToArrayList(thresholdsUlKbps), convertAntToHalAnt(ran));
} else {
riljLoge("setLinkCapacityReportingCriteria ignored on IRadio version less " + "than 1.2");
}
} catch (RemoteException | RuntimeException e) {
handleRadioProxyExceptionForRR(rr, "setLinkCapacityReportingCriteria", e);
}
}
}
use of android.hardware.radio.V1_0.IRadio in project android_frameworks_opt_telephony by LineageOS.
the class RIL method setGsmBroadcastConfig.
@Override
public void setGsmBroadcastConfig(SmsBroadcastConfigInfo[] config, Message result) {
IRadio radioProxy = getRadioProxy(result);
if (radioProxy != null) {
RILRequest rr = obtainRequest(RIL_REQUEST_GSM_SET_BROADCAST_CONFIG, result, mRILDefaultWorkSource);
if (RILJ_LOGD) {
riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " with " + config.length + " configs : ");
for (int i = 0; i < config.length; i++) {
riljLog(config[i].toString());
}
}
ArrayList<GsmBroadcastSmsConfigInfo> configs = new ArrayList<>();
int numOfConfig = config.length;
GsmBroadcastSmsConfigInfo info;
for (int i = 0; i < numOfConfig; i++) {
info = new GsmBroadcastSmsConfigInfo();
info.fromServiceId = config[i].getFromServiceId();
info.toServiceId = config[i].getToServiceId();
info.fromCodeScheme = config[i].getFromCodeScheme();
info.toCodeScheme = config[i].getToCodeScheme();
info.selected = config[i].isSelected();
configs.add(info);
}
try {
radioProxy.setGsmBroadcastConfig(rr.mSerial, configs);
} catch (RemoteException | RuntimeException e) {
handleRadioProxyExceptionForRR(rr, "setGsmBroadcastConfig", e);
}
}
}
use of android.hardware.radio.V1_0.IRadio in project android_frameworks_opt_telephony by LineageOS.
the class RIL method deactivateDataCall.
@Override
public void deactivateDataCall(int cid, int reason, Message result) {
IRadio radioProxy = getRadioProxy(result);
if (radioProxy != null) {
RILRequest rr = obtainRequest(RIL_REQUEST_DEACTIVATE_DATA_CALL, result, mRILDefaultWorkSource);
if (RILJ_LOGD) {
riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " cid = " + cid + " reason = " + reason);
}
try {
if (mRadioVersion.greaterOrEqual(RADIO_HAL_VERSION_1_2)) {
android.hardware.radio.V1_2.IRadio radioProxy12 = (android.hardware.radio.V1_2.IRadio) radioProxy;
radioProxy12.deactivateDataCall_1_2(rr.mSerial, cid, reason);
} else {
radioProxy.deactivateDataCall(rr.mSerial, cid, (reason == DataService.REQUEST_REASON_SHUTDOWN));
}
mMetrics.writeRilDeactivateDataCall(mPhoneId, rr.mSerial, cid, reason);
} catch (RemoteException | RuntimeException e) {
handleRadioProxyExceptionForRR(rr, "deactivateDataCall", e);
}
}
}
use of android.hardware.radio.V1_0.IRadio in project android_frameworks_opt_telephony by LineageOS.
the class RIL method iccTransmitApduBasicChannel.
@Override
public void iccTransmitApduBasicChannel(int cla, int instruction, int p1, int p2, int p3, String data, Message result) {
IRadio radioProxy = getRadioProxy(result);
if (radioProxy != null) {
RILRequest rr = obtainRequest(RIL_REQUEST_SIM_TRANSMIT_APDU_BASIC, result, mRILDefaultWorkSource);
if (RILJ_LOGD) {
if (TelephonyUtils.IS_DEBUGGABLE) {
riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + String.format(" cla = 0x%02X ins = 0x%02X", cla, instruction) + String.format(" p1 = 0x%02X p2 = 0x%02X p3 = 0x%02X", p1, p2, p3) + " data = " + data);
} else {
riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
}
}
SimApdu msg = createSimApdu(0, cla, instruction, p1, p2, p3, data);
try {
radioProxy.iccTransmitApduBasicChannel(rr.mSerial, msg);
} catch (RemoteException | RuntimeException e) {
handleRadioProxyExceptionForRR(rr, "iccTransmitApduBasicChannel", e);
}
}
}
use of android.hardware.radio.V1_0.IRadio in project android_frameworks_opt_telephony by LineageOS.
the class RIL method acknowledgeLastIncomingCdmaSms.
@Override
public void acknowledgeLastIncomingCdmaSms(boolean success, int cause, Message result) {
IRadio radioProxy = getRadioProxy(result);
if (radioProxy != null) {
RILRequest rr = obtainRequest(RIL_REQUEST_CDMA_SMS_ACKNOWLEDGE, result, mRILDefaultWorkSource);
if (RILJ_LOGD) {
riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " success = " + success + " cause = " + cause);
}
CdmaSmsAck msg = new CdmaSmsAck();
msg.errorClass = success ? 0 : 1;
msg.smsCauseCode = cause;
try {
radioProxy.acknowledgeLastIncomingCdmaSms(rr.mSerial, msg);
} catch (RemoteException | RuntimeException e) {
handleRadioProxyExceptionForRR(rr, "acknowledgeLastIncomingCdmaSms", e);
}
}
}
Aggregations