#define LOG_TAG "RILC"
-#include <android/hardware/radio/1.0/IRadio.h>
+#include <android/hardware/radio/1.1/IRadio.h>
+#include <android/hardware/radio/1.1/IRadioResponse.h>
+#include <android/hardware/radio/1.1/IRadioIndication.h>
+#include <android/hardware/radio/1.1/types.h>
+
#include <android/hardware/radio/deprecated/1.0/IOemHook.h>
#include <hwbinder/IPCThreadState.h>
using ::android::hardware::hidl_string;
using ::android::hardware::hidl_vec;
using ::android::hardware::hidl_array;
+using ::android::hardware::radio::V1_1::NetworkScanRequest;
+using ::android::hardware::radio::V1_1::KeepaliveRequest;
using ::android::hardware::Void;
using android::CommandInfo;
using android::RequestInfo;
sp<RadioImpl> radioService[SIM_COUNT];
sp<OemHookImpl> oemHookService[SIM_COUNT];
// counter used for synchronization. It is incremented every time response callbacks are updated.
-volatile int32_t mCounter[SIM_COUNT];
+volatile int32_t mCounterRadio[SIM_COUNT];
+volatile int32_t mCounterOemHook[SIM_COUNT];
#else
sp<RadioImpl> radioService[1];
sp<OemHookImpl> oemHookService[1];
// counter used for synchronization. It is incremented every time response callbacks are updated.
-volatile int32_t mCounter[1];
+volatile int32_t mCounterRadio[1];
+volatile int32_t mCounterOemHook[1];
#endif
static pthread_rwlock_t radioServiceRwlock = PTHREAD_RWLOCK_INITIALIZER;
void convertRilCellInfoListToHal(void *response, size_t responseLen, hidl_vec<CellInfo>& records);
-struct RadioImpl : public IRadio {
+struct RadioImpl : public ::android::hardware::radio::V1_1::IRadio {
int32_t mSlotId;
sp<IRadioResponse> mRadioResponse;
sp<IRadioIndication> mRadioIndication;
Return<void> getAvailableNetworks(int32_t serial);
+ Return<void> startNetworkScan(int32_t serial, const NetworkScanRequest& request);
+
+ Return<void> stopNetworkScan(int32_t serial);
+
Return<void> startDtmf(int32_t serial,
const ::android::hardware::hidl_string& s);
Return<void> iccTransmitApduBasicChannel(int32_t serial, const SimApdu& message);
Return<void> iccOpenLogicalChannel(int32_t serial,
- const ::android::hardware::hidl_string& aid);
+ const ::android::hardware::hidl_string& aid, int32_t p2);
Return<void> iccCloseLogicalChannel(int32_t serial, int32_t channelId);
Return<void> setIndicationFilter(int32_t serial, int32_t indicationFilter);
+ Return<void> startKeepalive(int32_t serial, const KeepaliveRequest& keepalive);
+
+ Return<void> stopKeepalive(int32_t serial, int32_t sessionHandle);
+
Return<void> setSimCardPower(int32_t serial, bool powerUp);
+ Return<void> setSimCardPower_1_1(int32_t serial,
+ const ::android::hardware::radio::V1_1::CardPowerState state);
Return<void> responseAcknowledgement();
+ Return<void> setCarrierInfoForImsiEncryption(int32_t serial,
+ const ::android::hardware::radio::V1_1::ImsiEncryptionInfo& message);
+
void checkReturnStatus(Return<void>& ret);
};
char *ptr = va_arg(ap, char *);
if (ptr) {
#ifdef MEMSET_FREED
- // TODO: Should pass in the maximum length of the string
- memsetString(ptr);
+#define MAX_STRING_LENGTH 4096
+ memset(ptr, 0, strnlen(ptr, MAX_STRING_LENGTH));
#endif
free(ptr);
}
sendErrorResponse(pRI, RIL_E_NO_MEMORY);
return false;
}
- strncpy(*dest, src, len + 1);
+ strncpy(*dest, src.c_str(), len + 1);
return true;
}
va_start(ap, countStrings);
for (int i = 0; i < countStrings; i++) {
const char* str = va_arg(ap, const char *);
- if (!copyHidlStringToRil(&pStrings[i], str, pRI)) {
+ if (!copyHidlStringToRil(&pStrings[i], hidl_string(str), pRI)) {
va_end(ap);
for (int j = 0; j < i; j++) {
memsetAndFreeStrings(1, pStrings[j]);
return false;
}
- RIL_SIM_APDU apdu;
- memset (&apdu, 0, sizeof(RIL_SIM_APDU));
+ RIL_SIM_APDU apdu = {};
apdu.sessionid = message.sessionId;
apdu.cla = message.cla;
return true;
}
-void checkReturnStatus(int32_t slotId, Return<void>& ret) {
+void checkReturnStatus(int32_t slotId, Return<void>& ret, bool isRadioService) {
if (ret.isOk() == false) {
RLOGE("checkReturnStatus: unable to call response/indication callback");
// Remote process hosting the callbacks must be dead. Reset the callback objects;
// Caller should already hold rdlock, release that first
// note the current counter to avoid overwriting updates made by another thread before
// write lock is acquired.
- int counter = mCounter[slotId];
+ int counter = isRadioService ? mCounterRadio[slotId] : mCounterOemHook[slotId];
pthread_rwlock_t *radioServiceRwlockPtr = radio::getRadioServiceRwlock(slotId);
int ret = pthread_rwlock_unlock(radioServiceRwlockPtr);
assert(ret == 0);
assert(ret == 0);
// make sure the counter value has not changed
- if (counter == mCounter[slotId]) {
- radioService[slotId]->mRadioResponse = NULL;
- radioService[slotId]->mRadioIndication = NULL;
- oemHookService[slotId]->mOemHookResponse = NULL;
- oemHookService[slotId]->mOemHookIndication = NULL;
- mCounter[slotId]++;
+ if (counter == (isRadioService ? mCounterRadio[slotId] : mCounterOemHook[slotId])) {
+ if (isRadioService) {
+ radioService[slotId]->mRadioResponse = NULL;
+ radioService[slotId]->mRadioIndication = NULL;
+ } else {
+ oemHookService[slotId]->mOemHookResponse = NULL;
+ oemHookService[slotId]->mOemHookIndication = NULL;
+ }
+ isRadioService ? mCounterRadio[slotId]++ : mCounterOemHook[slotId]++;
} else {
RLOGE("checkReturnStatus: not resetting responseFunctions as they likely "
"got updated on another thread");
}
void RadioImpl::checkReturnStatus(Return<void>& ret) {
- ::checkReturnStatus(mSlotId, ret);
+ ::checkReturnStatus(mSlotId, ret, true);
}
Return<void> RadioImpl::setResponseFunctions(
mRadioResponse = radioResponseParam;
mRadioIndication = radioIndicationParam;
- mCounter[mSlotId]++;
+ mCounterRadio[mSlotId]++;
ret = pthread_rwlock_unlock(radioServiceRwlockPtr);
assert(ret == 0);
+ // client is connected. Send initial indications.
+ android::onNewCommandConnect((RIL_SOCKET_ID) mSlotId);
+
return Void();
}
Return<void> RadioImpl::getIccCardStatus(int32_t serial) {
+#if VDBG
RLOGD("getIccCardStatus: serial %d", serial);
+#endif
dispatchVoid(serial, mSlotId, RIL_REQUEST_GET_SIM_STATUS);
return Void();
}
Return<void> RadioImpl::supplyIccPinForApp(int32_t serial, const hidl_string& pin,
const hidl_string& aid) {
+#if VDBG
RLOGD("supplyIccPinForApp: serial %d", serial);
+#endif
dispatchStrings(serial, mSlotId, RIL_REQUEST_ENTER_SIM_PIN,
- 2, (const char *)pin, (const char *)aid);
+ 2, pin.c_str(), aid.c_str());
return Void();
}
Return<void> RadioImpl::supplyIccPukForApp(int32_t serial, const hidl_string& puk,
const hidl_string& pin, const hidl_string& aid) {
+#if VDBG
RLOGD("supplyIccPukForApp: serial %d", serial);
+#endif
dispatchStrings(serial, mSlotId, RIL_REQUEST_ENTER_SIM_PUK,
- 3, (const char *)puk, (const char *)pin, (const char *)aid);
+ 3, puk.c_str(), pin.c_str(), aid.c_str());
return Void();
}
Return<void> RadioImpl::supplyIccPin2ForApp(int32_t serial, const hidl_string& pin2,
const hidl_string& aid) {
+#if VDBG
RLOGD("supplyIccPin2ForApp: serial %d", serial);
+#endif
dispatchStrings(serial, mSlotId, RIL_REQUEST_ENTER_SIM_PIN2,
- 2, (const char *)pin2, (const char *)aid);
+ 2, pin2.c_str(), aid.c_str());
return Void();
}
Return<void> RadioImpl::supplyIccPuk2ForApp(int32_t serial, const hidl_string& puk2,
const hidl_string& pin2, const hidl_string& aid) {
+#if VDBG
RLOGD("supplyIccPuk2ForApp: serial %d", serial);
+#endif
dispatchStrings(serial, mSlotId, RIL_REQUEST_ENTER_SIM_PUK2,
- 3, (const char *)puk2, (const char *)pin2, (const char *)aid);
+ 3, puk2.c_str(), pin2.c_str(), aid.c_str());
return Void();
}
Return<void> RadioImpl::changeIccPinForApp(int32_t serial, const hidl_string& oldPin,
const hidl_string& newPin, const hidl_string& aid) {
+#if VDBG
RLOGD("changeIccPinForApp: serial %d", serial);
+#endif
dispatchStrings(serial, mSlotId, RIL_REQUEST_CHANGE_SIM_PIN,
- 3, (const char *)oldPin, (const char *)newPin, (const char *)aid);
+ 3, oldPin.c_str(), newPin.c_str(), aid.c_str());
return Void();
}
Return<void> RadioImpl::changeIccPin2ForApp(int32_t serial, const hidl_string& oldPin2,
const hidl_string& newPin2, const hidl_string& aid) {
+#if VDBG
RLOGD("changeIccPin2ForApp: serial %d", serial);
+#endif
dispatchStrings(serial, mSlotId, RIL_REQUEST_CHANGE_SIM_PIN2,
- 3, (const char *)oldPin2, (const char *)newPin2, (const char *)aid);
+ 3, oldPin2.c_str(), newPin2.c_str(), aid.c_str());
return Void();
}
Return<void> RadioImpl::supplyNetworkDepersonalization(int32_t serial,
const hidl_string& netPin) {
+#if VDBG
RLOGD("supplyNetworkDepersonalization: serial %d", serial);
+#endif
dispatchStrings(serial, mSlotId, RIL_REQUEST_ENTER_NETWORK_DEPERSONALIZATION,
- 1, (const char *)netPin);
+ 1, netPin.c_str());
return Void();
}
Return<void> RadioImpl::getCurrentCalls(int32_t serial) {
+#if VDBG
RLOGD("getCurrentCalls: serial %d", serial);
+#endif
dispatchVoid(serial, mSlotId, RIL_REQUEST_GET_CURRENT_CALLS);
return Void();
}
Return<void> RadioImpl::dial(int32_t serial, const Dial& dialInfo) {
+#if VDBG
RLOGD("dial: serial %d", serial);
+#endif
RequestInfo *pRI = android::addRequestToList(serial, mSlotId, RIL_REQUEST_DIAL);
if (pRI == NULL) {
return Void();
}
Return<void> RadioImpl::getImsiForApp(int32_t serial, const hidl_string& aid) {
+#if VDBG
RLOGD("getImsiForApp: serial %d", serial);
+#endif
dispatchStrings(serial, mSlotId, RIL_REQUEST_GET_IMSI,
- 1, (const char *) aid);
+ 1, aid.c_str());
return Void();
}
Return<void> RadioImpl::hangup(int32_t serial, int32_t gsmIndex) {
+#if VDBG
RLOGD("hangup: serial %d", serial);
+#endif
dispatchInts(serial, mSlotId, RIL_REQUEST_HANGUP, 1, gsmIndex);
return Void();
}
Return<void> RadioImpl::hangupWaitingOrBackground(int32_t serial) {
+#if VDBG
RLOGD("hangupWaitingOrBackground: serial %d", serial);
+#endif
dispatchVoid(serial, mSlotId, RIL_REQUEST_HANGUP_WAITING_OR_BACKGROUND);
return Void();
}
Return<void> RadioImpl::hangupForegroundResumeBackground(int32_t serial) {
+#if VDBG
RLOGD("hangupForegroundResumeBackground: serial %d", serial);
+#endif
dispatchVoid(serial, mSlotId, RIL_REQUEST_HANGUP_FOREGROUND_RESUME_BACKGROUND);
return Void();
}
Return<void> RadioImpl::switchWaitingOrHoldingAndActive(int32_t serial) {
+#if VDBG
RLOGD("switchWaitingOrHoldingAndActive: serial %d", serial);
+#endif
dispatchVoid(serial, mSlotId, RIL_REQUEST_SWITCH_WAITING_OR_HOLDING_AND_ACTIVE);
return Void();
}
Return<void> RadioImpl::conference(int32_t serial) {
+#if VDBG
RLOGD("conference: serial %d", serial);
+#endif
dispatchVoid(serial, mSlotId, RIL_REQUEST_CONFERENCE);
return Void();
}
Return<void> RadioImpl::rejectCall(int32_t serial) {
+#if VDBG
RLOGD("rejectCall: serial %d", serial);
+#endif
dispatchVoid(serial, mSlotId, RIL_REQUEST_UDUB);
return Void();
}
Return<void> RadioImpl::getLastCallFailCause(int32_t serial) {
+#if VDBG
RLOGD("getLastCallFailCause: serial %d", serial);
+#endif
dispatchVoid(serial, mSlotId, RIL_REQUEST_LAST_CALL_FAIL_CAUSE);
return Void();
}
Return<void> RadioImpl::getSignalStrength(int32_t serial) {
+#if VDBG
RLOGD("getSignalStrength: serial %d", serial);
+#endif
dispatchVoid(serial, mSlotId, RIL_REQUEST_SIGNAL_STRENGTH);
return Void();
}
Return<void> RadioImpl::getVoiceRegistrationState(int32_t serial) {
+#if VDBG
RLOGD("getVoiceRegistrationState: serial %d", serial);
+#endif
dispatchVoid(serial, mSlotId, RIL_REQUEST_VOICE_REGISTRATION_STATE);
return Void();
}
Return<void> RadioImpl::getDataRegistrationState(int32_t serial) {
+#if VDBG
RLOGD("getDataRegistrationState: serial %d", serial);
+#endif
dispatchVoid(serial, mSlotId, RIL_REQUEST_DATA_REGISTRATION_STATE);
return Void();
}
Return<void> RadioImpl::getOperator(int32_t serial) {
+#if VDBG
RLOGD("getOperator: serial %d", serial);
+#endif
dispatchVoid(serial, mSlotId, RIL_REQUEST_OPERATOR);
return Void();
}
}
Return<void> RadioImpl::sendDtmf(int32_t serial, const hidl_string& s) {
+#if VDBG
RLOGD("sendDtmf: serial %d", serial);
- dispatchString(serial, mSlotId, RIL_REQUEST_DTMF, (const char *) s);
+#endif
+ dispatchString(serial, mSlotId, RIL_REQUEST_DTMF, s.c_str());
return Void();
}
Return<void> RadioImpl::sendSms(int32_t serial, const GsmSmsMessage& message) {
+#if VDBG
RLOGD("sendSms: serial %d", serial);
+#endif
dispatchStrings(serial, mSlotId, RIL_REQUEST_SEND_SMS,
- 2, (const char *) message.smscPdu, (const char *) message.pdu);
+ 2, message.smscPdu.c_str(), message.pdu.c_str());
return Void();
}
Return<void> RadioImpl::sendSMSExpectMore(int32_t serial, const GsmSmsMessage& message) {
+#if VDBG
RLOGD("sendSMSExpectMore: serial %d", serial);
+#endif
dispatchStrings(serial, mSlotId, RIL_REQUEST_SEND_SMS_EXPECT_MORE,
- 2, (const char *) message.smscPdu, (const char *) message.pdu);
+ 2, message.smscPdu.c_str(), message.pdu.c_str());
return Void();
}
-const char *convertMvnoTypeToString(MvnoType type) {
+static bool convertMvnoTypeToString(MvnoType type, char *&str) {
switch (type) {
- case MvnoType::IMSI: return "imsi";
- case MvnoType::GID: return "gid";
- case MvnoType::SPN: return "spn";
- default: return NULL;
+ case MvnoType::IMSI:
+ str = (char *)"imsi";
+ return true;
+ case MvnoType::GID:
+ str = (char *)"gid";
+ return true;
+ case MvnoType::SPN:
+ str = (char *)"spn";
+ return true;
+ case MvnoType::NONE:
+ str = (char *)"";
+ return true;
}
+ return false;
}
Return<void> RadioImpl::setupDataCall(int32_t serial, RadioTechnology radioTechnology,
const DataProfileInfo& dataProfileInfo, bool modemCognitive,
bool roamingAllowed, bool isRoaming) {
+#if VDBG
RLOGD("setupDataCall: serial %d", serial);
+#endif
if (s_vendorFunctions->version >= 4 && s_vendorFunctions->version <= 14) {
const hidl_string &protocol =
std::to_string((int) dataProfileInfo.authType).c_str(),
protocol.c_str());
} else if (s_vendorFunctions->version >= 15) {
- const char *mvnoTypeStr = convertMvnoTypeToString(dataProfileInfo.mvnoType);
- if (mvnoTypeStr == NULL) {
+ char *mvnoTypeStr = NULL;
+ if (!convertMvnoTypeToString(dataProfileInfo.mvnoType, mvnoTypeStr)) {
RequestInfo *pRI = android::addRequestToList(serial, mSlotId,
RIL_REQUEST_SETUP_DATA_CALL);
if (pRI != NULL) {
dataProfileInfo.roamingProtocol.c_str(),
std::to_string(dataProfileInfo.supportedApnTypesBitmap).c_str(),
std::to_string(dataProfileInfo.bearerBitmap).c_str(),
- BOOL_TO_INT(modemCognitive),
+ modemCognitive ? "1" : "0",
std::to_string(dataProfileInfo.mtu).c_str(),
mvnoTypeStr,
dataProfileInfo.mvnoMatchData.c_str(),
- BOOL_TO_INT(roamingAllowed));
+ roamingAllowed ? "1" : "0");
} else {
RLOGE("Unsupported RIL version %d, min version expected 4", s_vendorFunctions->version);
RequestInfo *pRI = android::addRequestToList(serial, mSlotId,
}
Return<void> RadioImpl::iccIOForApp(int32_t serial, const IccIo& iccIo) {
+#if VDBG
RLOGD("iccIOForApp: serial %d", serial);
+#endif
RequestInfo *pRI = android::addRequestToList(serial, mSlotId, RIL_REQUEST_SIM_IO);
if (pRI == NULL) {
return Void();
}
- RIL_SIM_IO_v6 rilIccIo;
+ RIL_SIM_IO_v6 rilIccIo = {};
rilIccIo.command = iccIo.command;
rilIccIo.fileid = iccIo.fileId;
if (!copyHidlStringToRil(&rilIccIo.path, iccIo.path, pRI)) {
}
Return<void> RadioImpl::sendUssd(int32_t serial, const hidl_string& ussd) {
+#if VDBG
RLOGD("sendUssd: serial %d", serial);
- dispatchString(serial, mSlotId, RIL_REQUEST_SEND_USSD, (const char *) ussd);
+#endif
+ dispatchString(serial, mSlotId, RIL_REQUEST_SEND_USSD, ussd.c_str());
return Void();
}
Return<void> RadioImpl::cancelPendingUssd(int32_t serial) {
+#if VDBG
RLOGD("cancelPendingUssd: serial %d", serial);
+#endif
dispatchVoid(serial, mSlotId, RIL_REQUEST_CANCEL_USSD);
return Void();
}
Return<void> RadioImpl::getClir(int32_t serial) {
+#if VDBG
RLOGD("getClir: serial %d", serial);
+#endif
dispatchVoid(serial, mSlotId, RIL_REQUEST_GET_CLIR);
return Void();
}
Return<void> RadioImpl::setClir(int32_t serial, int32_t status) {
+#if VDBG
RLOGD("setClir: serial %d", serial);
+#endif
dispatchInts(serial, mSlotId, RIL_REQUEST_SET_CLIR, 1, status);
return Void();
}
Return<void> RadioImpl::getCallForwardStatus(int32_t serial, const CallForwardInfo& callInfo) {
+#if VDBG
RLOGD("getCallForwardStatus: serial %d", serial);
+#endif
dispatchCallForwardStatus(serial, mSlotId, RIL_REQUEST_QUERY_CALL_FORWARD_STATUS,
callInfo);
return Void();
}
Return<void> RadioImpl::setCallForward(int32_t serial, const CallForwardInfo& callInfo) {
+#if VDBG
RLOGD("setCallForward: serial %d", serial);
+#endif
dispatchCallForwardStatus(serial, mSlotId, RIL_REQUEST_SET_CALL_FORWARD,
callInfo);
return Void();
}
Return<void> RadioImpl::getCallWaiting(int32_t serial, int32_t serviceClass) {
+#if VDBG
RLOGD("getCallWaiting: serial %d", serial);
+#endif
dispatchInts(serial, mSlotId, RIL_REQUEST_QUERY_CALL_WAITING, 1, serviceClass);
return Void();
}
Return<void> RadioImpl::setCallWaiting(int32_t serial, bool enable, int32_t serviceClass) {
+#if VDBG
RLOGD("setCallWaiting: serial %d", serial);
+#endif
dispatchInts(serial, mSlotId, RIL_REQUEST_SET_CALL_WAITING, 2, BOOL_TO_INT(enable),
serviceClass);
return Void();
Return<void> RadioImpl::acknowledgeLastIncomingGsmSms(int32_t serial,
bool success, SmsAcknowledgeFailCause cause) {
+#if VDBG
RLOGD("acknowledgeLastIncomingGsmSms: serial %d", serial);
+#endif
dispatchInts(serial, mSlotId, RIL_REQUEST_SMS_ACKNOWLEDGE, 2, BOOL_TO_INT(success),
cause);
return Void();
}
Return<void> RadioImpl::acceptCall(int32_t serial) {
+#if VDBG
RLOGD("acceptCall: serial %d", serial);
+#endif
dispatchVoid(serial, mSlotId, RIL_REQUEST_ANSWER);
return Void();
}
Return<void> RadioImpl::deactivateDataCall(int32_t serial,
int32_t cid, bool reasonRadioShutDown) {
+#if VDBG
RLOGD("deactivateDataCall: serial %d", serial);
+#endif
dispatchStrings(serial, mSlotId, RIL_REQUEST_DEACTIVATE_DATA_CALL,
- 2, (const char *) (std::to_string(cid)).c_str(), reasonRadioShutDown ? "1" : "0");
+ 2, (std::to_string(cid)).c_str(), reasonRadioShutDown ? "1" : "0");
return Void();
}
Return<void> RadioImpl::getFacilityLockForApp(int32_t serial, const hidl_string& facility,
const hidl_string& password, int32_t serviceClass,
const hidl_string& appId) {
+#if VDBG
RLOGD("getFacilityLockForApp: serial %d", serial);
+#endif
dispatchStrings(serial, mSlotId, RIL_REQUEST_QUERY_FACILITY_LOCK,
- 4, (const char *) facility, (const char *) password,
- (const char *) (std::to_string(serviceClass)).c_str(), (const char *) appId);
+ 4, facility.c_str(), password.c_str(),
+ (std::to_string(serviceClass)).c_str(), appId.c_str());
return Void();
}
Return<void> RadioImpl::setFacilityLockForApp(int32_t serial, const hidl_string& facility,
bool lockState, const hidl_string& password,
int32_t serviceClass, const hidl_string& appId) {
+#if VDBG
RLOGD("setFacilityLockForApp: serial %d", serial);
+#endif
dispatchStrings(serial, mSlotId, RIL_REQUEST_SET_FACILITY_LOCK,
- 5, (const char *) facility, lockState ? "1" : "0", (const char *) password,
- (const char *) (std::to_string(serviceClass)).c_str(), (const char *) appId);
+ 5, facility.c_str(), lockState ? "1" : "0", password.c_str(),
+ (std::to_string(serviceClass)).c_str(), appId.c_str() );
return Void();
}
Return<void> RadioImpl::setBarringPassword(int32_t serial, const hidl_string& facility,
const hidl_string& oldPassword,
const hidl_string& newPassword) {
+#if VDBG
RLOGD("setBarringPassword: serial %d", serial);
+#endif
dispatchStrings(serial, mSlotId, RIL_REQUEST_CHANGE_BARRING_PASSWORD,
- 2, (const char *) oldPassword, (const char *) newPassword);
+ 2, oldPassword.c_str(), newPassword.c_str());
return Void();
}
Return<void> RadioImpl::getNetworkSelectionMode(int32_t serial) {
+#if VDBG
RLOGD("getNetworkSelectionMode: serial %d", serial);
+#endif
dispatchVoid(serial, mSlotId, RIL_REQUEST_QUERY_NETWORK_SELECTION_MODE);
return Void();
}
Return<void> RadioImpl::setNetworkSelectionModeAutomatic(int32_t serial) {
+#if VDBG
RLOGD("setNetworkSelectionModeAutomatic: serial %d", serial);
+#endif
dispatchVoid(serial, mSlotId, RIL_REQUEST_SET_NETWORK_SELECTION_AUTOMATIC);
return Void();
}
Return<void> RadioImpl::setNetworkSelectionModeManual(int32_t serial,
const hidl_string& operatorNumeric) {
+#if VDBG
RLOGD("setNetworkSelectionModeManual: serial %d", serial);
+#endif
dispatchString(serial, mSlotId, RIL_REQUEST_SET_NETWORK_SELECTION_MANUAL,
- (const char *) operatorNumeric);
+ operatorNumeric.c_str());
return Void();
}
Return<void> RadioImpl::getAvailableNetworks(int32_t serial) {
+#if VDBG
RLOGD("getAvailableNetworks: serial %d", serial);
+#endif
dispatchVoid(serial, mSlotId, RIL_REQUEST_QUERY_AVAILABLE_NETWORKS);
return Void();
}
+Return<void> RadioImpl::startNetworkScan(int32_t serial, const NetworkScanRequest& request) {
+#if VDBG
+ RLOGD("startNetworkScan: serial %d", serial);
+#endif
+
+ RequestInfo *pRI = android::addRequestToList(serial, mSlotId, RIL_REQUEST_START_NETWORK_SCAN);
+ if (pRI == NULL) {
+ return Void();
+ }
+
+ if (request.specifiers.size() > MAX_RADIO_ACCESS_NETWORKS) {
+ sendErrorResponse(pRI, RIL_E_INVALID_ARGUMENTS);
+ return Void();
+ }
+
+ RIL_NetworkScanRequest scan_request = {};
+
+ scan_request.type = (RIL_ScanType) request.type;
+ scan_request.interval = request.interval;
+ scan_request.specifiers_length = request.specifiers.size();
+ for (size_t i = 0; i < request.specifiers.size(); ++i) {
+ if (request.specifiers[i].geranBands.size() > MAX_BANDS ||
+ request.specifiers[i].utranBands.size() > MAX_BANDS ||
+ request.specifiers[i].eutranBands.size() > MAX_BANDS ||
+ request.specifiers[i].channels.size() > MAX_CHANNELS) {
+ sendErrorResponse(pRI, RIL_E_INVALID_ARGUMENTS);
+ return Void();
+ }
+ const ::android::hardware::radio::V1_1::RadioAccessSpecifier& ras_from =
+ request.specifiers[i];
+ RIL_RadioAccessSpecifier& ras_to = scan_request.specifiers[i];
+
+ ras_to.radio_access_network = (RIL_RadioAccessNetworks) ras_from.radioAccessNetwork;
+ ras_to.channels_length = ras_from.channels.size();
+
+ std::copy(ras_from.channels.begin(), ras_from.channels.end(), ras_to.channels);
+ const std::vector<uint32_t> * bands = nullptr;
+ switch (request.specifiers[i].radioAccessNetwork) {
+ case ::android::hardware::radio::V1_1::RadioAccessNetworks::GERAN:
+ ras_to.bands_length = ras_from.geranBands.size();
+ bands = (std::vector<uint32_t> *) &ras_from.geranBands;
+ break;
+ case ::android::hardware::radio::V1_1::RadioAccessNetworks::UTRAN:
+ ras_to.bands_length = ras_from.utranBands.size();
+ bands = (std::vector<uint32_t> *) &ras_from.utranBands;
+ break;
+ case ::android::hardware::radio::V1_1::RadioAccessNetworks::EUTRAN:
+ ras_to.bands_length = ras_from.eutranBands.size();
+ bands = (std::vector<uint32_t> *) &ras_from.eutranBands;
+ break;
+ default:
+ sendErrorResponse(pRI, RIL_E_INVALID_ARGUMENTS);
+ return Void();
+ }
+ // safe to copy to geran_bands because it's a union member
+ for (size_t idx = 0; idx < ras_to.bands_length; ++idx) {
+ ras_to.bands.geran_bands[idx] = (RIL_GeranBands) (*bands)[idx];
+ }
+ }
+
+ s_vendorFunctions->onRequest(
+ RIL_REQUEST_START_NETWORK_SCAN, &scan_request, sizeof(scan_request), pRI);
+
+ return Void();
+}
+
+Return<void> RadioImpl::stopNetworkScan(int32_t serial) {
+#if VDBG
+ RLOGD("stopNetworkScan: serial %d", serial);
+#endif
+ dispatchVoid(serial, mSlotId, RIL_REQUEST_STOP_NETWORK_SCAN);
+ return Void();
+}
+
Return<void> RadioImpl::startDtmf(int32_t serial, const hidl_string& s) {
+#if VDBG
RLOGD("startDtmf: serial %d", serial);
+#endif
dispatchString(serial, mSlotId, RIL_REQUEST_DTMF_START,
- (const char *) s);
+ s.c_str());
return Void();
}
Return<void> RadioImpl::stopDtmf(int32_t serial) {
+#if VDBG
RLOGD("stopDtmf: serial %d", serial);
+#endif
dispatchVoid(serial, mSlotId, RIL_REQUEST_DTMF_STOP);
return Void();
}
Return<void> RadioImpl::getBasebandVersion(int32_t serial) {
+#if VDBG
RLOGD("getBasebandVersion: serial %d", serial);
+#endif
dispatchVoid(serial, mSlotId, RIL_REQUEST_BASEBAND_VERSION);
return Void();
}
Return<void> RadioImpl::separateConnection(int32_t serial, int32_t gsmIndex) {
+#if VDBG
RLOGD("separateConnection: serial %d", serial);
+#endif
dispatchInts(serial, mSlotId, RIL_REQUEST_SEPARATE_CONNECTION, 1, gsmIndex);
return Void();
}
Return<void> RadioImpl::setMute(int32_t serial, bool enable) {
+#if VDBG
RLOGD("setMute: serial %d", serial);
+#endif
dispatchInts(serial, mSlotId, RIL_REQUEST_SET_MUTE, 1, BOOL_TO_INT(enable));
return Void();
}
Return<void> RadioImpl::getMute(int32_t serial) {
+#if VDBG
RLOGD("getMute: serial %d", serial);
+#endif
dispatchVoid(serial, mSlotId, RIL_REQUEST_GET_MUTE);
return Void();
}
Return<void> RadioImpl::getClip(int32_t serial) {
+#if VDBG
RLOGD("getClip: serial %d", serial);
+#endif
dispatchVoid(serial, mSlotId, RIL_REQUEST_QUERY_CLIP);
return Void();
}
Return<void> RadioImpl::getDataCallList(int32_t serial) {
+#if VDBG
RLOGD("getDataCallList: serial %d", serial);
+#endif
dispatchVoid(serial, mSlotId, RIL_REQUEST_DATA_CALL_LIST);
return Void();
}
Return<void> RadioImpl::setSuppServiceNotifications(int32_t serial, bool enable) {
+#if VDBG
RLOGD("setSuppServiceNotifications: serial %d", serial);
+#endif
dispatchInts(serial, mSlotId, RIL_REQUEST_SET_SUPP_SVC_NOTIFICATION, 1,
BOOL_TO_INT(enable));
return Void();
}
Return<void> RadioImpl::writeSmsToSim(int32_t serial, const SmsWriteArgs& smsWriteArgs) {
+#if VDBG
RLOGD("writeSmsToSim: serial %d", serial);
+#endif
RequestInfo *pRI = android::addRequestToList(serial, mSlotId, RIL_REQUEST_WRITE_SMS_TO_SIM);
if (pRI == NULL) {
return Void();
}
Return<void> RadioImpl::deleteSmsOnSim(int32_t serial, int32_t index) {
+#if VDBG
RLOGD("deleteSmsOnSim: serial %d", serial);
+#endif
dispatchInts(serial, mSlotId, RIL_REQUEST_DELETE_SMS_ON_SIM, 1, index);
return Void();
}
Return<void> RadioImpl::setBandMode(int32_t serial, RadioBandMode mode) {
+#if VDBG
RLOGD("setBandMode: serial %d", serial);
+#endif
dispatchInts(serial, mSlotId, RIL_REQUEST_SET_BAND_MODE, 1, mode);
return Void();
}
Return<void> RadioImpl::getAvailableBandModes(int32_t serial) {
+#if VDBG
RLOGD("getAvailableBandModes: serial %d", serial);
+#endif
dispatchVoid(serial, mSlotId, RIL_REQUEST_QUERY_AVAILABLE_BAND_MODE);
return Void();
}
Return<void> RadioImpl::sendEnvelope(int32_t serial, const hidl_string& command) {
+#if VDBG
RLOGD("sendEnvelope: serial %d", serial);
+#endif
dispatchString(serial, mSlotId, RIL_REQUEST_STK_SEND_ENVELOPE_COMMAND,
- (const char *) command);
+ command.c_str());
return Void();
}
Return<void> RadioImpl::sendTerminalResponseToSim(int32_t serial,
const hidl_string& commandResponse) {
+#if VDBG
RLOGD("sendTerminalResponseToSim: serial %d", serial);
+#endif
dispatchString(serial, mSlotId, RIL_REQUEST_STK_SEND_TERMINAL_RESPONSE,
- (const char *) commandResponse);
+ commandResponse.c_str());
return Void();
}
Return<void> RadioImpl::handleStkCallSetupRequestFromSim(int32_t serial, bool accept) {
+#if VDBG
RLOGD("handleStkCallSetupRequestFromSim: serial %d", serial);
+#endif
dispatchInts(serial, mSlotId, RIL_REQUEST_STK_HANDLE_CALL_SETUP_REQUESTED_FROM_SIM,
1, BOOL_TO_INT(accept));
return Void();
}
Return<void> RadioImpl::explicitCallTransfer(int32_t serial) {
+#if VDBG
RLOGD("explicitCallTransfer: serial %d", serial);
+#endif
dispatchVoid(serial, mSlotId, RIL_REQUEST_EXPLICIT_CALL_TRANSFER);
return Void();
}
Return<void> RadioImpl::setPreferredNetworkType(int32_t serial, PreferredNetworkType nwType) {
+#if VDBG
RLOGD("setPreferredNetworkType: serial %d", serial);
+#endif
dispatchInts(serial, mSlotId, RIL_REQUEST_SET_PREFERRED_NETWORK_TYPE, 1, nwType);
return Void();
}
Return<void> RadioImpl::getPreferredNetworkType(int32_t serial) {
+#if VDBG
RLOGD("getPreferredNetworkType: serial %d", serial);
+#endif
dispatchVoid(serial, mSlotId, RIL_REQUEST_GET_PREFERRED_NETWORK_TYPE);
return Void();
}
Return<void> RadioImpl::getNeighboringCids(int32_t serial) {
+#if VDBG
RLOGD("getNeighboringCids: serial %d", serial);
+#endif
dispatchVoid(serial, mSlotId, RIL_REQUEST_GET_NEIGHBORING_CELL_IDS);
return Void();
}
Return<void> RadioImpl::setLocationUpdates(int32_t serial, bool enable) {
+#if VDBG
RLOGD("setLocationUpdates: serial %d", serial);
+#endif
dispatchInts(serial, mSlotId, RIL_REQUEST_SET_LOCATION_UPDATES, 1, BOOL_TO_INT(enable));
return Void();
}
Return<void> RadioImpl::setCdmaSubscriptionSource(int32_t serial, CdmaSubscriptionSource cdmaSub) {
+#if VDBG
RLOGD("setCdmaSubscriptionSource: serial %d", serial);
+#endif
dispatchInts(serial, mSlotId, RIL_REQUEST_CDMA_SET_SUBSCRIPTION_SOURCE, 1, cdmaSub);
return Void();
}
Return<void> RadioImpl::setCdmaRoamingPreference(int32_t serial, CdmaRoamingType type) {
+#if VDBG
RLOGD("setCdmaRoamingPreference: serial %d", serial);
+#endif
dispatchInts(serial, mSlotId, RIL_REQUEST_CDMA_SET_ROAMING_PREFERENCE, 1, type);
return Void();
}
Return<void> RadioImpl::getCdmaRoamingPreference(int32_t serial) {
+#if VDBG
RLOGD("getCdmaRoamingPreference: serial %d", serial);
+#endif
dispatchVoid(serial, mSlotId, RIL_REQUEST_CDMA_QUERY_ROAMING_PREFERENCE);
return Void();
}
Return<void> RadioImpl::setTTYMode(int32_t serial, TtyMode mode) {
+#if VDBG
RLOGD("setTTYMode: serial %d", serial);
+#endif
dispatchInts(serial, mSlotId, RIL_REQUEST_SET_TTY_MODE, 1, mode);
return Void();
}
Return<void> RadioImpl::getTTYMode(int32_t serial) {
+#if VDBG
RLOGD("getTTYMode: serial %d", serial);
+#endif
dispatchVoid(serial, mSlotId, RIL_REQUEST_QUERY_TTY_MODE);
return Void();
}
Return<void> RadioImpl::setPreferredVoicePrivacy(int32_t serial, bool enable) {
+#if VDBG
RLOGD("setPreferredVoicePrivacy: serial %d", serial);
+#endif
dispatchInts(serial, mSlotId, RIL_REQUEST_CDMA_SET_PREFERRED_VOICE_PRIVACY_MODE,
1, BOOL_TO_INT(enable));
return Void();
}
Return<void> RadioImpl::getPreferredVoicePrivacy(int32_t serial) {
+#if VDBG
RLOGD("getPreferredVoicePrivacy: serial %d", serial);
+#endif
dispatchVoid(serial, mSlotId, RIL_REQUEST_CDMA_QUERY_PREFERRED_VOICE_PRIVACY_MODE);
return Void();
}
Return<void> RadioImpl::sendCDMAFeatureCode(int32_t serial, const hidl_string& featureCode) {
+#if VDBG
RLOGD("sendCDMAFeatureCode: serial %d", serial);
+#endif
dispatchString(serial, mSlotId, RIL_REQUEST_CDMA_FLASH,
- (const char *) featureCode);
+ featureCode.c_str());
return Void();
}
Return<void> RadioImpl::sendBurstDtmf(int32_t serial, const hidl_string& dtmf, int32_t on,
int32_t off) {
+#if VDBG
RLOGD("sendBurstDtmf: serial %d", serial);
+#endif
dispatchStrings(serial, mSlotId, RIL_REQUEST_CDMA_BURST_DTMF,
- 3, (const char *) dtmf, (const char *) (std::to_string(on)).c_str(),
- (const char *) (std::to_string(off)).c_str());
+ 3, dtmf.c_str(), (std::to_string(on)).c_str(),
+ (std::to_string(off)).c_str());
return Void();
}
void constructCdmaSms(RIL_CDMA_SMS_Message &rcsm, const CdmaSmsMessage& sms) {
- memset(&rcsm, 0, sizeof(rcsm));
-
rcsm.uTeleserviceID = sms.teleserviceId;
rcsm.bIsServicePresent = BOOL_TO_INT(sms.isServicePresent);
rcsm.uServicecategory = sms.serviceCategory;
}
Return<void> RadioImpl::sendCdmaSms(int32_t serial, const CdmaSmsMessage& sms) {
+#if VDBG
RLOGD("sendCdmaSms: serial %d", serial);
+#endif
RequestInfo *pRI = android::addRequestToList(serial, mSlotId, RIL_REQUEST_CDMA_SEND_SMS);
if (pRI == NULL) {
return Void();
}
- RIL_CDMA_SMS_Message rcsm;
+ RIL_CDMA_SMS_Message rcsm = {};
constructCdmaSms(rcsm, sms);
s_vendorFunctions->onRequest(pRI->pCI->requestNumber, &rcsm, sizeof(rcsm), pRI);
}
Return<void> RadioImpl::acknowledgeLastIncomingCdmaSms(int32_t serial, const CdmaSmsAck& smsAck) {
+#if VDBG
RLOGD("acknowledgeLastIncomingCdmaSms: serial %d", serial);
+#endif
RequestInfo *pRI = android::addRequestToList(serial, mSlotId, RIL_REQUEST_CDMA_SMS_ACKNOWLEDGE);
if (pRI == NULL) {
return Void();
}
Return<void> RadioImpl::getGsmBroadcastConfig(int32_t serial) {
+#if VDBG
RLOGD("getGsmBroadcastConfig: serial %d", serial);
+#endif
dispatchVoid(serial, mSlotId, RIL_REQUEST_GSM_GET_BROADCAST_SMS_CONFIG);
return Void();
}
Return<void> RadioImpl::setGsmBroadcastConfig(int32_t serial,
const hidl_vec<GsmBroadcastSmsConfigInfo>&
configInfo) {
+#if VDBG
RLOGD("setGsmBroadcastConfig: serial %d", serial);
+#endif
RequestInfo *pRI = android::addRequestToList(serial, mSlotId,
RIL_REQUEST_GSM_SET_BROADCAST_SMS_CONFIG);
if (pRI == NULL) {
}
Return<void> RadioImpl::setGsmBroadcastActivation(int32_t serial, bool activate) {
+#if VDBG
RLOGD("setGsmBroadcastActivation: serial %d", serial);
+#endif
dispatchInts(serial, mSlotId, RIL_REQUEST_GSM_SMS_BROADCAST_ACTIVATION,
1, BOOL_TO_INT(!activate));
return Void();
}
Return<void> RadioImpl::getCdmaBroadcastConfig(int32_t serial) {
+#if VDBG
RLOGD("getCdmaBroadcastConfig: serial %d", serial);
+#endif
dispatchVoid(serial, mSlotId, RIL_REQUEST_CDMA_GET_BROADCAST_SMS_CONFIG);
return Void();
}
Return<void> RadioImpl::setCdmaBroadcastConfig(int32_t serial,
const hidl_vec<CdmaBroadcastSmsConfigInfo>&
configInfo) {
+#if VDBG
RLOGD("setCdmaBroadcastConfig: serial %d", serial);
+#endif
RequestInfo *pRI = android::addRequestToList(serial, mSlotId,
RIL_REQUEST_CDMA_SET_BROADCAST_SMS_CONFIG);
if (pRI == NULL) {
}
Return<void> RadioImpl::setCdmaBroadcastActivation(int32_t serial, bool activate) {
+#if VDBG
RLOGD("setCdmaBroadcastActivation: serial %d", serial);
+#endif
dispatchInts(serial, mSlotId, RIL_REQUEST_CDMA_SMS_BROADCAST_ACTIVATION,
1, BOOL_TO_INT(!activate));
return Void();
}
Return<void> RadioImpl::getCDMASubscription(int32_t serial) {
+#if VDBG
RLOGD("getCDMASubscription: serial %d", serial);
+#endif
dispatchVoid(serial, mSlotId, RIL_REQUEST_CDMA_SUBSCRIPTION);
return Void();
}
Return<void> RadioImpl::writeSmsToRuim(int32_t serial, const CdmaSmsWriteArgs& cdmaSms) {
+#if VDBG
RLOGD("writeSmsToRuim: serial %d", serial);
+#endif
RequestInfo *pRI = android::addRequestToList(serial, mSlotId,
RIL_REQUEST_CDMA_WRITE_SMS_TO_RUIM);
if (pRI == NULL) {
}
Return<void> RadioImpl::deleteSmsOnRuim(int32_t serial, int32_t index) {
+#if VDBG
RLOGD("deleteSmsOnRuim: serial %d", serial);
+#endif
dispatchInts(serial, mSlotId, RIL_REQUEST_CDMA_DELETE_SMS_ON_RUIM, 1, index);
return Void();
}
Return<void> RadioImpl::getDeviceIdentity(int32_t serial) {
+#if VDBG
RLOGD("getDeviceIdentity: serial %d", serial);
+#endif
dispatchVoid(serial, mSlotId, RIL_REQUEST_DEVICE_IDENTITY);
return Void();
}
Return<void> RadioImpl::exitEmergencyCallbackMode(int32_t serial) {
+#if VDBG
RLOGD("exitEmergencyCallbackMode: serial %d", serial);
+#endif
dispatchVoid(serial, mSlotId, RIL_REQUEST_EXIT_EMERGENCY_CALLBACK_MODE);
return Void();
}
Return<void> RadioImpl::getSmscAddress(int32_t serial) {
+#if VDBG
RLOGD("getSmscAddress: serial %d", serial);
+#endif
dispatchVoid(serial, mSlotId, RIL_REQUEST_GET_SMSC_ADDRESS);
return Void();
}
Return<void> RadioImpl::setSmscAddress(int32_t serial, const hidl_string& smsc) {
+#if VDBG
RLOGD("setSmscAddress: serial %d", serial);
+#endif
dispatchString(serial, mSlotId, RIL_REQUEST_SET_SMSC_ADDRESS,
- (const char *) smsc);
+ smsc.c_str());
return Void();
}
Return<void> RadioImpl::reportSmsMemoryStatus(int32_t serial, bool available) {
+#if VDBG
RLOGD("reportSmsMemoryStatus: serial %d", serial);
+#endif
dispatchInts(serial, mSlotId, RIL_REQUEST_REPORT_SMS_MEMORY_STATUS, 1,
BOOL_TO_INT(available));
return Void();
}
Return<void> RadioImpl::reportStkServiceIsRunning(int32_t serial) {
+#if VDBG
RLOGD("reportStkServiceIsRunning: serial %d", serial);
+#endif
dispatchVoid(serial, mSlotId, RIL_REQUEST_REPORT_STK_SERVICE_IS_RUNNING);
return Void();
}
Return<void> RadioImpl::getCdmaSubscriptionSource(int32_t serial) {
+#if VDBG
RLOGD("getCdmaSubscriptionSource: serial %d", serial);
+#endif
dispatchVoid(serial, mSlotId, RIL_REQUEST_CDMA_GET_SUBSCRIPTION_SOURCE);
return Void();
}
Return<void> RadioImpl::requestIsimAuthentication(int32_t serial, const hidl_string& challenge) {
+#if VDBG
RLOGD("requestIsimAuthentication: serial %d", serial);
+#endif
dispatchString(serial, mSlotId, RIL_REQUEST_ISIM_AUTHENTICATION,
- (const char *) challenge);
+ challenge.c_str());
return Void();
}
Return<void> RadioImpl::acknowledgeIncomingGsmSmsWithPdu(int32_t serial, bool success,
const hidl_string& ackPdu) {
+#if VDBG
RLOGD("acknowledgeIncomingGsmSmsWithPdu: serial %d", serial);
+#endif
dispatchStrings(serial, mSlotId, RIL_REQUEST_ACKNOWLEDGE_INCOMING_GSM_SMS_WITH_PDU,
- 2, success ? "1" : "0", (const char *) ackPdu);
+ 2, success ? "1" : "0", ackPdu.c_str());
return Void();
}
Return<void> RadioImpl::sendEnvelopeWithStatus(int32_t serial, const hidl_string& contents) {
+#if VDBG
RLOGD("sendEnvelopeWithStatus: serial %d", serial);
+#endif
dispatchString(serial, mSlotId, RIL_REQUEST_STK_SEND_ENVELOPE_WITH_STATUS,
- (const char *) contents);
+ contents.c_str());
return Void();
}
Return<void> RadioImpl::getVoiceRadioTechnology(int32_t serial) {
+#if VDBG
RLOGD("getVoiceRadioTechnology: serial %d", serial);
+#endif
dispatchVoid(serial, mSlotId, RIL_REQUEST_VOICE_RADIO_TECH);
return Void();
}
Return<void> RadioImpl::getCellInfoList(int32_t serial) {
+#if VDBG
RLOGD("getCellInfoList: serial %d", serial);
+#endif
dispatchVoid(serial, mSlotId, RIL_REQUEST_GET_CELL_INFO_LIST);
return Void();
}
Return<void> RadioImpl::setCellInfoListRate(int32_t serial, int32_t rate) {
+#if VDBG
RLOGD("setCellInfoListRate: serial %d", serial);
+#endif
dispatchInts(serial, mSlotId, RIL_REQUEST_SET_UNSOL_CELL_INFO_LIST_RATE, 1, rate);
return Void();
}
Return<void> RadioImpl::setInitialAttachApn(int32_t serial, const DataProfileInfo& dataProfileInfo,
bool modemCognitive, bool isRoaming) {
+#if VDBG
RLOGD("setInitialAttachApn: serial %d", serial);
+#endif
RequestInfo *pRI = android::addRequestToList(serial, mSlotId,
RIL_REQUEST_SET_INITIAL_ATTACH_APN);
if (pRI == NULL) {
(isRoaming ? dataProfileInfo.roamingProtocol : dataProfileInfo.protocol);
if (!copyHidlStringToRil(&iaa.protocol, protocol, pRI)) {
+ memsetAndFreeStrings(1, iaa.apn);
return Void();
}
iaa.authtype = (int) dataProfileInfo.authType;
if (!copyHidlStringToRil(&iaa.username, dataProfileInfo.user, pRI)) {
+ memsetAndFreeStrings(2, iaa.apn, iaa.protocol);
return Void();
}
if (!copyHidlStringToRil(&iaa.password, dataProfileInfo.password, pRI)) {
+ memsetAndFreeStrings(3, iaa.apn, iaa.protocol, iaa.username);
return Void();
}
return Void();
}
if (!copyHidlStringToRil(&iaa.protocol, dataProfileInfo.protocol, pRI)) {
+ memsetAndFreeStrings(1, iaa.apn);
return Void();
}
if (!copyHidlStringToRil(&iaa.roamingProtocol, dataProfileInfo.roamingProtocol, pRI)) {
+ memsetAndFreeStrings(2, iaa.apn, iaa.protocol);
return Void();
}
iaa.authtype = (int) dataProfileInfo.authType;
if (!copyHidlStringToRil(&iaa.username, dataProfileInfo.user, pRI)) {
+ memsetAndFreeStrings(3, iaa.apn, iaa.protocol, iaa.roamingProtocol);
return Void();
}
if (!copyHidlStringToRil(&iaa.password, dataProfileInfo.password, pRI)) {
+ memsetAndFreeStrings(4, iaa.apn, iaa.protocol, iaa.roamingProtocol, iaa.username);
return Void();
}
iaa.supportedTypesBitmask = dataProfileInfo.supportedApnTypesBitmap;
iaa.modemCognitive = BOOL_TO_INT(modemCognitive);
iaa.mtu = dataProfileInfo.mtu;
- // Note that there is no need for memory allocation/free.
- iaa.mvnoType = (char *) convertMvnoTypeToString(dataProfileInfo.mvnoType);
- if (iaa.mvnoType == NULL) {
+ if (!convertMvnoTypeToString(dataProfileInfo.mvnoType, iaa.mvnoType)) {
sendErrorResponse(pRI, RIL_E_INVALID_ARGUMENTS);
+ memsetAndFreeStrings(5, iaa.apn, iaa.protocol, iaa.roamingProtocol, iaa.username,
+ iaa.password);
return Void();
}
if (!copyHidlStringToRil(&iaa.mvnoMatchData, dataProfileInfo.mvnoMatchData, pRI)) {
+ memsetAndFreeStrings(5, iaa.apn, iaa.protocol, iaa.roamingProtocol, iaa.username,
+ iaa.password);
return Void();
}
}
Return<void> RadioImpl::getImsRegistrationState(int32_t serial) {
+#if VDBG
RLOGD("getImsRegistrationState: serial %d", serial);
+#endif
dispatchVoid(serial, mSlotId, RIL_REQUEST_IMS_REGISTRATION_STATE);
return Void();
}
if (!copyHidlStringToRil(&pStrings[0], message.gsmMessage[0].smscPdu, pRI)) {
#ifdef MEMSET_FREED
- memset(pStrings, 0, datalen);
+ memset(pStrings, 0, dataLen);
#endif
free(pStrings);
return false;
if (!copyHidlStringToRil(&pStrings[1], message.gsmMessage[0].pdu, pRI)) {
memsetAndFreeStrings(1, pStrings[0]);
#ifdef MEMSET_FREED
- memset(pStrings, 0, datalen);
+ memset(pStrings, 0, dataLen);
#endif
free(pStrings);
return false;
}
#ifdef MEMSET_FREED
- memset(pStrings, 0, datalen);
+ memset(pStrings, 0, dataLen);
#endif
free(pStrings);
}
bool dispatchImsCdmaSms(const ImsSmsMessage& message, RequestInfo *pRI) {
- RIL_IMS_SMS_Message rism;
- RIL_CDMA_SMS_Message rcsm;
+ RIL_IMS_SMS_Message rism = {};
+ RIL_CDMA_SMS_Message rcsm = {};
if (message.cdmaMessage.size() != 1) {
RLOGE("dispatchImsCdmaSms: Invalid len %s", requestToString(pRI->pCI->requestNumber));
}
Return<void> RadioImpl::sendImsSms(int32_t serial, const ImsSmsMessage& message) {
+#if VDBG
RLOGD("sendImsSms: serial %d", serial);
+#endif
RequestInfo *pRI = android::addRequestToList(serial, mSlotId, RIL_REQUEST_IMS_SEND_SMS);
if (pRI == NULL) {
return Void();
}
Return<void> RadioImpl::iccTransmitApduBasicChannel(int32_t serial, const SimApdu& message) {
+#if VDBG
RLOGD("iccTransmitApduBasicChannel: serial %d", serial);
+#endif
dispatchIccApdu(serial, mSlotId, RIL_REQUEST_SIM_TRANSMIT_APDU_BASIC, message);
return Void();
}
-Return<void> RadioImpl::iccOpenLogicalChannel(int32_t serial, const hidl_string& aid) {
+Return<void> RadioImpl::iccOpenLogicalChannel(int32_t serial, const hidl_string& aid, int32_t p2) {
+#if VDBG
RLOGD("iccOpenLogicalChannel: serial %d", serial);
- dispatchString(serial, mSlotId, RIL_REQUEST_SIM_OPEN_CHANNEL,
- (const char *) aid);
+#endif
+ if (s_vendorFunctions->version < 15) {
+ dispatchString(serial, mSlotId, RIL_REQUEST_SIM_OPEN_CHANNEL, aid.c_str());
+ } else {
+ RequestInfo *pRI = android::addRequestToList(serial, mSlotId, RIL_REQUEST_SIM_OPEN_CHANNEL);
+ if (pRI == NULL) {
+ return Void();
+ }
+
+ RIL_OpenChannelParams params = {};
+
+ params.p2 = p2;
+
+ if (!copyHidlStringToRil(¶ms.aidPtr, aid, pRI)) {
+ return Void();
+ }
+
+ s_vendorFunctions->onRequest(pRI->pCI->requestNumber, ¶ms, sizeof(params), pRI);
+
+ memsetAndFreeStrings(1, params.aidPtr);
+ }
return Void();
}
Return<void> RadioImpl::iccCloseLogicalChannel(int32_t serial, int32_t channelId) {
+#if VDBG
RLOGD("iccCloseLogicalChannel: serial %d", serial);
+#endif
dispatchInts(serial, mSlotId, RIL_REQUEST_SIM_CLOSE_CHANNEL, 1, channelId);
return Void();
}
Return<void> RadioImpl::iccTransmitApduLogicalChannel(int32_t serial, const SimApdu& message) {
+#if VDBG
RLOGD("iccTransmitApduLogicalChannel: serial %d", serial);
+#endif
dispatchIccApdu(serial, mSlotId, RIL_REQUEST_SIM_TRANSMIT_APDU_CHANNEL, message);
return Void();
}
Return<void> RadioImpl::nvReadItem(int32_t serial, NvItem itemId) {
+#if VDBG
RLOGD("nvReadItem: serial %d", serial);
+#endif
RequestInfo *pRI = android::addRequestToList(serial, mSlotId, RIL_REQUEST_NV_READ_ITEM);
if (pRI == NULL) {
return Void();
}
- RIL_NV_ReadItem nvri;
- memset (&nvri, 0, sizeof(nvri));
+ RIL_NV_ReadItem nvri = {};
nvri.itemID = (RIL_NV_Item) itemId;
s_vendorFunctions->onRequest(pRI->pCI->requestNumber, &nvri, sizeof(nvri), pRI);
}
Return<void> RadioImpl::nvWriteItem(int32_t serial, const NvWriteItem& item) {
+#if VDBG
RLOGD("nvWriteItem: serial %d", serial);
+#endif
RequestInfo *pRI = android::addRequestToList(serial, mSlotId, RIL_REQUEST_NV_WRITE_ITEM);
if (pRI == NULL) {
return Void();
}
- RIL_NV_WriteItem nvwi;
- memset (&nvwi, 0, sizeof(nvwi));
+ RIL_NV_WriteItem nvwi = {};
nvwi.itemID = (RIL_NV_Item) item.itemId;
}
Return<void> RadioImpl::nvWriteCdmaPrl(int32_t serial, const hidl_vec<uint8_t>& prl) {
+#if VDBG
RLOGD("nvWriteCdmaPrl: serial %d", serial);
+#endif
dispatchRaw(serial, mSlotId, RIL_REQUEST_NV_WRITE_CDMA_PRL, prl);
return Void();
}
Return<void> RadioImpl::nvResetConfig(int32_t serial, ResetNvType resetType) {
+ int rilResetType = -1;
+#if VDBG
RLOGD("nvResetConfig: serial %d", serial);
- dispatchInts(serial, mSlotId, RIL_REQUEST_NV_RESET_CONFIG, 1, (int) resetType);
+#endif
+ /* Convert ResetNvType to RIL.h values
+ * RIL_REQUEST_NV_RESET_CONFIG
+ * 1 - reload all NV items
+ * 2 - erase NV reset (SCRTN)
+ * 3 - factory reset (RTN)
+ */
+ switch(resetType) {
+ case ResetNvType::RELOAD:
+ rilResetType = 1;
+ break;
+ case ResetNvType::ERASE:
+ rilResetType = 2;
+ break;
+ case ResetNvType::FACTORY_RESET:
+ rilResetType = 3;
+ break;
+ }
+ dispatchInts(serial, mSlotId, RIL_REQUEST_NV_RESET_CONFIG, 1, rilResetType);
return Void();
}
Return<void> RadioImpl::setUiccSubscription(int32_t serial, const SelectUiccSub& uiccSub) {
+#if VDBG
RLOGD("setUiccSubscription: serial %d", serial);
+#endif
RequestInfo *pRI = android::addRequestToList(serial, mSlotId,
RIL_REQUEST_SET_UICC_SUBSCRIPTION);
if (pRI == NULL) {
}
Return<void> RadioImpl::setDataAllowed(int32_t serial, bool allow) {
+#if VDBG
RLOGD("setDataAllowed: serial %d", serial);
+#endif
dispatchInts(serial, mSlotId, RIL_REQUEST_ALLOW_DATA, 1, BOOL_TO_INT(allow));
return Void();
}
Return<void> RadioImpl::getHardwareConfig(int32_t serial) {
+#if VDBG
RLOGD("getHardwareConfig: serial %d", serial);
+#endif
dispatchVoid(serial, mSlotId, RIL_REQUEST_GET_HARDWARE_CONFIG);
return Void();
}
Return<void> RadioImpl::requestIccSimAuthentication(int32_t serial, int32_t authContext,
const hidl_string& authData, const hidl_string& aid) {
+#if VDBG
RLOGD("requestIccSimAuthentication: serial %d", serial);
+#endif
RequestInfo *pRI = android::addRequestToList(serial, mSlotId, RIL_REQUEST_SIM_AUTHENTICATION);
if (pRI == NULL) {
return Void();
}
- RIL_SimAuthentication pf;
- memset (&pf, 0, sizeof(pf));
+ RIL_SimAuthentication pf = {};
pf.authContext = authContext;
Return<void> RadioImpl::setDataProfile(int32_t serial, const hidl_vec<DataProfileInfo>& profiles,
bool isRoaming) {
+#if VDBG
RLOGD("setDataProfile: serial %d", serial);
+#endif
RequestInfo *pRI = android::addRequestToList(serial, mSlotId, RIL_REQUEST_SET_DATA_PROFILE);
if (pRI == NULL) {
return Void();
pRI)) {
success = false;
}
-
if (success && !copyHidlStringToRil(&dataProfiles[i].mvnoMatchData,
profiles[i].mvnoMatchData, pRI)) {
success = false;
}
- if (success) {
- dataProfiles[i].mvnoType = (char *) convertMvnoTypeToString(profiles[i].mvnoType);
- if (dataProfiles[i].mvnoType == NULL) {
- sendErrorResponse(pRI, RIL_E_INVALID_ARGUMENTS);
- success = false;
- }
+ if (success && !convertMvnoTypeToString(profiles[i].mvnoType,
+ dataProfiles[i].mvnoType)) {
+ sendErrorResponse(pRI, RIL_E_INVALID_ARGUMENTS);
+ success = false;
}
if (!success) {
}
Return<void> RadioImpl::requestShutdown(int32_t serial) {
+#if VDBG
RLOGD("requestShutdown: serial %d", serial);
+#endif
dispatchVoid(serial, mSlotId, RIL_REQUEST_SHUTDOWN);
return Void();
}
Return<void> RadioImpl::getRadioCapability(int32_t serial) {
+#if VDBG
RLOGD("getRadioCapability: serial %d", serial);
+#endif
dispatchVoid(serial, mSlotId, RIL_REQUEST_GET_RADIO_CAPABILITY);
return Void();
}
Return<void> RadioImpl::setRadioCapability(int32_t serial, const RadioCapability& rc) {
+#if VDBG
RLOGD("setRadioCapability: serial %d", serial);
+#endif
RequestInfo *pRI = android::addRequestToList(serial, mSlotId, RIL_REQUEST_SET_RADIO_CAPABILITY);
if (pRI == NULL) {
return Void();
}
- RIL_RadioCapability rilRc;
- memset (&rilRc, 0, sizeof(rilRc));
+ RIL_RadioCapability rilRc = {};
// TODO : set rilRc.version using HIDL version ?
rilRc.session = rc.session;
rilRc.phase = (int) rc.phase;
rilRc.rat = (int) rc.raf;
rilRc.status = (int) rc.status;
- strncpy(rilRc.logicalModemUuid, (const char *) rc.logicalModemUuid, MAX_UUID_LENGTH);
+ strncpy(rilRc.logicalModemUuid, rc.logicalModemUuid.c_str(), MAX_UUID_LENGTH);
s_vendorFunctions->onRequest(pRI->pCI->requestNumber, &rilRc, sizeof(rilRc), pRI);
}
Return<void> RadioImpl::startLceService(int32_t serial, int32_t reportInterval, bool pullMode) {
+#if VDBG
RLOGD("startLceService: serial %d", serial);
+#endif
dispatchInts(serial, mSlotId, RIL_REQUEST_START_LCE, 2, reportInterval,
BOOL_TO_INT(pullMode));
return Void();
}
Return<void> RadioImpl::stopLceService(int32_t serial) {
+#if VDBG
RLOGD("stopLceService: serial %d", serial);
+#endif
dispatchVoid(serial, mSlotId, RIL_REQUEST_STOP_LCE);
return Void();
}
Return<void> RadioImpl::pullLceData(int32_t serial) {
+#if VDBG
RLOGD("pullLceData: serial %d", serial);
+#endif
dispatchVoid(serial, mSlotId, RIL_REQUEST_PULL_LCEDATA);
return Void();
}
Return<void> RadioImpl::getModemActivityInfo(int32_t serial) {
+#if VDBG
RLOGD("getModemActivityInfo: serial %d", serial);
+#endif
dispatchVoid(serial, mSlotId, RIL_REQUEST_GET_ACTIVITY_INFO);
return Void();
}
Return<void> RadioImpl::setAllowedCarriers(int32_t serial, bool allAllowed,
const CarrierRestrictions& carriers) {
+#if VDBG
RLOGD("setAllowedCarriers: serial %d", serial);
+#endif
RequestInfo *pRI = android::addRequestToList(serial, mSlotId,
RIL_REQUEST_SET_CARRIER_RESTRICTIONS);
if (pRI == NULL) {
cr.excluded_carriers = excludedCarriers;
for (int i = 0; i < cr.len_allowed_carriers; i++) {
- allowedCarriers[i].mcc = (const char *) carriers.allowedCarriers[i].mcc;
- allowedCarriers[i].mnc = (const char *) carriers.allowedCarriers[i].mnc;
+ allowedCarriers[i].mcc = carriers.allowedCarriers[i].mcc.c_str();
+ allowedCarriers[i].mnc = carriers.allowedCarriers[i].mnc.c_str();
allowedCarriers[i].match_type = (RIL_CarrierMatchType) carriers.allowedCarriers[i].matchType;
- allowedCarriers[i].match_data = (const char *) carriers.allowedCarriers[i].matchData;
+ allowedCarriers[i].match_data = carriers.allowedCarriers[i].matchData.c_str();
}
for (int i = 0; i < cr.len_excluded_carriers; i++) {
- excludedCarriers[i].mcc = (const char *) carriers.excludedCarriers[i].mcc;
- excludedCarriers[i].mnc = (const char *) carriers.excludedCarriers[i].mnc;
+ excludedCarriers[i].mcc = carriers.excludedCarriers[i].mcc.c_str();
+ excludedCarriers[i].mnc = carriers.excludedCarriers[i].mnc.c_str();
excludedCarriers[i].match_type =
(RIL_CarrierMatchType) carriers.excludedCarriers[i].matchType;
- excludedCarriers[i].match_data = (const char *) carriers.excludedCarriers[i].matchData;
+ excludedCarriers[i].match_data = carriers.excludedCarriers[i].matchData.c_str();
}
s_vendorFunctions->onRequest(pRI->pCI->requestNumber, &cr, sizeof(RIL_CarrierRestrictions), pRI);
}
Return<void> RadioImpl::getAllowedCarriers(int32_t serial) {
+#if VDBG
RLOGD("getAllowedCarriers: serial %d", serial);
+#endif
dispatchVoid(serial, mSlotId, RIL_REQUEST_GET_CARRIER_RESTRICTIONS);
return Void();
}
Return<void> RadioImpl::sendDeviceState(int32_t serial, DeviceStateType deviceStateType,
bool state) {
+#if VDBG
RLOGD("sendDeviceState: serial %d", serial);
+#endif
if (s_vendorFunctions->version < 15) {
if (deviceStateType == DeviceStateType::LOW_DATA_EXPECTED) {
RLOGD("sendDeviceState: calling screen state %d", BOOL_TO_INT(!state));
}
Return<void> RadioImpl::setIndicationFilter(int32_t serial, int32_t indicationFilter) {
+#if VDBG
RLOGD("setIndicationFilter: serial %d", serial);
+#endif
if (s_vendorFunctions->version < 15) {
RequestInfo *pRI = android::addRequestToList(serial, mSlotId,
RIL_REQUEST_SET_UNSOLICITED_RESPONSE_FILTER);
}
Return<void> RadioImpl::setSimCardPower(int32_t serial, bool powerUp) {
+#if VDBG
RLOGD("setSimCardPower: serial %d", serial);
+#endif
dispatchInts(serial, mSlotId, RIL_REQUEST_SET_SIM_CARD_POWER, 1, BOOL_TO_INT(powerUp));
return Void();
}
+Return<void> RadioImpl::setSimCardPower_1_1(int32_t serial,
+ const ::android::hardware::radio::V1_1::CardPowerState state) {
+#if VDBG
+ RLOGD("setSimCardPower_1_1: serial %d state %d", serial, state);
+#endif
+ dispatchInts(serial, mSlotId, RIL_REQUEST_SET_SIM_CARD_POWER, 1, state);
+ return Void();
+}
+
Return<void> RadioImpl::responseAcknowledgement() {
android::releaseWakeLock();
return Void();
Return<void> OemHookImpl::setResponseFunctions(
const ::android::sp<IOemHookResponse>& oemHookResponseParam,
const ::android::sp<IOemHookIndication>& oemHookIndicationParam) {
+#if VDBG
RLOGD("OemHookImpl::setResponseFunctions");
+#endif
pthread_rwlock_t *radioServiceRwlockPtr = radio::getRadioServiceRwlock(mSlotId);
int ret = pthread_rwlock_wrlock(radioServiceRwlockPtr);
mOemHookResponse = oemHookResponseParam;
mOemHookIndication = oemHookIndicationParam;
- mCounter[mSlotId]++;
+ mCounterOemHook[mSlotId]++;
ret = pthread_rwlock_unlock(radioServiceRwlockPtr);
assert(ret == 0);
}
Return<void> OemHookImpl::sendRequestRaw(int32_t serial, const hidl_vec<uint8_t>& data) {
+#if VDBG
RLOGD("OemHookImpl::sendRequestRaw: serial %d", serial);
+#endif
dispatchRaw(serial, mSlotId, RIL_REQUEST_OEM_HOOK_RAW, data);
return Void();
}
Return<void> OemHookImpl::sendRequestStrings(int32_t serial,
const hidl_vec<hidl_string>& data) {
+#if VDBG
RLOGD("OemHookImpl::sendRequestStrings: serial %d", serial);
+#endif
dispatchStrings(serial, mSlotId, RIL_REQUEST_OEM_HOOK_STRINGS, data);
return Void();
}
+Return<void> RadioImpl::setCarrierInfoForImsiEncryption(int32_t serial,
+ const ::android::hardware::radio::V1_1::ImsiEncryptionInfo& data) {
+ RLOGD("setCarrierInfoForImsiEncryption: serial %d", serial);
+ RequestInfo *pRI = android::addRequestToList(serial, mSlotId, RIL_REQUEST_SET_CARRIER_INFO_IMSI_ENCRYPTION);
+ RIL_CarrierInfoForImsiEncryption imsiEncryption = {};
+
+ if (!copyHidlStringToRil(&imsiEncryption.mnc, data.mnc, pRI)) {
+ return Void();
+ }
+ if (!copyHidlStringToRil(&imsiEncryption.mcc, data.mcc, pRI)) {
+ memsetAndFreeStrings(1, imsiEncryption.mnc);
+ return Void();
+ }
+ if (!copyHidlStringToRil(&imsiEncryption.keyIdentifier, data.keyIdentifier, pRI)) {
+ memsetAndFreeStrings(2, imsiEncryption.mnc, imsiEncryption.mcc);
+ return Void();
+ }
+ int32_t lSize = data.carrierKey.size();
+ imsiEncryption.carrierKey = new uint8_t[lSize];
+ memcpy(imsiEncryption.carrierKey, data.carrierKey.data(), lSize);
+ imsiEncryption.expirationTime = data.expirationTime;
+ s_vendorFunctions->onRequest(pRI->pCI->requestNumber, &imsiEncryption, sizeof(RIL_CarrierInfoForImsiEncryption), pRI);
+ delete(imsiEncryption.carrierKey);
+ return Void();
+}
+
+Return<void> RadioImpl::startKeepalive(int32_t serial, const KeepaliveRequest& keepalive) {
+ RLOGD("startKeepalive: serial %d", serial);
+ return Void();
+}
+
+Return<void> RadioImpl::stopKeepalive(int32_t serial, int32_t sessionHandle) {
+ RLOGD("stopKeepalive: serial %d", serial);
+ return Void();
+}
+
+
/***************************************************************************************************
* RESPONSE FUNCTIONS
* Functions above are used for requests going from framework to vendor code. The ones below are
responseInfo.error = (RadioError) e;
}
+int responseIntOrEmpty(RadioResponseInfo& responseInfo, int serial, int responseType, RIL_Errno e,
+ void *response, size_t responseLen) {
+ populateResponseInfo(responseInfo, serial, responseType, e);
+ int ret = -1;
+
+ if (response == NULL && responseLen == 0) {
+ // Earlier RILs did not send a response for some cases although the interface
+ // expected an integer as response. Do not return error if response is empty. Instead
+ // Return -1 in those cases to maintain backward compatibility.
+ } else if (response == NULL || responseLen != sizeof(int)) {
+ RLOGE("responseIntOrEmpty: Invalid response");
+ if (e == RIL_E_SUCCESS) responseInfo.error = RadioError::INVALID_RESPONSE;
+ } else {
+ int *p_int = (int *) response;
+ ret = p_int[0];
+ }
+ return ret;
+}
+
int responseInt(RadioResponseInfo& responseInfo, int serial, int responseType, RIL_Errno e,
void *response, size_t responseLen) {
populateResponseInfo(responseInfo, serial, responseType, e);
RadioResponseInfo responseInfo = {};
populateResponseInfo(responseInfo, serial, responseType, e);
CardStatus cardStatus = {};
- if (response == NULL || responseLen != sizeof(RIL_CardStatus_v6)) {
+ RIL_CardStatus_v6 *p_cur = ((RIL_CardStatus_v6 *) response);
+ if (response == NULL || responseLen != sizeof(RIL_CardStatus_v6)
+ || p_cur->gsm_umts_subscription_app_index >= p_cur->num_applications
+ || p_cur->cdma_subscription_app_index >= p_cur->num_applications
+ || p_cur->ims_subscription_app_index >= p_cur->num_applications) {
RLOGE("getIccCardStatusResponse: Invalid response");
if (e == RIL_E_SUCCESS) responseInfo.error = RadioError::INVALID_RESPONSE;
} else {
- RIL_CardStatus_v6 *p_cur = ((RIL_CardStatus_v6 *) response);
cardStatus.cardState = (CardState) p_cur->card_state;
cardStatus.universalPinState = (PinState) p_cur->universal_pin_state;
cardStatus.gsmUmtsSubscriptionAppIndex = p_cur->gsm_umts_subscription_app_index;
RIL_AppStatus *rilAppStatus = p_cur->applications;
cardStatus.applications.resize(p_cur->num_applications);
AppStatus *appStatus = cardStatus.applications.data();
+#if VDBG
RLOGD("getIccCardStatusResponse: num_applications %d", p_cur->num_applications);
+#endif
for (int i = 0; i < p_cur->num_applications; i++) {
appStatus[i].appType = (AppType) rilAppStatus[i].app_type;
appStatus[i].appState = (AppState) rilAppStatus[i].app_state;
int radio::supplyIccPinForAppResponse(int slotId,
int responseType, int serial, RIL_Errno e,
void *response, size_t responseLen) {
+#if VDBG
RLOGD("supplyIccPinForAppResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
- int ret = responseInt(responseInfo, serial, responseType, e, response, responseLen);
+ int ret = responseIntOrEmpty(responseInfo, serial, responseType, e, response, responseLen);
Return<void> retStatus = radioService[slotId]->mRadioResponse->
supplyIccPinForAppResponse(responseInfo, ret);
radioService[slotId]->checkReturnStatus(retStatus);
int radio::supplyIccPukForAppResponse(int slotId,
int responseType, int serial, RIL_Errno e,
void *response, size_t responseLen) {
+#if VDBG
RLOGD("supplyIccPukForAppResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
- int ret = responseInt(responseInfo, serial, responseType, e, response, responseLen);
+ int ret = responseIntOrEmpty(responseInfo, serial, responseType, e, response, responseLen);
Return<void> retStatus = radioService[slotId]->mRadioResponse->supplyIccPukForAppResponse(
responseInfo, ret);
radioService[slotId]->checkReturnStatus(retStatus);
int radio::supplyIccPin2ForAppResponse(int slotId,
int responseType, int serial, RIL_Errno e,
void *response, size_t responseLen) {
+#if VDBG
RLOGD("supplyIccPin2ForAppResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
- int ret = responseInt(responseInfo, serial, responseType, e, response, responseLen);
+ int ret = responseIntOrEmpty(responseInfo, serial, responseType, e, response, responseLen);
Return<void> retStatus = radioService[slotId]->mRadioResponse->
supplyIccPin2ForAppResponse(responseInfo, ret);
radioService[slotId]->checkReturnStatus(retStatus);
int radio::supplyIccPuk2ForAppResponse(int slotId,
int responseType, int serial, RIL_Errno e,
void *response, size_t responseLen) {
+#if VDBG
RLOGD("supplyIccPuk2ForAppResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
- int ret = responseInt(responseInfo, serial, responseType, e, response, responseLen);
+ int ret = responseIntOrEmpty(responseInfo, serial, responseType, e, response, responseLen);
Return<void> retStatus = radioService[slotId]->mRadioResponse->
supplyIccPuk2ForAppResponse(responseInfo, ret);
radioService[slotId]->checkReturnStatus(retStatus);
int radio::changeIccPinForAppResponse(int slotId,
int responseType, int serial, RIL_Errno e,
void *response, size_t responseLen) {
+#if VDBG
RLOGD("changeIccPinForAppResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
- int ret = responseInt(responseInfo, serial, responseType, e, response, responseLen);
+ int ret = responseIntOrEmpty(responseInfo, serial, responseType, e, response, responseLen);
Return<void> retStatus = radioService[slotId]->mRadioResponse->
changeIccPinForAppResponse(responseInfo, ret);
radioService[slotId]->checkReturnStatus(retStatus);
int radio::changeIccPin2ForAppResponse(int slotId,
int responseType, int serial, RIL_Errno e,
void *response, size_t responseLen) {
+#if VDBG
RLOGD("changeIccPin2ForAppResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
- int ret = responseInt(responseInfo, serial, responseType, e, response, responseLen);
+ int ret = responseIntOrEmpty(responseInfo, serial, responseType, e, response, responseLen);
Return<void> retStatus = radioService[slotId]->mRadioResponse->
changeIccPin2ForAppResponse(responseInfo, ret);
radioService[slotId]->checkReturnStatus(retStatus);
int radio::supplyNetworkDepersonalizationResponse(int slotId,
int responseType, int serial, RIL_Errno e,
void *response, size_t responseLen) {
+#if VDBG
RLOGD("supplyNetworkDepersonalizationResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
- int ret = responseInt(responseInfo, serial, responseType, e, response, responseLen);
+ int ret = responseIntOrEmpty(responseInfo, serial, responseType, e, response, responseLen);
Return<void> retStatus = radioService[slotId]->mRadioResponse->
supplyNetworkDepersonalizationResponse(responseInfo, ret);
radioService[slotId]->checkReturnStatus(retStatus);
int radio::getCurrentCallsResponse(int slotId,
int responseType, int serial, RIL_Errno e,
void *response, size_t responseLen) {
+#if VDBG
RLOGD("getCurrentCallsResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::dialResponse(int slotId,
int responseType, int serial, RIL_Errno e, void *response,
size_t responseLen) {
+#if VDBG
RLOGD("dialResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::getIMSIForAppResponse(int slotId,
int responseType, int serial, RIL_Errno e, void *response,
size_t responseLen) {
+#if VDBG
RLOGD("getIMSIForAppResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::hangupConnectionResponse(int slotId,
int responseType, int serial, RIL_Errno e,
void *response, size_t responseLen) {
+#if VDBG
RLOGD("hangupConnectionResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::hangupWaitingOrBackgroundResponse(int slotId,
int responseType, int serial, RIL_Errno e,
void *response, size_t responseLen) {
+#if VDBG
RLOGD("hangupWaitingOrBackgroundResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::hangupForegroundResumeBackgroundResponse(int slotId, int responseType, int serial,
RIL_Errno e, void *response,
size_t responseLen) {
+#if VDBG
RLOGD("hangupWaitingOrBackgroundResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::switchWaitingOrHoldingAndActiveResponse(int slotId, int responseType, int serial,
RIL_Errno e, void *response,
size_t responseLen) {
+#if VDBG
RLOGD("switchWaitingOrHoldingAndActiveResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::conferenceResponse(int slotId, int responseType,
int serial, RIL_Errno e, void *response, size_t responseLen) {
+#if VDBG
RLOGD("conferenceResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::rejectCallResponse(int slotId, int responseType,
int serial, RIL_Errno e, void *response, size_t responseLen) {
+#if VDBG
RLOGD("rejectCallResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::getLastCallFailCauseResponse(int slotId,
int responseType, int serial, RIL_Errno e, void *response,
size_t responseLen) {
+#if VDBG
RLOGD("getLastCallFailCauseResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::getSignalStrengthResponse(int slotId,
int responseType, int serial, RIL_Errno e,
void *response, size_t responseLen) {
+#if VDBG
RLOGD("getSignalStrengthResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int numStrings, char** response) {
RIL_CellIdentity_v16 rilCellIdentity;
- int32_t *tmp = (int32_t*)&rilCellIdentity;
-
- for (size_t i = 0; i < sizeof(RIL_CellIdentity_v16)/sizeof(int32_t); i++) {
- tmp[i] = -1;
- }
+ memset(&rilCellIdentity, -1, sizeof(RIL_CellIdentity_v16));
rilCellIdentity.cellInfoType = getCellInfoTypeRadioTechnology(response[3]);
switch(rilCellIdentity.cellInfoType) {
case RIL_CELL_INFO_TYPE_CDMA:{
rilCellIdentity.cellIdentityCdma.basestationId =
convertResponseStringEntryToInt(response, 4, numStrings);
- rilCellIdentity.cellIdentityCdma.longitude =
- convertResponseStringEntryToInt(response, 5, numStrings);
+ /* Order of Lat. and Long. swapped between RIL and HIDL interface versions. */
rilCellIdentity.cellIdentityCdma.latitude =
+ convertResponseStringEntryToInt(response, 5, numStrings);
+ rilCellIdentity.cellIdentityCdma.longitude =
convertResponseStringEntryToInt(response, 6, numStrings);
rilCellIdentity.cellIdentityCdma.systemId =
convertResponseStringEntryToInt(response, 8, numStrings);
int numStrings, char** response) {
RIL_CellIdentity_v16 rilCellIdentity;
- int32_t *tmp = (int32_t*)&rilCellIdentity;
-
- for (size_t i = 0; i < sizeof(RIL_CellIdentity_v16)/sizeof(int32_t); i++) {
- tmp[i] = -1;
- }
+ memset(&rilCellIdentity, -1, sizeof(RIL_CellIdentity_v16));
rilCellIdentity.cellInfoType = getCellInfoTypeRadioTechnology(response[3]);
switch(rilCellIdentity.cellInfoType) {
int radio::getVoiceRegistrationStateResponse(int slotId,
int responseType, int serial, RIL_Errno e,
void *response, size_t responseLen) {
+#if VDBG
RLOGD("getVoiceRegistrationStateResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::getDataRegistrationStateResponse(int slotId,
int responseType, int serial, RIL_Errno e,
void *response, size_t responseLen) {
+#if VDBG
RLOGD("getDataRegistrationStateResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::getOperatorResponse(int slotId,
int responseType, int serial, RIL_Errno e, void *response,
size_t responseLen) {
+#if VDBG
RLOGD("getOperatorResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::sendDtmfResponse(int slotId,
int responseType, int serial, RIL_Errno e, void *response,
size_t responseLen) {
+#if VDBG
RLOGD("sendDtmfResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::sendSmsResponse(int slotId,
int responseType, int serial, RIL_Errno e, void *response,
size_t responseLen) {
+#if VDBG
RLOGD("sendSmsResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::sendSMSExpectMoreResponse(int slotId,
int responseType, int serial, RIL_Errno e, void *response,
size_t responseLen) {
+#if VDBG
RLOGD("sendSMSExpectMoreResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::setupDataCallResponse(int slotId,
int responseType, int serial, RIL_Errno e, void *response,
size_t responseLen) {
+#if VDBG
RLOGD("setupDataCallResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::iccIOForAppResponse(int slotId,
int responseType, int serial, RIL_Errno e, void *response,
size_t responseLen) {
+#if VDBG
RLOGD("iccIOForAppResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::sendUssdResponse(int slotId,
int responseType, int serial, RIL_Errno e, void *response,
size_t responseLen) {
+#if VDBG
RLOGD("sendUssdResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::cancelPendingUssdResponse(int slotId,
int responseType, int serial, RIL_Errno e, void *response,
size_t responseLen) {
+#if VDBG
RLOGD("cancelPendingUssdResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::getClirResponse(int slotId,
int responseType, int serial, RIL_Errno e, void *response,
size_t responseLen) {
+#if VDBG
RLOGD("getClirResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::setClirResponse(int slotId,
int responseType, int serial, RIL_Errno e, void *response,
size_t responseLen) {
+#if VDBG
RLOGD("setClirResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::getCallForwardStatusResponse(int slotId,
int responseType, int serial, RIL_Errno e,
void *response, size_t responseLen) {
+#if VDBG
RLOGD("getCallForwardStatusResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::setCallForwardResponse(int slotId,
int responseType, int serial, RIL_Errno e, void *response,
size_t responseLen) {
+#if VDBG
RLOGD("setCallForwardResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::getCallWaitingResponse(int slotId,
int responseType, int serial, RIL_Errno e, void *response,
size_t responseLen) {
+#if VDBG
RLOGD("getCallWaitingResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::setCallWaitingResponse(int slotId,
int responseType, int serial, RIL_Errno e, void *response,
size_t responseLen) {
+#if VDBG
RLOGD("setCallWaitingResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::acknowledgeLastIncomingGsmSmsResponse(int slotId,
int responseType, int serial, RIL_Errno e,
void *response, size_t responseLen) {
+#if VDBG
RLOGD("acknowledgeLastIncomingGsmSmsResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::acceptCallResponse(int slotId,
int responseType, int serial, RIL_Errno e,
void *response, size_t responseLen) {
+#if VDBG
RLOGD("acceptCallResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::deactivateDataCallResponse(int slotId,
int responseType, int serial, RIL_Errno e,
void *response, size_t responseLen) {
+#if VDBG
RLOGD("deactivateDataCallResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::getFacilityLockForAppResponse(int slotId,
int responseType, int serial, RIL_Errno e,
void *response, size_t responseLen) {
+#if VDBG
RLOGD("getFacilityLockForAppResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::setFacilityLockForAppResponse(int slotId,
int responseType, int serial, RIL_Errno e,
void *response, size_t responseLen) {
+#if VDBG
RLOGD("setFacilityLockForAppResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
- int ret = responseInt(responseInfo, serial, responseType, e, response, responseLen);
+ int ret = responseIntOrEmpty(responseInfo, serial, responseType, e, response, responseLen);
Return<void> retStatus
= radioService[slotId]->mRadioResponse->setFacilityLockForAppResponse(responseInfo,
ret);
int radio::setBarringPasswordResponse(int slotId,
int responseType, int serial, RIL_Errno e,
void *response, size_t responseLen) {
+#if VDBG
RLOGD("acceptCallResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::getNetworkSelectionModeResponse(int slotId,
int responseType, int serial, RIL_Errno e, void *response,
size_t responseLen) {
+#if VDBG
RLOGD("getNetworkSelectionModeResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::setNetworkSelectionModeAutomaticResponse(int slotId, int responseType, int serial,
RIL_Errno e, void *response,
size_t responseLen) {
+#if VDBG
RLOGD("setNetworkSelectionModeAutomaticResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::setNetworkSelectionModeManualResponse(int slotId,
int responseType, int serial, RIL_Errno e,
void *response, size_t responseLen) {
+#if VDBG
RLOGD("setNetworkSelectionModeManualResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::getAvailableNetworksResponse(int slotId,
int responseType, int serial, RIL_Errno e, void *response,
size_t responseLen) {
+#if VDBG
RLOGD("getAvailableNetworksResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::startDtmfResponse(int slotId,
int responseType, int serial, RIL_Errno e,
void *response, size_t responseLen) {
+#if VDBG
RLOGD("startDtmfResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::stopDtmfResponse(int slotId,
int responseType, int serial, RIL_Errno e,
void *response, size_t responseLen) {
+#if VDBG
RLOGD("stopDtmfResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::getBasebandVersionResponse(int slotId,
int responseType, int serial, RIL_Errno e,
void *response, size_t responseLen) {
+#if VDBG
RLOGD("getBasebandVersionResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::separateConnectionResponse(int slotId,
int responseType, int serial, RIL_Errno e,
void *response, size_t responseLen) {
+#if VDBG
RLOGD("separateConnectionResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::setMuteResponse(int slotId,
int responseType, int serial, RIL_Errno e,
void *response, size_t responseLen) {
+#if VDBG
RLOGD("setMuteResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::getMuteResponse(int slotId,
int responseType, int serial, RIL_Errno e, void *response,
size_t responseLen) {
+#if VDBG
RLOGD("getMuteResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::getClipResponse(int slotId,
int responseType, int serial, RIL_Errno e,
void *response, size_t responseLen) {
+#if VDBG
RLOGD("getClipResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::getDataCallListResponse(int slotId,
int responseType, int serial, RIL_Errno e,
void *response, size_t responseLen) {
+#if VDBG
RLOGD("getDataCallListResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::setSuppServiceNotificationsResponse(int slotId,
int responseType, int serial, RIL_Errno e,
void *response, size_t responseLen) {
+#if VDBG
RLOGD("setSuppServiceNotificationsResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::deleteSmsOnSimResponse(int slotId,
int responseType, int serial, RIL_Errno e,
void *response, size_t responseLen) {
+#if VDBG
RLOGD("deleteSmsOnSimResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::setBandModeResponse(int slotId,
int responseType, int serial, RIL_Errno e,
void *response, size_t responseLen) {
+#if VDBG
RLOGD("setBandModeResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::writeSmsToSimResponse(int slotId,
int responseType, int serial, RIL_Errno e,
void *response, size_t responseLen) {
+#if VDBG
RLOGD("writeSmsToSimResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::getAvailableBandModesResponse(int slotId,
int responseType, int serial, RIL_Errno e, void *response,
size_t responseLen) {
+#if VDBG
RLOGD("getAvailableBandModesResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::sendEnvelopeResponse(int slotId,
int responseType, int serial, RIL_Errno e,
void *response, size_t responseLen) {
+#if VDBG
RLOGD("sendEnvelopeResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::sendTerminalResponseToSimResponse(int slotId,
int responseType, int serial, RIL_Errno e,
void *response, size_t responseLen) {
+#if VDBG
RLOGD("sendTerminalResponseToSimResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int responseType, int serial,
RIL_Errno e, void *response,
size_t responseLen) {
+#if VDBG
RLOGD("handleStkCallSetupRequestFromSimResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::explicitCallTransferResponse(int slotId,
int responseType, int serial, RIL_Errno e,
void *response, size_t responseLen) {
+#if VDBG
RLOGD("explicitCallTransferResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::setPreferredNetworkTypeResponse(int slotId,
int responseType, int serial, RIL_Errno e,
void *response, size_t responseLen) {
+#if VDBG
RLOGD("setPreferredNetworkTypeResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::getPreferredNetworkTypeResponse(int slotId,
int responseType, int serial, RIL_Errno e,
void *response, size_t responseLen) {
+#if VDBG
RLOGD("getPreferredNetworkTypeResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::getNeighboringCidsResponse(int slotId,
int responseType, int serial, RIL_Errno e,
void *response, size_t responseLen) {
+#if VDBG
RLOGD("getNeighboringCidsResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::setLocationUpdatesResponse(int slotId,
int responseType, int serial, RIL_Errno e,
void *response, size_t responseLen) {
+#if VDBG
RLOGD("setLocationUpdatesResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::setCdmaSubscriptionSourceResponse(int slotId,
int responseType, int serial, RIL_Errno e,
void *response, size_t responseLen) {
+#if VDBG
RLOGD("setCdmaSubscriptionSourceResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::setCdmaRoamingPreferenceResponse(int slotId,
int responseType, int serial, RIL_Errno e,
void *response, size_t responseLen) {
+#if VDBG
RLOGD("setCdmaRoamingPreferenceResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::getCdmaRoamingPreferenceResponse(int slotId,
int responseType, int serial, RIL_Errno e,
void *response, size_t responseLen) {
+#if VDBG
RLOGD("getCdmaRoamingPreferenceResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::setTTYModeResponse(int slotId,
int responseType, int serial, RIL_Errno e,
void *response, size_t responseLen) {
+#if VDBG
RLOGD("setTTYModeResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::getTTYModeResponse(int slotId,
int responseType, int serial, RIL_Errno e,
void *response, size_t responseLen) {
+#if VDBG
RLOGD("getTTYModeResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::setPreferredVoicePrivacyResponse(int slotId,
int responseType, int serial, RIL_Errno e,
void *response, size_t responseLen) {
+#if VDBG
RLOGD("setPreferredVoicePrivacyResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::getPreferredVoicePrivacyResponse(int slotId,
int responseType, int serial, RIL_Errno e,
void *response, size_t responseLen) {
+#if VDBG
RLOGD("getPreferredVoicePrivacyResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::sendCDMAFeatureCodeResponse(int slotId,
int responseType, int serial, RIL_Errno e,
void *response, size_t responseLen) {
+#if VDBG
RLOGD("sendCDMAFeatureCodeResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::sendBurstDtmfResponse(int slotId,
int responseType, int serial, RIL_Errno e,
void *response, size_t responseLen) {
+#if VDBG
RLOGD("sendBurstDtmfResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::sendCdmaSmsResponse(int slotId,
int responseType, int serial, RIL_Errno e, void *response,
size_t responseLen) {
+#if VDBG
RLOGD("sendCdmaSmsResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::acknowledgeLastIncomingCdmaSmsResponse(int slotId,
int responseType, int serial, RIL_Errno e,
void *response, size_t responseLen) {
+#if VDBG
RLOGD("acknowledgeLastIncomingCdmaSmsResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::getGsmBroadcastConfigResponse(int slotId,
int responseType, int serial, RIL_Errno e,
void *response, size_t responseLen) {
+#if VDBG
RLOGD("getGsmBroadcastConfigResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::setGsmBroadcastConfigResponse(int slotId,
int responseType, int serial, RIL_Errno e,
void *response, size_t responseLen) {
+#if VDBG
RLOGD("setGsmBroadcastConfigResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::setGsmBroadcastActivationResponse(int slotId,
int responseType, int serial, RIL_Errno e,
void *response, size_t responseLen) {
+#if VDBG
RLOGD("setGsmBroadcastActivationResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::getCdmaBroadcastConfigResponse(int slotId,
int responseType, int serial, RIL_Errno e,
void *response, size_t responseLen) {
+#if VDBG
RLOGD("getCdmaBroadcastConfigResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::setCdmaBroadcastConfigResponse(int slotId,
int responseType, int serial, RIL_Errno e,
void *response, size_t responseLen) {
+#if VDBG
RLOGD("setCdmaBroadcastConfigResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::setCdmaBroadcastActivationResponse(int slotId,
int responseType, int serial, RIL_Errno e,
void *response, size_t responseLen) {
+#if VDBG
RLOGD("setCdmaBroadcastActivationResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::getCDMASubscriptionResponse(int slotId,
int responseType, int serial, RIL_Errno e, void *response,
size_t responseLen) {
+#if VDBG
RLOGD("getCDMASubscriptionResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::writeSmsToRuimResponse(int slotId,
int responseType, int serial, RIL_Errno e,
void *response, size_t responseLen) {
+#if VDBG
RLOGD("writeSmsToRuimResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::deleteSmsOnRuimResponse(int slotId,
int responseType, int serial, RIL_Errno e,
void *response, size_t responseLen) {
+#if VDBG
RLOGD("deleteSmsOnRuimResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::getDeviceIdentityResponse(int slotId,
int responseType, int serial, RIL_Errno e, void *response,
size_t responseLen) {
+#if VDBG
RLOGD("getDeviceIdentityResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::exitEmergencyCallbackModeResponse(int slotId,
int responseType, int serial, RIL_Errno e,
void *response, size_t responseLen) {
+#if VDBG
RLOGD("exitEmergencyCallbackModeResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::getSmscAddressResponse(int slotId,
int responseType, int serial, RIL_Errno e,
void *response, size_t responseLen) {
+#if VDBG
RLOGD("getSmscAddressResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::setSmscAddressResponse(int slotId,
int responseType, int serial, RIL_Errno e,
void *response, size_t responseLen) {
+#if VDBG
RLOGD("setSmscAddressResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::reportSmsMemoryStatusResponse(int slotId,
int responseType, int serial, RIL_Errno e,
void *response, size_t responseLen) {
+#if VDBG
RLOGD("reportSmsMemoryStatusResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::reportStkServiceIsRunningResponse(int slotId,
int responseType, int serial, RIL_Errno e,
void *response, size_t responseLen) {
+#if VDBG
RLOGD("reportStkServiceIsRunningResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::getCdmaSubscriptionSourceResponse(int slotId,
int responseType, int serial, RIL_Errno e,
void *response, size_t responseLen) {
+#if VDBG
RLOGD("getCdmaSubscriptionSourceResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::requestIsimAuthenticationResponse(int slotId,
int responseType, int serial, RIL_Errno e,
void *response, size_t responseLen) {
+#if VDBG
RLOGD("requestIsimAuthenticationResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int responseType,
int serial, RIL_Errno e, void *response,
size_t responseLen) {
+#if VDBG
RLOGD("acknowledgeIncomingGsmSmsWithPduResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::sendEnvelopeWithStatusResponse(int slotId,
int responseType, int serial, RIL_Errno e, void *response,
size_t responseLen) {
+#if VDBG
RLOGD("sendEnvelopeWithStatusResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::getVoiceRadioTechnologyResponse(int slotId,
int responseType, int serial, RIL_Errno e,
void *response, size_t responseLen) {
+#if VDBG
RLOGD("getVoiceRadioTechnologyResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int responseType,
int serial, RIL_Errno e, void *response,
size_t responseLen) {
+#if VDBG
RLOGD("getCellInfoListResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int responseType,
int serial, RIL_Errno e, void *response,
size_t responseLen) {
+#if VDBG
RLOGD("setCellInfoListRateResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::setInitialAttachApnResponse(int slotId,
int responseType, int serial, RIL_Errno e,
void *response, size_t responseLen) {
+#if VDBG
RLOGD("setInitialAttachApnResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::getImsRegistrationStateResponse(int slotId,
int responseType, int serial, RIL_Errno e,
void *response, size_t responseLen) {
+#if VDBG
RLOGD("getImsRegistrationStateResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::sendImsSmsResponse(int slotId,
int responseType, int serial, RIL_Errno e, void *response,
size_t responseLen) {
+#if VDBG
RLOGD("sendImsSmsResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::iccTransmitApduBasicChannelResponse(int slotId,
int responseType, int serial, RIL_Errno e,
void *response, size_t responseLen) {
+#if VDBG
RLOGD("iccTransmitApduBasicChannelResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::iccOpenLogicalChannelResponse(int slotId,
int responseType, int serial, RIL_Errno e, void *response,
size_t responseLen) {
+#if VDBG
RLOGD("iccOpenLogicalChannelResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::iccCloseLogicalChannelResponse(int slotId,
int responseType, int serial, RIL_Errno e,
void *response, size_t responseLen) {
+#if VDBG
RLOGD("iccCloseLogicalChannelResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::iccTransmitApduLogicalChannelResponse(int slotId,
int responseType, int serial, RIL_Errno e,
void *response, size_t responseLen) {
+#if VDBG
RLOGD("iccTransmitApduLogicalChannelResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::nvReadItemResponse(int slotId,
int responseType, int serial, RIL_Errno e,
void *response, size_t responseLen) {
+#if VDBG
RLOGD("nvReadItemResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::nvWriteItemResponse(int slotId,
int responseType, int serial, RIL_Errno e,
void *response, size_t responseLen) {
+#if VDBG
RLOGD("nvWriteItemResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::nvWriteCdmaPrlResponse(int slotId,
int responseType, int serial, RIL_Errno e,
void *response, size_t responseLen) {
+#if VDBG
RLOGD("nvWriteCdmaPrlResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::nvResetConfigResponse(int slotId,
int responseType, int serial, RIL_Errno e,
void *response, size_t responseLen) {
+#if VDBG
RLOGD("nvResetConfigResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::setUiccSubscriptionResponse(int slotId,
int responseType, int serial, RIL_Errno e,
void *response, size_t responseLen) {
+#if VDBG
RLOGD("setUiccSubscriptionResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::setDataAllowedResponse(int slotId,
int responseType, int serial, RIL_Errno e,
void *response, size_t responseLen) {
+#if VDBG
RLOGD("setDataAllowedResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::getHardwareConfigResponse(int slotId,
int responseType, int serial, RIL_Errno e,
void *response, size_t responseLen) {
+#if VDBG
RLOGD("getHardwareConfigResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::requestIccSimAuthenticationResponse(int slotId,
int responseType, int serial, RIL_Errno e,
void *response, size_t responseLen) {
+#if VDBG
RLOGD("requestIccSimAuthenticationResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::setDataProfileResponse(int slotId,
int responseType, int serial, RIL_Errno e,
void *response, size_t responseLen) {
+#if VDBG
RLOGD("setDataProfileResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::requestShutdownResponse(int slotId,
int responseType, int serial, RIL_Errno e,
void *response, size_t responseLen) {
+#if VDBG
RLOGD("requestShutdownResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::getRadioCapabilityResponse(int slotId,
int responseType, int serial, RIL_Errno e,
void *response, size_t responseLen) {
+#if VDBG
RLOGD("getRadioCapabilityResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::setRadioCapabilityResponse(int slotId,
int responseType, int serial, RIL_Errno e,
void *response, size_t responseLen) {
+#if VDBG
RLOGD("setRadioCapabilityResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::startLceServiceResponse(int slotId,
int responseType, int serial, RIL_Errno e,
void *response, size_t responseLen) {
+#if VDBG
RLOGD("startLceServiceResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::stopLceServiceResponse(int slotId,
int responseType, int serial, RIL_Errno e,
void *response, size_t responseLen) {
+#if VDBG
RLOGD("stopLceServiceResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::pullLceDataResponse(int slotId,
int responseType, int serial, RIL_Errno e,
void *response, size_t responseLen) {
+#if VDBG
RLOGD("pullLceDataResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::getModemActivityInfoResponse(int slotId,
int responseType, int serial, RIL_Errno e,
void *response, size_t responseLen) {
+#if VDBG
RLOGD("getModemActivityInfoResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::setAllowedCarriersResponse(int slotId,
int responseType, int serial, RIL_Errno e,
void *response, size_t responseLen) {
+#if VDBG
RLOGD("setAllowedCarriersResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
int radio::getAllowedCarriersResponse(int slotId,
int responseType, int serial, RIL_Errno e,
void *response, size_t responseLen) {
+#if VDBG
RLOGD("getAllowedCarriersResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
populateResponseInfo(responseInfo, serial, responseType, e);
CarrierRestrictions carrierInfo = {};
bool allAllowed = true;
- if (response == NULL || responseLen != sizeof(RIL_CarrierRestrictions)) {
- RLOGE("getAllowedCarriersResponse Invalid response: NULL");
+ if (response == NULL) {
+#if VDBG
+ RLOGD("getAllowedCarriersResponse response is NULL: all allowed");
+#endif
+ carrierInfo.allowedCarriers.resize(0);
+ carrierInfo.excludedCarriers.resize(0);
+ } else if (responseLen != sizeof(RIL_CarrierRestrictions)) {
+ RLOGE("getAllowedCarriersResponse Invalid response");
if (e == RIL_E_SUCCESS) responseInfo.error = RadioError::INVALID_RESPONSE;
} else {
RIL_CarrierRestrictions *pCr = (RIL_CarrierRestrictions *)response;
int radio::sendDeviceStateResponse(int slotId,
int responseType, int serial, RIL_Errno e,
void *response, size_t responselen) {
+#if VDBG
RLOGD("sendDeviceStateResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
return 0;
}
+int radio::setCarrierInfoForImsiEncryptionResponse(int slotId,
+ int responseType, int serial, RIL_Errno e,
+ void *response, size_t responseLen) {
+ RLOGD("setCarrierInfoForImsiEncryptionResponse: serial %d", serial);
+ if (radioService[slotId]->mRadioResponse != NULL) {
+ RadioResponseInfo responseInfo = {};
+ populateResponseInfo(responseInfo, serial, responseType, e);
+ Return<sp<::android::hardware::radio::V1_1::IRadioResponse>> ret =
+ ::android::hardware::radio::V1_1::IRadioResponse::castFrom(
+ radioService[slotId]->mRadioResponse);
+ if (ret.isOk()) {
+ sp<::android::hardware::radio::V1_1::IRadioResponse> radioResponseV1_1 = ret;
+ Return<void> retStatus
+ = radioResponseV1_1->setCarrierInfoForImsiEncryptionResponse(responseInfo);
+ radioService[slotId]->checkReturnStatus(retStatus);
+ } else {
+ RLOGE("setCarrierInfoForImsiEncryptionResponse: ret.isOk() == false for "
+ "radioService[%d]" , slotId);
+ }
+ } else {
+ RLOGE("setCarrierInfoForImsiEncryptionResponse: radioService[%d]->mRadioResponse == NULL",
+ slotId);
+ }
+ return 0;
+}
+
int radio::setIndicationFilterResponse(int slotId,
int responseType, int serial, RIL_Errno e,
void *response, size_t responselen) {
+#if VDBG
RLOGD("setIndicationFilterResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
return 0;
}
-
int radio::setSimCardPowerResponse(int slotId,
int responseType, int serial, RIL_Errno e,
void *response, size_t responseLen) {
+#if VDBG
RLOGD("setSimCardPowerResponse: serial %d", serial);
+#endif
if (radioService[slotId]->mRadioResponse != NULL) {
RadioResponseInfo responseInfo = {};
populateResponseInfo(responseInfo, serial, responseType, e);
- Return<void> retStatus
- = radioService[slotId]->mRadioResponse->setSimCardPowerResponse(responseInfo);
- radioService[slotId]->checkReturnStatus(retStatus);
+ Return<sp<::android::hardware::radio::V1_1::IRadioResponse>> ret =
+ ::android::hardware::radio::V1_1::IRadioResponse::castFrom(
+ radioService[slotId]->mRadioResponse);
+ if (ret.isOk()) {
+ sp<::android::hardware::radio::V1_1::IRadioResponse> radioResponseV1_1 = ret;
+ Return<void> retStatus
+ = radioResponseV1_1->setSimCardPowerResponse_1_1(responseInfo);
+ radioService[slotId]->checkReturnStatus(retStatus);
+ } else {
+ RLOGD("setSimCardPowerResponse: ret.isOK() == false for radioService[%d]",
+ slotId);
+ Return<void> retStatus
+ = radioService[slotId]->mRadioResponse->setSimCardPowerResponse(responseInfo);
+ radioService[slotId]->checkReturnStatus(retStatus);
+ }
+ } else {
+ RLOGE("setSimCardPowerResponse: radioService[%d]->mRadioResponse == NULL",
+ slotId);
+ }
+ return 0;
+}
+
+int radio::startNetworkScanResponse(int slotId, int responseType, int serial, RIL_Errno e,
+ void *response, size_t responseLen) {
+#if VDBG
+ RLOGD("startNetworkScanResponse: serial %d", serial);
+#endif
+
+ if (radioService[slotId]->mRadioResponse != NULL) {
+ RadioResponseInfo responseInfo = {};
+ populateResponseInfo(responseInfo, serial, responseType, e);
+ Return<sp<::android::hardware::radio::V1_1::IRadioResponse>> ret =
+ ::android::hardware::radio::V1_1::IRadioResponse::castFrom(
+ radioService[slotId]->mRadioResponse);
+ if (ret.isOk()) {
+ sp<::android::hardware::radio::V1_1::IRadioResponse> radioResponseV1_1 = ret;
+ Return<void> retStatus = radioResponseV1_1->startNetworkScanResponse(responseInfo);
+ radioService[slotId]->checkReturnStatus(retStatus);
+ } else {
+ RLOGD("startNetworkScanResponse: ret.isOK() == false for radioService[%d]", slotId);
+ }
+ } else {
+ RLOGE("startNetworkScanResponse: radioService[%d]->mRadioResponse == NULL", slotId);
+ }
+
+ return 0;
+}
+
+int radio::stopNetworkScanResponse(int slotId, int responseType, int serial, RIL_Errno e,
+ void *response, size_t responseLen) {
+#if VDBG
+ RLOGD("stopNetworkScanResponse: serial %d", serial);
+#endif
+
+ if (radioService[slotId]->mRadioResponse != NULL) {
+ RadioResponseInfo responseInfo = {};
+ populateResponseInfo(responseInfo, serial, responseType, e);
+ Return<sp<::android::hardware::radio::V1_1::IRadioResponse>> ret =
+ ::android::hardware::radio::V1_1::IRadioResponse::castFrom(
+ radioService[slotId]->mRadioResponse);
+ if (ret.isOk()) {
+ sp<::android::hardware::radio::V1_1::IRadioResponse> radioResponseV1_1 = ret;
+ Return<void> retStatus = radioResponseV1_1->stopNetworkScanResponse(responseInfo);
+ radioService[slotId]->checkReturnStatus(retStatus);
+ } else {
+ RLOGD("stopNetworkScanResponse: ret.isOK() == false for radioService[%d]", slotId);
+ }
} else {
- RLOGE("setSimCardPowerResponse: radioService[%d]->mRadioResponse == NULL", slotId);
+ RLOGE("stopNetworkScanResponse: radioService[%d]->mRadioResponse == NULL", slotId);
}
return 0;
int radio::sendRequestRawResponse(int slotId,
int responseType, int serial, RIL_Errno e,
void *response, size_t responseLen) {
+#if VDBG
RLOGD("sendRequestRawResponse: serial %d", serial);
+#endif
if (oemHookService[slotId]->mOemHookResponse != NULL) {
RadioResponseInfo responseInfo = {};
}
Return<void> retStatus = oemHookService[slotId]->mOemHookResponse->
sendRequestRawResponse(responseInfo, data);
- checkReturnStatus(slotId, retStatus);
+ checkReturnStatus(slotId, retStatus, false);
} else {
RLOGE("sendRequestRawResponse: oemHookService[%d]->mOemHookResponse == NULL",
slotId);
int radio::sendRequestStringsResponse(int slotId,
int responseType, int serial, RIL_Errno e,
void *response, size_t responseLen) {
+#if VDBG
RLOGD("sendRequestStringsResponse: serial %d", serial);
+#endif
if (oemHookService[slotId]->mOemHookResponse != NULL) {
RadioResponseInfo responseInfo = {};
Return<void> retStatus
= oemHookService[slotId]->mOemHookResponse->sendRequestStringsResponse(
responseInfo, data);
- checkReturnStatus(slotId, retStatus);
+ checkReturnStatus(slotId, retStatus, false);
} else {
RLOGE("sendRequestStringsResponse: oemHookService[%d]->mOemHookResponse == "
"NULL", slotId);
int indicationType, int token, RIL_Errno e, void *response,
size_t responseLen) {
if (radioService[slotId] != NULL && radioService[slotId]->mRadioIndication != NULL) {
+#if VDBG
RLOGD("callStateChangedInd");
+#endif
Return<void> retStatus = radioService[slotId]->mRadioIndication->callStateChanged(
convertIntToRadioIndicationType(indicationType));
radioService[slotId]->checkReturnStatus(retStatus);
int indicationType, int token, RIL_Errno e, void *response,
size_t responseLen) {
if (radioService[slotId] != NULL && radioService[slotId]->mRadioIndication != NULL) {
+#if VDBG
RLOGD("networkStateChangedInd");
+#endif
Return<void> retStatus = radioService[slotId]->mRadioIndication->networkStateChanged(
convertIntToRadioIndicationType(indicationType));
radioService[slotId]->checkReturnStatus(retStatus);
hidl_vec<uint8_t> pdu;
pdu.setToExternal(bytes, responseLen/2);
+#if VDBG
RLOGD("newSmsInd");
+#endif
Return<void> retStatus = radioService[slotId]->mRadioIndication->newSms(
convertIntToRadioIndicationType(indicationType), pdu);
radioService[slotId]->checkReturnStatus(retStatus);
hidl_vec<uint8_t> pdu;
pdu.setToExternal(bytes, responseLen/2);
+#if VDBG
RLOGD("newSmsStatusReportInd");
+#endif
Return<void> retStatus = radioService[slotId]->mRadioIndication->newSmsStatusReport(
convertIntToRadioIndicationType(indicationType), pdu);
radioService[slotId]->checkReturnStatus(retStatus);
return 0;
}
int32_t recordNumber = ((int32_t *) response)[0];
+#if VDBG
RLOGD("newSmsOnSimInd: slotIndex %d", recordNumber);
+#endif
Return<void> retStatus = radioService[slotId]->mRadioIndication->newSmsOnSim(
convertIntToRadioIndicationType(indicationType), recordNumber);
radioService[slotId]->checkReturnStatus(retStatus);
char *mode = strings[0];
hidl_string msg = convertCharPtrToHidlString(strings[1]);
UssdModeType modeType = (UssdModeType) atoi(mode);
+#if VDBG
RLOGD("onUssdInd: mode %s", mode);
+#endif
Return<void> retStatus = radioService[slotId]->mRadioIndication->onUssd(
convertIntToRadioIndicationType(indicationType), modeType, msg);
radioService[slotId]->checkReturnStatus(retStatus);
}
hidl_string nitzTime = convertCharPtrToHidlString((char *) response);
int64_t timeReceived = android::elapsedRealtime();
+#if VDBG
RLOGD("nitzTimeReceivedInd: nitzTime %s receivedTime %" PRId64, nitzTime.c_str(),
timeReceived);
+#endif
Return<void> retStatus = radioService[slotId]->mRadioIndication->nitzTimeReceived(
convertIntToRadioIndicationType(indicationType), nitzTime, timeReceived);
radioService[slotId]->checkReturnStatus(retStatus);
SignalStrength signalStrength = {};
convertRilSignalStrengthToHal(response, responseLen, signalStrength);
+#if VDBG
RLOGD("currentSignalStrengthInd");
+#endif
Return<void> retStatus = radioService[slotId]->mRadioIndication->currentSignalStrength(
convertIntToRadioIndicationType(indicationType), signalStrength);
radioService[slotId]->checkReturnStatus(retStatus);
}
hidl_vec<SetupDataCallResult> dcList;
convertRilDataCallListToHal(response, responseLen, dcList);
+#if VDBG
RLOGD("dataCallListChangedInd");
+#endif
Return<void> retStatus = radioService[slotId]->mRadioIndication->dataCallListChanged(
convertIntToRadioIndicationType(indicationType), dcList);
radioService[slotId]->checkReturnStatus(retStatus);
suppSvc.type = ssn->type;
suppSvc.number = convertCharPtrToHidlString(ssn->number);
+#if VDBG
RLOGD("suppSvcNotifyInd: isMT %d code %d index %d type %d",
suppSvc.isMT, suppSvc.code, suppSvc.index, suppSvc.type);
+#endif
Return<void> retStatus = radioService[slotId]->mRadioIndication->suppSvcNotify(
convertIntToRadioIndicationType(indicationType), suppSvc);
radioService[slotId]->checkReturnStatus(retStatus);
int radio::stkSessionEndInd(int slotId, int indicationType,
int token, RIL_Errno e, void *response, size_t responseLen) {
if (radioService[slotId] != NULL && radioService[slotId]->mRadioIndication != NULL) {
+#if VDBG
RLOGD("stkSessionEndInd");
+#endif
Return<void> retStatus = radioService[slotId]->mRadioIndication->stkSessionEnd(
convertIntToRadioIndicationType(indicationType));
radioService[slotId]->checkReturnStatus(retStatus);
RLOGE("stkProactiveCommandInd: invalid response");
return 0;
}
+#if VDBG
RLOGD("stkProactiveCommandInd");
+#endif
Return<void> retStatus = radioService[slotId]->mRadioIndication->stkProactiveCommand(
convertIntToRadioIndicationType(indicationType),
convertCharPtrToHidlString((char *) response));
RLOGE("stkEventNotifyInd: invalid response");
return 0;
}
+#if VDBG
RLOGD("stkEventNotifyInd");
+#endif
Return<void> retStatus = radioService[slotId]->mRadioIndication->stkEventNotify(
convertIntToRadioIndicationType(indicationType),
convertCharPtrToHidlString((char *) response));
return 0;
}
int32_t timeout = ((int32_t *) response)[0];
+#if VDBG
RLOGD("stkCallSetupInd: timeout %d", timeout);
+#endif
Return<void> retStatus = radioService[slotId]->mRadioIndication->stkCallSetup(
convertIntToRadioIndicationType(indicationType), timeout);
radioService[slotId]->checkReturnStatus(retStatus);
int indicationType, int token, RIL_Errno e, void *response,
size_t responseLen) {
if (radioService[slotId] != NULL && radioService[slotId]->mRadioIndication != NULL) {
+#if VDBG
RLOGD("simSmsStorageFullInd");
+#endif
Return<void> retStatus = radioService[slotId]->mRadioIndication->simSmsStorageFull(
convertIntToRadioIndicationType(indicationType));
radioService[slotId]->checkReturnStatus(retStatus);
refreshResult.efId = simRefreshResponse->ef_id;
refreshResult.aid = convertCharPtrToHidlString(simRefreshResponse->aid);
+#if VDBG
RLOGD("simRefreshInd: type %d efId %d", refreshResult.type, refreshResult.efId);
+#endif
Return<void> retStatus = radioService[slotId]->mRadioIndication->simRefresh(
convertIntToRadioIndicationType(indicationType), refreshResult);
radioService[slotId]->checkReturnStatus(retStatus);
convertRilCdmaSignalInfoRecordToHal((RIL_CDMA_SignalInfoRecord *) response, record);
}
+#if VDBG
RLOGD("callRingInd: isGsm %d", isGsm);
+#endif
Return<void> retStatus = radioService[slotId]->mRadioIndication->callRing(
convertIntToRadioIndicationType(indicationType), isGsm, record);
radioService[slotId]->checkReturnStatus(retStatus);
int indicationType, int token, RIL_Errno e, void *response,
size_t responseLen) {
if (radioService[slotId] != NULL && radioService[slotId]->mRadioIndication != NULL) {
+#if VDBG
RLOGD("simStatusChangedInd");
+#endif
Return<void> retStatus = radioService[slotId]->mRadioIndication->simStatusChanged(
convertIntToRadioIndicationType(indicationType));
radioService[slotId]->checkReturnStatus(retStatus);
digitLimit = MIN((rilMsg->uBearerDataLen), RIL_CDMA_SMS_BEARER_DATA_MAX);
msg.bearerData.setToExternal(rilMsg->aBearerData, digitLimit);
+#if VDBG
RLOGD("cdmaNewSmsInd");
+#endif
Return<void> retStatus = radioService[slotId]->mRadioIndication->cdmaNewSms(
convertIntToRadioIndicationType(indicationType), msg);
radioService[slotId]->checkReturnStatus(retStatus);
hidl_vec<uint8_t> data;
data.setToExternal((uint8_t *) response, responseLen);
+#if VDBG
RLOGD("newBroadcastSmsInd");
+#endif
Return<void> retStatus = radioService[slotId]->mRadioIndication->newBroadcastSms(
convertIntToRadioIndicationType(indicationType), data);
radioService[slotId]->checkReturnStatus(retStatus);
int indicationType, int token, RIL_Errno e, void *response,
size_t responseLen) {
if (radioService[slotId] != NULL && radioService[slotId]->mRadioIndication != NULL) {
+#if VDBG
RLOGD("cdmaRuimSmsStorageFullInd");
+#endif
Return<void> retStatus = radioService[slotId]->mRadioIndication->cdmaRuimSmsStorageFull(
convertIntToRadioIndicationType(indicationType));
radioService[slotId]->checkReturnStatus(retStatus);
return 0;
}
int32_t state = ((int32_t *) response)[0];
+#if VDBG
RLOGD("restrictedStateChangedInd: state %d", state);
+#endif
Return<void> retStatus = radioService[slotId]->mRadioIndication->restrictedStateChanged(
convertIntToRadioIndicationType(indicationType), (PhoneRestrictedState) state);
radioService[slotId]->checkReturnStatus(retStatus);
int indicationType, int token, RIL_Errno e, void *response,
size_t responseLen) {
if (radioService[slotId] != NULL && radioService[slotId]->mRadioIndication != NULL) {
+#if VDBG
RLOGD("enterEmergencyCallbackModeInd");
+#endif
Return<void> retStatus = radioService[slotId]->mRadioIndication->enterEmergencyCallbackMode(
convertIntToRadioIndicationType(indicationType));
radioService[slotId]->checkReturnStatus(retStatus);
callWaitingRecord.numberType = (CdmaCallWaitingNumberType) callWaitingRil->number_type;
callWaitingRecord.numberPlan = (CdmaCallWaitingNumberPlan) callWaitingRil->number_plan;
+#if VDBG
RLOGD("cdmaCallWaitingInd");
+#endif
Return<void> retStatus = radioService[slotId]->mRadioIndication->cdmaCallWaiting(
convertIntToRadioIndicationType(indicationType), callWaitingRecord);
radioService[slotId]->checkReturnStatus(retStatus);
return 0;
}
int32_t status = ((int32_t *) response)[0];
+#if VDBG
RLOGD("cdmaOtaProvisionStatusInd: status %d", status);
+#endif
Return<void> retStatus = radioService[slotId]->mRadioIndication->cdmaOtaProvisionStatus(
convertIntToRadioIndicationType(indicationType), (CdmaOtaProvisionStatus) status);
radioService[slotId]->checkReturnStatus(retStatus);
}
}
+#if VDBG
RLOGD("cdmaInfoRecInd");
+#endif
Return<void> retStatus = radioService[slotId]->mRadioIndication->cdmaInfoRec(
convertIntToRadioIndicationType(indicationType), records);
radioService[slotId]->checkReturnStatus(retStatus);
return 0;
}
bool start = ((int32_t *) response)[0];
+#if VDBG
RLOGD("indicateRingbackToneInd: start %d", start);
+#endif
Return<void> retStatus = radioService[slotId]->mRadioIndication->indicateRingbackTone(
convertIntToRadioIndicationType(indicationType), start);
radioService[slotId]->checkReturnStatus(retStatus);
int indicationType, int token, RIL_Errno e, void *response,
size_t responseLen) {
if (radioService[slotId] != NULL && radioService[slotId]->mRadioIndication != NULL) {
+#if VDBG
RLOGD("resendIncallMuteInd");
+#endif
Return<void> retStatus = radioService[slotId]->mRadioIndication->resendIncallMute(
convertIntToRadioIndicationType(indicationType));
radioService[slotId]->checkReturnStatus(retStatus);
return 0;
}
int32_t cdmaSource = ((int32_t *) response)[0];
+#if VDBG
RLOGD("cdmaSubscriptionSourceChangedInd: cdmaSource %d", cdmaSource);
+#endif
Return<void> retStatus = radioService[slotId]->mRadioIndication->
cdmaSubscriptionSourceChanged(convertIntToRadioIndicationType(indicationType),
(CdmaSubscriptionSource) cdmaSource);
return 0;
}
int32_t version = ((int32_t *) response)[0];
+#if VDBG
RLOGD("cdmaPrlChangedInd: version %d", version);
+#endif
Return<void> retStatus = radioService[slotId]->mRadioIndication->cdmaPrlChanged(
convertIntToRadioIndicationType(indicationType), version);
radioService[slotId]->checkReturnStatus(retStatus);
int indicationType, int token, RIL_Errno e, void *response,
size_t responseLen) {
if (radioService[slotId] != NULL && radioService[slotId]->mRadioIndication != NULL) {
+#if VDBG
RLOGD("exitEmergencyCallbackModeInd");
+#endif
Return<void> retStatus = radioService[slotId]->mRadioIndication->exitEmergencyCallbackMode(
convertIntToRadioIndicationType(indicationType));
radioService[slotId]->checkReturnStatus(retStatus);
return 0;
}
int32_t rat = ((int32_t *) response)[0];
+#if VDBG
RLOGD("voiceRadioTechChangedInd: rat %d", rat);
+#endif
Return<void> retStatus = radioService[slotId]->mRadioIndication->voiceRadioTechChanged(
convertIntToRadioIndicationType(indicationType), (RadioTechnology) rat);
radioService[slotId]->checkReturnStatus(retStatus);
hidl_vec<CellInfo> records;
convertRilCellInfoListToHal(response, responseLen, records);
+#if VDBG
RLOGD("cellInfoListInd");
+#endif
Return<void> retStatus = radioService[slotId]->mRadioIndication->cellInfoList(
convertIntToRadioIndicationType(indicationType), records);
radioService[slotId]->checkReturnStatus(retStatus);
int indicationType, int token, RIL_Errno e, void *response,
size_t responseLen) {
if (radioService[slotId] != NULL && radioService[slotId]->mRadioIndication != NULL) {
+#if VDBG
RLOGD("imsNetworkStateChangedInd");
+#endif
Return<void> retStatus = radioService[slotId]->mRadioIndication->imsNetworkStateChanged(
convertIntToRadioIndicationType(indicationType));
radioService[slotId]->checkReturnStatus(retStatus);
return 0;
}
bool activate = ((int32_t *) response)[0];
+#if VDBG
RLOGD("subscriptionStatusChangedInd: activate %d", activate);
+#endif
Return<void> retStatus = radioService[slotId]->mRadioIndication->subscriptionStatusChanged(
convertIntToRadioIndicationType(indicationType), activate);
radioService[slotId]->checkReturnStatus(retStatus);
return 0;
}
int32_t state = ((int32_t *) response)[0];
+#if VDBG
RLOGD("srvccStateNotifyInd: rat %d", state);
+#endif
Return<void> retStatus = radioService[slotId]->mRadioIndication->srvccStateNotify(
convertIntToRadioIndicationType(indicationType), (SrvccState) state);
radioService[slotId]->checkReturnStatus(retStatus);
hidl_vec<HardwareConfig> configs;
convertRilHardwareConfigListToHal(response, responseLen, configs);
+#if VDBG
RLOGD("hardwareConfigChangedInd");
+#endif
Return<void> retStatus = radioService[slotId]->mRadioIndication->hardwareConfigChanged(
convertIntToRadioIndicationType(indicationType), configs);
radioService[slotId]->checkReturnStatus(retStatus);
RadioCapability rc = {};
convertRilRadioCapabilityToHal(response, responseLen, rc);
+#if VDBG
RLOGD("radioCapabilityIndicationInd");
+#endif
Return<void> retStatus = radioService[slotId]->mRadioIndication->radioCapabilityIndication(
convertIntToRadioIndicationType(indicationType), rc);
radioService[slotId]->checkReturnStatus(retStatus);
ss.result = (RadioError) rilSsResponse->result;
if (isServiceTypeCfQuery(rilSsResponse->serviceType, rilSsResponse->requestType)) {
+#if VDBG
RLOGD("onSupplementaryServiceIndicationInd CF type, num of Cf elements %d",
rilSsResponse->cfData.numValidIndexes);
+#endif
if (rilSsResponse->cfData.numValidIndexes > NUM_SERVICE_CLASSES) {
RLOGE("onSupplementaryServiceIndicationInd numValidIndexes is greater than "
"max value %d, truncating it to max value", NUM_SERVICE_CLASSES);
cfInfo->toa = cf.toa;
cfInfo->number = convertCharPtrToHidlString(cf.number);
cfInfo->timeSeconds = cf.timeSeconds;
+#if VDBG
RLOGD("onSupplementaryServiceIndicationInd: "
"Data: %d,reason=%d,cls=%d,toa=%d,num=%s,tout=%d],", cf.status,
cf.reason, cf.serviceClass, cf.toa, (char*)cf.number, cf.timeSeconds);
+#endif
}
} else {
ss.ssInfo.resize(1);
/* each int */
ss.ssInfo[0].ssInfo.resize(SS_INFO_MAX);
for (int i = 0; i < SS_INFO_MAX; i++) {
+#if VDBG
RLOGD("onSupplementaryServiceIndicationInd: Data: %d",
rilSsResponse->ssInfo[i]);
+#endif
ss.ssInfo[0].ssInfo[i] = rilSsResponse->ssInfo[i];
}
}
+#if VDBG
RLOGD("onSupplementaryServiceIndicationInd");
+#endif
Return<void> retStatus = radioService[slotId]->mRadioIndication->
onSupplementaryServiceIndication(convertIntToRadioIndicationType(indicationType),
ss);
RLOGE("stkCallControlAlphaNotifyInd: invalid response");
return 0;
}
+#if VDBG
RLOGD("stkCallControlAlphaNotifyInd");
+#endif
Return<void> retStatus = radioService[slotId]->mRadioIndication->stkCallControlAlphaNotify(
convertIntToRadioIndicationType(indicationType),
convertCharPtrToHidlString((char *) response));
LceDataInfo lce = {};
convertRilLceDataInfoToHal(response, responseLen, lce);
+#if VDBG
RLOGD("lceDataInd");
+#endif
Return<void> retStatus = radioService[slotId]->mRadioIndication->lceData(
convertIntToRadioIndicationType(indicationType), lce);
radioService[slotId]->checkReturnStatus(retStatus);
pco.pcoId = rilPcoData->pco_id;
pco.contents.setToExternal((uint8_t *) rilPcoData->contents, rilPcoData->contents_length);
+#if VDBG
RLOGD("pcoDataInd");
+#endif
Return<void> retStatus = radioService[slotId]->mRadioIndication->pcoData(
convertIntToRadioIndicationType(indicationType), pco);
radioService[slotId]->checkReturnStatus(retStatus);
RLOGE("modemResetInd: invalid response");
return 0;
}
+#if VDBG
RLOGD("modemResetInd");
+#endif
Return<void> retStatus = radioService[slotId]->mRadioIndication->modemReset(
convertIntToRadioIndicationType(indicationType),
convertCharPtrToHidlString((char *) response));
return 0;
}
+int radio::networkScanResultInd(int slotId,
+ int indicationType, int token, RIL_Errno e, void *response,
+ size_t responseLen) {
+#if VDBG
+ RLOGD("networkScanResultInd");
+#endif
+ if (radioService[slotId] != NULL && radioService[slotId]->mRadioIndication != NULL) {
+ if (response == NULL || responseLen == 0) {
+ RLOGE("networkScanResultInd: invalid response");
+ return 0;
+ }
+ RLOGD("networkScanResultInd");
+
+#if VDBG
+ RLOGD("networkScanResultInd");
+#endif
+
+ Return<sp<::android::hardware::radio::V1_1::IRadioIndication>> ret =
+ ::android::hardware::radio::V1_1::IRadioIndication::castFrom(
+ radioService[slotId]->mRadioIndication);
+ if (ret.isOk()) {
+ RIL_NetworkScanResult *networkScanResult = (RIL_NetworkScanResult *) response;
+
+ ::android::hardware::radio::V1_1::NetworkScanResult result;
+ result.status =
+ (::android::hardware::radio::V1_1::ScanStatus) networkScanResult->status;
+ result.error = (RadioError) e;
+ convertRilCellInfoListToHal(
+ networkScanResult->network_infos,
+ networkScanResult->network_infos_length * sizeof(RIL_CellInfo_v12),
+ result.networkInfos);
+
+ sp<::android::hardware::radio::V1_1::IRadioIndication> radioIndicationV1_1 = ret;
+ Return<void> retStatus = radioIndicationV1_1->networkScanResult(
+ convertIntToRadioIndicationType(indicationType), result);
+ radioService[slotId]->checkReturnStatus(retStatus);
+ } else {
+ RLOGE("networkScanResultInd: ret.isOk() == false for radioService[%d]", slotId);
+ }
+ } else {
+ RLOGE("networkScanResultInd: radioService[%d]->mRadioIndication == NULL", slotId);
+ }
+ return 0;
+}
+
+int radio::carrierInfoForImsiEncryption(int slotId,
+ int indicationType, int token, RIL_Errno e, void *response,
+ size_t responseLen) {
+ if (radioService[slotId] != NULL && radioService[slotId]->mRadioIndication != NULL) {
+ if (response == NULL || responseLen == 0) {
+ RLOGE("carrierInfoForImsiEncryption: invalid response");
+ return 0;
+ }
+ RLOGD("carrierInfoForImsiEncryption");
+ Return<sp<::android::hardware::radio::V1_1::IRadioIndication>> ret =
+ ::android::hardware::radio::V1_1::IRadioIndication::castFrom(
+ radioService[slotId]->mRadioIndication);
+ if (ret.isOk()) {
+ sp<::android::hardware::radio::V1_1::IRadioIndication> radioIndicationV1_1 = ret;
+ Return<void> retStatus = radioIndicationV1_1->carrierInfoForImsiEncryption(
+ convertIntToRadioIndicationType(indicationType));
+ radioService[slotId]->checkReturnStatus(retStatus);
+ } else {
+ RLOGE("carrierInfoForImsiEncryptionResponse: ret.isOk() == false for radioService[%d]",
+ slotId);
+ }
+ } else {
+ RLOGE("carrierInfoForImsiEncryption: radioService[%d]->mRadioIndication == NULL", slotId);
+ }
+
+ return 0;
+}
+
int radio::oemHookRawInd(int slotId,
int indicationType, int token, RIL_Errno e, void *response,
size_t responseLen) {
hidl_vec<uint8_t> data;
data.setToExternal((uint8_t *) response, responseLen);
+#if VDBG
RLOGD("oemHookRawInd");
+#endif
Return<void> retStatus = oemHookService[slotId]->mOemHookIndication->oemHookRaw(
convertIntToRadioIndicationType(indicationType), data);
- checkReturnStatus(slotId, retStatus);
+ checkReturnStatus(slotId, retStatus, false);
} else {
RLOGE("oemHookRawInd: oemHookService[%d]->mOemHookIndication == NULL", slotId);
}
using namespace android::hardware;
int simCount = 1;
const char *serviceNames[] = {
- android::RIL_getRilSocketName()
- #if (SIM_COUNT >= 2)
- , SOCKET2_NAME_RIL
- #if (SIM_COUNT >= 3)
- , SOCKET3_NAME_RIL
- #if (SIM_COUNT >= 4)
- , SOCKET4_NAME_RIL
- #endif
- #endif
- #endif
- };
-
- const char *oemHookServiceNames[] = {
- OEM_HOOK_SERVICE_NAME
+ android::RIL_getServiceName()
#if (SIM_COUNT >= 2)
- , OEM_HOOK2_SERVICE_NAME
+ , RIL2_SERVICE_NAME
#if (SIM_COUNT >= 3)
- , OEM_HOOK3_SERVICE_NAME
+ , RIL3_SERVICE_NAME
#if (SIM_COUNT >= 4)
- , OEM_HOOK4_SERVICE_NAME
+ , RIL4_SERVICE_NAME
#endif
#endif
#endif
radioService[i]->mSlotId = i;
oemHookService[i] = new OemHookImpl;
oemHookService[i]->mSlotId = i;
- RLOGD("registerService: starting IRadio %s", serviceNames[i]);
+ RLOGD("registerService: starting android::hardware::radio::V1_1::IRadio %s",
+ serviceNames[i]);
android::status_t status = radioService[i]->registerAsService(serviceNames[i]);
- status = oemHookService[i]->registerAsService(oemHookServiceNames[i]);
+ status = oemHookService[i]->registerAsService(serviceNames[i]);
ret = pthread_rwlock_unlock(radioServiceRwlockPtr);
assert(ret == 0);