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 radioTechnology, DataProfile dataProfile, boolean isRoaming, boolean allowRoaming, Message result) {
IRadio radioProxy = getRadioProxy(result);
if (radioProxy != null) {
RILRequest rr = obtainRequest(RIL_REQUEST_SETUP_DATA_CALL, result, mRILDefaultWorkSource);
// Convert to HAL data profile
DataProfileInfo dpi = convertToHalDataProfile(dataProfile);
if (RILJ_LOGD) {
riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + ",radioTechnology=" + radioTechnology + ",isRoaming=" + isRoaming + ",allowRoaming=" + allowRoaming + "," + dataProfile);
}
try {
radioProxy.setupDataCall(rr.mSerial, radioTechnology, dpi, dataProfile.modemCognitive, allowRoaming, isRoaming);
mMetrics.writeRilSetupDataCall(mPhoneId, rr.mSerial, radioTechnology, dpi.profileId, dpi.apn, dpi.authType, dpi.protocol);
} 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 setAllowedCarriers.
@Override
public void setAllowedCarriers(List<CarrierIdentifier> carriers, Message result) {
checkNotNull(carriers, "Allowed carriers list cannot be null.");
IRadio radioProxy = getRadioProxy(result);
if (radioProxy != null) {
RILRequest rr = obtainRequest(RIL_REQUEST_SET_ALLOWED_CARRIERS, result, mRILDefaultWorkSource);
if (RILJ_LOGD) {
String logStr = "";
for (int i = 0; i < carriers.size(); i++) {
logStr = logStr + carriers.get(i) + " ";
}
riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " carriers = " + logStr);
}
boolean allAllowed;
if (carriers.size() == 0) {
allAllowed = true;
} else {
allAllowed = false;
}
CarrierRestrictions carrierList = new CarrierRestrictions();
for (CarrierIdentifier ci : carriers) {
/* allowed carriers */
Carrier c = new Carrier();
c.mcc = convertNullToEmptyString(ci.getMcc());
c.mnc = convertNullToEmptyString(ci.getMnc());
int matchType = CarrierIdentifier.MatchType.ALL;
String matchData = null;
if (!TextUtils.isEmpty(ci.getSpn())) {
matchType = CarrierIdentifier.MatchType.SPN;
matchData = ci.getSpn();
} else if (!TextUtils.isEmpty(ci.getImsi())) {
matchType = CarrierIdentifier.MatchType.IMSI_PREFIX;
matchData = ci.getImsi();
} else if (!TextUtils.isEmpty(ci.getGid1())) {
matchType = CarrierIdentifier.MatchType.GID1;
matchData = ci.getGid1();
} else if (!TextUtils.isEmpty(ci.getGid2())) {
matchType = CarrierIdentifier.MatchType.GID2;
matchData = ci.getGid2();
}
c.matchType = matchType;
c.matchData = convertNullToEmptyString(matchData);
carrierList.allowedCarriers.add(c);
}
try {
radioProxy.setAllowedCarriers(rr.mSerial, allAllowed, carrierList);
} catch (RemoteException | RuntimeException e) {
handleRadioProxyExceptionForRR(rr, "setAllowedCarriers", e);
}
}
}
use of android.hardware.radio.V1_0.IRadio in project android_frameworks_opt_telephony by LineageOS.
the class RIL method dial.
@Override
public void dial(String address, int clirMode, UUSInfo uusInfo, Message result) {
IRadio radioProxy = getRadioProxy(result);
if (radioProxy != null) {
RILRequest rr = obtainRequest(RIL_REQUEST_DIAL, result, mRILDefaultWorkSource);
Dial dialInfo = new Dial();
dialInfo.address = convertNullToEmptyString(address);
dialInfo.clir = clirMode;
if (uusInfo != null) {
UusInfo info = new UusInfo();
info.uusType = uusInfo.getType();
info.uusDcs = uusInfo.getDcs();
info.uusData = new String(uusInfo.getUserData());
dialInfo.uusInfo.add(info);
}
if (RILJ_LOGD) {
// Do not log function arg for privacy
riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
}
try {
radioProxy.dial(rr.mSerial, dialInfo);
} catch (RemoteException | RuntimeException e) {
handleRadioProxyExceptionForRR(rr, "dial", e);
}
}
}
use of android.hardware.radio.V1_0.IRadio in project android_frameworks_opt_telephony by LineageOS.
the class RIL method getNeighboringCids.
@Override
public void getNeighboringCids(Message result, WorkSource workSource) {
workSource = getDeafultWorkSourceIfInvalid(workSource);
IRadio radioProxy = getRadioProxy(result);
if (radioProxy != null) {
RILRequest rr = obtainRequest(RIL_REQUEST_GET_NEIGHBORING_CELL_IDS, result, workSource);
if (RILJ_LOGD)
riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
try {
radioProxy.getNeighboringCids(rr.mSerial);
} catch (RemoteException | RuntimeException e) {
handleRadioProxyExceptionForRR(rr, "getNeighboringCids", e);
}
}
}
use of android.hardware.radio.V1_0.IRadio in project android_frameworks_opt_telephony by LineageOS.
the class RIL method nvWriteItem.
@Override
public void nvWriteItem(int itemId, String itemValue, Message result) {
IRadio radioProxy = getRadioProxy(result);
if (radioProxy != null) {
RILRequest rr = obtainRequest(RIL_REQUEST_NV_WRITE_ITEM, result, mRILDefaultWorkSource);
if (RILJ_LOGD) {
riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " itemId = " + itemId + " itemValue = " + itemValue);
}
NvWriteItem item = new NvWriteItem();
item.itemId = itemId;
item.value = convertNullToEmptyString(itemValue);
try {
radioProxy.nvWriteItem(rr.mSerial, item);
} catch (RemoteException | RuntimeException e) {
handleRadioProxyExceptionForRR(rr, "nvWriteItem", e);
}
}
}
Aggregations