use of android.hardware.radio.V1_0.IRadio in project android_frameworks_opt_telephony by LineageOS.
the class RIL method areUiccApplicationsEnabled.
/**
* Whether uicc applications are enabled or not.
*
* @param onCompleteMessage a Message to return to the requester
*/
@Override
public void areUiccApplicationsEnabled(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_GET_UICC_APPLICATIONS_ENABLEMENT, onCompleteMessage, mRILDefaultWorkSource);
if (RILJ_LOGD)
riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
try {
radioProxy15.areUiccApplicationsEnabled(rr.mSerial);
} catch (RemoteException | RuntimeException e) {
handleRadioProxyExceptionForRR(rr, "areUiccApplicationsEnabled", e);
}
}
use of android.hardware.radio.V1_0.IRadio in project android_frameworks_opt_telephony by LineageOS.
the class RIL method getModemActivityInfo.
@Override
public void getModemActivityInfo(Message result) {
IRadio radioProxy = getRadioProxy(result);
if (radioProxy != null) {
RILRequest rr = obtainRequest(RIL_REQUEST_GET_ACTIVITY_INFO, result, mRILDefaultWorkSource);
if (RILJ_LOGD) {
riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
}
try {
radioProxy.getModemActivityInfo(rr.mSerial);
Message msg = mRilHandler.obtainMessage(EVENT_BLOCKING_RESPONSE_TIMEOUT);
msg.obj = null;
msg.arg1 = rr.mSerial;
mRilHandler.sendMessageDelayed(msg, DEFAULT_BLOCKING_MESSAGE_RESPONSE_TIMEOUT_MS);
} catch (RemoteException | RuntimeException e) {
handleRadioProxyExceptionForRR(rr, "getModemActivityInfo", e);
}
}
}
use of android.hardware.radio.V1_0.IRadio in project android_frameworks_opt_telephony by LineageOS.
the class RIL method stopNetworkScan.
@Override
public void stopNetworkScan(Message result) {
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_STOP_NETWORK_SCAN, result, mRILDefaultWorkSource);
if (RILJ_LOGD) {
riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
}
try {
radioProxy11.stopNetworkScan(rr.mSerial);
} catch (RemoteException | RuntimeException e) {
handleRadioProxyExceptionForRR(rr, "stopNetworkScan", 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 startNattKeepalive.
@Override
public void startNattKeepalive(int contextId, KeepalivePacketData packetData, int intervalMillis, Message result) {
checkNotNull(packetData, "KeepaliveRequest cannot be null.");
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_START_KEEPALIVE, result, mRILDefaultWorkSource);
if (RILJ_LOGD)
riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
try {
android.hardware.radio.V1_1.KeepaliveRequest req = new android.hardware.radio.V1_1.KeepaliveRequest();
req.cid = contextId;
if (packetData.getDstAddress() instanceof Inet4Address) {
req.type = android.hardware.radio.V1_1.KeepaliveType.NATT_IPV4;
} else if (packetData.getDstAddress() instanceof Inet6Address) {
req.type = android.hardware.radio.V1_1.KeepaliveType.NATT_IPV6;
} else {
AsyncResult.forMessage(result, null, CommandException.fromRilErrno(INVALID_ARGUMENTS));
result.sendToTarget();
return;
}
final InetAddress srcAddress = packetData.getSrcAddress();
final InetAddress dstAddress = packetData.getDstAddress();
appendPrimitiveArrayToArrayList(srcAddress.getAddress(), req.sourceAddress);
req.sourcePort = packetData.getSrcPort();
appendPrimitiveArrayToArrayList(dstAddress.getAddress(), req.destinationAddress);
req.destinationPort = packetData.getDstPort();
req.maxKeepaliveIntervalMillis = intervalMillis;
radioProxy11.startKeepalive(rr.mSerial, req);
} catch (RemoteException | RuntimeException e) {
handleRadioProxyExceptionForRR(rr, "startNattKeepalive", e);
}
}
use of android.hardware.radio.V1_0.IRadio in project android_frameworks_opt_telephony by LineageOS.
the class RIL method writeSmsToSim.
@Override
public void writeSmsToSim(int status, String smsc, String pdu, Message result) {
status = translateStatus(status);
IRadio radioProxy = getRadioProxy(result);
if (radioProxy != null) {
RILRequest rr = obtainRequest(RIL_REQUEST_WRITE_SMS_TO_SIM, result, mRILDefaultWorkSource);
if (RILJ_LOGV) {
riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " " + status);
}
SmsWriteArgs args = new SmsWriteArgs();
args.status = status;
args.smsc = convertNullToEmptyString(smsc);
args.pdu = convertNullToEmptyString(pdu);
try {
radioProxy.writeSmsToSim(rr.mSerial, args);
} catch (RemoteException | RuntimeException e) {
handleRadioProxyExceptionForRR(rr, "writeSmsToSim", e);
}
}
}
Aggregations