use of android.hardware.radio.V1_0.IRadio in project android_frameworks_opt_telephony by LineageOS.
the class RIL method setSimCardPower.
@Override
public void setSimCardPower(int state, Message result) {
IRadio radioProxy = getRadioProxy(result);
if (radioProxy != null) {
RILRequest rr = obtainRequest(RIL_REQUEST_SET_SIM_CARD_POWER, result, mRILDefaultWorkSource);
if (RILJ_LOGD) {
riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " " + state);
}
android.hardware.radio.V1_1.IRadio radioProxy11 = android.hardware.radio.V1_1.IRadio.castFrom(radioProxy);
if (radioProxy11 == null) {
try {
switch(state) {
case TelephonyManager.CARD_POWER_DOWN:
{
radioProxy.setSimCardPower(rr.mSerial, false);
break;
}
case TelephonyManager.CARD_POWER_UP:
{
radioProxy.setSimCardPower(rr.mSerial, true);
break;
}
default:
{
if (result != null) {
AsyncResult.forMessage(result, null, CommandException.fromRilErrno(REQUEST_NOT_SUPPORTED));
result.sendToTarget();
}
}
}
} catch (RemoteException | RuntimeException e) {
handleRadioProxyExceptionForRR(rr, "setSimCardPower", e);
}
} else {
try {
radioProxy11.setSimCardPower_1_1(rr.mSerial, state);
} catch (RemoteException | RuntimeException e) {
handleRadioProxyExceptionForRR(rr, "setSimCardPower", e);
}
}
}
}
use of android.hardware.radio.V1_0.IRadio in project android_frameworks_opt_telephony by LineageOS.
the class RIL method writeSmsToRuim.
@Override
public void writeSmsToRuim(int status, String pdu, Message result) {
status = translateStatus(status);
IRadio radioProxy = getRadioProxy(result);
if (radioProxy != null) {
RILRequest rr = obtainRequest(RIL_REQUEST_CDMA_WRITE_SMS_TO_RUIM, result, mRILDefaultWorkSource);
if (RILJ_LOGV) {
riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " status = " + status);
}
CdmaSmsWriteArgs args = new CdmaSmsWriteArgs();
args.status = status;
constructCdmaSendSmsRilRequest(args.message, pdu.getBytes());
try {
radioProxy.writeSmsToRuim(rr.mSerial, args);
} catch (RemoteException | RuntimeException e) {
handleRadioProxyExceptionForRR(rr, "writeSmsToRuim", e);
}
}
}
use of android.hardware.radio.V1_0.IRadio in project android_frameworks_opt_telephony by LineageOS.
the class RIL method stopNattKeepalive.
@Override
public void stopNattKeepalive(int sessionHandle, Message result) {
IRadio radioProxy = getRadioProxy(result);
if (radioProxy == null)
return;
if (mRadioVersion.less(RADIO_HAL_VERSION_1_1)) {
if (result != null) {
AsyncResult.forMessage(result, null, CommandException.fromRilErrno(REQUEST_NOT_SUPPORTED));
result.sendToTarget();
}
return;
}
android.hardware.radio.V1_1.IRadio radioProxy11 = (android.hardware.radio.V1_1.IRadio) radioProxy;
RILRequest rr = obtainRequest(RIL_REQUEST_STOP_KEEPALIVE, result, mRILDefaultWorkSource);
if (RILJ_LOGD)
riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
try {
radioProxy11.stopKeepalive(rr.mSerial, sessionHandle);
} catch (RemoteException | RuntimeException e) {
handleRadioProxyExceptionForRR(rr, "stopNattKeepalive", e);
}
}
use of android.hardware.radio.V1_0.IRadio in project android_frameworks_opt_telephony by LineageOS.
the class RIL method sendSMS.
@Override
public void sendSMS(String smscPdu, String pdu, Message result) {
IRadio radioProxy = getRadioProxy(result);
if (radioProxy != null) {
RILRequest rr = obtainRequest(RIL_REQUEST_SEND_SMS, result, mRILDefaultWorkSource);
// Do not log function args for privacy
if (RILJ_LOGD)
riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
GsmSmsMessage msg = constructGsmSendSmsRilRequest(smscPdu, pdu);
try {
radioProxy.sendSms(rr.mSerial, msg);
mMetrics.writeRilSendSms(mPhoneId, rr.mSerial, SmsSession.Event.Tech.SMS_GSM, SmsSession.Event.Format.SMS_FORMAT_3GPP);
} catch (RemoteException | RuntimeException e) {
handleRadioProxyExceptionForRR(rr, "sendSMS", e);
}
}
}
use of android.hardware.radio.V1_0.IRadio in project android_frameworks_opt_telephony by LineageOS.
the class RIL method getBarringInfo.
/**
* {@inheritDoc}
*/
@Override
public void getBarringInfo(Message result) {
IRadio radioProxy = getRadioProxy(result);
if (radioProxy == null)
return;
if (mRadioVersion.less(RADIO_HAL_VERSION_1_5)) {
if (result != null) {
AsyncResult.forMessage(result, null, CommandException.fromRilErrno(REQUEST_NOT_SUPPORTED));
result.sendToTarget();
}
return;
}
android.hardware.radio.V1_5.IRadio radioProxy15 = (android.hardware.radio.V1_5.IRadio) radioProxy;
if (radioProxy15 != null) {
RILRequest rr = obtainRequest(RIL_REQUEST_GET_BARRING_INFO, result, mRILDefaultWorkSource);
if (RILJ_LOGD)
riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
try {
radioProxy15.getBarringInfo(rr.mSerial);
} catch (RemoteException | RuntimeException e) {
handleRadioProxyExceptionForRR(rr, "getBarringInfo", e);
}
}
}
Aggregations