use of android.hardware.radio.V1_0.IRadio in project android_frameworks_opt_telephony by LineageOS.
the class RIL method getAllowedCarriers.
@Override
public void getAllowedCarriers(Message result, WorkSource workSource) {
workSource = getDeafultWorkSourceIfInvalid(workSource);
IRadio radioProxy = getRadioProxy(result);
if (radioProxy == null)
return;
RILRequest rr = obtainRequest(RIL_REQUEST_GET_ALLOWED_CARRIERS, result, workSource);
if (RILJ_LOGD) {
riljLog(rr.serialString() + "> " + requestToString(rr.mRequest));
}
if (mRadioVersion.greaterOrEqual(RADIO_HAL_VERSION_1_4)) {
riljLog("RIL.java - Using IRadio 1.4 or greater");
android.hardware.radio.V1_4.IRadio radioProxy14 = (android.hardware.radio.V1_4.IRadio) radioProxy;
try {
radioProxy14.getAllowedCarriers_1_4(rr.mSerial);
} catch (RemoteException | RuntimeException e) {
handleRadioProxyExceptionForRR(rr, "getAllowedCarriers_1_4", e);
}
} else {
riljLog("RIL.java - Using IRadio 1.3 or lower");
try {
radioProxy.getAllowedCarriers(rr.mSerial);
} catch (RemoteException | RuntimeException e) {
handleRadioProxyExceptionForRR(rr, "getAllowedCarriers", e);
}
}
}
use of android.hardware.radio.V1_0.IRadio in project android_frameworks_opt_telephony by LineageOS.
the class RIL method setPreferredNetworkType.
@Override
public void setPreferredNetworkType(@PrefNetworkMode int networkType, Message result) {
IRadio radioProxy = getRadioProxy(result);
if (radioProxy != null) {
RILRequest rr = obtainRequest(RIL_REQUEST_SET_PREFERRED_NETWORK_TYPE, result, mRILDefaultWorkSource);
if (RILJ_LOGD) {
riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " networkType = " + networkType);
}
mPreferredNetworkType = networkType;
mMetrics.writeSetPreferredNetworkType(mPhoneId, networkType);
if (mRadioVersion.greaterOrEqual(RADIO_HAL_VERSION_1_4)) {
android.hardware.radio.V1_4.IRadio radioProxy14 = (android.hardware.radio.V1_4.IRadio) radioProxy;
try {
radioProxy14.setPreferredNetworkTypeBitmap(rr.mSerial, convertToHalRadioAccessFamily(RadioAccessFamily.getRafFromNetworkType(networkType)));
} catch (RemoteException | RuntimeException e) {
handleRadioProxyExceptionForRR(rr, "setPreferredNetworkTypeBitmap", e);
}
} else {
try {
radioProxy.setPreferredNetworkType(rr.mSerial, networkType);
} catch (RemoteException | RuntimeException e) {
handleRadioProxyExceptionForRR(rr, "setPreferredNetworkType", e);
}
}
}
}
use of android.hardware.radio.V1_0.IRadio in project android_frameworks_opt_telephony by LineageOS.
the class RIL method queryCallForwardStatus.
@Override
public void queryCallForwardStatus(int cfReason, int serviceClass, String number, Message result) {
IRadio radioProxy = getRadioProxy(result);
if (radioProxy != null) {
RILRequest rr = obtainRequest(RIL_REQUEST_QUERY_CALL_FORWARD_STATUS, result, mRILDefaultWorkSource);
if (RILJ_LOGD) {
riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " cfreason = " + cfReason + " serviceClass = " + serviceClass);
}
android.hardware.radio.V1_0.CallForwardInfo cfInfo = new android.hardware.radio.V1_0.CallForwardInfo();
cfInfo.reason = cfReason;
cfInfo.serviceClass = serviceClass;
cfInfo.toa = PhoneNumberUtils.toaFromString(number);
cfInfo.number = convertNullToEmptyString(number);
cfInfo.timeSeconds = 0;
try {
radioProxy.getCallForwardStatus(rr.mSerial, cfInfo);
} catch (RemoteException | RuntimeException e) {
handleRadioProxyExceptionForRR(rr, "queryCallForwardStatus", e);
}
}
}
use of android.hardware.radio.V1_0.IRadio in project android_frameworks_opt_telephony by LineageOS.
the class RIL method emergencyDial.
private void emergencyDial(String address, EmergencyNumber emergencyNumberInfo, boolean hasKnownUserIntentEmergency, int clirMode, UUSInfo uusInfo, Message result) {
IRadio radioProxy = getRadioProxy(result);
// IRadio V1.4
android.hardware.radio.V1_4.IRadio radioProxy14 = (android.hardware.radio.V1_4.IRadio) radioProxy;
if (radioProxy != null) {
RILRequest rr = obtainRequest(RIL_REQUEST_EMERGENCY_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 {
radioProxy14.emergencyDial(rr.mSerial, dialInfo, emergencyNumberInfo.getEmergencyServiceCategoryBitmaskInternalDial(), emergencyNumberInfo.getEmergencyUrns() != null ? new ArrayList(emergencyNumberInfo.getEmergencyUrns()) : new ArrayList<>(), emergencyNumberInfo.getEmergencyCallRouting(), hasKnownUserIntentEmergency, emergencyNumberInfo.getEmergencyNumberSourceBitmask() == EmergencyNumber.EMERGENCY_NUMBER_SOURCE_TEST);
} catch (RemoteException | RuntimeException e) {
handleRadioProxyExceptionForRR(rr, "emergencyDial", e);
}
}
}
use of android.hardware.radio.V1_0.IRadio in project android_frameworks_opt_telephony by LineageOS.
the class RIL method enableModem.
@Override
public void enableModem(boolean enable, Message result) {
IRadio radioProxy = getRadioProxy(result);
if (mRadioVersion.less(RADIO_HAL_VERSION_1_3)) {
if (RILJ_LOGV)
riljLog("enableModem: 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_ENABLE_MODEM, result, mRILDefaultWorkSource);
if (RILJ_LOGD) {
riljLog(rr.serialString() + "> " + requestToString(rr.mRequest) + " enable = " + enable);
}
try {
radioProxy13.enableModem(rr.mSerial, enable);
} catch (RemoteException | RuntimeException e) {
handleRadioProxyExceptionForRR(rr, "enableModem", e);
}
}
}
Aggregations