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