use of android.hardware.radio.V1_0.IRadio in project android_frameworks_opt_telephony by LineageOS.
the class RIL method sendUSSD.
@Override
public void sendUSSD(String ussd, Message result) {
IRadio radioProxy = getRadioProxy(result);
if (radioProxy != null) {
RILRequest rr = obtainRequest(RIL_REQUEST_SEND_USSD, result, mRILDefaultWorkSource);
if (RILJ_LOGD) {
String logUssd = "*******";
if (RILJ_LOGV)
logUssd = ussd;
riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " ussd = " + logUssd);
}
try {
radioProxy.sendUssd(rr.mSerial, convertNullToEmptyString(ussd));
} catch (RemoteException | RuntimeException e) {
handleRadioProxyExceptionForRR(rr, "sendUSSD", e);
}
}
}
use of android.hardware.radio.V1_0.IRadio in project android_frameworks_opt_telephony by LineageOS.
the class RIL method getModemStatus.
@Override
public void getModemStatus(Message result) {
IRadio radioProxy = getRadioProxy(result);
if (mRadioVersion.less(RADIO_HAL_VERSION_1_3)) {
if (RILJ_LOGV)
riljLog("getModemStatus: not supported.");
if (result != null) {
AsyncResult.forMessage(result, null, CommandException.fromRilErrno(REQUEST_NOT_SUPPORTED));
result.sendToTarget();
}
return;
}
android.hardware.radio.V1_3.IRadio radioProxy13 = (android.hardware.radio.V1_3.IRadio) radioProxy;
if (radioProxy13 != null) {
RILRequest rr = obtainRequest(RIL_REQUEST_GET_MODEM_STATUS, result, mRILDefaultWorkSource);
if (RILJ_LOGD) {
riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
}
try {
radioProxy13.getModemStackStatus(rr.mSerial);
} catch (RemoteException | RuntimeException e) {
handleRadioProxyExceptionForRR(rr, "getModemStatus", e);
}
}
}
use of android.hardware.radio.V1_0.IRadio in project android_frameworks_opt_telephony by LineageOS.
the class RIL method setupDataCall.
@Override
public void setupDataCall(int accessNetworkType, DataProfile dataProfile, boolean isRoaming, boolean allowRoaming, int reason, LinkProperties linkProperties, Message result) {
IRadio radioProxy = getRadioProxy(result);
if (radioProxy != null) {
RILRequest rr = obtainRequest(RIL_REQUEST_SETUP_DATA_CALL, result, mRILDefaultWorkSource);
ArrayList<String> addresses = new ArrayList<>();
ArrayList<String> dnses = new ArrayList<>();
if (linkProperties != null) {
for (InetAddress address : linkProperties.getAddresses()) {
addresses.add(address.getHostAddress());
}
for (InetAddress dns : linkProperties.getDnsServers()) {
dnses.add(dns.getHostAddress());
}
}
try {
if (mRadioVersion.greaterOrEqual(RADIO_HAL_VERSION_1_5)) {
// IRadio V1.5
android.hardware.radio.V1_5.IRadio radioProxy15 = (android.hardware.radio.V1_5.IRadio) radioProxy;
// Convert to HAL data profile
android.hardware.radio.V1_5.DataProfileInfo dpi = convertToHalDataProfile15(dataProfile);
ArrayList<android.hardware.radio.V1_5.LinkAddress> addresses15 = new ArrayList<>();
if (linkProperties != null) {
for (LinkAddress la : linkProperties.getAllLinkAddresses()) {
android.hardware.radio.V1_5.LinkAddress linkAddress = new android.hardware.radio.V1_5.LinkAddress();
linkAddress.address = la.getAddress().getHostAddress();
linkAddress.properties = la.getFlags();
linkAddress.deprecationTime = la.getDeprecationTime();
linkAddress.expirationTime = la.getExpirationTime();
addresses15.add(linkAddress);
}
}
if (RILJ_LOGD) {
riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + ",accessNetworkType=" + AccessNetworkType.toString(accessNetworkType) + ",isRoaming=" + isRoaming + ",allowRoaming=" + allowRoaming + "," + dataProfile + ",addresses=" + addresses15 + ",dnses=" + dnses);
}
radioProxy15.setupDataCall_1_5(rr.mSerial, accessNetworkType, dpi, allowRoaming, reason, addresses15, dnses);
} else if (mRadioVersion.greaterOrEqual(RADIO_HAL_VERSION_1_4)) {
// IRadio V1.4
android.hardware.radio.V1_4.IRadio radioProxy14 = (android.hardware.radio.V1_4.IRadio) radioProxy;
// Convert to HAL data profile
android.hardware.radio.V1_4.DataProfileInfo dpi = convertToHalDataProfile14(dataProfile);
if (RILJ_LOGD) {
riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + ",accessNetworkType=" + AccessNetworkType.toString(accessNetworkType) + ",isRoaming=" + isRoaming + ",allowRoaming=" + allowRoaming + "," + dataProfile + ",addresses=" + addresses + ",dnses=" + dnses);
}
radioProxy14.setupDataCall_1_4(rr.mSerial, accessNetworkType, dpi, allowRoaming, reason, addresses, dnses);
} else if (mRadioVersion.greaterOrEqual(RADIO_HAL_VERSION_1_2)) {
// IRadio V1.2 and IRadio V1.3
android.hardware.radio.V1_2.IRadio radioProxy12 = (android.hardware.radio.V1_2.IRadio) radioProxy;
// Convert to HAL data profile
android.hardware.radio.V1_0.DataProfileInfo dpi = convertToHalDataProfile10(dataProfile);
if (RILJ_LOGD) {
riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + ",accessNetworkType=" + AccessNetworkType.toString(accessNetworkType) + ",isRoaming=" + isRoaming + ",allowRoaming=" + allowRoaming + "," + dataProfile + ",addresses=" + addresses + ",dnses=" + dnses);
}
radioProxy12.setupDataCall_1_2(rr.mSerial, accessNetworkType, dpi, dataProfile.isPersistent(), allowRoaming, isRoaming, reason, addresses, dnses);
} else {
// IRadio V1.0 and IRadio V1.1
// Convert to HAL data profile
android.hardware.radio.V1_0.DataProfileInfo dpi = convertToHalDataProfile10(dataProfile);
// Getting data RAT here is just a workaround to support the older 1.0
// vendor RIL. The new data service interface passes access network type
// instead of RAT for setup data request. It is impossible to convert access
// network type back to RAT here, so we directly get the data RAT from
// phone.
int dataRat = ServiceState.RIL_RADIO_TECHNOLOGY_UNKNOWN;
Phone phone = PhoneFactory.getPhone(mPhoneId);
if (phone != null) {
ServiceState ss = phone.getServiceState();
if (ss != null) {
dataRat = ss.getRilDataRadioTechnology();
}
}
if (RILJ_LOGD) {
riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + ",dataRat=" + dataRat + ",isRoaming=" + isRoaming + ",allowRoaming=" + allowRoaming + "," + dataProfile);
}
radioProxy.setupDataCall(rr.mSerial, dataRat, dpi, dataProfile.isPersistent(), allowRoaming, isRoaming);
}
} catch (RemoteException | RuntimeException e) {
handleRadioProxyExceptionForRR(rr, "setupDataCall", e);
}
}
}
use of android.hardware.radio.V1_0.IRadio in project android_frameworks_opt_telephony by LineageOS.
the class RIL method getCellInfoList.
@Override
public void getCellInfoList(Message result, WorkSource workSource) {
workSource = getDeafultWorkSourceIfInvalid(workSource);
IRadio radioProxy = getRadioProxy(result);
if (radioProxy != null) {
RILRequest rr = obtainRequest(RIL_REQUEST_GET_CELL_INFO_LIST, result, workSource);
if (RILJ_LOGD) {
riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
}
try {
radioProxy.getCellInfoList(rr.mSerial);
} catch (RemoteException | RuntimeException e) {
handleRadioProxyExceptionForRR(rr, "getCellInfoList", e);
}
}
}
use of android.hardware.radio.V1_0.IRadio in project android_frameworks_opt_telephony by LineageOS.
the class RIL method setUiccSubscription.
@Override
public void setUiccSubscription(int appIndex, boolean activate, Message result) {
IRadio radioProxy = getRadioProxy(result);
if (radioProxy != null) {
RILRequest rr = obtainRequest(RIL_REQUEST_SET_UICC_SUBSCRIPTION, result, mRILDefaultWorkSource);
if (RILJ_LOGD) {
riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " appIndex: " + appIndex + " activate: " + activate);
}
SelectUiccSub info = new SelectUiccSub();
info.slot = mPhoneId;
info.appIndex = appIndex;
info.subType = mPhoneId;
info.actStatus = activate ? 1 : 0;
try {
radioProxy.setUiccSubscription(rr.mSerial, info);
} catch (RemoteException | RuntimeException e) {
handleRadioProxyExceptionForRR(rr, "setUiccSubscription", e);
}
}
}
Aggregations