HELLO·Android
系统源代码
IT资讯
技术文章
我的收藏
注册
登录
-
我收藏的文章
创建代码块
我的代码块
我的账号
Android 10
|
10.0.0_r6
下载
查看原文件
收藏
根目录
hardware
ril
libril
ril_service.cpp
/* * Copyright (c) 2016 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #define LOG_TAG "RILC" #include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#define INVALID_HEX_CHAR 16 using namespace android::hardware::radio; using namespace android::hardware::radio::V1_0; using namespace android::hardware::radio::deprecated::V1_0; using ::android::hardware::configureRpcThreadpool; using ::android::hardware::joinRpcThreadpool; using ::android::hardware::Return; using ::android::hardware::hidl_string; using ::android::hardware::hidl_vec; using ::android::hardware::hidl_array; using ::android::hardware::Void; using android::CommandInfo; using android::RequestInfo; using android::requestToString; using android::sp; #define BOOL_TO_INT(x) (x ? 1 : 0) #define ATOI_NULL_HANDLED(x) (x ? atoi(x) : -1) #define ATOI_NULL_HANDLED_DEF(x, defaultVal) (x ? atoi(x) : defaultVal) #if defined(ANDROID_MULTI_SIM) #define CALL_ONREQUEST(a, b, c, d, e) \ s_vendorFunctions->onRequest((a), (b), (c), (d), ((RIL_SOCKET_ID)(e))) #define CALL_ONSTATEREQUEST(a) s_vendorFunctions->onStateRequest((RIL_SOCKET_ID)(a)) #else #define CALL_ONREQUEST(a, b, c, d, e) s_vendorFunctions->onRequest((a), (b), (c), (d)) #define CALL_ONSTATEREQUEST(a) s_vendorFunctions->onStateRequest() #endif #ifdef OEM_HOOK_DISABLED constexpr bool kOemHookEnabled = false; #else constexpr bool kOemHookEnabled = true; #endif RIL_RadioFunctions *s_vendorFunctions = NULL; static CommandInfo *s_commands; struct RadioImpl; struct OemHookImpl; #if (SIM_COUNT >= 2) sp
radioService[SIM_COUNT]; sp
oemHookService[SIM_COUNT]; int64_t nitzTimeReceived[SIM_COUNT]; // counter used for synchronization. It is incremented every time response callbacks are updated. volatile int32_t mCounterRadio[SIM_COUNT]; volatile int32_t mCounterOemHook[SIM_COUNT]; #else sp
radioService[1]; sp
oemHookService[1]; int64_t nitzTimeReceived[1]; // counter used for synchronization. It is incremented every time response callbacks are updated. volatile int32_t mCounterRadio[1]; volatile int32_t mCounterOemHook[1]; #endif static pthread_rwlock_t radioServiceRwlock = PTHREAD_RWLOCK_INITIALIZER; #if (SIM_COUNT >= 2) static pthread_rwlock_t radioServiceRwlock2 = PTHREAD_RWLOCK_INITIALIZER; #if (SIM_COUNT >= 3) static pthread_rwlock_t radioServiceRwlock3 = PTHREAD_RWLOCK_INITIALIZER; #if (SIM_COUNT >= 4) static pthread_rwlock_t radioServiceRwlock4 = PTHREAD_RWLOCK_INITIALIZER; #endif #endif #endif void convertRilHardwareConfigListToHal(void *response, size_t responseLen, hidl_vec
& records); void convertRilRadioCapabilityToHal(void *response, size_t responseLen, RadioCapability& rc); void convertRilLceDataInfoToHal(void *response, size_t responseLen, LceDataInfo& lce); void convertRilSignalStrengthToHal(void *response, size_t responseLen, SignalStrength& signalStrength); void convertRilDataCallToHal(RIL_Data_Call_Response_v11 *dcResponse, SetupDataCallResult& dcResult); void convertRilDataCallListToHal(void *response, size_t responseLen, hidl_vec
& dcResultList); void convertRilCellInfoListToHal(void *response, size_t responseLen, hidl_vec
& records); struct RadioImpl : public V1_1::IRadio { int32_t mSlotId; sp
mRadioResponse; sp
mRadioIndication; sp
mRadioResponseV1_1; sp
mRadioIndicationV1_1; Return
setResponseFunctions( const ::android::sp
& radioResponse, const ::android::sp
& radioIndication); Return
getIccCardStatus(int32_t serial); Return
supplyIccPinForApp(int32_t serial, const hidl_string& pin, const hidl_string& aid); Return
supplyIccPukForApp(int32_t serial, const hidl_string& puk, const hidl_string& pin, const hidl_string& aid); Return
supplyIccPin2ForApp(int32_t serial, const hidl_string& pin2, const hidl_string& aid); Return
supplyIccPuk2ForApp(int32_t serial, const hidl_string& puk2, const hidl_string& pin2, const hidl_string& aid); Return
changeIccPinForApp(int32_t serial, const hidl_string& oldPin, const hidl_string& newPin, const hidl_string& aid); Return
changeIccPin2ForApp(int32_t serial, const hidl_string& oldPin2, const hidl_string& newPin2, const hidl_string& aid); Return
supplyNetworkDepersonalization(int32_t serial, const hidl_string& netPin); Return
getCurrentCalls(int32_t serial); Return
dial(int32_t serial, const Dial& dialInfo); Return
getImsiForApp(int32_t serial, const ::android::hardware::hidl_string& aid); Return
hangup(int32_t serial, int32_t gsmIndex); Return
hangupWaitingOrBackground(int32_t serial); Return
hangupForegroundResumeBackground(int32_t serial); Return
switchWaitingOrHoldingAndActive(int32_t serial); Return
conference(int32_t serial); Return
rejectCall(int32_t serial); Return
getLastCallFailCause(int32_t serial); Return
getSignalStrength(int32_t serial); Return
getVoiceRegistrationState(int32_t serial); Return
getDataRegistrationState(int32_t serial); Return
getOperator(int32_t serial); Return
setRadioPower(int32_t serial, bool on); Return
sendDtmf(int32_t serial, const ::android::hardware::hidl_string& s); Return
sendSms(int32_t serial, const GsmSmsMessage& message); Return
sendSMSExpectMore(int32_t serial, const GsmSmsMessage& message); Return
setupDataCall(int32_t serial, RadioTechnology radioTechnology, const DataProfileInfo& profileInfo, bool modemCognitive, bool roamingAllowed, bool isRoaming); Return
iccIOForApp(int32_t serial, const IccIo& iccIo); Return
sendUssd(int32_t serial, const ::android::hardware::hidl_string& ussd); Return
cancelPendingUssd(int32_t serial); Return
getClir(int32_t serial); Return
setClir(int32_t serial, int32_t status); Return
getCallForwardStatus(int32_t serial, const CallForwardInfo& callInfo); Return
setCallForward(int32_t serial, const CallForwardInfo& callInfo); Return
getCallWaiting(int32_t serial, int32_t serviceClass); Return
setCallWaiting(int32_t serial, bool enable, int32_t serviceClass); Return
acknowledgeLastIncomingGsmSms(int32_t serial, bool success, SmsAcknowledgeFailCause cause); Return
acceptCall(int32_t serial); Return
deactivateDataCall(int32_t serial, int32_t cid, bool reasonRadioShutDown); Return
getFacilityLockForApp(int32_t serial, const ::android::hardware::hidl_string& facility, const ::android::hardware::hidl_string& password, int32_t serviceClass, const ::android::hardware::hidl_string& appId); Return
setFacilityLockForApp(int32_t serial, const ::android::hardware::hidl_string& facility, bool lockState, const ::android::hardware::hidl_string& password, int32_t serviceClass, const ::android::hardware::hidl_string& appId); Return
setBarringPassword(int32_t serial, const ::android::hardware::hidl_string& facility, const ::android::hardware::hidl_string& oldPassword, const ::android::hardware::hidl_string& newPassword); Return
getNetworkSelectionMode(int32_t serial); Return
setNetworkSelectionModeAutomatic(int32_t serial); Return
setNetworkSelectionModeManual(int32_t serial, const ::android::hardware::hidl_string& operatorNumeric); Return
getAvailableNetworks(int32_t serial); Return
startNetworkScan(int32_t serial, const V1_1::NetworkScanRequest& request); Return
stopNetworkScan(int32_t serial); Return
startDtmf(int32_t serial, const ::android::hardware::hidl_string& s); Return
stopDtmf(int32_t serial); Return
getBasebandVersion(int32_t serial); Return
separateConnection(int32_t serial, int32_t gsmIndex); Return
setMute(int32_t serial, bool enable); Return
getMute(int32_t serial); Return
getClip(int32_t serial); Return
getDataCallList(int32_t serial); Return
setSuppServiceNotifications(int32_t serial, bool enable); Return
writeSmsToSim(int32_t serial, const SmsWriteArgs& smsWriteArgs); Return
deleteSmsOnSim(int32_t serial, int32_t index); Return
setBandMode(int32_t serial, RadioBandMode mode); Return
getAvailableBandModes(int32_t serial); Return
sendEnvelope(int32_t serial, const ::android::hardware::hidl_string& command); Return
sendTerminalResponseToSim(int32_t serial, const ::android::hardware::hidl_string& commandResponse); Return
handleStkCallSetupRequestFromSim(int32_t serial, bool accept); Return
explicitCallTransfer(int32_t serial); Return
setPreferredNetworkType(int32_t serial, PreferredNetworkType nwType); Return
getPreferredNetworkType(int32_t serial); Return
getNeighboringCids(int32_t serial); Return
setLocationUpdates(int32_t serial, bool enable); Return
setCdmaSubscriptionSource(int32_t serial, CdmaSubscriptionSource cdmaSub); Return
setCdmaRoamingPreference(int32_t serial, CdmaRoamingType type); Return
getCdmaRoamingPreference(int32_t serial); Return
setTTYMode(int32_t serial, TtyMode mode); Return
getTTYMode(int32_t serial); Return
setPreferredVoicePrivacy(int32_t serial, bool enable); Return
getPreferredVoicePrivacy(int32_t serial); Return
sendCDMAFeatureCode(int32_t serial, const ::android::hardware::hidl_string& featureCode); Return
sendBurstDtmf(int32_t serial, const ::android::hardware::hidl_string& dtmf, int32_t on, int32_t off); Return
sendCdmaSms(int32_t serial, const CdmaSmsMessage& sms); Return
acknowledgeLastIncomingCdmaSms(int32_t serial, const CdmaSmsAck& smsAck); Return
getGsmBroadcastConfig(int32_t serial); Return
setGsmBroadcastConfig(int32_t serial, const hidl_vec
& configInfo); Return
setGsmBroadcastActivation(int32_t serial, bool activate); Return
getCdmaBroadcastConfig(int32_t serial); Return
setCdmaBroadcastConfig(int32_t serial, const hidl_vec
& configInfo); Return
setCdmaBroadcastActivation(int32_t serial, bool activate); Return
getCDMASubscription(int32_t serial); Return
writeSmsToRuim(int32_t serial, const CdmaSmsWriteArgs& cdmaSms); Return
deleteSmsOnRuim(int32_t serial, int32_t index); Return
getDeviceIdentity(int32_t serial); Return
exitEmergencyCallbackMode(int32_t serial); Return
getSmscAddress(int32_t serial); Return
setSmscAddress(int32_t serial, const ::android::hardware::hidl_string& smsc); Return
reportSmsMemoryStatus(int32_t serial, bool available); Return
reportStkServiceIsRunning(int32_t serial); Return
getCdmaSubscriptionSource(int32_t serial); Return
requestIsimAuthentication(int32_t serial, const ::android::hardware::hidl_string& challenge); Return
acknowledgeIncomingGsmSmsWithPdu(int32_t serial, bool success, const ::android::hardware::hidl_string& ackPdu); Return
sendEnvelopeWithStatus(int32_t serial, const ::android::hardware::hidl_string& contents); Return
getVoiceRadioTechnology(int32_t serial); Return
getCellInfoList(int32_t serial); Return
setCellInfoListRate(int32_t serial, int32_t rate); Return
setInitialAttachApn(int32_t serial, const DataProfileInfo& dataProfileInfo, bool modemCognitive, bool isRoaming); Return
getImsRegistrationState(int32_t serial); Return
sendImsSms(int32_t serial, const ImsSmsMessage& message); Return
iccTransmitApduBasicChannel(int32_t serial, const SimApdu& message); Return
iccOpenLogicalChannel(int32_t serial, const ::android::hardware::hidl_string& aid, int32_t p2); Return
iccCloseLogicalChannel(int32_t serial, int32_t channelId); Return
iccTransmitApduLogicalChannel(int32_t serial, const SimApdu& message); Return
nvReadItem(int32_t serial, NvItem itemId); Return
nvWriteItem(int32_t serial, const NvWriteItem& item); Return
nvWriteCdmaPrl(int32_t serial, const ::android::hardware::hidl_vec
& prl); Return
nvResetConfig(int32_t serial, ResetNvType resetType); Return
setUiccSubscription(int32_t serial, const SelectUiccSub& uiccSub); Return
setDataAllowed(int32_t serial, bool allow); Return
getHardwareConfig(int32_t serial); Return
requestIccSimAuthentication(int32_t serial, int32_t authContext, const ::android::hardware::hidl_string& authData, const ::android::hardware::hidl_string& aid); Return
setDataProfile(int32_t serial, const ::android::hardware::hidl_vec
& profiles, bool isRoaming); Return
requestShutdown(int32_t serial); Return
getRadioCapability(int32_t serial); Return
setRadioCapability(int32_t serial, const RadioCapability& rc); Return
startLceService(int32_t serial, int32_t reportInterval, bool pullMode); Return
stopLceService(int32_t serial); Return
pullLceData(int32_t serial); Return
getModemActivityInfo(int32_t serial); Return
setAllowedCarriers(int32_t serial, bool allAllowed, const CarrierRestrictions& carriers); Return
getAllowedCarriers(int32_t serial); Return
sendDeviceState(int32_t serial, DeviceStateType deviceStateType, bool state); Return
setIndicationFilter(int32_t serial, int32_t indicationFilter); Return
startKeepalive(int32_t serial, const V1_1::KeepaliveRequest& keepalive); Return
stopKeepalive(int32_t serial, int32_t sessionHandle); Return
setSimCardPower(int32_t serial, bool powerUp); Return
setSimCardPower_1_1(int32_t serial, const V1_1::CardPowerState state); Return
responseAcknowledgement(); Return
setCarrierInfoForImsiEncryption(int32_t serial, const V1_1::ImsiEncryptionInfo& message); void checkReturnStatus(Return
& ret); }; struct OemHookImpl : public IOemHook { int32_t mSlotId; sp
mOemHookResponse; sp
mOemHookIndication; Return
setResponseFunctions( const ::android::sp
& oemHookResponse, const ::android::sp
& oemHookIndication); Return
sendRequestRaw(int32_t serial, const ::android::hardware::hidl_vec
& data); Return
sendRequestStrings(int32_t serial, const ::android::hardware::hidl_vec<::android::hardware::hidl_string>& data); }; void memsetAndFreeStrings(int numPointers, ...) { va_list ap; va_start(ap, numPointers); for (int i = 0; i < numPointers; i++) { char *ptr = va_arg(ap, char *); if (ptr) { #ifdef MEMSET_FREED #define MAX_STRING_LENGTH 4096 memset(ptr, 0, strnlen(ptr, MAX_STRING_LENGTH)); #endif free(ptr); } } va_end(ap); } void sendErrorResponse(RequestInfo *pRI, RIL_Errno err) { pRI->pCI->responseFunction((int) pRI->socket_id, (int) RadioResponseType::SOLICITED, pRI->token, err, NULL, 0); } /** * Copies over src to dest. If memory allocation fails, responseFunction() is called for the * request with error RIL_E_NO_MEMORY. The size() method is used to determine the size of the * destination buffer into which the HIDL string is copied. If there is a discrepancy between * the string length reported by the size() method, and the length of the string returned by * the c_str() method, the function will return false indicating a failure. * * Returns true on success, and false on failure. */ bool copyHidlStringToRil(char **dest, const hidl_string &src, RequestInfo *pRI, bool allowEmpty) { size_t len = src.size(); if (len == 0 && !allowEmpty) { *dest = NULL; return true; } *dest = (char *) calloc(len + 1, sizeof(char)); if (*dest == NULL) { RLOGE("Memory allocation failed for request %s", requestToString(pRI->pCI->requestNumber)); sendErrorResponse(pRI, RIL_E_NO_MEMORY); return false; } if (strlcpy(*dest, src.c_str(), len + 1) >= (len + 1)) { RLOGE("Copy of the HIDL string has been truncated, as " "the string length reported by size() does not " "match the length of string returned by c_str()."); free(*dest); *dest = NULL; sendErrorResponse(pRI, RIL_E_INTERNAL_ERR); return false; } return true; } bool copyHidlStringToRil(char **dest, const hidl_string &src, RequestInfo *pRI) { return copyHidlStringToRil(dest, src, pRI, false); } hidl_string convertCharPtrToHidlString(const char *ptr) { hidl_string ret; if (ptr != NULL) { // TODO: replace this with strnlen ret.setToExternal(ptr, strlen(ptr)); } return ret; } bool dispatchVoid(int serial, int slotId, int request) { RequestInfo *pRI = android::addRequestToList(serial, slotId, request); if (pRI == NULL) { return false; } CALL_ONREQUEST(request, NULL, 0, pRI, slotId); return true; } bool dispatchString(int serial, int slotId, int request, const char * str) { RequestInfo *pRI = android::addRequestToList(serial, slotId, request); if (pRI == NULL) { return false; } char *pString; if (!copyHidlStringToRil(&pString, str, pRI)) { return false; } CALL_ONREQUEST(request, pString, sizeof(char *), pRI, slotId); memsetAndFreeStrings(1, pString); return true; } bool dispatchStrings(int serial, int slotId, int request, bool allowEmpty, int countStrings, ...) { RequestInfo *pRI = android::addRequestToList(serial, slotId, request); if (pRI == NULL) { return false; } char **pStrings; pStrings = (char **)calloc(countStrings, sizeof(char *)); if (pStrings == NULL) { RLOGE("Memory allocation failed for request %s", requestToString(request)); sendErrorResponse(pRI, RIL_E_NO_MEMORY); return false; } va_list ap; va_start(ap, countStrings); for (int i = 0; i < countStrings; i++) { const char* str = va_arg(ap, const char *); if (!copyHidlStringToRil(&pStrings[i], hidl_string(str), pRI, allowEmpty)) { va_end(ap); for (int j = 0; j < i; j++) { memsetAndFreeStrings(1, pStrings[j]); } free(pStrings); return false; } } va_end(ap); CALL_ONREQUEST(request, pStrings, countStrings * sizeof(char *), pRI, slotId); if (pStrings != NULL) { for (int i = 0 ; i < countStrings ; i++) { memsetAndFreeStrings(1, pStrings[i]); } #ifdef MEMSET_FREED memset(pStrings, 0, countStrings * sizeof(char *)); #endif free(pStrings); } return true; } bool dispatchStrings(int serial, int slotId, int request, const hidl_vec
& data) { RequestInfo *pRI = android::addRequestToList(serial, slotId, request); if (pRI == NULL) { return false; } int countStrings = data.size(); char **pStrings; pStrings = (char **)calloc(countStrings, sizeof(char *)); if (pStrings == NULL) { RLOGE("Memory allocation failed for request %s", requestToString(request)); sendErrorResponse(pRI, RIL_E_NO_MEMORY); return false; } for (int i = 0; i < countStrings; i++) { if (!copyHidlStringToRil(&pStrings[i], data[i], pRI)) { for (int j = 0; j < i; j++) { memsetAndFreeStrings(1, pStrings[j]); } free(pStrings); return false; } } CALL_ONREQUEST(request, pStrings, countStrings * sizeof(char *), pRI, slotId); if (pStrings != NULL) { for (int i = 0 ; i < countStrings ; i++) { memsetAndFreeStrings(1, pStrings[i]); } #ifdef MEMSET_FREED memset(pStrings, 0, countStrings * sizeof(char *)); #endif free(pStrings); } return true; } bool dispatchInts(int serial, int slotId, int request, int countInts, ...) { RequestInfo *pRI = android::addRequestToList(serial, slotId, request); if (pRI == NULL) { return false; } int *pInts = (int *)calloc(countInts, sizeof(int)); if (pInts == NULL) { RLOGE("Memory allocation failed for request %s", requestToString(request)); sendErrorResponse(pRI, RIL_E_NO_MEMORY); return false; } va_list ap; va_start(ap, countInts); for (int i = 0; i < countInts; i++) { pInts[i] = va_arg(ap, int); } va_end(ap); CALL_ONREQUEST(request, pInts, countInts * sizeof(int), pRI, slotId); if (pInts != NULL) { #ifdef MEMSET_FREED memset(pInts, 0, countInts * sizeof(int)); #endif free(pInts); } return true; } bool dispatchCallForwardStatus(int serial, int slotId, int request, const CallForwardInfo& callInfo) { RequestInfo *pRI = android::addRequestToList(serial, slotId, request); if (pRI == NULL) { return false; } RIL_CallForwardInfo cf; cf.status = (int) callInfo.status; cf.reason = callInfo.reason; cf.serviceClass = callInfo.serviceClass; cf.toa = callInfo.toa; cf.timeSeconds = callInfo.timeSeconds; if (!copyHidlStringToRil(&cf.number, callInfo.number, pRI)) { return false; } CALL_ONREQUEST(request, &cf, sizeof(cf), pRI, slotId); memsetAndFreeStrings(1, cf.number); return true; } bool dispatchRaw(int serial, int slotId, int request, const hidl_vec
& rawBytes) { RequestInfo *pRI = android::addRequestToList(serial, slotId, request); if (pRI == NULL) { return false; } const uint8_t *uData = rawBytes.data(); CALL_ONREQUEST(request, (void *) uData, rawBytes.size(), pRI, slotId); return true; } bool dispatchIccApdu(int serial, int slotId, int request, const SimApdu& message) { RequestInfo *pRI = android::addRequestToList(serial, slotId, request); if (pRI == NULL) { return false; } RIL_SIM_APDU apdu = {}; apdu.sessionid = message.sessionId; apdu.cla = message.cla; apdu.instruction = message.instruction; apdu.p1 = message.p1; apdu.p2 = message.p2; apdu.p3 = message.p3; if (!copyHidlStringToRil(&apdu.data, message.data, pRI)) { return false; } CALL_ONREQUEST(request, &apdu, sizeof(apdu), pRI, slotId); memsetAndFreeStrings(1, apdu.data); return true; } void checkReturnStatus(int32_t slotId, Return
& 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; // there's no other recovery to be done here. When the client process is back up, it will // call setResponseFunctions() // 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 = isRadioService ? mCounterRadio[slotId] : mCounterOemHook[slotId]; pthread_rwlock_t *radioServiceRwlockPtr = radio::getRadioServiceRwlock(slotId); int ret = pthread_rwlock_unlock(radioServiceRwlockPtr); assert(ret == 0); // acquire wrlock ret = pthread_rwlock_wrlock(radioServiceRwlockPtr); assert(ret == 0); // make sure the counter value has not changed if (counter == (isRadioService ? mCounterRadio[slotId] : mCounterOemHook[slotId])) { if (isRadioService) { radioService[slotId]->mRadioResponse = NULL; radioService[slotId]->mRadioIndication = NULL; radioService[slotId]->mRadioResponseV1_1 = NULL; radioService[slotId]->mRadioIndicationV1_1 = 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"); } // release wrlock ret = pthread_rwlock_unlock(radioServiceRwlockPtr); assert(ret == 0); // Reacquire rdlock ret = pthread_rwlock_rdlock(radioServiceRwlockPtr); assert(ret == 0); } } void RadioImpl::checkReturnStatus(Return
& ret) { ::checkReturnStatus(mSlotId, ret, true); } Return
RadioImpl::setResponseFunctions( const ::android::sp
& radioResponseParam, const ::android::sp
& radioIndicationParam) { RLOGD("setResponseFunctions"); pthread_rwlock_t *radioServiceRwlockPtr = radio::getRadioServiceRwlock(mSlotId); int ret = pthread_rwlock_wrlock(radioServiceRwlockPtr); assert(ret == 0); mRadioResponse = radioResponseParam; mRadioIndication = radioIndicationParam; mRadioResponseV1_1 = V1_1::IRadioResponse::castFrom(mRadioResponse).withDefault(nullptr); mRadioIndicationV1_1 = V1_1::IRadioIndication::castFrom(mRadioIndication).withDefault(nullptr); if (mRadioResponseV1_1 == nullptr || mRadioIndicationV1_1 == nullptr) { mRadioResponseV1_1 = nullptr; mRadioIndicationV1_1 = nullptr; } 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
RadioImpl::getIccCardStatus(int32_t serial) { #if VDBG RLOGD("getIccCardStatus: serial %d", serial); #endif dispatchVoid(serial, mSlotId, RIL_REQUEST_GET_SIM_STATUS); return Void(); } Return
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, true, 2, pin.c_str(), aid.c_str()); return Void(); } Return
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, true, 3, puk.c_str(), pin.c_str(), aid.c_str()); return Void(); } Return
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, true, 2, pin2.c_str(), aid.c_str()); return Void(); } Return
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, true, 3, puk2.c_str(), pin2.c_str(), aid.c_str()); return Void(); } Return
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, true, 3, oldPin.c_str(), newPin.c_str(), aid.c_str()); return Void(); } Return
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, true, 3, oldPin2.c_str(), newPin2.c_str(), aid.c_str()); return Void(); } Return
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, true, 1, netPin.c_str()); return Void(); } Return
RadioImpl::getCurrentCalls(int32_t serial) { #if VDBG RLOGD("getCurrentCalls: serial %d", serial); #endif dispatchVoid(serial, mSlotId, RIL_REQUEST_GET_CURRENT_CALLS); return Void(); } Return
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(); } RIL_Dial dial = {}; RIL_UUS_Info uusInfo = {}; int32_t sizeOfDial = sizeof(dial); if (!copyHidlStringToRil(&dial.address, dialInfo.address, pRI)) { return Void(); } dial.clir = (int) dialInfo.clir; if (dialInfo.uusInfo.size() != 0) { uusInfo.uusType = (RIL_UUS_Type) dialInfo.uusInfo[0].uusType; uusInfo.uusDcs = (RIL_UUS_DCS) dialInfo.uusInfo[0].uusDcs; if (dialInfo.uusInfo[0].uusData.size() == 0) { uusInfo.uusData = NULL; uusInfo.uusLength = 0; } else { if (!copyHidlStringToRil(&uusInfo.uusData, dialInfo.uusInfo[0].uusData, pRI)) { memsetAndFreeStrings(1, dial.address); return Void(); } uusInfo.uusLength = dialInfo.uusInfo[0].uusData.size(); } dial.uusInfo = &uusInfo; } CALL_ONREQUEST(RIL_REQUEST_DIAL, &dial, sizeOfDial, pRI, mSlotId); memsetAndFreeStrings(2, dial.address, uusInfo.uusData); return Void(); } Return
RadioImpl::getImsiForApp(int32_t serial, const hidl_string& aid) { #if VDBG RLOGD("getImsiForApp: serial %d", serial); #endif dispatchStrings(serial, mSlotId, RIL_REQUEST_GET_IMSI, false, 1, aid.c_str()); return Void(); } Return
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
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
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
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
RadioImpl::conference(int32_t serial) { #if VDBG RLOGD("conference: serial %d", serial); #endif dispatchVoid(serial, mSlotId, RIL_REQUEST_CONFERENCE); return Void(); } Return
RadioImpl::rejectCall(int32_t serial) { #if VDBG RLOGD("rejectCall: serial %d", serial); #endif dispatchVoid(serial, mSlotId, RIL_REQUEST_UDUB); return Void(); } Return
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
RadioImpl::getSignalStrength(int32_t serial) { #if VDBG RLOGD("getSignalStrength: serial %d", serial); #endif dispatchVoid(serial, mSlotId, RIL_REQUEST_SIGNAL_STRENGTH); return Void(); } Return
RadioImpl::getVoiceRegistrationState(int32_t serial) { #if VDBG RLOGD("getVoiceRegistrationState: serial %d", serial); #endif dispatchVoid(serial, mSlotId, RIL_REQUEST_VOICE_REGISTRATION_STATE); return Void(); } Return
RadioImpl::getDataRegistrationState(int32_t serial) { #if VDBG RLOGD("getDataRegistrationState: serial %d", serial); #endif dispatchVoid(serial, mSlotId, RIL_REQUEST_DATA_REGISTRATION_STATE); return Void(); } Return
RadioImpl::getOperator(int32_t serial) { #if VDBG RLOGD("getOperator: serial %d", serial); #endif dispatchVoid(serial, mSlotId, RIL_REQUEST_OPERATOR); return Void(); } Return
RadioImpl::setRadioPower(int32_t serial, bool on) { RLOGD("setRadioPower: serial %d on %d", serial, on); dispatchInts(serial, mSlotId, RIL_REQUEST_RADIO_POWER, 1, BOOL_TO_INT(on)); return Void(); } Return
RadioImpl::sendDtmf(int32_t serial, const hidl_string& s) { #if VDBG RLOGD("sendDtmf: serial %d", serial); #endif dispatchString(serial, mSlotId, RIL_REQUEST_DTMF, s.c_str()); return Void(); } Return
RadioImpl::sendSms(int32_t serial, const GsmSmsMessage& message) { #if VDBG RLOGD("sendSms: serial %d", serial); #endif dispatchStrings(serial, mSlotId, RIL_REQUEST_SEND_SMS, false, 2, message.smscPdu.c_str(), message.pdu.c_str()); return Void(); } Return
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, false, 2, message.smscPdu.c_str(), message.pdu.c_str()); return Void(); } static bool convertMvnoTypeToString(MvnoType type, char *&str) { switch (type) { 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
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 = (isRoaming ? dataProfileInfo.roamingProtocol : dataProfileInfo.protocol); dispatchStrings(serial, mSlotId, RIL_REQUEST_SETUP_DATA_CALL, true, 7, std::to_string((int) radioTechnology + 2).c_str(), std::to_string((int) dataProfileInfo.profileId).c_str(), dataProfileInfo.apn.c_str(), dataProfileInfo.user.c_str(), dataProfileInfo.password.c_str(), std::to_string((int) dataProfileInfo.authType).c_str(), protocol.c_str()); } else if (s_vendorFunctions->version >= 15) { char *mvnoTypeStr = NULL; if (!convertMvnoTypeToString(dataProfileInfo.mvnoType, mvnoTypeStr)) { RequestInfo *pRI = android::addRequestToList(serial, mSlotId, RIL_REQUEST_SETUP_DATA_CALL); if (pRI != NULL) { sendErrorResponse(pRI, RIL_E_INVALID_ARGUMENTS); } return Void(); } dispatchStrings(serial, mSlotId, RIL_REQUEST_SETUP_DATA_CALL, true, 15, std::to_string((int) radioTechnology + 2).c_str(), std::to_string((int) dataProfileInfo.profileId).c_str(), dataProfileInfo.apn.c_str(), dataProfileInfo.user.c_str(), dataProfileInfo.password.c_str(), std::to_string((int) dataProfileInfo.authType).c_str(), dataProfileInfo.protocol.c_str(), dataProfileInfo.roamingProtocol.c_str(), std::to_string(dataProfileInfo.supportedApnTypesBitmap).c_str(), std::to_string(dataProfileInfo.bearerBitmap).c_str(), modemCognitive ? "1" : "0", std::to_string(dataProfileInfo.mtu).c_str(), mvnoTypeStr, dataProfileInfo.mvnoMatchData.c_str(), roamingAllowed ? "1" : "0"); } else { RLOGE("Unsupported RIL version %d, min version expected 4", s_vendorFunctions->version); RequestInfo *pRI = android::addRequestToList(serial, mSlotId, RIL_REQUEST_SETUP_DATA_CALL); if (pRI != NULL) { sendErrorResponse(pRI, RIL_E_REQUEST_NOT_SUPPORTED); } } return Void(); } Return
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 = {}; rilIccIo.command = iccIo.command; rilIccIo.fileid = iccIo.fileId; if (!copyHidlStringToRil(&rilIccIo.path, iccIo.path, pRI)) { return Void(); } rilIccIo.p1 = iccIo.p1; rilIccIo.p2 = iccIo.p2; rilIccIo.p3 = iccIo.p3; if (!copyHidlStringToRil(&rilIccIo.data, iccIo.data, pRI)) { memsetAndFreeStrings(1, rilIccIo.path); return Void(); } if (!copyHidlStringToRil(&rilIccIo.pin2, iccIo.pin2, pRI)) { memsetAndFreeStrings(2, rilIccIo.path, rilIccIo.data); return Void(); } if (!copyHidlStringToRil(&rilIccIo.aidPtr, iccIo.aid, pRI)) { memsetAndFreeStrings(3, rilIccIo.path, rilIccIo.data, rilIccIo.pin2); return Void(); } CALL_ONREQUEST(RIL_REQUEST_SIM_IO, &rilIccIo, sizeof(rilIccIo), pRI, mSlotId); memsetAndFreeStrings(4, rilIccIo.path, rilIccIo.data, rilIccIo.pin2, rilIccIo.aidPtr); return Void(); } Return
RadioImpl::sendUssd(int32_t serial, const hidl_string& ussd) { #if VDBG RLOGD("sendUssd: serial %d", serial); #endif dispatchString(serial, mSlotId, RIL_REQUEST_SEND_USSD, ussd.c_str()); return Void(); } Return
RadioImpl::cancelPendingUssd(int32_t serial) { #if VDBG RLOGD("cancelPendingUssd: serial %d", serial); #endif dispatchVoid(serial, mSlotId, RIL_REQUEST_CANCEL_USSD); return Void(); } Return
RadioImpl::getClir(int32_t serial) { #if VDBG RLOGD("getClir: serial %d", serial); #endif dispatchVoid(serial, mSlotId, RIL_REQUEST_GET_CLIR); return Void(); } Return
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
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
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
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
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
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
RadioImpl::acceptCall(int32_t serial) { #if VDBG RLOGD("acceptCall: serial %d", serial); #endif dispatchVoid(serial, mSlotId, RIL_REQUEST_ANSWER); return Void(); } Return
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, false, 2, (std::to_string(cid)).c_str(), reasonRadioShutDown ? "1" : "0"); return Void(); } Return
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, true, 4, facility.c_str(), password.c_str(), (std::to_string(serviceClass)).c_str(), appId.c_str()); return Void(); } Return
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, true, 5, facility.c_str(), lockState ? "1" : "0", password.c_str(), (std::to_string(serviceClass)).c_str(), appId.c_str() ); return Void(); } Return
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, true, 3, facility.c_str(), oldPassword.c_str(), newPassword.c_str()); return Void(); } Return
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
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
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, operatorNumeric.c_str()); return Void(); } Return
RadioImpl::getAvailableNetworks(int32_t serial) { #if VDBG RLOGD("getAvailableNetworks: serial %d", serial); #endif dispatchVoid(serial, mSlotId, RIL_REQUEST_QUERY_AVAILABLE_NETWORKS); return Void(); } Return
RadioImpl::startNetworkScan(int32_t serial, const V1_1::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 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
* bands = nullptr; switch (request.specifiers[i].radioAccessNetwork) { case V1_1::RadioAccessNetworks::GERAN: ras_to.bands_length = ras_from.geranBands.size(); bands = (std::vector
*) &ras_from.geranBands; break; case V1_1::RadioAccessNetworks::UTRAN: ras_to.bands_length = ras_from.utranBands.size(); bands = (std::vector
*) &ras_from.utranBands; break; case V1_1::RadioAccessNetworks::EUTRAN: ras_to.bands_length = ras_from.eutranBands.size(); bands = (std::vector
*) &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]; } } CALL_ONREQUEST(RIL_REQUEST_START_NETWORK_SCAN, &scan_request, sizeof(scan_request), pRI, mSlotId); return Void(); } Return
RadioImpl::stopNetworkScan(int32_t serial) { #if VDBG RLOGD("stopNetworkScan: serial %d", serial); #endif dispatchVoid(serial, mSlotId, RIL_REQUEST_STOP_NETWORK_SCAN); return Void(); } Return
RadioImpl::startDtmf(int32_t serial, const hidl_string& s) { #if VDBG RLOGD("startDtmf: serial %d", serial); #endif dispatchString(serial, mSlotId, RIL_REQUEST_DTMF_START, s.c_str()); return Void(); } Return
RadioImpl::stopDtmf(int32_t serial) { #if VDBG RLOGD("stopDtmf: serial %d", serial); #endif dispatchVoid(serial, mSlotId, RIL_REQUEST_DTMF_STOP); return Void(); } Return
RadioImpl::getBasebandVersion(int32_t serial) { #if VDBG RLOGD("getBasebandVersion: serial %d", serial); #endif dispatchVoid(serial, mSlotId, RIL_REQUEST_BASEBAND_VERSION); return Void(); } Return
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
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
RadioImpl::getMute(int32_t serial) { #if VDBG RLOGD("getMute: serial %d", serial); #endif dispatchVoid(serial, mSlotId, RIL_REQUEST_GET_MUTE); return Void(); } Return
RadioImpl::getClip(int32_t serial) { #if VDBG RLOGD("getClip: serial %d", serial); #endif dispatchVoid(serial, mSlotId, RIL_REQUEST_QUERY_CLIP); return Void(); } Return
RadioImpl::getDataCallList(int32_t serial) { #if VDBG RLOGD("getDataCallList: serial %d", serial); #endif dispatchVoid(serial, mSlotId, RIL_REQUEST_DATA_CALL_LIST); return Void(); } Return
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
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(); } RIL_SMS_WriteArgs args; args.status = (int) smsWriteArgs.status; if (!copyHidlStringToRil(&args.pdu, smsWriteArgs.pdu, pRI)) { return Void(); } if (!copyHidlStringToRil(&args.smsc, smsWriteArgs.smsc, pRI)) { memsetAndFreeStrings(1, args.pdu); return Void(); } CALL_ONREQUEST(RIL_REQUEST_WRITE_SMS_TO_SIM, &args, sizeof(args), pRI, mSlotId); memsetAndFreeStrings(2, args.smsc, args.pdu); return Void(); } Return
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
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
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
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, command.c_str()); return Void(); } Return
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, commandResponse.c_str()); return Void(); } Return
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
RadioImpl::explicitCallTransfer(int32_t serial) { #if VDBG RLOGD("explicitCallTransfer: serial %d", serial); #endif dispatchVoid(serial, mSlotId, RIL_REQUEST_EXPLICIT_CALL_TRANSFER); return Void(); } Return
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
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