OSDN Git Service

Merge "Fix the RIL-to-HIDL conversion for Cell Lat and Long"
[android-x86/hardware-ril.git] / libril / ril_service.cpp
index def4405..443225a 100644 (file)
 
 #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>
@@ -33,10 +37,11 @@ using namespace android::hardware::radio::deprecated::V1_0;
 using ::android::hardware::configureRpcThreadpool;
 using ::android::hardware::joinRpcThreadpool;
 using ::android::hardware::Return;
-using ::android::hardware::Status;
 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;
@@ -57,12 +62,14 @@ struct OemHookImpl;
 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;
@@ -95,7 +102,7 @@ void convertRilDataCallListToHal(void *response, size_t responseLen,
 
 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;
@@ -169,7 +176,8 @@ struct RadioImpl : public IRadio {
             RadioTechnology radioTechnology,
             const DataProfileInfo& profileInfo,
             bool modemCognitive,
-            bool roamingAllowed);
+            bool roamingAllowed,
+            bool isRoaming);
 
     Return<void> iccIOForApp(int32_t serial,
             const IccIo& iccIo);
@@ -228,6 +236,10 @@ struct RadioImpl : public IRadio {
 
     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);
 
@@ -245,8 +257,6 @@ struct RadioImpl : public IRadio {
 
     Return<void> getDataCallList(int32_t serial);
 
-    Return<void> sendScreenState(int32_t serial, bool enable);
-
     Return<void> setSuppServiceNotifications(int32_t serial, bool enable);
 
     Return<void> writeSmsToSim(int32_t serial,
@@ -356,7 +366,7 @@ struct RadioImpl : public IRadio {
     Return<void> setCellInfoListRate(int32_t serial, int32_t rate);
 
     Return<void> setInitialAttachApn(int32_t serial, const DataProfileInfo& dataProfileInfo,
-            bool modemCognitive);
+            bool modemCognitive, bool isRoaming);
 
     Return<void> getImsRegistrationState(int32_t serial);
 
@@ -365,7 +375,7 @@ struct RadioImpl : public IRadio {
     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);
 
@@ -392,7 +402,7 @@ struct RadioImpl : public IRadio {
             const ::android::hardware::hidl_string& aid);
 
     Return<void> setDataProfile(int32_t serial,
-            const ::android::hardware::hidl_vec<DataProfileInfo>& profiles);
+            const ::android::hardware::hidl_vec<DataProfileInfo>& profiles, bool isRoaming);
 
     Return<void> requestShutdown(int32_t serial);
 
@@ -418,10 +428,19 @@ struct RadioImpl : public IRadio {
 
     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);
 };
 
@@ -448,7 +467,8 @@ void memsetAndFreeStrings(int numPointers, ...) {
         char *ptr = va_arg(ap, char *);
         if (ptr) {
 #ifdef MEMSET_FREED
-            memsetString (ptr);
+#define MAX_STRING_LENGTH 4096
+            memset(ptr, 0, strnlen(ptr, MAX_STRING_LENGTH));
 #endif
             free(ptr);
         }
@@ -456,6 +476,11 @@ void memsetAndFreeStrings(int numPointers, ...) {
     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.
@@ -470,12 +495,10 @@ bool copyHidlStringToRil(char **dest, const hidl_string &src, RequestInfo *pRI)
     *dest = (char *) calloc(len + 1, sizeof(char));
     if (*dest == NULL) {
         RLOGE("Memory allocation failed for request %s", requestToString(pRI->pCI->requestNumber));
-        android::Parcel p; // TODO: should delete this after translation of all commands is complete
-        pRI->pCI->responseFunction(p, (int) pRI->socket_id, pRI->pCI->requestNumber,
-                (int) RadioResponseType::SOLICITED, pRI->token, RIL_E_NO_MEMORY, NULL, 0);
+        sendErrorResponse(pRI, RIL_E_NO_MEMORY);
         return false;
     }
-    strncpy(*dest, src, len + 1);
+    strncpy(*dest, src.c_str(), len + 1);
     return true;
 }
 
@@ -521,19 +544,17 @@ bool dispatchStrings(int serial, int slotId, int request, int countStrings, ...)
     }
 
     char **pStrings;
-    android::Parcel p;   // TODO: should delete this after translation of all commands is complete
     pStrings = (char **)calloc(countStrings, sizeof(char *));
     if (pStrings == NULL) {
         RLOGE("Memory allocation failed for request %s", requestToString(request));
-        pRI->pCI->responseFunction(p, (int) pRI->socket_id, request,
-                (int) RadioResponseType::SOLICITED, pRI->token, RIL_E_NO_MEMORY, NULL, 0);
+        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], str, pRI)) {
+        if (!copyHidlStringToRil(&pStrings[i], hidl_string(str), pRI)) {
             va_end(ap);
             for (int j = 0; j < i; j++) {
                 memsetAndFreeStrings(1, pStrings[j]);
@@ -567,12 +588,10 @@ bool dispatchStrings(int serial, int slotId, int request, const hidl_vec<hidl_st
 
     int countStrings = data.size();
     char **pStrings;
-    android::Parcel p;   // TODO: should delete this after translation of all commands is complete
     pStrings = (char **)calloc(countStrings, sizeof(char *));
     if (pStrings == NULL) {
         RLOGE("Memory allocation failed for request %s", requestToString(request));
-        pRI->pCI->responseFunction(p, (int) pRI->socket_id, request,
-                (int) RadioResponseType::SOLICITED, pRI->token, RIL_E_NO_MEMORY, NULL, 0);
+        sendErrorResponse(pRI, RIL_E_NO_MEMORY);
         return false;
     }
 
@@ -607,13 +626,11 @@ bool dispatchInts(int serial, int slotId, int request, int countInts, ...) {
         return false;
     }
 
-    android::Parcel p;   // TODO: should delete this after translation of all commands is complete
+    int *pInts = (int *)calloc(countInts, sizeof(int));
 
-    int *pInts = (int *) calloc(countInts, sizeof(int));
     if (pInts == NULL) {
         RLOGE("Memory allocation failed for request %s", requestToString(request));
-        pRI->pCI->responseFunction(p, (int) pRI->socket_id, request,
-                (int) RadioResponseType::SOLICITED, pRI->token, RIL_E_NO_MEMORY, NULL, 0);
+        sendErrorResponse(pRI, RIL_E_NO_MEMORY);
         return false;
     }
     va_list ap;
@@ -678,8 +695,7 @@ bool dispatchIccApdu(int serial, int slotId, int request, const SimApdu& message
         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;
@@ -699,7 +715,7 @@ bool dispatchIccApdu(int serial, int slotId, int request, const SimApdu& message
     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;
@@ -709,7 +725,7 @@ void checkReturnStatus(int32_t slotId, Return<void>& ret) {
         // 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);
@@ -719,12 +735,15 @@ void checkReturnStatus(int32_t slotId, Return<void>& ret) {
         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");
@@ -741,13 +760,13 @@ void checkReturnStatus(int32_t slotId, Return<void>& ret) {
 }
 
 void RadioImpl::checkReturnStatus(Return<void>& ret) {
-    ::checkReturnStatus(mSlotId, ret);
+    ::checkReturnStatus(mSlotId, ret, true);
 }
 
 Return<void> RadioImpl::setResponseFunctions(
         const ::android::sp<IRadioResponse>& radioResponseParam,
         const ::android::sp<IRadioIndication>& radioIndicationParam) {
-    RLOGD("RadioImpl::setResponseFunctions");
+    RLOGD("setResponseFunctions");
 
     pthread_rwlock_t *radioServiceRwlockPtr = radio::getRadioServiceRwlock(mSlotId);
     int ret = pthread_rwlock_wrlock(radioServiceRwlockPtr);
@@ -755,84 +774,107 @@ 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) {
-    RLOGD("RadioImpl::getIccCardStatus: serial %d", 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) {
-    RLOGD("RadioImpl::supplyIccPinForApp: serial %d", serial);
+#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) {
-    RLOGD("RadioImpl::supplyIccPukForApp: serial %d", serial);
+#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) {
-    RLOGD("RadioImpl::supplyIccPin2ForApp: serial %d", serial);
+#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) {
-    RLOGD("RadioImpl::supplyIccPuk2ForApp: serial %d", serial);
+#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) {
-    RLOGD("RadioImpl::changeIccPinForApp: serial %d", serial);
+#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) {
-    RLOGD("RadioImpl::changeIccPin2ForApp: serial %d", serial);
+#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) {
-    RLOGD("RadioImpl::supplyNetworkDepersonalization: serial %d", serial);
+#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) {
-    RLOGD("RadioImpl::getCurrentCalls: serial %d", 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) {
-    RLOGD("RadioImpl::dial: serial %d", serial);
+#if VDBG
+    RLOGD("dial: serial %d", serial);
+#endif
     RequestInfo *pRI = android::addRequestToList(serial, mSlotId, RIL_REQUEST_DIAL);
     if (pRI == NULL) {
         return Void();
@@ -872,124 +914,218 @@ Return<void> RadioImpl::dial(int32_t serial, const Dial& dialInfo) {
 }
 
 Return<void> RadioImpl::getImsiForApp(int32_t serial, const hidl_string& aid) {
-    RLOGD("RadioImpl::getImsiForApp: serial %d", serial);
+#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) {
-    RLOGD("RadioImpl::hangup: serial %d", serial);
+#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) {
-    RLOGD("RadioImpl::hangupWaitingOrBackground: serial %d", 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) {
-    RLOGD("RadioImpl::hangupForegroundResumeBackground: serial %d", 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) {
-    RLOGD("RadioImpl::switchWaitingOrHoldingAndActive: serial %d", 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) {
-    RLOGD("RadioImpl::conference: serial %d", serial);
+#if VDBG
+    RLOGD("conference: serial %d", serial);
+#endif
     dispatchVoid(serial, mSlotId, RIL_REQUEST_CONFERENCE);
     return Void();
 }
 
 Return<void> RadioImpl::rejectCall(int32_t serial) {
-    RLOGD("RadioImpl::rejectCall: serial %d", serial);
+#if VDBG
+    RLOGD("rejectCall: serial %d", serial);
+#endif
     dispatchVoid(serial, mSlotId, RIL_REQUEST_UDUB);
     return Void();
 }
 
 Return<void> RadioImpl::getLastCallFailCause(int32_t serial) {
-    RLOGD("RadioImpl::getLastCallFailCause: serial %d", 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) {
-    RLOGD("RadioImpl::getSignalStrength: serial %d", 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) {
-    RLOGD("RadioImpl::getVoiceRegistrationState: serial %d", 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) {
-    RLOGD("RadioImpl::getDataRegistrationState: serial %d", 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) {
-    RLOGD("RadioImpl::getOperator: serial %d", serial);
+#if VDBG
+    RLOGD("getOperator: serial %d", serial);
+#endif
     dispatchVoid(serial, mSlotId, RIL_REQUEST_OPERATOR);
     return Void();
 }
 
 Return<void> RadioImpl::setRadioPower(int32_t serial, bool on) {
-    RLOGD("RadioImpl::setRadioPower: serial %d on %d", serial, on);
+    RLOGD("setRadioPower: serial %d on %d", serial, on);
     dispatchInts(serial, mSlotId, RIL_REQUEST_RADIO_POWER, 1, BOOL_TO_INT(on));
     return Void();
 }
 
 Return<void> RadioImpl::sendDtmf(int32_t serial, const hidl_string& s) {
-    RLOGD("RadioImpl::sendDtmf: serial %d", serial);
-    dispatchString(serial, mSlotId, RIL_REQUEST_DTMF, (const char *) s);
+#if VDBG
+    RLOGD("sendDtmf: serial %d", serial);
+#endif
+    dispatchString(serial, mSlotId, RIL_REQUEST_DTMF, s.c_str());
     return Void();
 }
 
 Return<void> RadioImpl::sendSms(int32_t serial, const GsmSmsMessage& message) {
-    RLOGD("RadioImpl::sendSms: serial %d", serial);
+#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) {
-    RLOGD("RadioImpl::sendSMSExpectMore: serial %d", serial);
+#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();
 }
 
-Return<void> RadioImpl::setupDataCall(int32_t serial,
-                                      RadioTechnology radioTechnology,
-                                      const DataProfileInfo& profileInfo,
-                                      bool modemCognitive,
-                                      bool roamingAllowed) {
-    RLOGD("RadioImpl::setupDataCall: serial %d", serial);
+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<void> RadioImpl::setupDataCall(int32_t serial, RadioTechnology radioTechnology,
+                                      const DataProfileInfo& dataProfileInfo, bool modemCognitive,
+                                      bool roamingAllowed, bool isRoaming) {
 
-    // todo: dispatch request
+#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, 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, 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<void> RadioImpl::iccIOForApp(int32_t serial, const IccIo& iccIo) {
-    RLOGD("RadioImpl::iccIOForApp: serial %d", serial);
+#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)) {
@@ -1023,51 +1159,67 @@ Return<void> RadioImpl::iccIOForApp(int32_t serial, const IccIo& iccIo) {
 }
 
 Return<void> RadioImpl::sendUssd(int32_t serial, const hidl_string& ussd) {
-    RLOGD("RadioImpl::sendUssd: serial %d", serial);
-    dispatchString(serial, mSlotId, RIL_REQUEST_SEND_USSD, (const char *) ussd);
+#if VDBG
+    RLOGD("sendUssd: serial %d", serial);
+#endif
+    dispatchString(serial, mSlotId, RIL_REQUEST_SEND_USSD, ussd.c_str());
     return Void();
 }
 
 Return<void> RadioImpl::cancelPendingUssd(int32_t serial) {
-    RLOGD("RadioImpl::cancelPendingUssd: serial %d", 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) {
-    RLOGD("RadioImpl::getClir: serial %d", 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) {
-    RLOGD("RadioImpl::setClir: serial %d", serial);
+#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) {
-    RLOGD("RadioImpl::getCallForwardStatus: serial %d", serial);
+#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) {
-    RLOGD("RadioImpl::setCallForward: serial %d", serial);
+#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) {
-    RLOGD("RadioImpl::getCallWaiting: serial %d", serial);
+#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) {
-    RLOGD("RadioImpl::setCallWaiting: serial %d", serial);
+#if VDBG
+    RLOGD("setCallWaiting: serial %d", serial);
+#endif
     dispatchInts(serial, mSlotId, RIL_REQUEST_SET_CALL_WAITING, 2, BOOL_TO_INT(enable),
             serviceClass);
     return Void();
@@ -1075,145 +1227,253 @@ Return<void> RadioImpl::setCallWaiting(int32_t serial, bool enable, int32_t serv
 
 Return<void> RadioImpl::acknowledgeLastIncomingGsmSms(int32_t serial,
                                                       bool success, SmsAcknowledgeFailCause cause) {
-    RLOGD("RadioImpl::acknowledgeLastIncomingGsmSms: serial %d", serial);
+#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) {
-    RLOGD("RadioImpl::acceptCall: serial %d", 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) {
-    RLOGD("RadioImpl::deactivateDataCall: serial %d", serial);
+#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) {
-    RLOGD("RadioImpl::getFacilityLockForApp: serial %d", serial);
+#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) {
-    RLOGD("RadioImpl::setFacilityLockForApp: serial %d", serial);
+#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) {
-    RLOGD("RadioImpl::setBarringPassword: serial %d", serial);
+#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) {
-    RLOGD("RadioImpl::getNetworkSelectionMode: serial %d", 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) {
-    RLOGD("RadioImpl::setNetworkSelectionModeAutomatic: serial %d", 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) {
-    RLOGD("RadioImpl::setNetworkSelectionModeManual: serial %d", serial);
+#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) {
-    RLOGD("RadioImpl::getAvailableNetworks: serial %d", 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) {
-    RLOGD("RadioImpl::startDtmf: serial %d", serial);
+#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) {
-    RLOGD("RadioImpl::stopDtmf: serial %d", 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) {
-    RLOGD("RadioImpl::getBasebandVersion: serial %d", 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) {
-    RLOGD("RadioImpl::separateConnection: serial %d", serial);
+#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) {
-    RLOGD("RadioImpl::setMute: serial %d", serial);
+#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) {
-    RLOGD("RadioImpl::getMute: serial %d", 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) {
-    RLOGD("RadioImpl::getClip: serial %d", 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) {
-    RLOGD("RadioImpl::getDataCallList: serial %d", serial);
+#if VDBG
+    RLOGD("getDataCallList: serial %d", serial);
+#endif
     dispatchVoid(serial, mSlotId, RIL_REQUEST_DATA_CALL_LIST);
     return Void();
 }
 
-Return<void> RadioImpl::sendScreenState(int32_t serial, bool enable) {
-    RLOGD("RadioImpl::sendScreenState: serial %d", serial);
-    dispatchInts(serial, mSlotId, RIL_REQUEST_SCREEN_STATE, 1, BOOL_TO_INT(enable));
-    return Void();
-}
-
 Return<void> RadioImpl::setSuppServiceNotifications(int32_t serial, bool enable) {
-    RLOGD("RadioImpl::setSuppServiceNotifications: serial %d", serial);
+#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) {
-    RLOGD("RadioImpl::writeSmsToSim: serial %d", serial);
+#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();
@@ -1240,137 +1500,175 @@ Return<void> RadioImpl::writeSmsToSim(int32_t serial, const SmsWriteArgs& smsWri
 }
 
 Return<void> RadioImpl::deleteSmsOnSim(int32_t serial, int32_t index) {
-    RLOGD("RadioImpl::deleteSmsOnSim: serial %d", serial);
+#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) {
-    RLOGD("RadioImpl::setBandMode: serial %d", serial);
+#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) {
-    RLOGD("RadioImpl::getAvailableBandModes: serial %d", 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) {
-    RLOGD("RadioImpl::sendEnvelope: serial %d", serial);
+#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) {
-    RLOGD("RadioImpl::sendTerminalResponseToSim: serial %d", serial);
+#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) {
-    RLOGD("RadioImpl::handleStkCallSetupRequestFromSim: serial %d", serial);
+#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) {
-    RLOGD("RadioImpl::explicitCallTransfer: serial %d", 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) {
-    RLOGD("RadioImpl::setPreferredNetworkType: serial %d", serial);
+#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) {
-    RLOGD("RadioImpl::getPreferredNetworkType: serial %d", 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) {
-    RLOGD("RadioImpl::getNeighboringCids: serial %d", 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) {
-    RLOGD("RadioImpl::setLocationUpdates: serial %d", serial);
+#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) {
-    RLOGD("RadioImpl::setCdmaSubscriptionSource: serial %d", serial);
+#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) {
-    RLOGD("RadioImpl::setCdmaRoamingPreference: serial %d", serial);
+#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) {
-    RLOGD("RadioImpl::getCdmaRoamingPreference: serial %d", 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) {
-    RLOGD("RadioImpl::setTTYMode: serial %d", serial);
+#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) {
-    RLOGD("RadioImpl::getTTYMode: serial %d", 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) {
-    RLOGD("RadioImpl::setPreferredVoicePrivacy: serial %d", serial);
+#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) {
-    RLOGD("RadioImpl::getPreferredVoicePrivacy: serial %d", 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) {
-    RLOGD("RadioImpl::sendCDMAFeatureCode: serial %d", serial);
+#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) {
-    RLOGD("RadioImpl::sendBurstDtmf: serial %d", serial);
+#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;
@@ -1402,13 +1700,15 @@ void constructCdmaSms(RIL_CDMA_SMS_Message &rcsm, const CdmaSmsMessage& sms) {
 }
 
 Return<void> RadioImpl::sendCdmaSms(int32_t serial, const CdmaSmsMessage& sms) {
-    RLOGD("RadioImpl::sendCdmaSms: serial %d", serial);
+#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);
@@ -1416,7 +1716,9 @@ Return<void> RadioImpl::sendCdmaSms(int32_t serial, const CdmaSmsMessage& sms) {
 }
 
 Return<void> RadioImpl::acknowledgeLastIncomingCdmaSms(int32_t serial, const CdmaSmsAck& smsAck) {
-    RLOGD("RadioImpl::acknowledgeLastIncomingCdmaSms: serial %d", serial);
+#if VDBG
+    RLOGD("acknowledgeLastIncomingCdmaSms: serial %d", serial);
+#endif
     RequestInfo *pRI = android::addRequestToList(serial, mSlotId, RIL_REQUEST_CDMA_SMS_ACKNOWLEDGE);
     if (pRI == NULL) {
         return Void();
@@ -1432,7 +1734,9 @@ Return<void> RadioImpl::acknowledgeLastIncomingCdmaSms(int32_t serial, const Cdm
 }
 
 Return<void> RadioImpl::getGsmBroadcastConfig(int32_t serial) {
-    RLOGD("RadioImpl::getGsmBroadcastConfig: serial %d", serial);
+#if VDBG
+    RLOGD("getGsmBroadcastConfig: serial %d", serial);
+#endif
     dispatchVoid(serial, mSlotId, RIL_REQUEST_GSM_GET_BROADCAST_SMS_CONFIG);
     return Void();
 }
@@ -1440,7 +1744,9 @@ Return<void> RadioImpl::getGsmBroadcastConfig(int32_t serial) {
 Return<void> RadioImpl::setGsmBroadcastConfig(int32_t serial,
                                               const hidl_vec<GsmBroadcastSmsConfigInfo>&
                                               configInfo) {
-    RLOGD("RadioImpl::setGsmBroadcastConfig: serial %d", serial);
+#if VDBG
+    RLOGD("setGsmBroadcastConfig: serial %d", serial);
+#endif
     RequestInfo *pRI = android::addRequestToList(serial, mSlotId,
             RIL_REQUEST_GSM_SET_BROADCAST_SMS_CONFIG);
     if (pRI == NULL) {
@@ -1466,14 +1772,18 @@ Return<void> RadioImpl::setGsmBroadcastConfig(int32_t serial,
 }
 
 Return<void> RadioImpl::setGsmBroadcastActivation(int32_t serial, bool activate) {
-    RLOGD("RadioImpl::setGsmBroadcastActivation: serial %d", serial);
+#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) {
-    RLOGD("RadioImpl::getCdmaBroadcastConfig: serial %d", serial);
+#if VDBG
+    RLOGD("getCdmaBroadcastConfig: serial %d", serial);
+#endif
     dispatchVoid(serial, mSlotId, RIL_REQUEST_CDMA_GET_BROADCAST_SMS_CONFIG);
     return Void();
 }
@@ -1481,7 +1791,9 @@ Return<void> RadioImpl::getCdmaBroadcastConfig(int32_t serial) {
 Return<void> RadioImpl::setCdmaBroadcastConfig(int32_t serial,
                                                const hidl_vec<CdmaBroadcastSmsConfigInfo>&
                                                configInfo) {
-    RLOGD("RadioImpl::setCdmaBroadcastConfig: serial %d", serial);
+#if VDBG
+    RLOGD("setCdmaBroadcastConfig: serial %d", serial);
+#endif
     RequestInfo *pRI = android::addRequestToList(serial, mSlotId,
             RIL_REQUEST_CDMA_SET_BROADCAST_SMS_CONFIG);
     if (pRI == NULL) {
@@ -1505,20 +1817,26 @@ Return<void> RadioImpl::setCdmaBroadcastConfig(int32_t serial,
 }
 
 Return<void> RadioImpl::setCdmaBroadcastActivation(int32_t serial, bool activate) {
-    RLOGD("RadioImpl::setCdmaBroadcastActivation: serial %d", serial);
+#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) {
-    RLOGD("RadioImpl::getCDMASubscription: serial %d", 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) {
-    RLOGD("RadioImpl::writeSmsToRuim: serial %d", serial);
+#if VDBG
+    RLOGD("writeSmsToRuim: serial %d", serial);
+#endif
     RequestInfo *pRI = android::addRequestToList(serial, mSlotId,
             RIL_REQUEST_CDMA_WRITE_SMS_TO_RUIM);
     if (pRI == NULL) {
@@ -1534,115 +1852,215 @@ Return<void> RadioImpl::writeSmsToRuim(int32_t serial, const CdmaSmsWriteArgs& c
 }
 
 Return<void> RadioImpl::deleteSmsOnRuim(int32_t serial, int32_t index) {
-    RLOGD("RadioImpl::deleteSmsOnRuim: serial %d", serial);
+#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) {
-    RLOGD("RadioImpl::getDeviceIdentity: serial %d", 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) {
-    RLOGD("RadioImpl::exitEmergencyCallbackMode: serial %d", 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) {
-    RLOGD("RadioImpl::getSmscAddress: serial %d", 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) {
-    RLOGD("RadioImpl::setSmscAddress: serial %d", serial);
+#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) {
-    RLOGD("RadioImpl::reportSmsMemoryStatus: serial %d", serial);
+#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) {
-    RLOGD("RadioImpl::reportStkServiceIsRunning: serial %d", 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) {
-    RLOGD("RadioImpl::getCdmaSubscriptionSource: serial %d", 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) {
-    RLOGD("RadioImpl::requestIsimAuthentication: serial %d", serial);
+#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) {
-    RLOGD("RadioImpl::acknowledgeIncomingGsmSmsWithPdu: serial %d", serial);
+#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) {
-    RLOGD("RadioImpl::sendEnvelopeWithStatus: serial %d", serial);
+#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) {
-    RLOGD("RadioImpl::getVoiceRadioTechnology: serial %d", 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) {
-    RLOGD("RadioImpl::getCellInfoList: serial %d", 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) {
-    RLOGD("RadioImpl::setCellInfoListRate: serial %d", serial);
+#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) {
-    RLOGD("RadioImpl::setInitialAttachApn: serial %d", serial);
+                                            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) {
         return Void();
     }
 
-    RIL_InitialAttachApn pf;
-    memset(&pf, 0, sizeof(pf));
+    if (s_vendorFunctions->version <= 14) {
+        RIL_InitialAttachApn iaa = {};
 
-    // todo: populate pf
-    s_vendorFunctions->onRequest(pRI->pCI->requestNumber, &pf, sizeof(pf), pRI);
+        if (!copyHidlStringToRil(&iaa.apn, dataProfileInfo.apn, pRI)) {
+            return Void();
+        }
+
+        const hidl_string &protocol =
+                (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();
+        }
+
+        s_vendorFunctions->onRequest(RIL_REQUEST_SET_INITIAL_ATTACH_APN, &iaa, sizeof(iaa), pRI);
+
+        memsetAndFreeStrings(4, iaa.apn, iaa.protocol, iaa.username, iaa.password);
+    } else {
+        RIL_InitialAttachApn_v15 iaa = {};
+
+        if (!copyHidlStringToRil(&iaa.apn, dataProfileInfo.apn, pRI)) {
+            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.bearerBitmask = dataProfileInfo.bearerBitmap;
+        iaa.modemCognitive = BOOL_TO_INT(modemCognitive);
+        iaa.mtu = dataProfileInfo.mtu;
+
+        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();
+        }
+
+        s_vendorFunctions->onRequest(RIL_REQUEST_SET_INITIAL_ATTACH_APN, &iaa, sizeof(iaa), pRI);
+
+        memsetAndFreeStrings(6, iaa.apn, iaa.protocol, iaa.roamingProtocol, iaa.username,
+                iaa.password, iaa.mvnoMatchData);
+    }
 
     return Void();
 }
 
 Return<void> RadioImpl::getImsRegistrationState(int32_t serial) {
-    RLOGD("RadioImpl::getImsRegistrationState: serial %d", serial);
+#if VDBG
+    RLOGD("getImsRegistrationState: serial %d", serial);
+#endif
     dispatchVoid(serial, mSlotId, RIL_REQUEST_IMS_REGISTRATION_STATE);
     return Void();
 }
@@ -1659,9 +2077,7 @@ bool dispatchImsGsmSms(const ImsSmsMessage& message, RequestInfo *pRI) {
 
     if (message.gsmMessage.size() != 1) {
         RLOGE("dispatchImsGsmSms: Invalid len %s", requestToString(pRI->pCI->requestNumber));
-        android::Parcel p;
-        pRI->pCI->responseFunction(p, (int) pRI->socket_id, pRI->pCI->requestNumber,
-                (int) RadioResponseType::SOLICITED, pRI->token, RIL_E_INVALID_ARGUMENTS, NULL, 0);
+        sendErrorResponse(pRI, RIL_E_INVALID_ARGUMENTS);
         return false;
     }
 
@@ -1669,15 +2085,13 @@ bool dispatchImsGsmSms(const ImsSmsMessage& message, RequestInfo *pRI) {
     if (pStrings == NULL) {
         RLOGE("dispatchImsGsmSms: Memory allocation failed for request %s",
                 requestToString(pRI->pCI->requestNumber));
-        android::Parcel p;
-        pRI->pCI->responseFunction(p, (int) pRI->socket_id, pRI->pCI->requestNumber,
-                (int) RadioResponseType::SOLICITED, pRI->token, RIL_E_NO_MEMORY, NULL, 0);
+        sendErrorResponse(pRI, RIL_E_NO_MEMORY);
         return false;
     }
 
     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;
@@ -1686,7 +2100,7 @@ bool dispatchImsGsmSms(const ImsSmsMessage& message, RequestInfo *pRI) {
     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;
@@ -1701,7 +2115,7 @@ bool dispatchImsGsmSms(const ImsSmsMessage& message, RequestInfo *pRI) {
     }
 
 #ifdef MEMSET_FREED
-    memset(pStrings, 0, datalen);
+    memset(pStrings, 0, dataLen);
 #endif
     free(pStrings);
 
@@ -1709,14 +2123,12 @@ bool dispatchImsGsmSms(const ImsSmsMessage& message, RequestInfo *pRI) {
 }
 
 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));
-        android::Parcel p;
-        pRI->pCI->responseFunction(p, (int) pRI->socket_id, pRI->pCI->requestNumber,
-                (int) RadioResponseType::SOLICITED, pRI->token, RIL_E_INVALID_ARGUMENTS, NULL, 0);
+        sendErrorResponse(pRI, RIL_E_INVALID_ARGUMENTS);
         return false;
     }
 
@@ -1734,7 +2146,9 @@ bool dispatchImsCdmaSms(const ImsSmsMessage& message, RequestInfo *pRI) {
 }
 
 Return<void> RadioImpl::sendImsSms(int32_t serial, const ImsSmsMessage& message) {
-    RLOGD("RadioImpl::sendImsSms: serial %d", serial);
+#if VDBG
+    RLOGD("sendImsSms: serial %d", serial);
+#endif
     RequestInfo *pRI = android::addRequestToList(serial, mSlotId, RIL_REQUEST_IMS_SEND_SMS);
     if (pRI == NULL) {
         return Void();
@@ -1747,49 +2161,74 @@ Return<void> RadioImpl::sendImsSms(int32_t serial, const ImsSmsMessage& message)
     } else if (RADIO_TECH_3GPP2 == format) {
         dispatchImsCdmaSms(message, pRI);
     } else {
-        RLOGE("RadioImpl::sendImsSms: Invalid radio tech %s",
+        RLOGE("sendImsSms: Invalid radio tech %s",
                 requestToString(pRI->pCI->requestNumber));
-        android::Parcel p;
-        pRI->pCI->responseFunction(p, (int) pRI->socket_id, pRI->pCI->requestNumber,
-                (int) RadioResponseType::SOLICITED, pRI->token, RIL_E_INVALID_ARGUMENTS, NULL, 0);
+        sendErrorResponse(pRI, RIL_E_INVALID_ARGUMENTS);
     }
     return Void();
 }
 
 Return<void> RadioImpl::iccTransmitApduBasicChannel(int32_t serial, const SimApdu& message) {
-    RLOGD("RadioImpl::iccTransmitApduBasicChannel: serial %d", serial);
+#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) {
-    RLOGD("RadioImpl::iccOpenLogicalChannel: serial %d", serial);
-    dispatchString(serial, mSlotId, RIL_REQUEST_SIM_OPEN_CHANNEL,
-            (const char *) aid);
+Return<void> RadioImpl::iccOpenLogicalChannel(int32_t serial, const hidl_string& aid, int32_t p2) {
+#if VDBG
+    RLOGD("iccOpenLogicalChannel: serial %d", serial);
+#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(&params.aidPtr, aid, pRI)) {
+            return Void();
+        }
+
+        s_vendorFunctions->onRequest(pRI->pCI->requestNumber, &params, sizeof(params), pRI);
+
+        memsetAndFreeStrings(1, params.aidPtr);
+    }
     return Void();
 }
 
 Return<void> RadioImpl::iccCloseLogicalChannel(int32_t serial, int32_t channelId) {
-    RLOGD("RadioImpl::iccCloseLogicalChannel: serial %d", serial);
+#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) {
-    RLOGD("RadioImpl::iccTransmitApduLogicalChannel: serial %d", serial);
+#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) {
-    RLOGD("RadioImpl::nvReadItem: serial %d", serial);
+#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);
@@ -1797,14 +2236,15 @@ Return<void> RadioImpl::nvReadItem(int32_t serial, NvItem itemId) {
 }
 
 Return<void> RadioImpl::nvWriteItem(int32_t serial, const NvWriteItem& item) {
-    RLOGD("RadioImpl::nvWriteItem: serial %d", serial);
+#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;
 
@@ -1819,19 +2259,43 @@ Return<void> RadioImpl::nvWriteItem(int32_t serial, const NvWriteItem& item) {
 }
 
 Return<void> RadioImpl::nvWriteCdmaPrl(int32_t serial, const hidl_vec<uint8_t>& prl) {
-    RLOGD("RadioImpl::nvWriteCdmaPrl: serial %d", serial);
+#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) {
-    RLOGD("RadioImpl::nvResetConfig: serial %d", serial);
-    dispatchInts(serial, mSlotId, RIL_REQUEST_NV_RESET_CONFIG, 1, (int) resetType);
+    int rilResetType = -1;
+#if VDBG
+    RLOGD("nvResetConfig: serial %d", serial);
+#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) {
-    RLOGD("RadioImpl::setUiccSubscription: serial %d", serial);
+#if VDBG
+    RLOGD("setUiccSubscription: serial %d", serial);
+#endif
     RequestInfo *pRI = android::addRequestToList(serial, mSlotId,
             RIL_REQUEST_SET_UICC_SUBSCRIPTION);
     if (pRI == NULL) {
@@ -1850,27 +2314,32 @@ Return<void> RadioImpl::setUiccSubscription(int32_t serial, const SelectUiccSub&
 }
 
 Return<void> RadioImpl::setDataAllowed(int32_t serial, bool allow) {
-    RLOGD("RadioImpl::setDataAllowed: serial %d", serial);
+#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) {
-    RLOGD("RadioImpl::getHardwareConfig: serial %d", 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) {
-    RLOGD("RadioImpl::requestIccSimAuthentication: serial %d", serial);
+#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;
 
@@ -1891,63 +2360,232 @@ Return<void> RadioImpl::requestIccSimAuthentication(int32_t serial, int32_t auth
 }
 
 /**
- * dataProfilePtrs are contained in dataProfiles (dataProfilePtrs[i] = &dataProfiles[i])
+ * @param numProfiles number of data profile
+ * @param dataProfiles the pointer to the actual data profiles. The acceptable type is
+          RIL_DataProfileInfo or RIL_DataProfileInfo_v15.
+ * @param dataProfilePtrs the pointer to the pointers that point to each data profile structure
+ * @param numfields number of string-type member in the data profile structure
+ * @param ... the variadic parameters are pointers to each string-type member
  **/
-void freeSetDataProfileData(int num, RIL_DataProfileInfo *dataProfiles,
-                            RIL_DataProfileInfo **dataProfilePtrs, int freeNumProfiles) {
-    for (int i = 0; i < freeNumProfiles; i++) {
-        memsetAndFreeStrings(4, dataProfiles[i].apn, dataProfiles[i].protocol, dataProfiles[i].user,
-                dataProfiles[i].password);
+template <typename T>
+void freeSetDataProfileData(int numProfiles, T *dataProfiles, T **dataProfilePtrs,
+                            int numfields, ...) {
+    va_list args;
+    va_start(args, numfields);
+
+    // Iterate through each string-type field that need to be free.
+    for (int i = 0; i < numfields; i++) {
+        // Iterate through each data profile and free that specific string-type field.
+        // The type 'char *T::*' is a type of pointer to a 'char *' member inside T structure.
+        char *T::*ptr = va_arg(args, char *T::*);
+        for (int j = 0; j < numProfiles; j++) {
+            memsetAndFreeStrings(1, dataProfiles[j].*ptr);
+        }
     }
 
+    va_end(args);
+
 #ifdef MEMSET_FREED
-    memset(dataProfiles, 0, num * sizeof(RIL_DataProfileInfo));
-    memset(dataProfilePtrs, 0, num * sizeof(RIL_DataProfileInfo *));
+    memset(dataProfiles, 0, numProfiles * sizeof(T));
+    memset(dataProfilePtrs, 0, numProfiles * sizeof(T *));
 #endif
     free(dataProfiles);
     free(dataProfilePtrs);
 }
 
-Return<void> RadioImpl::setDataProfile(int32_t serial, const hidl_vec<DataProfileInfo>& profiles) {
-    RLOGD("RadioImpl::setDataProfile: serial %d", serial);
+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();
     }
 
-    // todo - dispatch request
+    size_t num = profiles.size();
+    bool success = false;
+
+    if (s_vendorFunctions->version <= 14) {
+
+        RIL_DataProfileInfo *dataProfiles =
+            (RIL_DataProfileInfo *) calloc(num, sizeof(RIL_DataProfileInfo));
+
+        if (dataProfiles == NULL) {
+            RLOGE("Memory allocation failed for request %s",
+                    requestToString(pRI->pCI->requestNumber));
+            sendErrorResponse(pRI, RIL_E_NO_MEMORY);
+            return Void();
+        }
+
+        RIL_DataProfileInfo **dataProfilePtrs =
+            (RIL_DataProfileInfo **) calloc(num, sizeof(RIL_DataProfileInfo *));
+        if (dataProfilePtrs == NULL) {
+            RLOGE("Memory allocation failed for request %s",
+                    requestToString(pRI->pCI->requestNumber));
+            free(dataProfiles);
+            sendErrorResponse(pRI, RIL_E_NO_MEMORY);
+            return Void();
+        }
+
+        for (size_t i = 0; i < num; i++) {
+            dataProfilePtrs[i] = &dataProfiles[i];
+
+            success = copyHidlStringToRil(&dataProfiles[i].apn, profiles[i].apn, pRI);
+
+            const hidl_string &protocol =
+                    (isRoaming ? profiles[i].roamingProtocol : profiles[i].protocol);
+
+            if (success && !copyHidlStringToRil(&dataProfiles[i].protocol, protocol, pRI)) {
+                success = false;
+            }
+
+            if (success && !copyHidlStringToRil(&dataProfiles[i].user, profiles[i].user, pRI)) {
+                success = false;
+            }
+            if (success && !copyHidlStringToRil(&dataProfiles[i].password, profiles[i].password,
+                    pRI)) {
+                success = false;
+            }
+
+            if (!success) {
+                freeSetDataProfileData(num, dataProfiles, dataProfilePtrs, 4,
+                    &RIL_DataProfileInfo::apn, &RIL_DataProfileInfo::protocol,
+                    &RIL_DataProfileInfo::user, &RIL_DataProfileInfo::password);
+                return Void();
+            }
+
+            dataProfiles[i].profileId = (RIL_DataProfile) profiles[i].profileId;
+            dataProfiles[i].authType = (int) profiles[i].authType;
+            dataProfiles[i].type = (int) profiles[i].type;
+            dataProfiles[i].maxConnsTime = profiles[i].maxConnsTime;
+            dataProfiles[i].maxConns = profiles[i].maxConns;
+            dataProfiles[i].waitTime = profiles[i].waitTime;
+            dataProfiles[i].enabled = BOOL_TO_INT(profiles[i].enabled);
+        }
+
+        s_vendorFunctions->onRequest(RIL_REQUEST_SET_DATA_PROFILE, dataProfilePtrs,
+                num * sizeof(RIL_DataProfileInfo *), pRI);
+
+        freeSetDataProfileData(num, dataProfiles, dataProfilePtrs, 4,
+                &RIL_DataProfileInfo::apn, &RIL_DataProfileInfo::protocol,
+                &RIL_DataProfileInfo::user, &RIL_DataProfileInfo::password);
+    } else {
+        RIL_DataProfileInfo_v15 *dataProfiles =
+            (RIL_DataProfileInfo_v15 *) calloc(num, sizeof(RIL_DataProfileInfo_v15));
+
+        if (dataProfiles == NULL) {
+            RLOGE("Memory allocation failed for request %s",
+                    requestToString(pRI->pCI->requestNumber));
+            sendErrorResponse(pRI, RIL_E_NO_MEMORY);
+            return Void();
+        }
+
+        RIL_DataProfileInfo_v15 **dataProfilePtrs =
+            (RIL_DataProfileInfo_v15 **) calloc(num, sizeof(RIL_DataProfileInfo_v15 *));
+        if (dataProfilePtrs == NULL) {
+            RLOGE("Memory allocation failed for request %s",
+                    requestToString(pRI->pCI->requestNumber));
+            free(dataProfiles);
+            sendErrorResponse(pRI, RIL_E_NO_MEMORY);
+            return Void();
+        }
+
+        for (size_t i = 0; i < num; i++) {
+            dataProfilePtrs[i] = &dataProfiles[i];
+
+            success = copyHidlStringToRil(&dataProfiles[i].apn, profiles[i].apn, pRI);
+            if (success && !copyHidlStringToRil(&dataProfiles[i].protocol, profiles[i].protocol,
+                    pRI)) {
+                success = false;
+            }
+            if (success && !copyHidlStringToRil(&dataProfiles[i].roamingProtocol,
+                    profiles[i].roamingProtocol, pRI)) {
+                success = false;
+            }
+            if (success && !copyHidlStringToRil(&dataProfiles[i].user, profiles[i].user, pRI)) {
+                success = false;
+            }
+            if (success && !copyHidlStringToRil(&dataProfiles[i].password, profiles[i].password,
+                    pRI)) {
+                success = false;
+            }
+            if (success && !copyHidlStringToRil(&dataProfiles[i].mvnoMatchData,
+                    profiles[i].mvnoMatchData, pRI)) {
+                success = false;
+            }
+
+            if (success && !convertMvnoTypeToString(profiles[i].mvnoType,
+                    dataProfiles[i].mvnoType)) {
+                sendErrorResponse(pRI, RIL_E_INVALID_ARGUMENTS);
+                success = false;
+            }
+
+            if (!success) {
+                freeSetDataProfileData(num, dataProfiles, dataProfilePtrs, 6,
+                    &RIL_DataProfileInfo_v15::apn, &RIL_DataProfileInfo_v15::protocol,
+                    &RIL_DataProfileInfo_v15::roamingProtocol, &RIL_DataProfileInfo_v15::user,
+                    &RIL_DataProfileInfo_v15::password, &RIL_DataProfileInfo_v15::mvnoMatchData);
+                return Void();
+            }
+
+            dataProfiles[i].profileId = (RIL_DataProfile) profiles[i].profileId;
+            dataProfiles[i].authType = (int) profiles[i].authType;
+            dataProfiles[i].type = (int) profiles[i].type;
+            dataProfiles[i].maxConnsTime = profiles[i].maxConnsTime;
+            dataProfiles[i].maxConns = profiles[i].maxConns;
+            dataProfiles[i].waitTime = profiles[i].waitTime;
+            dataProfiles[i].enabled = BOOL_TO_INT(profiles[i].enabled);
+            dataProfiles[i].supportedTypesBitmask = profiles[i].supportedApnTypesBitmap;
+            dataProfiles[i].bearerBitmask = profiles[i].bearerBitmap;
+            dataProfiles[i].mtu = profiles[i].mtu;
+        }
+
+        s_vendorFunctions->onRequest(RIL_REQUEST_SET_DATA_PROFILE, dataProfilePtrs,
+                num * sizeof(RIL_DataProfileInfo_v15 *), pRI);
+
+        freeSetDataProfileData(num, dataProfiles, dataProfilePtrs, 6,
+                &RIL_DataProfileInfo_v15::apn, &RIL_DataProfileInfo_v15::protocol,
+                &RIL_DataProfileInfo_v15::roamingProtocol, &RIL_DataProfileInfo_v15::user,
+                &RIL_DataProfileInfo_v15::password, &RIL_DataProfileInfo_v15::mvnoMatchData);
+    }
 
     return Void();
 }
 
 Return<void> RadioImpl::requestShutdown(int32_t serial) {
-    RLOGD("RadioImpl::requestShutdown: serial %d", serial);
+#if VDBG
+    RLOGD("requestShutdown: serial %d", serial);
+#endif
     dispatchVoid(serial, mSlotId, RIL_REQUEST_SHUTDOWN);
     return Void();
 }
 
 Return<void> RadioImpl::getRadioCapability(int32_t serial) {
-    RLOGD("RadioImpl::getRadioCapability: serial %d", 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) {
-    RLOGD("RadioImpl::setRadioCapability: serial %d", serial);
+#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);
 
@@ -1955,33 +2593,43 @@ Return<void> RadioImpl::setRadioCapability(int32_t serial, const RadioCapability
 }
 
 Return<void> RadioImpl::startLceService(int32_t serial, int32_t reportInterval, bool pullMode) {
-    RLOGD("RadioImpl::startLceService: serial %d", serial);
+#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) {
-    RLOGD("RadioImpl::stopLceService: serial %d", 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) {
-    RLOGD("RadioImpl::pullLceData: serial %d", 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) {
-    RLOGD("RadioImpl::getModemActivityInfo: serial %d", 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) {
-    RLOGD("RadioImpl::setAllowedCarriers: serial %d", serial);
+#if VDBG
+    RLOGD("setAllowedCarriers: serial %d", serial);
+#endif
     RequestInfo *pRI = android::addRequestToList(serial, mSlotId,
             RIL_REQUEST_SET_CARRIER_RESTRICTIONS);
     if (pRI == NULL) {
@@ -1989,17 +2637,15 @@ Return<void> RadioImpl::setAllowedCarriers(int32_t serial, bool allAllowed,
     }
 
     RIL_CarrierRestrictions cr = {};
-    RIL_Carrier * allowedCarriers = NULL;
-    RIL_Carrier * excludedCarriers = NULL;
+    RIL_Carrier *allowedCarriers = NULL;
+    RIL_Carrier *excludedCarriers = NULL;
 
     cr.len_allowed_carriers = carriers.allowedCarriers.size();
     allowedCarriers = (RIL_Carrier *)calloc(cr.len_allowed_carriers, sizeof(RIL_Carrier));
     if (allowedCarriers == NULL) {
-        RLOGE("RadioImpl::setAllowedCarriers: Memory allocation failed for request %s",
+        RLOGE("setAllowedCarriers: Memory allocation failed for request %s",
                 requestToString(pRI->pCI->requestNumber));
-        android::Parcel p;
-        pRI->pCI->responseFunction(p, (int) pRI->socket_id, pRI->pCI->requestNumber,
-                (int) RadioResponseType::SOLICITED, pRI->token, RIL_E_NO_MEMORY, NULL, 0);
+        sendErrorResponse(pRI, RIL_E_NO_MEMORY);
         return Void();
     }
     cr.allowed_carriers = allowedCarriers;
@@ -2007,11 +2653,9 @@ Return<void> RadioImpl::setAllowedCarriers(int32_t serial, bool allAllowed,
     cr.len_excluded_carriers = carriers.excludedCarriers.size();
     excludedCarriers = (RIL_Carrier *)calloc(cr.len_excluded_carriers, sizeof(RIL_Carrier));
     if (excludedCarriers == NULL) {
-        RLOGE("RadioImpl::setAllowedCarriers: Memory allocation failed for request %s",
+        RLOGE("setAllowedCarriers: Memory allocation failed for request %s",
                 requestToString(pRI->pCI->requestNumber));
-        android::Parcel p;
-        pRI->pCI->responseFunction(p, (int) pRI->socket_id, pRI->pCI->requestNumber,
-                (int) RadioResponseType::SOLICITED, pRI->token, RIL_E_NO_MEMORY, NULL, 0);
+        sendErrorResponse(pRI, RIL_E_NO_MEMORY);
 #ifdef MEMSET_FREED
         memset(allowedCarriers, 0, cr.len_allowed_carriers * sizeof(RIL_Carrier));
 #endif
@@ -2021,18 +2665,18 @@ Return<void> RadioImpl::setAllowedCarriers(int32_t serial, bool allAllowed,
     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);
@@ -2047,20 +2691,64 @@ Return<void> RadioImpl::setAllowedCarriers(int32_t serial, bool allAllowed,
 }
 
 Return<void> RadioImpl::getAllowedCarriers(int32_t serial) {
-    RLOGD("RadioImpl::getAllowedCarriers: serial %d", 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));
+            dispatchInts(serial, mSlotId, RIL_REQUEST_SCREEN_STATE, 1, BOOL_TO_INT(!state));
+        } else {
+            RequestInfo *pRI = android::addRequestToList(serial, mSlotId,
+                    RIL_REQUEST_SEND_DEVICE_STATE);
+            sendErrorResponse(pRI, RIL_E_REQUEST_NOT_SUPPORTED);
+        }
+        return Void();
+    }
+    dispatchInts(serial, mSlotId, RIL_REQUEST_SEND_DEVICE_STATE, 2, (int) deviceStateType,
+            BOOL_TO_INT(state));
+    return Void();
+}
+
+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);
+        sendErrorResponse(pRI, RIL_E_REQUEST_NOT_SUPPORTED);
+        return Void();
+    }
+    dispatchInts(serial, mSlotId, RIL_REQUEST_SET_UNSOLICITED_RESPONSE_FILTER, 1, indicationFilter);
+    return Void();
+}
+
 Return<void> RadioImpl::setSimCardPower(int32_t serial, bool powerUp) {
-    RLOGD("RadioImpl::setSimCardPower: serial %d", serial);
+#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::sendDeviceState(int32_t serial, DeviceStateType deviceStateType, bool state) {return Status::ok();}
-
-Return<void> RadioImpl::setIndicationFilter(int32_t serial, int32_t indicationFilter) {return Status::ok();}
+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();
@@ -2070,7 +2758,9 @@ Return<void> RadioImpl::responseAcknowledgement() {
 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);
@@ -2078,7 +2768,7 @@ Return<void> OemHookImpl::setResponseFunctions(
 
     mOemHookResponse = oemHookResponseParam;
     mOemHookIndication = oemHookIndicationParam;
-    mCounter[mSlotId]++;
+    mCounterOemHook[mSlotId]++;
 
     ret = pthread_rwlock_unlock(radioServiceRwlockPtr);
     assert(ret == 0);
@@ -2087,18 +2777,59 @@ Return<void> OemHookImpl::setResponseFunctions(
 }
 
 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
@@ -2110,7 +2841,7 @@ void radio::acknowledgeRequest(int slotId, int serial) {
         Return<void> retStatus = radioService[slotId]->mRadioResponse->acknowledgeRequest(serial);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::acknowledgeRequest: radioService[%d]->mRadioResponse == NULL", slotId);
+        RLOGE("acknowledgeRequest: radioService[%d]->mRadioResponse == NULL", slotId);
     }
 }
 
@@ -2128,6 +2859,25 @@ void populateResponseInfo(RadioResponseInfo& responseInfo, int serial, int respo
     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);
@@ -2143,18 +2893,21 @@ int responseInt(RadioResponseInfo& responseInfo, int serial, int responseType, R
     return ret;
 }
 
-int radio::getIccCardStatusResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::getIccCardStatusResponse(int slotId,
                                    int responseType, int serial, RIL_Errno e,
                                    void *response, size_t responseLen) {
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
         populateResponseInfo(responseInfo, serial, responseType, e);
         CardStatus cardStatus = {};
-        if (response == NULL || responseLen != sizeof(RIL_CardStatus_v6)) {
-            RLOGE("radio::getIccCardStatusResponse: Invalid response");
+        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;
@@ -2164,7 +2917,9 @@ int radio::getIccCardStatusResponse(android::Parcel &p, int slotId, int requestN
             RIL_AppStatus *rilAppStatus = p_cur->applications;
             cardStatus.applications.resize(p_cur->num_applications);
             AppStatus *appStatus = cardStatus.applications.data();
-            RLOGD("radio::getIccCardStatusResponse: num_applications %d", p_cur->num_applications);
+#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;
@@ -2182,149 +2937,165 @@ int radio::getIccCardStatusResponse(android::Parcel &p, int slotId, int requestN
                 getIccCardStatusResponse(responseInfo, cardStatus);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::getIccCardStatusResponse: radioService[%d]->mRadioResponse == NULL", slotId);
+        RLOGE("getIccCardStatusResponse: radioService[%d]->mRadioResponse == NULL", slotId);
     }
 
     return 0;
 }
 
-int radio::supplyIccPinForAppResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::supplyIccPinForAppResponse(int slotId,
                                      int responseType, int serial, RIL_Errno e,
                                      void *response, size_t responseLen) {
-    RLOGD("radio::supplyIccPinForAppResponse: serial %d", serial);
+#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);
     } else {
-        RLOGE("radio::supplyIccPinForAppResponse: radioService[%d]->mRadioResponse == NULL",
+        RLOGE("supplyIccPinForAppResponse: radioService[%d]->mRadioResponse == NULL",
                 slotId);
     }
 
     return 0;
 }
 
-int radio::supplyIccPukForAppResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::supplyIccPukForAppResponse(int slotId,
                                      int responseType, int serial, RIL_Errno e,
                                      void *response, size_t responseLen) {
-    RLOGD("radio::supplyIccPukForAppResponse: serial %d", serial);
+#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);
     } else {
-        RLOGE("radio::supplyIccPukForAppResponse: radioService[%d]->mRadioResponse == NULL",
+        RLOGE("supplyIccPukForAppResponse: radioService[%d]->mRadioResponse == NULL",
                 slotId);
     }
 
     return 0;
 }
 
-int radio::supplyIccPin2ForAppResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::supplyIccPin2ForAppResponse(int slotId,
                                       int responseType, int serial, RIL_Errno e,
                                       void *response, size_t responseLen) {
-    RLOGD("radio::supplyIccPin2ForAppResponse: serial %d", serial);
+#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);
     } else {
-        RLOGE("radio::supplyIccPin2ForAppResponse: radioService[%d]->mRadioResponse == NULL",
+        RLOGE("supplyIccPin2ForAppResponse: radioService[%d]->mRadioResponse == NULL",
                 slotId);
     }
 
     return 0;
 }
 
-int radio::supplyIccPuk2ForAppResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::supplyIccPuk2ForAppResponse(int slotId,
                                       int responseType, int serial, RIL_Errno e,
                                       void *response, size_t responseLen) {
-    RLOGD("radio::supplyIccPuk2ForAppResponse: serial %d", serial);
+#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);
     } else {
-        RLOGE("radio::supplyIccPuk2ForAppResponse: radioService[%d]->mRadioResponse == NULL",
+        RLOGE("supplyIccPuk2ForAppResponse: radioService[%d]->mRadioResponse == NULL",
                 slotId);
     }
 
     return 0;
 }
 
-int radio::changeIccPinForAppResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::changeIccPinForAppResponse(int slotId,
                                      int responseType, int serial, RIL_Errno e,
                                      void *response, size_t responseLen) {
-    RLOGD("radio::changeIccPinForAppResponse: serial %d", serial);
+#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);
     } else {
-        RLOGE("radio::changeIccPinForAppResponse: radioService[%d]->mRadioResponse == NULL",
+        RLOGE("changeIccPinForAppResponse: radioService[%d]->mRadioResponse == NULL",
                 slotId);
     }
 
     return 0;
 }
 
-int radio::changeIccPin2ForAppResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::changeIccPin2ForAppResponse(int slotId,
                                       int responseType, int serial, RIL_Errno e,
                                       void *response, size_t responseLen) {
-    RLOGD("radio::changeIccPin2ForAppResponse: serial %d", serial);
+#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);
     } else {
-        RLOGE("radio::changeIccPin2ForAppResponse: radioService[%d]->mRadioResponse == NULL",
+        RLOGE("changeIccPin2ForAppResponse: radioService[%d]->mRadioResponse == NULL",
                 slotId);
     }
 
     return 0;
 }
 
-int radio::supplyNetworkDepersonalizationResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::supplyNetworkDepersonalizationResponse(int slotId,
                                                  int responseType, int serial, RIL_Errno e,
                                                  void *response, size_t responseLen) {
-    RLOGD("radio::supplyNetworkDepersonalizationResponse: serial %d", serial);
+#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);
     } else {
-        RLOGE("radio::supplyNetworkDepersonalizationResponse: radioService[%d]->mRadioResponse == "
+        RLOGE("supplyNetworkDepersonalizationResponse: radioService[%d]->mRadioResponse == "
                 "NULL", slotId);
     }
 
     return 0;
 }
 
-int radio::getCurrentCallsResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::getCurrentCallsResponse(int slotId,
                                   int responseType, int serial, RIL_Errno e,
                                   void *response, size_t responseLen) {
-    RLOGD("radio::getCurrentCallsResponse: serial %d", serial);
+#if VDBG
+    RLOGD("getCurrentCallsResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -2332,7 +3103,7 @@ int radio::getCurrentCallsResponse(android::Parcel &p, int slotId, int requestNu
 
         hidl_vec<Call> calls;
         if (response == NULL || (responseLen % sizeof(RIL_Call *)) != 0) {
-            RLOGE("radio::getCurrentCallsResponse: Invalid response");
+            RLOGE("getCurrentCallsResponse: Invalid response");
             if (e == RIL_E_SUCCESS) responseInfo.error = RadioError::INVALID_RESPONSE;
         } else {
             int num = responseLen / sizeof(RIL_Call *);
@@ -2369,16 +3140,18 @@ int radio::getCurrentCallsResponse(android::Parcel &p, int slotId, int requestNu
                 getCurrentCallsResponse(responseInfo, calls);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::getCurrentCallsResponse: radioService[%d]->mRadioResponse == NULL", slotId);
+        RLOGE("getCurrentCallsResponse: radioService[%d]->mRadioResponse == NULL", slotId);
     }
 
     return 0;
 }
 
-int radio::dialResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::dialResponse(int slotId,
                        int responseType, int serial, RIL_Errno e, void *response,
                        size_t responseLen) {
-    RLOGD("radio::dialResponse: serial %d", serial);
+#if VDBG
+    RLOGD("dialResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -2386,16 +3159,18 @@ int radio::dialResponse(android::Parcel &p, int slotId, int requestNumber,
         Return<void> retStatus = radioService[slotId]->mRadioResponse->dialResponse(responseInfo);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::dialResponse: radioService[%d]->mRadioResponse == NULL", slotId);
+        RLOGE("dialResponse: radioService[%d]->mRadioResponse == NULL", slotId);
     }
 
     return 0;
 }
 
-int radio::getIMSIForAppResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::getIMSIForAppResponse(int slotId,
                                 int responseType, int serial, RIL_Errno e, void *response,
                                 size_t responseLen) {
-    RLOGD("radio::getIMSIForAppResponse: serial %d", serial);
+#if VDBG
+    RLOGD("getIMSIForAppResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -2404,17 +3179,19 @@ int radio::getIMSIForAppResponse(android::Parcel &p, int slotId, int requestNumb
                 responseInfo, convertCharPtrToHidlString((char *) response));
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::getIMSIForAppResponse: radioService[%d]->mRadioResponse == NULL",
+        RLOGE("getIMSIForAppResponse: radioService[%d]->mRadioResponse == NULL",
                 slotId);
     }
 
     return 0;
 }
 
-int radio::hangupConnectionResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::hangupConnectionResponse(int slotId,
                                    int responseType, int serial, RIL_Errno e,
                                    void *response, size_t responseLen) {
-    RLOGD("radio::hangupConnectionResponse: serial %d", serial);
+#if VDBG
+    RLOGD("hangupConnectionResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -2423,17 +3200,19 @@ int radio::hangupConnectionResponse(android::Parcel &p, int slotId, int requestN
                 responseInfo);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::hangupConnectionResponse: radioService[%d]->mRadioResponse == NULL",
+        RLOGE("hangupConnectionResponse: radioService[%d]->mRadioResponse == NULL",
                 slotId);
     }
 
     return 0;
 }
 
-int radio::hangupWaitingOrBackgroundResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::hangupWaitingOrBackgroundResponse(int slotId,
                                             int responseType, int serial, RIL_Errno e,
                                             void *response, size_t responseLen) {
-    RLOGD("radio::hangupWaitingOrBackgroundResponse: serial %d", serial);
+#if VDBG
+    RLOGD("hangupWaitingOrBackgroundResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -2443,18 +3222,19 @@ int radio::hangupWaitingOrBackgroundResponse(android::Parcel &p, int slotId, int
                 responseInfo);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::hangupWaitingOrBackgroundResponse: radioService[%d]->mRadioResponse == NULL",
+        RLOGE("hangupWaitingOrBackgroundResponse: radioService[%d]->mRadioResponse == NULL",
                 slotId);
     }
 
     return 0;
 }
 
-int radio::hangupForegroundResumeBackgroundResponse(android::Parcel &p, int slotId,
-                                                   int requestNumber,
-                                                   int responseType, int serial, RIL_Errno e,
-                                                   void *response, size_t responseLen) {
-    RLOGD("radio::hangupWaitingOrBackgroundResponse: serial %d", serial);
+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 = {};
@@ -2464,18 +3244,19 @@ int radio::hangupForegroundResumeBackgroundResponse(android::Parcel &p, int slot
                 responseInfo);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::hangupWaitingOrBackgroundResponse: radioService[%d]->mRadioResponse == NULL",
+        RLOGE("hangupWaitingOrBackgroundResponse: radioService[%d]->mRadioResponse == NULL",
                 slotId);
     }
 
     return 0;
 }
 
-int radio::switchWaitingOrHoldingAndActiveResponse(android::Parcel &p, int slotId,
-                                                  int requestNumber,
-                                                  int responseType, int serial, RIL_Errno e,
-                                                  void *response, size_t responseLen) {
-    RLOGD("radio::switchWaitingOrHoldingAndActiveResponse: serial %d", serial);
+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 = {};
@@ -2485,16 +3266,18 @@ int radio::switchWaitingOrHoldingAndActiveResponse(android::Parcel &p, int slotI
                 responseInfo);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::switchWaitingOrHoldingAndActiveResponse: radioService[%d]->mRadioResponse "
+        RLOGE("switchWaitingOrHoldingAndActiveResponse: radioService[%d]->mRadioResponse "
                 "== NULL", slotId);
     }
 
     return 0;
 }
 
-int radio::conferenceResponse(android::Parcel &p, int slotId, int requestNumber, int responseType,
+int radio::conferenceResponse(int slotId, int responseType,
                              int serial, RIL_Errno e, void *response, size_t responseLen) {
-    RLOGD("radio::conferenceResponse: serial %d", serial);
+#if VDBG
+    RLOGD("conferenceResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -2503,16 +3286,18 @@ int radio::conferenceResponse(android::Parcel &p, int slotId, int requestNumber,
                 responseInfo);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::conferenceResponse: radioService[%d]->mRadioResponse == NULL",
+        RLOGE("conferenceResponse: radioService[%d]->mRadioResponse == NULL",
                 slotId);
     }
 
     return 0;
 }
 
-int radio::rejectCallResponse(android::Parcel &p, int slotId, int requestNumber, int responseType,
+int radio::rejectCallResponse(int slotId, int responseType,
                              int serial, RIL_Errno e, void *response, size_t responseLen) {
-    RLOGD("radio::rejectCallResponse: serial %d", serial);
+#if VDBG
+    RLOGD("rejectCallResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -2521,17 +3306,19 @@ int radio::rejectCallResponse(android::Parcel &p, int slotId, int requestNumber,
                 responseInfo);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::rejectCallResponse: radioService[%d]->mRadioResponse == NULL",
+        RLOGE("rejectCallResponse: radioService[%d]->mRadioResponse == NULL",
                 slotId);
     }
 
     return 0;
 }
 
-int radio::getLastCallFailCauseResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::getLastCallFailCauseResponse(int slotId,
                                        int responseType, int serial, RIL_Errno e, void *response,
                                        size_t responseLen) {
-    RLOGD("radio::getLastCallFailCauseResponse: serial %d", serial);
+#if VDBG
+    RLOGD("getLastCallFailCauseResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -2540,7 +3327,7 @@ int radio::getLastCallFailCauseResponse(android::Parcel &p, int slotId, int requ
         LastCallFailCauseInfo info = {};
         info.vendorCause = hidl_string();
         if (response == NULL) {
-            RLOGE("radio::getCurrentCallsResponse Invalid response: NULL");
+            RLOGE("getCurrentCallsResponse Invalid response: NULL");
             if (e == RIL_E_SUCCESS) responseInfo.error = RadioError::INVALID_RESPONSE;
         } else if (responseLen == sizeof(int)) {
             int *pInt = (int *) response;
@@ -2550,7 +3337,7 @@ int radio::getLastCallFailCauseResponse(android::Parcel &p, int slotId, int requ
             info.causeCode = (LastCallFailCause) pFailCauseInfo->cause_code;
             info.vendorCause = convertCharPtrToHidlString(pFailCauseInfo->vendor_cause);
         } else {
-            RLOGE("radio::getCurrentCallsResponse Invalid response: NULL");
+            RLOGE("getCurrentCallsResponse Invalid response: NULL");
             if (e == RIL_E_SUCCESS) responseInfo.error = RadioError::INVALID_RESPONSE;
         }
 
@@ -2558,24 +3345,26 @@ int radio::getLastCallFailCauseResponse(android::Parcel &p, int slotId, int requ
                 responseInfo, info);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::getLastCallFailCauseResponse: radioService[%d]->mRadioResponse == NULL",
+        RLOGE("getLastCallFailCauseResponse: radioService[%d]->mRadioResponse == NULL",
                 slotId);
     }
 
     return 0;
 }
 
-int radio::getSignalStrengthResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::getSignalStrengthResponse(int slotId,
                                      int responseType, int serial, RIL_Errno e,
                                      void *response, size_t responseLen) {
-    RLOGD("radio::getSignalStrengthResponse: serial %d", serial);
+#if VDBG
+    RLOGD("getSignalStrengthResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
         populateResponseInfo(responseInfo, serial, responseType, e);
         SignalStrength signalStrength = {};
         if (response == NULL || responseLen != sizeof(RIL_SignalStrength_v10)) {
-            RLOGE("radio::getSignalStrengthResponse: Invalid response");
+            RLOGE("getSignalStrengthResponse: Invalid response");
             if (e == RIL_E_SUCCESS) responseInfo.error = RadioError::INVALID_RESPONSE;
         } else {
             convertRilSignalStrengthToHal(response, responseLen, signalStrength);
@@ -2585,46 +3374,312 @@ int radio::getSignalStrengthResponse(android::Parcel &p, int slotId, int request
                 responseInfo, signalStrength);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::getSignalStrengthResponse: radioService[%d]->mRadioResponse == NULL",
+        RLOGE("getSignalStrengthResponse: radioService[%d]->mRadioResponse == NULL",
                 slotId);
     }
 
     return 0;
 }
 
-int radio::getVoiceRegistrationStateResponse(android::Parcel &p, int slotId, int requestNumber,
+RIL_CellInfoType getCellInfoTypeRadioTechnology(char *rat) {
+    if (rat == NULL) {
+        return RIL_CELL_INFO_TYPE_NONE;
+    }
+
+    int radioTech = atoi(rat);
+
+    switch(radioTech) {
+
+        case RADIO_TECH_GPRS:
+        case RADIO_TECH_EDGE:
+        case RADIO_TECH_GSM: {
+            return RIL_CELL_INFO_TYPE_GSM;
+        }
+
+        case RADIO_TECH_UMTS:
+        case RADIO_TECH_HSDPA:
+        case RADIO_TECH_HSUPA:
+        case RADIO_TECH_HSPA:
+        case RADIO_TECH_HSPAP: {
+            return RIL_CELL_INFO_TYPE_WCDMA;
+        }
+
+        case RADIO_TECH_IS95A:
+        case RADIO_TECH_IS95B:
+        case RADIO_TECH_1xRTT:
+        case RADIO_TECH_EVDO_0:
+        case RADIO_TECH_EVDO_A:
+        case RADIO_TECH_EVDO_B:
+        case RADIO_TECH_EHRPD: {
+            return RIL_CELL_INFO_TYPE_CDMA;
+        }
+
+        case RADIO_TECH_LTE:
+        case RADIO_TECH_LTE_CA: {
+            return RIL_CELL_INFO_TYPE_LTE;
+        }
+
+        case RADIO_TECH_TD_SCDMA: {
+            return RIL_CELL_INFO_TYPE_TD_SCDMA;
+        }
+
+        default: {
+            break;
+        }
+    }
+
+    return RIL_CELL_INFO_TYPE_NONE;
+
+}
+
+void fillCellIdentityResponse(CellIdentity &cellIdentity, RIL_CellIdentity_v16 &rilCellIdentity) {
+
+    cellIdentity.cellIdentityGsm.resize(0);
+    cellIdentity.cellIdentityWcdma.resize(0);
+    cellIdentity.cellIdentityCdma.resize(0);
+    cellIdentity.cellIdentityTdscdma.resize(0);
+    cellIdentity.cellIdentityLte.resize(0);
+    cellIdentity.cellInfoType = (CellInfoType)rilCellIdentity.cellInfoType;
+    switch(rilCellIdentity.cellInfoType) {
+
+        case RIL_CELL_INFO_TYPE_GSM: {
+            cellIdentity.cellIdentityGsm.resize(1);
+            cellIdentity.cellIdentityGsm[0].mcc =
+                    std::to_string(rilCellIdentity.cellIdentityGsm.mcc);
+            cellIdentity.cellIdentityGsm[0].mnc =
+                    std::to_string(rilCellIdentity.cellIdentityGsm.mnc);
+            cellIdentity.cellIdentityGsm[0].lac = rilCellIdentity.cellIdentityGsm.lac;
+            cellIdentity.cellIdentityGsm[0].cid = rilCellIdentity.cellIdentityGsm.cid;
+            cellIdentity.cellIdentityGsm[0].arfcn = rilCellIdentity.cellIdentityGsm.arfcn;
+            cellIdentity.cellIdentityGsm[0].bsic = rilCellIdentity.cellIdentityGsm.bsic;
+            break;
+        }
+
+        case RIL_CELL_INFO_TYPE_WCDMA: {
+            cellIdentity.cellIdentityWcdma.resize(1);
+            cellIdentity.cellIdentityWcdma[0].mcc =
+                    std::to_string(rilCellIdentity.cellIdentityWcdma.mcc);
+            cellIdentity.cellIdentityWcdma[0].mnc =
+                    std::to_string(rilCellIdentity.cellIdentityWcdma.mnc);
+            cellIdentity.cellIdentityWcdma[0].lac = rilCellIdentity.cellIdentityWcdma.lac;
+            cellIdentity.cellIdentityWcdma[0].cid = rilCellIdentity.cellIdentityWcdma.cid;
+            cellIdentity.cellIdentityWcdma[0].psc = rilCellIdentity.cellIdentityWcdma.psc;
+            cellIdentity.cellIdentityWcdma[0].uarfcn = rilCellIdentity.cellIdentityWcdma.uarfcn;
+            break;
+        }
+
+        case RIL_CELL_INFO_TYPE_CDMA: {
+            cellIdentity.cellIdentityCdma.resize(1);
+            cellIdentity.cellIdentityCdma[0].networkId = rilCellIdentity.cellIdentityCdma.networkId;
+            cellIdentity.cellIdentityCdma[0].systemId = rilCellIdentity.cellIdentityCdma.systemId;
+            cellIdentity.cellIdentityCdma[0].baseStationId =
+                    rilCellIdentity.cellIdentityCdma.basestationId;
+            cellIdentity.cellIdentityCdma[0].longitude = rilCellIdentity.cellIdentityCdma.longitude;
+            cellIdentity.cellIdentityCdma[0].latitude = rilCellIdentity.cellIdentityCdma.latitude;
+            break;
+        }
+
+        case RIL_CELL_INFO_TYPE_LTE: {
+            cellIdentity.cellIdentityLte.resize(1);
+            cellIdentity.cellIdentityLte[0].mcc =
+                    std::to_string(rilCellIdentity.cellIdentityLte.mcc);
+            cellIdentity.cellIdentityLte[0].mnc =
+                    std::to_string(rilCellIdentity.cellIdentityLte.mnc);
+            cellIdentity.cellIdentityLte[0].ci = rilCellIdentity.cellIdentityLte.ci;
+            cellIdentity.cellIdentityLte[0].pci = rilCellIdentity.cellIdentityLte.pci;
+            cellIdentity.cellIdentityLte[0].tac = rilCellIdentity.cellIdentityLte.tac;
+            cellIdentity.cellIdentityLte[0].earfcn = rilCellIdentity.cellIdentityLte.earfcn;
+            break;
+        }
+
+        case RIL_CELL_INFO_TYPE_TD_SCDMA: {
+            cellIdentity.cellIdentityTdscdma.resize(1);
+            cellIdentity.cellIdentityTdscdma[0].mcc =
+                    std::to_string(rilCellIdentity.cellIdentityTdscdma.mcc);
+            cellIdentity.cellIdentityTdscdma[0].mnc =
+                    std::to_string(rilCellIdentity.cellIdentityTdscdma.mnc);
+            cellIdentity.cellIdentityTdscdma[0].lac = rilCellIdentity.cellIdentityTdscdma.lac;
+            cellIdentity.cellIdentityTdscdma[0].cid = rilCellIdentity.cellIdentityTdscdma.cid;
+            cellIdentity.cellIdentityTdscdma[0].cpid = rilCellIdentity.cellIdentityTdscdma.cpid;
+            break;
+        }
+
+        default: {
+            break;
+        }
+    }
+}
+
+int convertResponseStringEntryToInt(char **response, int index, int numStrings) {
+    if ((response != NULL) &&  (numStrings > index) && (response[index] != NULL)) {
+        return atoi(response[index]);
+    }
+
+    return -1;
+}
+
+void fillCellIdentityFromVoiceRegStateResponseString(CellIdentity &cellIdentity,
+        int numStrings, char** response) {
+
+    RIL_CellIdentity_v16 rilCellIdentity;
+    memset(&rilCellIdentity, -1, sizeof(RIL_CellIdentity_v16));
+
+    rilCellIdentity.cellInfoType = getCellInfoTypeRadioTechnology(response[3]);
+    switch(rilCellIdentity.cellInfoType) {
+
+        case RIL_CELL_INFO_TYPE_GSM: {
+            rilCellIdentity.cellIdentityGsm.lac =
+                    convertResponseStringEntryToInt(response, 1, numStrings);
+            rilCellIdentity.cellIdentityGsm.cid =
+                    convertResponseStringEntryToInt(response, 2, numStrings);
+            break;
+        }
+
+        case RIL_CELL_INFO_TYPE_WCDMA: {
+            rilCellIdentity.cellIdentityWcdma.lac =
+                    convertResponseStringEntryToInt(response, 1, numStrings);
+            rilCellIdentity.cellIdentityWcdma.cid =
+                    convertResponseStringEntryToInt(response, 2, numStrings);
+            rilCellIdentity.cellIdentityWcdma.psc =
+                    convertResponseStringEntryToInt(response, 14, numStrings);
+            break;
+        }
+
+        case RIL_CELL_INFO_TYPE_TD_SCDMA:{
+            rilCellIdentity.cellIdentityTdscdma.lac =
+                    convertResponseStringEntryToInt(response, 1, numStrings);
+            rilCellIdentity.cellIdentityTdscdma.cid =
+                    convertResponseStringEntryToInt(response, 2, numStrings);
+            break;
+        }
+
+        case RIL_CELL_INFO_TYPE_CDMA:{
+            rilCellIdentity.cellIdentityCdma.basestationId =
+                    convertResponseStringEntryToInt(response, 4, 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);
+            rilCellIdentity.cellIdentityCdma.networkId =
+                    convertResponseStringEntryToInt(response, 9, numStrings);
+            break;
+        }
+
+        case RIL_CELL_INFO_TYPE_LTE:{
+            rilCellIdentity.cellIdentityLte.tac =
+                    convertResponseStringEntryToInt(response, 1, numStrings);
+            rilCellIdentity.cellIdentityLte.ci =
+                    convertResponseStringEntryToInt(response, 2, numStrings);
+            break;
+        }
+
+        default: {
+            break;
+        }
+    }
+
+    fillCellIdentityResponse(cellIdentity, rilCellIdentity);
+}
+
+void fillCellIdentityFromDataRegStateResponseString(CellIdentity &cellIdentity,
+        int numStrings, char** response) {
+
+    RIL_CellIdentity_v16 rilCellIdentity;
+    memset(&rilCellIdentity, -1, sizeof(RIL_CellIdentity_v16));
+
+    rilCellIdentity.cellInfoType = getCellInfoTypeRadioTechnology(response[3]);
+    switch(rilCellIdentity.cellInfoType) {
+        case RIL_CELL_INFO_TYPE_GSM: {
+            rilCellIdentity.cellIdentityGsm.lac =
+                    convertResponseStringEntryToInt(response, 1, numStrings);
+            rilCellIdentity.cellIdentityGsm.cid =
+                    convertResponseStringEntryToInt(response, 2, numStrings);
+            break;
+        }
+        case RIL_CELL_INFO_TYPE_WCDMA: {
+            rilCellIdentity.cellIdentityWcdma.lac =
+                    convertResponseStringEntryToInt(response, 1, numStrings);
+            rilCellIdentity.cellIdentityWcdma.cid =
+                    convertResponseStringEntryToInt(response, 2, numStrings);
+            break;
+        }
+        case RIL_CELL_INFO_TYPE_TD_SCDMA:{
+            rilCellIdentity.cellIdentityTdscdma.lac =
+                    convertResponseStringEntryToInt(response, 1, numStrings);
+            rilCellIdentity.cellIdentityTdscdma.cid =
+                    convertResponseStringEntryToInt(response, 2, numStrings);
+            break;
+        }
+        case RIL_CELL_INFO_TYPE_LTE: {
+            rilCellIdentity.cellIdentityLte.tac =
+                    convertResponseStringEntryToInt(response, 6, numStrings);
+            rilCellIdentity.cellIdentityLte.pci =
+                    convertResponseStringEntryToInt(response, 7, numStrings);
+            rilCellIdentity.cellIdentityLte.ci =
+                    convertResponseStringEntryToInt(response, 8, numStrings);
+            break;
+        }
+        default: {
+            break;
+        }
+    }
+
+    fillCellIdentityResponse(cellIdentity, rilCellIdentity);
+}
+
+int radio::getVoiceRegistrationStateResponse(int slotId,
                                             int responseType, int serial, RIL_Errno e,
                                             void *response, size_t responseLen) {
-    RLOGD("radio::getVoiceRegistrationStateResponse: serial %d", serial);
+#if VDBG
+    RLOGD("getVoiceRegistrationStateResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
         populateResponseInfo(responseInfo, serial, responseType, e);
 
         VoiceRegStateResult voiceRegResponse = {};
-
         int numStrings = responseLen / sizeof(char *);
-
-        if (response == NULL || numStrings != 15) {
-            RLOGE("radio::getVoiceRegistrationStateResponse Invalid response: NULL");
-            if (e == RIL_E_SUCCESS) responseInfo.error = RadioError::INVALID_RESPONSE;
+        if (response == NULL) {
+               RLOGE("getVoiceRegistrationStateResponse Invalid response: NULL");
+               if (e == RIL_E_SUCCESS) responseInfo.error = RadioError::INVALID_RESPONSE;
+        } else if (s_vendorFunctions->version <= 14) {
+            if (numStrings != 15) {
+                RLOGE("getVoiceRegistrationStateResponse Invalid response: NULL");
+                if (e == RIL_E_SUCCESS) responseInfo.error = RadioError::INVALID_RESPONSE;
+            } else {
+                char **resp = (char **) response;
+                voiceRegResponse.regState = (RegState) ATOI_NULL_HANDLED_DEF(resp[0], 4);
+                voiceRegResponse.rat = ATOI_NULL_HANDLED(resp[3]);
+                voiceRegResponse.cssSupported = ATOI_NULL_HANDLED_DEF(resp[7], 0);
+                voiceRegResponse.roamingIndicator = ATOI_NULL_HANDLED(resp[10]);
+                voiceRegResponse.systemIsInPrl = ATOI_NULL_HANDLED_DEF(resp[11], 0);
+                voiceRegResponse.defaultRoamingIndicator = ATOI_NULL_HANDLED_DEF(resp[12], 0);
+                voiceRegResponse.reasonForDenial = ATOI_NULL_HANDLED_DEF(resp[13], 0);
+                fillCellIdentityFromVoiceRegStateResponseString(voiceRegResponse.cellIdentity,
+                        numStrings, resp);
+            }
         } else {
-            char **resp = (char **) response;
-            voiceRegResponse.regState = (RegState) ATOI_NULL_HANDLED_DEF(resp[0], 4);
-            voiceRegResponse.lac = ATOI_NULL_HANDLED(resp[1]);
-            voiceRegResponse.cid = ATOI_NULL_HANDLED(resp[2]);
-            voiceRegResponse.rat = ATOI_NULL_HANDLED(resp[3]);
-            voiceRegResponse.baseStationId = ATOI_NULL_HANDLED(resp[4]);
-            voiceRegResponse.baseStationLatitude = ATOI_NULL_HANDLED_DEF(resp[5], INT_MAX);
-            voiceRegResponse.baseStationLongitude = ATOI_NULL_HANDLED_DEF(resp[6], INT_MAX);
-            voiceRegResponse.cssSupported = ATOI_NULL_HANDLED_DEF(resp[7], 0);
-            voiceRegResponse.systemId = ATOI_NULL_HANDLED_DEF(resp[8], 0);
-            voiceRegResponse.networkId = ATOI_NULL_HANDLED_DEF(resp[9], 0);
-            voiceRegResponse.roamingIndicator = ATOI_NULL_HANDLED(resp[10]);
-            voiceRegResponse.systemIsInPrl = ATOI_NULL_HANDLED_DEF(resp[11], 0);
-            voiceRegResponse.defaultRoamingIndicator = ATOI_NULL_HANDLED_DEF(resp[12], 0);
-            voiceRegResponse.reasonForDenial = ATOI_NULL_HANDLED_DEF(resp[13], 0);
-            voiceRegResponse.psc = ATOI_NULL_HANDLED(resp[14]);
+            RIL_VoiceRegistrationStateResponse *voiceRegState =
+                    (RIL_VoiceRegistrationStateResponse *)response;
+
+            if (responseLen != sizeof(RIL_VoiceRegistrationStateResponse)) {
+                RLOGE("getVoiceRegistrationStateResponse Invalid response: NULL");
+                if (e == RIL_E_SUCCESS) responseInfo.error = RadioError::INVALID_RESPONSE;
+            } else {
+                voiceRegResponse.regState = (RegState) voiceRegState->regState;
+                voiceRegResponse.rat = voiceRegState->rat;;
+                voiceRegResponse.cssSupported = voiceRegState->cssSupported;
+                voiceRegResponse.roamingIndicator = voiceRegState->roamingIndicator;
+                voiceRegResponse.systemIsInPrl = voiceRegState->systemIsInPrl;
+                voiceRegResponse.defaultRoamingIndicator = voiceRegState->defaultRoamingIndicator;
+                voiceRegResponse.reasonForDenial = voiceRegState->reasonForDenial;
+                fillCellIdentityResponse(voiceRegResponse.cellIdentity,
+                        voiceRegState->cellIdentity);
+            }
         }
 
         Return<void> retStatus =
@@ -2632,40 +3687,54 @@ int radio::getVoiceRegistrationStateResponse(android::Parcel &p, int slotId, int
                 responseInfo, voiceRegResponse);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::getVoiceRegistrationStateResponse: radioService[%d]->mRadioResponse == NULL",
+        RLOGE("getVoiceRegistrationStateResponse: radioService[%d]->mRadioResponse == NULL",
                 slotId);
     }
 
     return 0;
 }
 
-int radio::getDataRegistrationStateResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::getDataRegistrationStateResponse(int slotId,
                                            int responseType, int serial, RIL_Errno e,
                                            void *response, size_t responseLen) {
-    RLOGD("radio::getDataRegistrationStateResponse: serial %d", serial);
+#if VDBG
+    RLOGD("getDataRegistrationStateResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
         populateResponseInfo(responseInfo, serial, responseType, e);
         DataRegStateResult dataRegResponse = {};
-        int numStrings = responseLen / sizeof(char *);
-        if (response == NULL || (numStrings != 6 && numStrings != 11)) {
-            RLOGE("radio::getDataRegistrationStateResponse Invalid response: NULL");
+        if (response == NULL) {
+            RLOGE("getDataRegistrationStateResponse Invalid response: NULL");
             if (e == RIL_E_SUCCESS) responseInfo.error = RadioError::INVALID_RESPONSE;
+        } else if (s_vendorFunctions->version <= 14) {
+            int numStrings = responseLen / sizeof(char *);
+            if ((numStrings != 6) && (numStrings != 11)) {
+                RLOGE("getDataRegistrationStateResponse Invalid response: NULL");
+                if (e == RIL_E_SUCCESS) responseInfo.error = RadioError::INVALID_RESPONSE;
+            } else {
+                char **resp = (char **) response;
+                dataRegResponse.regState = (RegState) ATOI_NULL_HANDLED_DEF(resp[0], 4);
+                dataRegResponse.rat =  ATOI_NULL_HANDLED_DEF(resp[3], 0);
+                dataRegResponse.reasonDataDenied =  ATOI_NULL_HANDLED(resp[4]);
+                dataRegResponse.maxDataCalls =  ATOI_NULL_HANDLED_DEF(resp[5], 1);
+                fillCellIdentityFromDataRegStateResponseString(dataRegResponse.cellIdentity,
+                        numStrings, resp);
+            }
         } else {
-            char **resp = (char **) response;
-            dataRegResponse.regState = (RegState) ATOI_NULL_HANDLED_DEF(resp[0], 4);
-            dataRegResponse.lac =  ATOI_NULL_HANDLED(resp[1]);
-            dataRegResponse.cid =  ATOI_NULL_HANDLED(resp[2]);
-            dataRegResponse.rat =  ATOI_NULL_HANDLED_DEF(resp[3], 0);
-            dataRegResponse.reasonDataDenied =  ATOI_NULL_HANDLED(resp[4]);
-            dataRegResponse.maxDataCalls =  ATOI_NULL_HANDLED_DEF(resp[5], 1);
-            if (numStrings == 11) {
-                dataRegResponse.tac = ATOI_NULL_HANDLED(resp[6]);
-                dataRegResponse.phyCid = ATOI_NULL_HANDLED(resp[7]);
-                dataRegResponse.eci = ATOI_NULL_HANDLED(resp[8]);
-                dataRegResponse.csgid = ATOI_NULL_HANDLED(resp[9]);
-                dataRegResponse.tadv = ATOI_NULL_HANDLED(resp[10]);
+            RIL_DataRegistrationStateResponse *dataRegState =
+                    (RIL_DataRegistrationStateResponse *)response;
+
+            if (responseLen != sizeof(RIL_DataRegistrationStateResponse)) {
+                RLOGE("getDataRegistrationStateResponse Invalid response: NULL");
+                if (e == RIL_E_SUCCESS) responseInfo.error = RadioError::INVALID_RESPONSE;
+            } else {
+                dataRegResponse.regState = (RegState) dataRegState->regState;
+                dataRegResponse.rat = dataRegState->rat;;
+                dataRegResponse.reasonDataDenied = dataRegState->reasonDataDenied;
+                dataRegResponse.maxDataCalls = dataRegState->maxDataCalls;
+                fillCellIdentityResponse(dataRegResponse.cellIdentity, dataRegState->cellIdentity);
             }
         }
 
@@ -2674,17 +3743,19 @@ int radio::getDataRegistrationStateResponse(android::Parcel &p, int slotId, int
                 dataRegResponse);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::getDataRegistrationStateResponse: radioService[%d]->mRadioResponse == NULL",
+        RLOGE("getDataRegistrationStateResponse: radioService[%d]->mRadioResponse == NULL",
                 slotId);
     }
 
     return 0;
 }
 
-int radio::getOperatorResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::getOperatorResponse(int slotId,
                               int responseType, int serial, RIL_Errno e, void *response,
                               size_t responseLen) {
-    RLOGD("radio::getOperatorResponse: serial %d", serial);
+#if VDBG
+    RLOGD("getOperatorResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -2694,7 +3765,7 @@ int radio::getOperatorResponse(android::Parcel &p, int slotId, int requestNumber
         hidl_string numeric;
         int numStrings = responseLen / sizeof(char *);
         if (response == NULL || numStrings != 3) {
-            RLOGE("radio::getOperatorResponse Invalid response: NULL");
+            RLOGE("getOperatorResponse Invalid response: NULL");
             if (e == RIL_E_SUCCESS) responseInfo.error = RadioError::INVALID_RESPONSE;
 
         } else {
@@ -2707,17 +3778,17 @@ int radio::getOperatorResponse(android::Parcel &p, int slotId, int requestNumber
                 responseInfo, longName, shortName, numeric);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::getOperatorResponse: radioService[%d]->mRadioResponse == NULL",
+        RLOGE("getOperatorResponse: radioService[%d]->mRadioResponse == NULL",
                 slotId);
     }
 
     return 0;
 }
 
-int radio::setRadioPowerResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::setRadioPowerResponse(int slotId,
                                 int responseType, int serial, RIL_Errno e, void *response,
                                 size_t responseLen) {
-    RLOGD("radio::setRadioPowerResponse: serial %d", serial);
+    RLOGD("setRadioPowerResponse: serial %d", serial);
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -2726,17 +3797,19 @@ int radio::setRadioPowerResponse(android::Parcel &p, int slotId, int requestNumb
                 responseInfo);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::setRadioPowerResponse: radioService[%d]->mRadioResponse == NULL",
+        RLOGE("setRadioPowerResponse: radioService[%d]->mRadioResponse == NULL",
                 slotId);
     }
 
     return 0;
 }
 
-int radio::sendDtmfResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::sendDtmfResponse(int slotId,
                            int responseType, int serial, RIL_Errno e, void *response,
                            size_t responseLen) {
-    RLOGD("radio::sendDtmfResponse: serial %d", serial);
+#if VDBG
+    RLOGD("sendDtmfResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -2745,7 +3818,7 @@ int radio::sendDtmfResponse(android::Parcel &p, int slotId, int requestNumber,
                 responseInfo);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::sendDtmfResponse: radioService[%d]->mRadioResponse == NULL",
+        RLOGE("sendDtmfResponse: radioService[%d]->mRadioResponse == NULL",
                 slotId);
     }
 
@@ -2770,10 +3843,12 @@ SendSmsResult makeSendSmsResult(RadioResponseInfo& responseInfo, int serial, int
     return result;
 }
 
-int radio::sendSmsResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::sendSmsResponse(int slotId,
                           int responseType, int serial, RIL_Errno e, void *response,
                           size_t responseLen) {
-    RLOGD("radio::sendSmsResponse: serial %d", serial);
+#if VDBG
+    RLOGD("sendSmsResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -2784,16 +3859,18 @@ int radio::sendSmsResponse(android::Parcel &p, int slotId, int requestNumber,
                 result);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::sendSmsResponse: radioService[%d]->mRadioResponse == NULL", slotId);
+        RLOGE("sendSmsResponse: radioService[%d]->mRadioResponse == NULL", slotId);
     }
 
     return 0;
 }
 
-int radio::sendSMSExpectMoreResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::sendSMSExpectMoreResponse(int slotId,
                                     int responseType, int serial, RIL_Errno e, void *response,
                                     size_t responseLen) {
-    RLOGD("radio::sendSMSExpectMoreResponse: serial %d", serial);
+#if VDBG
+    RLOGD("sendSMSExpectMoreResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -2804,16 +3881,18 @@ int radio::sendSMSExpectMoreResponse(android::Parcel &p, int slotId, int request
                 responseInfo, result);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::sendSMSExpectMoreResponse: radioService[%d]->mRadioResponse == NULL", slotId);
+        RLOGE("sendSMSExpectMoreResponse: radioService[%d]->mRadioResponse == NULL", slotId);
     }
 
     return 0;
 }
 
-int radio::setupDataCallResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::setupDataCallResponse(int slotId,
                                  int responseType, int serial, RIL_Errno e, void *response,
                                  size_t responseLen) {
-    RLOGD("radio::setupDataCallResponse: serial %d", serial);
+#if VDBG
+    RLOGD("setupDataCallResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -2821,8 +3900,9 @@ int radio::setupDataCallResponse(android::Parcel &p, int slotId, int requestNumb
 
         SetupDataCallResult result = {};
         if (response == NULL || responseLen != sizeof(RIL_Data_Call_Response_v11)) {
-            RLOGE("radio::setupDataCallResponse: Invalid response");
+            RLOGE("setupDataCallResponse: Invalid response");
             if (e == RIL_E_SUCCESS) responseInfo.error = RadioError::INVALID_RESPONSE;
+            result.status = DataCallFailCause::ERROR_UNSPECIFIED;
             result.type = hidl_string();
             result.ifname = hidl_string();
             result.addresses = hidl_string();
@@ -2837,7 +3917,7 @@ int radio::setupDataCallResponse(android::Parcel &p, int slotId, int requestNumb
                 responseInfo, result);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::setupDataCallResponse: radioService[%d]->mRadioResponse == NULL", slotId);
+        RLOGE("setupDataCallResponse: radioService[%d]->mRadioResponse == NULL", slotId);
     }
 
     return 0;
@@ -2861,10 +3941,12 @@ IccIoResult responseIccIo(RadioResponseInfo& responseInfo, int serial, int respo
     return result;
 }
 
-int radio::iccIOForAppResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::iccIOForAppResponse(int slotId,
                       int responseType, int serial, RIL_Errno e, void *response,
                       size_t responseLen) {
-    RLOGD("radio::radio::iccIOForAppResponse: serial %d", serial);
+#if VDBG
+    RLOGD("iccIOForAppResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -2875,16 +3957,18 @@ int radio::iccIOForAppResponse(android::Parcel &p, int slotId, int requestNumber
                 responseInfo, result);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::iccIOForAppResponse: radioService[%d]->mRadioResponse == NULL", slotId);
+        RLOGE("iccIOForAppResponse: radioService[%d]->mRadioResponse == NULL", slotId);
     }
 
     return 0;
 }
 
-int radio::sendUssdResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::sendUssdResponse(int slotId,
                            int responseType, int serial, RIL_Errno e, void *response,
                            size_t responseLen) {
-    RLOGD("radio::sendUssdResponse: serial %d", serial);
+#if VDBG
+    RLOGD("sendUssdResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -2893,17 +3977,19 @@ int radio::sendUssdResponse(android::Parcel &p, int slotId, int requestNumber,
                 responseInfo);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::sendUssdResponse: radioService[%d]->mRadioResponse == NULL",
+        RLOGE("sendUssdResponse: radioService[%d]->mRadioResponse == NULL",
                 slotId);
     }
 
     return 0;
 }
 
-int radio::cancelPendingUssdResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::cancelPendingUssdResponse(int slotId,
                                     int responseType, int serial, RIL_Errno e, void *response,
                                     size_t responseLen) {
-    RLOGD("radio::cancelPendingUssdResponse: serial %d", serial);
+#if VDBG
+    RLOGD("cancelPendingUssdResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -2912,17 +3998,19 @@ int radio::cancelPendingUssdResponse(android::Parcel &p, int slotId, int request
                 responseInfo);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::cancelPendingUssdResponse: radioService[%d]->mRadioResponse == NULL",
+        RLOGE("cancelPendingUssdResponse: radioService[%d]->mRadioResponse == NULL",
                 slotId);
     }
 
     return 0;
 }
 
-int radio::getClirResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::getClirResponse(int slotId,
                               int responseType, int serial, RIL_Errno e, void *response,
                               size_t responseLen) {
-    RLOGD("radio::getClirResponse: serial %d", serial);
+#if VDBG
+    RLOGD("getClirResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -2930,7 +4018,7 @@ int radio::getClirResponse(android::Parcel &p, int slotId, int requestNumber,
         int n = -1, m = -1;
         int numInts = responseLen / sizeof(int);
         if (response == NULL || numInts != 2) {
-            RLOGE("radio::getClirResponse Invalid response: NULL");
+            RLOGE("getClirResponse Invalid response: NULL");
             if (e == RIL_E_SUCCESS) responseInfo.error = RadioError::INVALID_RESPONSE;
         } else {
             int *pInt = (int *) response;
@@ -2941,16 +4029,18 @@ int radio::getClirResponse(android::Parcel &p, int slotId, int requestNumber,
                 n, m);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::getClirResponse: radioService[%d]->mRadioResponse == NULL", slotId);
+        RLOGE("getClirResponse: radioService[%d]->mRadioResponse == NULL", slotId);
     }
 
     return 0;
 }
 
-int radio::setClirResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::setClirResponse(int slotId,
                           int responseType, int serial, RIL_Errno e, void *response,
                           size_t responseLen) {
-    RLOGD("radio::setClirResponse: serial %d", serial);
+#if VDBG
+    RLOGD("setClirResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -2959,16 +4049,18 @@ int radio::setClirResponse(android::Parcel &p, int slotId, int requestNumber,
                 responseInfo);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::setClirResponse: radioService[%d]->mRadioResponse == NULL", slotId);
+        RLOGE("setClirResponse: radioService[%d]->mRadioResponse == NULL", slotId);
     }
 
     return 0;
 }
 
-int radio::getCallForwardStatusResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::getCallForwardStatusResponse(int slotId,
                                        int responseType, int serial, RIL_Errno e,
                                        void *response, size_t responseLen) {
-    RLOGD("radio::getCallForwardStatusResponse: serial %d", serial);
+#if VDBG
+    RLOGD("getCallForwardStatusResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -2976,7 +4068,7 @@ int radio::getCallForwardStatusResponse(android::Parcel &p, int slotId, int requ
         hidl_vec<CallForwardInfo> callForwardInfos;
 
         if (response == NULL || responseLen % sizeof(RIL_CallForwardInfo *) != 0) {
-            RLOGE("radio::getCallForwardStatusResponse Invalid response: NULL");
+            RLOGE("getCallForwardStatusResponse Invalid response: NULL");
             if (e == RIL_E_SUCCESS) responseInfo.error = RadioError::INVALID_RESPONSE;
         } else {
             int num = responseLen / sizeof(RIL_CallForwardInfo *);
@@ -2996,17 +4088,19 @@ int radio::getCallForwardStatusResponse(android::Parcel &p, int slotId, int requ
                 responseInfo, callForwardInfos);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::getCallForwardStatusResponse: radioService[%d]->mRadioResponse == NULL",
+        RLOGE("getCallForwardStatusResponse: radioService[%d]->mRadioResponse == NULL",
                 slotId);
     }
 
     return 0;
 }
 
-int radio::setCallForwardResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::setCallForwardResponse(int slotId,
                                  int responseType, int serial, RIL_Errno e, void *response,
                                  size_t responseLen) {
-    RLOGD("radio::setCallForwardResponse: serial %d", serial);
+#if VDBG
+    RLOGD("setCallForwardResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -3015,16 +4109,18 @@ int radio::setCallForwardResponse(android::Parcel &p, int slotId, int requestNum
                 responseInfo);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::setCallForwardResponse: radioService[%d]->mRadioResponse == NULL", slotId);
+        RLOGE("setCallForwardResponse: radioService[%d]->mRadioResponse == NULL", slotId);
     }
 
     return 0;
 }
 
-int radio::getCallWaitingResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::getCallWaitingResponse(int slotId,
                                  int responseType, int serial, RIL_Errno e, void *response,
                                  size_t responseLen) {
-    RLOGD("radio::getCallWaitingResponse: serial %d", serial);
+#if VDBG
+    RLOGD("getCallWaitingResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -3033,27 +4129,29 @@ int radio::getCallWaitingResponse(android::Parcel &p, int slotId, int requestNum
         int serviceClass = -1;
         int numInts = responseLen / sizeof(int);
         if (response == NULL || numInts != 2) {
-            RLOGE("radio::getCallWaitingResponse Invalid response: NULL");
+            RLOGE("getCallWaitingResponse Invalid response: NULL");
             if (e == RIL_E_SUCCESS) responseInfo.error = RadioError::INVALID_RESPONSE;
         } else {
             int *pInt = (int *) response;
             enable = pInt[0] == 1 ? true : false;
             serviceClass = pInt[1];
         }
-        Return<void> retStatus = radioService[slotId]->mRadioResponse->getClirResponse(responseInfo,
-                enable, serviceClass);
+        Return<void> retStatus = radioService[slotId]->mRadioResponse->getCallWaitingResponse(
+                responseInfo, enable, serviceClass);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::getCallWaitingResponse: radioService[%d]->mRadioResponse == NULL", slotId);
+        RLOGE("getCallWaitingResponse: radioService[%d]->mRadioResponse == NULL", slotId);
     }
 
     return 0;
 }
 
-int radio::setCallWaitingResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::setCallWaitingResponse(int slotId,
                                  int responseType, int serial, RIL_Errno e, void *response,
                                  size_t responseLen) {
-    RLOGD("radio::setCallWaitingResponse: serial %d", serial);
+#if VDBG
+    RLOGD("setCallWaitingResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -3062,16 +4160,18 @@ int radio::setCallWaitingResponse(android::Parcel &p, int slotId, int requestNum
                 responseInfo);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::setCallWaitingResponse: radioService[%d]->mRadioResponse == NULL", slotId);
+        RLOGE("setCallWaitingResponse: radioService[%d]->mRadioResponse == NULL", slotId);
     }
 
     return 0;
 }
 
-int radio::acknowledgeLastIncomingGsmSmsResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::acknowledgeLastIncomingGsmSmsResponse(int slotId,
                                                 int responseType, int serial, RIL_Errno e,
                                                 void *response, size_t responseLen) {
-    RLOGD("radio::acknowledgeLastIncomingGsmSmsResponse: serial %d", serial);
+#if VDBG
+    RLOGD("acknowledgeLastIncomingGsmSmsResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -3081,17 +4181,19 @@ int radio::acknowledgeLastIncomingGsmSmsResponse(android::Parcel &p, int slotId,
                 responseInfo);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::acknowledgeLastIncomingGsmSmsResponse: radioService[%d]->mRadioResponse "
+        RLOGE("acknowledgeLastIncomingGsmSmsResponse: radioService[%d]->mRadioResponse "
                 "== NULL", slotId);
     }
 
     return 0;
 }
 
-int radio::acceptCallResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::acceptCallResponse(int slotId,
                              int responseType, int serial, RIL_Errno e,
                              void *response, size_t responseLen) {
-    RLOGD("radio::acceptCallResponse: serial %d", serial);
+#if VDBG
+    RLOGD("acceptCallResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -3100,17 +4202,19 @@ int radio::acceptCallResponse(android::Parcel &p, int slotId, int requestNumber,
                 responseInfo);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::acceptCallResponse: radioService[%d]->mRadioResponse == NULL",
+        RLOGE("acceptCallResponse: radioService[%d]->mRadioResponse == NULL",
                 slotId);
     }
 
     return 0;
 }
 
-int radio::deactivateDataCallResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::deactivateDataCallResponse(int slotId,
                                                 int responseType, int serial, RIL_Errno e,
                                                 void *response, size_t responseLen) {
-    RLOGD("radio::deactivateDataCallResponse: serial %d", serial);
+#if VDBG
+    RLOGD("deactivateDataCallResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -3119,17 +4223,19 @@ int radio::deactivateDataCallResponse(android::Parcel &p, int slotId, int reques
                 responseInfo);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::deactivateDataCallResponse: radioService[%d]->mRadioResponse == NULL",
+        RLOGE("deactivateDataCallResponse: radioService[%d]->mRadioResponse == NULL",
                 slotId);
     }
 
     return 0;
 }
 
-int radio::getFacilityLockForAppResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::getFacilityLockForAppResponse(int slotId,
                                         int responseType, int serial, RIL_Errno e,
                                         void *response, size_t responseLen) {
-    RLOGD("radio::getFacilityLockForAppResponse: serial %d", serial);
+#if VDBG
+    RLOGD("getFacilityLockForAppResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -3138,37 +4244,41 @@ int radio::getFacilityLockForAppResponse(android::Parcel &p, int slotId, int req
                 getFacilityLockForAppResponse(responseInfo, ret);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::getFacilityLockForAppResponse: radioService[%d]->mRadioResponse == NULL",
+        RLOGE("getFacilityLockForAppResponse: radioService[%d]->mRadioResponse == NULL",
                 slotId);
     }
 
     return 0;
 }
 
-int radio::setFacilityLockForAppResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::setFacilityLockForAppResponse(int slotId,
                                       int responseType, int serial, RIL_Errno e,
                                       void *response, size_t responseLen) {
-    RLOGD("radio::setFacilityLockForAppResponse: serial %d", serial);
+#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);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::setFacilityLockForAppResponse: radioService[%d]->mRadioResponse == NULL",
+        RLOGE("setFacilityLockForAppResponse: radioService[%d]->mRadioResponse == NULL",
                 slotId);
     }
 
     return 0;
 }
 
-int radio::setBarringPasswordResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::setBarringPasswordResponse(int slotId,
                              int responseType, int serial, RIL_Errno e,
                              void *response, size_t responseLen) {
-    RLOGD("radio::acceptCallResponse: serial %d", serial);
+#if VDBG
+    RLOGD("acceptCallResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -3177,17 +4287,19 @@ int radio::setBarringPasswordResponse(android::Parcel &p, int slotId, int reques
                 = radioService[slotId]->mRadioResponse->setBarringPasswordResponse(responseInfo);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::setBarringPasswordResponse: radioService[%d]->mRadioResponse == NULL",
+        RLOGE("setBarringPasswordResponse: radioService[%d]->mRadioResponse == NULL",
                 slotId);
     }
 
     return 0;
 }
 
-int radio::getNetworkSelectionModeResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::getNetworkSelectionModeResponse(int slotId,
                                           int responseType, int serial, RIL_Errno e, void *response,
                                           size_t responseLen) {
-    RLOGD("radio::getNetworkSelectionModeResponse: serial %d", serial);
+#if VDBG
+    RLOGD("getNetworkSelectionModeResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -3195,7 +4307,7 @@ int radio::getNetworkSelectionModeResponse(android::Parcel &p, int slotId, int r
         bool manual = false;
         int serviceClass;
         if (response == NULL || responseLen != sizeof(int)) {
-            RLOGE("radio::getNetworkSelectionModeResponse Invalid response: NULL");
+            RLOGE("getNetworkSelectionModeResponse Invalid response: NULL");
             if (e == RIL_E_SUCCESS) responseInfo.error = RadioError::INVALID_RESPONSE;
         } else {
             int *pInt = (int *) response;
@@ -3207,18 +4319,19 @@ int radio::getNetworkSelectionModeResponse(android::Parcel &p, int slotId, int r
                 manual);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::getNetworkSelectionModeResponse: radioService[%d]->mRadioResponse == NULL",
+        RLOGE("getNetworkSelectionModeResponse: radioService[%d]->mRadioResponse == NULL",
                 slotId);
     }
 
     return 0;
 }
 
-int radio::setNetworkSelectionModeAutomaticResponse(android::Parcel &p, int slotId,
-                             int requestNumber,
-                             int responseType, int serial, RIL_Errno e,
-                             void *response, size_t responseLen) {
-    RLOGD("radio::setNetworkSelectionModeAutomaticResponse: serial %d", serial);
+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 = {};
@@ -3228,17 +4341,19 @@ int radio::setNetworkSelectionModeAutomaticResponse(android::Parcel &p, int slot
                 responseInfo);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::setNetworkSelectionModeAutomaticResponse: radioService[%d]->mRadioResponse "
+        RLOGE("setNetworkSelectionModeAutomaticResponse: radioService[%d]->mRadioResponse "
                 "== NULL", slotId);
     }
 
     return 0;
 }
 
-int radio::setNetworkSelectionModeManualResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::setNetworkSelectionModeManualResponse(int slotId,
                              int responseType, int serial, RIL_Errno e,
                              void *response, size_t responseLen) {
-    RLOGD("radio::setNetworkSelectionModeManualResponse: serial %d", serial);
+#if VDBG
+    RLOGD("setNetworkSelectionModeManualResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -3248,7 +4363,7 @@ int radio::setNetworkSelectionModeManualResponse(android::Parcel &p, int slotId,
                 responseInfo);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::acceptCallResponse: radioService[%d]->setNetworkSelectionModeManualResponse "
+        RLOGE("acceptCallResponse: radioService[%d]->setNetworkSelectionModeManualResponse "
                 "== NULL", slotId);
     }
 
@@ -3269,31 +4384,33 @@ int convertOperatorStatusToInt(const char *str) {
     }
 }
 
-int radio::getAvailableNetworksResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::getAvailableNetworksResponse(int slotId,
                               int responseType, int serial, RIL_Errno e, void *response,
                               size_t responseLen) {
-    RLOGD("radio::getAvailableNetworksResponse: serial %d", serial);
+#if VDBG
+    RLOGD("getAvailableNetworksResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
         populateResponseInfo(responseInfo, serial, responseType, e);
         hidl_vec<OperatorInfo> networks;
         if (response == NULL || responseLen % (4 * sizeof(char *))!= 0) {
-            RLOGE("radio::getAvailableNetworksResponse Invalid response: NULL");
+            RLOGE("getAvailableNetworksResponse Invalid response: NULL");
             if (e == RIL_E_SUCCESS) responseInfo.error = RadioError::INVALID_RESPONSE;
         } else {
             char **resp = (char **) response;
             int numStrings = responseLen / sizeof(char *);
             networks.resize(numStrings/4);
-            for (int i = 0; i < numStrings; i = i + 4) {
-                networks[i].alphaLong = convertCharPtrToHidlString(resp[i]);
-                networks[i].alphaShort = convertCharPtrToHidlString(resp[i + 1]);
-                networks[i].operatorNumeric = convertCharPtrToHidlString(resp[i + 2]);
+            for (int i = 0, j = 0; i < numStrings; i = i + 4, j++) {
+                networks[j].alphaLong = convertCharPtrToHidlString(resp[i]);
+                networks[j].alphaShort = convertCharPtrToHidlString(resp[i + 1]);
+                networks[j].operatorNumeric = convertCharPtrToHidlString(resp[i + 2]);
                 int status = convertOperatorStatusToInt(resp[i + 3]);
                 if (status == -1) {
                     if (e == RIL_E_SUCCESS) responseInfo.error = RadioError::INVALID_RESPONSE;
                 } else {
-                    networks[i].status = (OperatorStatus) status;
+                    networks[j].status = (OperatorStatus) status;
                 }
             }
         }
@@ -3302,17 +4419,19 @@ int radio::getAvailableNetworksResponse(android::Parcel &p, int slotId, int requ
                 networks);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::getAvailableNetworksResponse: radioService[%d]->mRadioResponse == NULL",
+        RLOGE("getAvailableNetworksResponse: radioService[%d]->mRadioResponse == NULL",
                 slotId);
     }
 
     return 0;
 }
 
-int radio::startDtmfResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::startDtmfResponse(int slotId,
                             int responseType, int serial, RIL_Errno e,
                             void *response, size_t responseLen) {
-    RLOGD("radio::startDtmfResponse: serial %d", serial);
+#if VDBG
+    RLOGD("startDtmfResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -3321,16 +4440,18 @@ int radio::startDtmfResponse(android::Parcel &p, int slotId, int requestNumber,
                 = radioService[slotId]->mRadioResponse->startDtmfResponse(responseInfo);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::startDtmfResponse: radioService[%d]->mRadioResponse == NULL", slotId);
+        RLOGE("startDtmfResponse: radioService[%d]->mRadioResponse == NULL", slotId);
     }
 
     return 0;
 }
 
-int radio::stopDtmfResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::stopDtmfResponse(int slotId,
                            int responseType, int serial, RIL_Errno e,
                            void *response, size_t responseLen) {
-    RLOGD("radio::stopDtmfResponse: serial %d", serial);
+#if VDBG
+    RLOGD("stopDtmfResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -3339,16 +4460,18 @@ int radio::stopDtmfResponse(android::Parcel &p, int slotId, int requestNumber,
                 = radioService[slotId]->mRadioResponse->stopDtmfResponse(responseInfo);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::stopDtmfResponse: radioService[%d]->mRadioResponse == NULL", slotId);
+        RLOGE("stopDtmfResponse: radioService[%d]->mRadioResponse == NULL", slotId);
     }
 
     return 0;
 }
 
-int radio::getBasebandVersionResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::getBasebandVersionResponse(int slotId,
                                      int responseType, int serial, RIL_Errno e,
                                      void *response, size_t responseLen) {
-    RLOGD("radio::getBasebandVersionResponse: serial %d", serial);
+#if VDBG
+    RLOGD("getBasebandVersionResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -3358,16 +4481,18 @@ int radio::getBasebandVersionResponse(android::Parcel &p, int slotId, int reques
                 convertCharPtrToHidlString((char *) response));
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::getBasebandVersionResponse: radioService[%d]->mRadioResponse == NULL", slotId);
+        RLOGE("getBasebandVersionResponse: radioService[%d]->mRadioResponse == NULL", slotId);
     }
 
     return 0;
 }
 
-int radio::separateConnectionResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::separateConnectionResponse(int slotId,
                                      int responseType, int serial, RIL_Errno e,
                                      void *response, size_t responseLen) {
-    RLOGD("radio::separateConnectionResponse: serial %d", serial);
+#if VDBG
+    RLOGD("separateConnectionResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -3376,17 +4501,19 @@ int radio::separateConnectionResponse(android::Parcel &p, int slotId, int reques
                 = radioService[slotId]->mRadioResponse->separateConnectionResponse(responseInfo);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::separateConnectionResponse: radioService[%d]->mRadioResponse == NULL",
+        RLOGE("separateConnectionResponse: radioService[%d]->mRadioResponse == NULL",
                 slotId);
     }
 
     return 0;
 }
 
-int radio::setMuteResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::setMuteResponse(int slotId,
                           int responseType, int serial, RIL_Errno e,
                           void *response, size_t responseLen) {
-    RLOGD("radio::setMuteResponse: serial %d", serial);
+#if VDBG
+    RLOGD("setMuteResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -3395,16 +4522,18 @@ int radio::setMuteResponse(android::Parcel &p, int slotId, int requestNumber,
                 = radioService[slotId]->mRadioResponse->setMuteResponse(responseInfo);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::setMuteResponse: radioService[%d]->mRadioResponse == NULL", slotId);
+        RLOGE("setMuteResponse: radioService[%d]->mRadioResponse == NULL", slotId);
     }
 
     return 0;
 }
 
-int radio::getMuteResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::getMuteResponse(int slotId,
                           int responseType, int serial, RIL_Errno e, void *response,
                           size_t responseLen) {
-    RLOGD("radio::getMuteResponse: serial %d", serial);
+#if VDBG
+    RLOGD("getMuteResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -3412,7 +4541,7 @@ int radio::getMuteResponse(android::Parcel &p, int slotId, int requestNumber,
         bool enable = false;
         int serviceClass;
         if (response == NULL || responseLen != sizeof(int)) {
-            RLOGE("radio::getMuteResponse Invalid response: NULL");
+            RLOGE("getMuteResponse Invalid response: NULL");
             if (e == RIL_E_SUCCESS) responseInfo.error = RadioError::INVALID_RESPONSE;
         } else {
             int *pInt = (int *) response;
@@ -3422,16 +4551,18 @@ int radio::getMuteResponse(android::Parcel &p, int slotId, int requestNumber,
                 enable);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::getMuteResponse: radioService[%d]->mRadioResponse == NULL", slotId);
+        RLOGE("getMuteResponse: radioService[%d]->mRadioResponse == NULL", slotId);
     }
 
     return 0;
 }
 
-int radio::getClipResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::getClipResponse(int slotId,
                           int responseType, int serial, RIL_Errno e,
                           void *response, size_t responseLen) {
-    RLOGD("radio::getClipResponse: serial %d", serial);
+#if VDBG
+    RLOGD("getClipResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -3440,16 +4571,18 @@ int radio::getClipResponse(android::Parcel &p, int slotId, int requestNumber,
                 (ClipStatus) ret);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::getClipResponse: radioService[%d]->mRadioResponse == NULL", slotId);
+        RLOGE("getClipResponse: radioService[%d]->mRadioResponse == NULL", slotId);
     }
 
     return 0;
 }
 
-int radio::getDataCallListResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::getDataCallListResponse(int slotId,
                                    int responseType, int serial, RIL_Errno e,
                                    void *response, size_t responseLen) {
-    RLOGD("radio::getDataCallListResponse: serial %d", serial);
+#if VDBG
+    RLOGD("getDataCallListResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -3457,44 +4590,28 @@ int radio::getDataCallListResponse(android::Parcel &p, int slotId, int requestNu
 
         hidl_vec<SetupDataCallResult> ret;
         if (response == NULL || responseLen % sizeof(RIL_Data_Call_Response_v11) != 0) {
-            RLOGE("radio::getDataCallListResponse: invalid response");
+            RLOGE("getDataCallListResponse: invalid response");
             if (e == RIL_E_SUCCESS) responseInfo.error = RadioError::INVALID_RESPONSE;
         } else {
             convertRilDataCallListToHal(response, responseLen, ret);
         }
 
         Return<void> retStatus = radioService[slotId]->mRadioResponse->getDataCallListResponse(
-                responseInfo, ret);
-        radioService[slotId]->checkReturnStatus(retStatus);
-    } else {
-        RLOGE("radio::getDataCallListResponse: radioService[%d]->mRadioResponse == NULL", slotId);
-    }
-
-    return 0;
-}
-
-int radio::sendScreenStateResponse(android::Parcel &p, int slotId, int requestNumber,
-                          int responseType, int serial, RIL_Errno e,
-                          void *response, size_t responseLen) {
-    RLOGD("radio::sendScreenStateResponse: serial %d", serial);
-
-    if (radioService[slotId]->mRadioResponse != NULL) {
-        RadioResponseInfo responseInfo = {};
-        populateResponseInfo(responseInfo, serial, responseType, e);
-        Return<void> retStatus
-                = radioService[slotId]->mRadioResponse->sendScreenStateResponse(responseInfo);
+                responseInfo, ret);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::sendScreenStateResponse: radioService[%d]->mRadioResponse == NULL", slotId);
+        RLOGE("getDataCallListResponse: radioService[%d]->mRadioResponse == NULL", slotId);
     }
 
     return 0;
 }
 
-int radio::setSuppServiceNotificationsResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::setSuppServiceNotificationsResponse(int slotId,
                                               int responseType, int serial, RIL_Errno e,
                                               void *response, size_t responseLen) {
-    RLOGD("radio::setSuppServiceNotificationsResponse: serial %d", serial);
+#if VDBG
+    RLOGD("setSuppServiceNotificationsResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -3504,17 +4621,19 @@ int radio::setSuppServiceNotificationsResponse(android::Parcel &p, int slotId, i
                 responseInfo);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::setSuppServiceNotificationsResponse: radioService[%d]->mRadioResponse "
+        RLOGE("setSuppServiceNotificationsResponse: radioService[%d]->mRadioResponse "
                 "== NULL", slotId);
     }
 
     return 0;
 }
 
-int radio::deleteSmsOnSimResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::deleteSmsOnSimResponse(int slotId,
                                  int responseType, int serial, RIL_Errno e,
                                  void *response, size_t responseLen) {
-    RLOGD("radio::deleteSmsOnSimResponse: serial %d", serial);
+#if VDBG
+    RLOGD("deleteSmsOnSimResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -3523,16 +4642,18 @@ int radio::deleteSmsOnSimResponse(android::Parcel &p, int slotId, int requestNum
                 = radioService[slotId]->mRadioResponse->deleteSmsOnSimResponse(responseInfo);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::deleteSmsOnSimResponse: radioService[%d]->mRadioResponse == NULL", slotId);
+        RLOGE("deleteSmsOnSimResponse: radioService[%d]->mRadioResponse == NULL", slotId);
     }
 
     return 0;
 }
 
-int radio::setBandModeResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::setBandModeResponse(int slotId,
                               int responseType, int serial, RIL_Errno e,
                               void *response, size_t responseLen) {
-    RLOGD("radio::setBandModeResponse: serial %d", serial);
+#if VDBG
+    RLOGD("setBandModeResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -3541,16 +4662,18 @@ int radio::setBandModeResponse(android::Parcel &p, int slotId, int requestNumber
                 = radioService[slotId]->mRadioResponse->setBandModeResponse(responseInfo);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::setBandModeResponse: radioService[%d]->mRadioResponse == NULL", slotId);
+        RLOGE("setBandModeResponse: radioService[%d]->mRadioResponse == NULL", slotId);
     }
 
     return 0;
 }
 
-int radio::writeSmsToSimResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::writeSmsToSimResponse(int slotId,
                                 int responseType, int serial, RIL_Errno e,
                                 void *response, size_t responseLen) {
-    RLOGD("radio::writeSmsToSimResponse: serial %d", serial);
+#if VDBG
+    RLOGD("writeSmsToSimResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -3559,23 +4682,25 @@ int radio::writeSmsToSimResponse(android::Parcel &p, int slotId, int requestNumb
                 = radioService[slotId]->mRadioResponse->writeSmsToSimResponse(responseInfo, ret);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::writeSmsToSimResponse: radioService[%d]->mRadioResponse == NULL", slotId);
+        RLOGE("writeSmsToSimResponse: radioService[%d]->mRadioResponse == NULL", slotId);
     }
 
     return 0;
 }
 
-int radio::getAvailableBandModesResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::getAvailableBandModesResponse(int slotId,
                                         int responseType, int serial, RIL_Errno e, void *response,
                                         size_t responseLen) {
-    RLOGD("radio::getAvailableBandModesResponse: serial %d", serial);
+#if VDBG
+    RLOGD("getAvailableBandModesResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
         populateResponseInfo(responseInfo, serial, responseType, e);
         hidl_vec<RadioBandMode> modes;
         if (response == NULL || responseLen % sizeof(int) != 0) {
-            RLOGE("radio::getAvailableBandModesResponse Invalid response: NULL");
+            RLOGE("getAvailableBandModesResponse Invalid response: NULL");
             if (e == RIL_E_SUCCESS) responseInfo.error = RadioError::INVALID_RESPONSE;
         } else {
             int *pInt = (int *) response;
@@ -3590,17 +4715,19 @@ int radio::getAvailableBandModesResponse(android::Parcel &p, int slotId, int req
                 modes);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::getAvailableBandModesResponse: radioService[%d]->mRadioResponse == NULL",
+        RLOGE("getAvailableBandModesResponse: radioService[%d]->mRadioResponse == NULL",
                 slotId);
     }
 
     return 0;
 }
 
-int radio::sendEnvelopeResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::sendEnvelopeResponse(int slotId,
                                int responseType, int serial, RIL_Errno e,
                                void *response, size_t responseLen) {
-    RLOGD("radio::sendEnvelopeResponse: serial %d", serial);
+#if VDBG
+    RLOGD("sendEnvelopeResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -3610,16 +4737,18 @@ int radio::sendEnvelopeResponse(android::Parcel &p, int slotId, int requestNumbe
                 convertCharPtrToHidlString((char *) response));
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::sendEnvelopeResponse: radioService[%d]->mRadioResponse == NULL", slotId);
+        RLOGE("sendEnvelopeResponse: radioService[%d]->mRadioResponse == NULL", slotId);
     }
 
     return 0;
 }
 
-int radio::sendTerminalResponseToSimResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::sendTerminalResponseToSimResponse(int slotId,
                                             int responseType, int serial, RIL_Errno e,
                                             void *response, size_t responseLen) {
-    RLOGD("radio::sendTerminalResponseToSimResponse: serial %d", serial);
+#if VDBG
+    RLOGD("sendTerminalResponseToSimResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -3629,18 +4758,20 @@ int radio::sendTerminalResponseToSimResponse(android::Parcel &p, int slotId, int
                 responseInfo);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::sendTerminalResponseToSimResponse: radioService[%d]->mRadioResponse == NULL",
+        RLOGE("sendTerminalResponseToSimResponse: radioService[%d]->mRadioResponse == NULL",
                 slotId);
     }
 
     return 0;
 }
 
-int radio::handleStkCallSetupRequestFromSimResponse(android::Parcel &p, int slotId,
-                                                   int requestNumber, int responseType, int serial,
+int radio::handleStkCallSetupRequestFromSimResponse(int slotId,
+                                                   int responseType, int serial,
                                                    RIL_Errno e, void *response,
                                                    size_t responseLen) {
-    RLOGD("radio::handleStkCallSetupRequestFromSimResponse: serial %d", serial);
+#if VDBG
+    RLOGD("handleStkCallSetupRequestFromSimResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -3650,17 +4781,19 @@ int radio::handleStkCallSetupRequestFromSimResponse(android::Parcel &p, int slot
                 responseInfo);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::handleStkCallSetupRequestFromSimResponse: radioService[%d]->mRadioResponse "
+        RLOGE("handleStkCallSetupRequestFromSimResponse: radioService[%d]->mRadioResponse "
                 "== NULL", slotId);
     }
 
     return 0;
 }
 
-int radio::explicitCallTransferResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::explicitCallTransferResponse(int slotId,
                                        int responseType, int serial, RIL_Errno e,
                                        void *response, size_t responseLen) {
-    RLOGD("radio::explicitCallTransferResponse: serial %d", serial);
+#if VDBG
+    RLOGD("explicitCallTransferResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -3669,17 +4802,19 @@ int radio::explicitCallTransferResponse(android::Parcel &p, int slotId, int requ
                 = radioService[slotId]->mRadioResponse->explicitCallTransferResponse(responseInfo);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::explicitCallTransferResponse: radioService[%d]->mRadioResponse == NULL",
+        RLOGE("explicitCallTransferResponse: radioService[%d]->mRadioResponse == NULL",
                 slotId);
     }
 
     return 0;
 }
 
-int radio::setPreferredNetworkTypeResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::setPreferredNetworkTypeResponse(int slotId,
                                  int responseType, int serial, RIL_Errno e,
                                  void *response, size_t responseLen) {
-    RLOGD("radio::setPreferredNetworkTypeResponse: serial %d", serial);
+#if VDBG
+    RLOGD("setPreferredNetworkTypeResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -3689,7 +4824,7 @@ int radio::setPreferredNetworkTypeResponse(android::Parcel &p, int slotId, int r
                 responseInfo);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::setPreferredNetworkTypeResponse: radioService[%d]->mRadioResponse == NULL",
+        RLOGE("setPreferredNetworkTypeResponse: radioService[%d]->mRadioResponse == NULL",
                 slotId);
     }
 
@@ -3697,10 +4832,12 @@ int radio::setPreferredNetworkTypeResponse(android::Parcel &p, int slotId, int r
 }
 
 
-int radio::getPreferredNetworkTypeResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::getPreferredNetworkTypeResponse(int slotId,
                                           int responseType, int serial, RIL_Errno e,
                                           void *response, size_t responseLen) {
-    RLOGD("radio::getPreferredNetworkTypeResponse: serial %d", serial);
+#if VDBG
+    RLOGD("getPreferredNetworkTypeResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -3710,17 +4847,19 @@ int radio::getPreferredNetworkTypeResponse(android::Parcel &p, int slotId, int r
                 responseInfo, (PreferredNetworkType) ret);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::getPreferredNetworkTypeResponse: radioService[%d]->mRadioResponse == NULL",
+        RLOGE("getPreferredNetworkTypeResponse: radioService[%d]->mRadioResponse == NULL",
                 slotId);
     }
 
     return 0;
 }
 
-int radio::getNeighboringCidsResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::getNeighboringCidsResponse(int slotId,
                                      int responseType, int serial, RIL_Errno e,
                                      void *response, size_t responseLen) {
-    RLOGD("radio::getNeighboringCidsResponse: serial %d", serial);
+#if VDBG
+    RLOGD("getNeighboringCidsResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -3728,7 +4867,7 @@ int radio::getNeighboringCidsResponse(android::Parcel &p, int slotId, int reques
         hidl_vec<NeighboringCell> cells;
 
         if (response == NULL || responseLen % sizeof(RIL_NeighboringCell *) != 0) {
-            RLOGE("radio::getNeighboringCidsResponse Invalid response: NULL");
+            RLOGE("getNeighboringCidsResponse Invalid response: NULL");
             if (e == RIL_E_SUCCESS) responseInfo.error = RadioError::INVALID_RESPONSE;
         } else {
             int num = responseLen / sizeof(RIL_NeighboringCell *);
@@ -3745,17 +4884,19 @@ int radio::getNeighboringCidsResponse(android::Parcel &p, int slotId, int reques
                 cells);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::getNeighboringCidsResponse: radioService[%d]->mRadioResponse == NULL",
+        RLOGE("getNeighboringCidsResponse: radioService[%d]->mRadioResponse == NULL",
                 slotId);
     }
 
     return 0;
 }
 
-int radio::setLocationUpdatesResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::setLocationUpdatesResponse(int slotId,
                                      int responseType, int serial, RIL_Errno e,
                                      void *response, size_t responseLen) {
-    RLOGD("radio::setLocationUpdatesResponse: serial %d", serial);
+#if VDBG
+    RLOGD("setLocationUpdatesResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -3764,17 +4905,19 @@ int radio::setLocationUpdatesResponse(android::Parcel &p, int slotId, int reques
                 = radioService[slotId]->mRadioResponse->setLocationUpdatesResponse(responseInfo);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::setLocationUpdatesResponse: radioService[%d]->mRadioResponse == NULL",
+        RLOGE("setLocationUpdatesResponse: radioService[%d]->mRadioResponse == NULL",
                 slotId);
     }
 
     return 0;
 }
 
-int radio::setCdmaSubscriptionSourceResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::setCdmaSubscriptionSourceResponse(int slotId,
                                  int responseType, int serial, RIL_Errno e,
                                  void *response, size_t responseLen) {
-    RLOGD("radio::setCdmaSubscriptionSourceResponse: serial %d", serial);
+#if VDBG
+    RLOGD("setCdmaSubscriptionSourceResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -3784,17 +4927,19 @@ int radio::setCdmaSubscriptionSourceResponse(android::Parcel &p, int slotId, int
                 responseInfo);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::setCdmaSubscriptionSourceResponse: radioService[%d]->mRadioResponse == NULL",
+        RLOGE("setCdmaSubscriptionSourceResponse: radioService[%d]->mRadioResponse == NULL",
                 slotId);
     }
 
     return 0;
 }
 
-int radio::setCdmaRoamingPreferenceResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::setCdmaRoamingPreferenceResponse(int slotId,
                                  int responseType, int serial, RIL_Errno e,
                                  void *response, size_t responseLen) {
-    RLOGD("radio::setCdmaRoamingPreferenceResponse: serial %d", serial);
+#if VDBG
+    RLOGD("setCdmaRoamingPreferenceResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -3804,17 +4949,19 @@ int radio::setCdmaRoamingPreferenceResponse(android::Parcel &p, int slotId, int
                 responseInfo);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::setCdmaRoamingPreferenceResponse: radioService[%d]->mRadioResponse == NULL",
+        RLOGE("setCdmaRoamingPreferenceResponse: radioService[%d]->mRadioResponse == NULL",
                 slotId);
     }
 
     return 0;
 }
 
-int radio::getCdmaRoamingPreferenceResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::getCdmaRoamingPreferenceResponse(int slotId,
                                            int responseType, int serial, RIL_Errno e,
                                            void *response, size_t responseLen) {
-    RLOGD("radio::getCdmaRoamingPreferenceResponse: serial %d", serial);
+#if VDBG
+    RLOGD("getCdmaRoamingPreferenceResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -3824,17 +4971,19 @@ int radio::getCdmaRoamingPreferenceResponse(android::Parcel &p, int slotId, int
                 responseInfo, (CdmaRoamingType) ret);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::getCdmaRoamingPreferenceResponse: radioService[%d]->mRadioResponse == NULL",
+        RLOGE("getCdmaRoamingPreferenceResponse: radioService[%d]->mRadioResponse == NULL",
                 slotId);
     }
 
     return 0;
 }
 
-int radio::setTTYModeResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::setTTYModeResponse(int slotId,
                              int responseType, int serial, RIL_Errno e,
                              void *response, size_t responseLen) {
-    RLOGD("radio::setTTYModeResponse: serial %d", serial);
+#if VDBG
+    RLOGD("setTTYModeResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -3843,16 +4992,18 @@ int radio::setTTYModeResponse(android::Parcel &p, int slotId, int requestNumber,
                 = radioService[slotId]->mRadioResponse->setTTYModeResponse(responseInfo);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::setTTYModeResponse: radioService[%d]->mRadioResponse == NULL", slotId);
+        RLOGE("setTTYModeResponse: radioService[%d]->mRadioResponse == NULL", slotId);
     }
 
     return 0;
 }
 
-int radio::getTTYModeResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::getTTYModeResponse(int slotId,
                              int responseType, int serial, RIL_Errno e,
                              void *response, size_t responseLen) {
-    RLOGD("radio::getTTYModeResponse: serial %d", serial);
+#if VDBG
+    RLOGD("getTTYModeResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -3862,16 +5013,18 @@ int radio::getTTYModeResponse(android::Parcel &p, int slotId, int requestNumber,
                 (TtyMode) ret);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::getTTYModeResponse: radioService[%d]->mRadioResponse == NULL", slotId);
+        RLOGE("getTTYModeResponse: radioService[%d]->mRadioResponse == NULL", slotId);
     }
 
     return 0;
 }
 
-int radio::setPreferredVoicePrivacyResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::setPreferredVoicePrivacyResponse(int slotId,
                                  int responseType, int serial, RIL_Errno e,
                                  void *response, size_t responseLen) {
-    RLOGD("radio::setPreferredVoicePrivacyResponse: serial %d", serial);
+#if VDBG
+    RLOGD("setPreferredVoicePrivacyResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -3881,17 +5034,19 @@ int radio::setPreferredVoicePrivacyResponse(android::Parcel &p, int slotId, int
                 responseInfo);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::setPreferredVoicePrivacyResponse: radioService[%d]->mRadioResponse == NULL",
+        RLOGE("setPreferredVoicePrivacyResponse: radioService[%d]->mRadioResponse == NULL",
                 slotId);
     }
 
     return 0;
 }
 
-int radio::getPreferredVoicePrivacyResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::getPreferredVoicePrivacyResponse(int slotId,
                                            int responseType, int serial, RIL_Errno e,
                                            void *response, size_t responseLen) {
-    RLOGD("radio::getPreferredVoicePrivacyResponse: serial %d", serial);
+#if VDBG
+    RLOGD("getPreferredVoicePrivacyResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -3899,7 +5054,7 @@ int radio::getPreferredVoicePrivacyResponse(android::Parcel &p, int slotId, int
         bool enable = false;
         int numInts = responseLen / sizeof(int);
         if (response == NULL || numInts != 1) {
-            RLOGE("radio::getPreferredVoicePrivacyResponse Invalid response: NULL");
+            RLOGE("getPreferredVoicePrivacyResponse Invalid response: NULL");
             if (e == RIL_E_SUCCESS) responseInfo.error = RadioError::INVALID_RESPONSE;
         } else {
             int *pInt = (int *) response;
@@ -3910,17 +5065,19 @@ int radio::getPreferredVoicePrivacyResponse(android::Parcel &p, int slotId, int
                 responseInfo, enable);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::getPreferredVoicePrivacyResponse: radioService[%d]->mRadioResponse == NULL",
+        RLOGE("getPreferredVoicePrivacyResponse: radioService[%d]->mRadioResponse == NULL",
                 slotId);
     }
 
     return 0;
 }
 
-int radio::sendCDMAFeatureCodeResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::sendCDMAFeatureCodeResponse(int slotId,
                                  int responseType, int serial, RIL_Errno e,
                                  void *response, size_t responseLen) {
-    RLOGD("radio::sendCDMAFeatureCodeResponse: serial %d", serial);
+#if VDBG
+    RLOGD("sendCDMAFeatureCodeResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -3929,17 +5086,19 @@ int radio::sendCDMAFeatureCodeResponse(android::Parcel &p, int slotId, int reque
                 = radioService[slotId]->mRadioResponse->sendCDMAFeatureCodeResponse(responseInfo);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::sendCDMAFeatureCodeResponse: radioService[%d]->mRadioResponse == NULL",
+        RLOGE("sendCDMAFeatureCodeResponse: radioService[%d]->mRadioResponse == NULL",
                 slotId);
     }
 
     return 0;
 }
 
-int radio::sendBurstDtmfResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::sendBurstDtmfResponse(int slotId,
                                  int responseType, int serial, RIL_Errno e,
                                  void *response, size_t responseLen) {
-    RLOGD("radio::sendBurstDtmfResponse: serial %d", serial);
+#if VDBG
+    RLOGD("sendBurstDtmfResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -3948,16 +5107,18 @@ int radio::sendBurstDtmfResponse(android::Parcel &p, int slotId, int requestNumb
                 = radioService[slotId]->mRadioResponse->sendBurstDtmfResponse(responseInfo);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::sendBurstDtmfResponse: radioService[%d]->mRadioResponse == NULL", slotId);
+        RLOGE("sendBurstDtmfResponse: radioService[%d]->mRadioResponse == NULL", slotId);
     }
 
     return 0;
 }
 
-int radio::sendCdmaSmsResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::sendCdmaSmsResponse(int slotId,
                               int responseType, int serial, RIL_Errno e, void *response,
                               size_t responseLen) {
-    RLOGD("radio::sendCdmaSmsResponse: serial %d", serial);
+#if VDBG
+    RLOGD("sendCdmaSmsResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -3968,16 +5129,18 @@ int radio::sendCdmaSmsResponse(android::Parcel &p, int slotId, int requestNumber
                 = radioService[slotId]->mRadioResponse->sendCdmaSmsResponse(responseInfo, result);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::sendCdmaSmsResponse: radioService[%d]->mRadioResponse == NULL", slotId);
+        RLOGE("sendCdmaSmsResponse: radioService[%d]->mRadioResponse == NULL", slotId);
     }
 
     return 0;
 }
 
-int radio::acknowledgeLastIncomingCdmaSmsResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::acknowledgeLastIncomingCdmaSmsResponse(int slotId,
                                                  int responseType, int serial, RIL_Errno e,
                                                  void *response, size_t responseLen) {
-    RLOGD("radio::acknowledgeLastIncomingCdmaSmsResponse: serial %d", serial);
+#if VDBG
+    RLOGD("acknowledgeLastIncomingCdmaSmsResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -3987,17 +5150,19 @@ int radio::acknowledgeLastIncomingCdmaSmsResponse(android::Parcel &p, int slotId
                 responseInfo);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::acknowledgeLastIncomingCdmaSmsResponse: radioService[%d]->mRadioResponse "
+        RLOGE("acknowledgeLastIncomingCdmaSmsResponse: radioService[%d]->mRadioResponse "
                 "== NULL", slotId);
     }
 
     return 0;
 }
 
-int radio::getGsmBroadcastConfigResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::getGsmBroadcastConfigResponse(int slotId,
                                         int responseType, int serial, RIL_Errno e,
                                         void *response, size_t responseLen) {
-    RLOGD("radio::getGsmBroadcastConfigResponse: serial %d", serial);
+#if VDBG
+    RLOGD("getGsmBroadcastConfigResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -4005,7 +5170,7 @@ int radio::getGsmBroadcastConfigResponse(android::Parcel &p, int slotId, int req
         hidl_vec<GsmBroadcastSmsConfigInfo> configs;
 
         if (response == NULL || responseLen % sizeof(RIL_GSM_BroadcastSmsConfigInfo *) != 0) {
-            RLOGE("radio::getGsmBroadcastConfigResponse Invalid response: NULL");
+            RLOGE("getGsmBroadcastConfigResponse Invalid response: NULL");
             if (e == RIL_E_SUCCESS) responseInfo.error = RadioError::INVALID_RESPONSE;
         } else {
             int num = responseLen / sizeof(RIL_GSM_BroadcastSmsConfigInfo *);
@@ -4026,17 +5191,19 @@ int radio::getGsmBroadcastConfigResponse(android::Parcel &p, int slotId, int req
                 configs);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::getGsmBroadcastConfigResponse: radioService[%d]->mRadioResponse == NULL",
+        RLOGE("getGsmBroadcastConfigResponse: radioService[%d]->mRadioResponse == NULL",
                 slotId);
     }
 
     return 0;
 }
 
-int radio::setGsmBroadcastConfigResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::setGsmBroadcastConfigResponse(int slotId,
                                         int responseType, int serial, RIL_Errno e,
                                         void *response, size_t responseLen) {
-    RLOGD("radio::setGsmBroadcastConfigResponse: serial %d", serial);
+#if VDBG
+    RLOGD("setGsmBroadcastConfigResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -4045,17 +5212,19 @@ int radio::setGsmBroadcastConfigResponse(android::Parcel &p, int slotId, int req
                 = radioService[slotId]->mRadioResponse->setGsmBroadcastConfigResponse(responseInfo);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::setGsmBroadcastConfigResponse: radioService[%d]->mRadioResponse == NULL",
+        RLOGE("setGsmBroadcastConfigResponse: radioService[%d]->mRadioResponse == NULL",
                 slotId);
     }
 
     return 0;
 }
 
-int radio::setGsmBroadcastActivationResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::setGsmBroadcastActivationResponse(int slotId,
                                             int responseType, int serial, RIL_Errno e,
                                             void *response, size_t responseLen) {
-    RLOGD("radio::setGsmBroadcastActivationResponse: serial %d", serial);
+#if VDBG
+    RLOGD("setGsmBroadcastActivationResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -4065,17 +5234,19 @@ int radio::setGsmBroadcastActivationResponse(android::Parcel &p, int slotId, int
                 responseInfo);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::setGsmBroadcastActivationResponse: radioService[%d]->mRadioResponse == NULL",
+        RLOGE("setGsmBroadcastActivationResponse: radioService[%d]->mRadioResponse == NULL",
                 slotId);
     }
 
     return 0;
 }
 
-int radio::getCdmaBroadcastConfigResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::getCdmaBroadcastConfigResponse(int slotId,
                                          int responseType, int serial, RIL_Errno e,
                                          void *response, size_t responseLen) {
-    RLOGD("radio::getCdmaBroadcastConfigResponse: serial %d", serial);
+#if VDBG
+    RLOGD("getCdmaBroadcastConfigResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -4083,7 +5254,7 @@ int radio::getCdmaBroadcastConfigResponse(android::Parcel &p, int slotId, int re
         hidl_vec<CdmaBroadcastSmsConfigInfo> configs;
 
         if (response == NULL || responseLen % sizeof(RIL_CDMA_BroadcastSmsConfigInfo *) != 0) {
-            RLOGE("radio::getCdmaBroadcastConfigResponse Invalid response: NULL");
+            RLOGE("getCdmaBroadcastConfigResponse Invalid response: NULL");
             if (e == RIL_E_SUCCESS) responseInfo.error = RadioError::INVALID_RESPONSE;
         } else {
             int num = responseLen / sizeof(RIL_CDMA_BroadcastSmsConfigInfo *);
@@ -4102,17 +5273,19 @@ int radio::getCdmaBroadcastConfigResponse(android::Parcel &p, int slotId, int re
                 configs);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::getCdmaBroadcastConfigResponse: radioService[%d]->mRadioResponse == NULL",
+        RLOGE("getCdmaBroadcastConfigResponse: radioService[%d]->mRadioResponse == NULL",
                 slotId);
     }
 
     return 0;
 }
 
-int radio::setCdmaBroadcastConfigResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::setCdmaBroadcastConfigResponse(int slotId,
                                          int responseType, int serial, RIL_Errno e,
                                          void *response, size_t responseLen) {
-    RLOGD("radio::setCdmaBroadcastConfigResponse: serial %d", serial);
+#if VDBG
+    RLOGD("setCdmaBroadcastConfigResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -4122,17 +5295,19 @@ int radio::setCdmaBroadcastConfigResponse(android::Parcel &p, int slotId, int re
                 responseInfo);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::setCdmaBroadcastConfigResponse: radioService[%d]->mRadioResponse == NULL",
+        RLOGE("setCdmaBroadcastConfigResponse: radioService[%d]->mRadioResponse == NULL",
                 slotId);
     }
 
     return 0;
 }
 
-int radio::setCdmaBroadcastActivationResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::setCdmaBroadcastActivationResponse(int slotId,
                                              int responseType, int serial, RIL_Errno e,
                                              void *response, size_t responseLen) {
-    RLOGD("radio::setCdmaBroadcastActivationResponse: serial %d", serial);
+#if VDBG
+    RLOGD("setCdmaBroadcastActivationResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -4142,17 +5317,19 @@ int radio::setCdmaBroadcastActivationResponse(android::Parcel &p, int slotId, in
                 responseInfo);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::setCdmaBroadcastActivationResponse: radioService[%d]->mRadioResponse == NULL",
+        RLOGE("setCdmaBroadcastActivationResponse: radioService[%d]->mRadioResponse == NULL",
                 slotId);
     }
 
     return 0;
 }
 
-int radio::getCDMASubscriptionResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::getCDMASubscriptionResponse(int slotId,
                                       int responseType, int serial, RIL_Errno e, void *response,
                                       size_t responseLen) {
-    RLOGD("radio::getCDMASubscriptionResponse: serial %d", serial);
+#if VDBG
+    RLOGD("getCDMASubscriptionResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -4161,7 +5338,7 @@ int radio::getCDMASubscriptionResponse(android::Parcel &p, int slotId, int reque
         int numStrings = responseLen / sizeof(char *);
         hidl_string emptyString;
         if (response == NULL || numStrings != 5) {
-            RLOGE("radio::getOperatorResponse Invalid response: NULL");
+            RLOGE("getOperatorResponse Invalid response: NULL");
             if (e == RIL_E_SUCCESS) responseInfo.error = RadioError::INVALID_RESPONSE;
             Return<void> retStatus
                     = radioService[slotId]->mRadioResponse->getCDMASubscriptionResponse(
@@ -4180,17 +5357,19 @@ int radio::getCDMASubscriptionResponse(android::Parcel &p, int slotId, int reque
             radioService[slotId]->checkReturnStatus(retStatus);
         }
     } else {
-        RLOGE("radio::getCDMASubscriptionResponse: radioService[%d]->mRadioResponse == NULL",
+        RLOGE("getCDMASubscriptionResponse: radioService[%d]->mRadioResponse == NULL",
                 slotId);
     }
 
     return 0;
 }
 
-int radio::writeSmsToRuimResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::writeSmsToRuimResponse(int slotId,
                                  int responseType, int serial, RIL_Errno e,
                                  void *response, size_t responseLen) {
-    RLOGD("radio::writeSmsToRuimResponse: serial %d", serial);
+#if VDBG
+    RLOGD("writeSmsToRuimResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -4199,16 +5378,18 @@ int radio::writeSmsToRuimResponse(android::Parcel &p, int slotId, int requestNum
                 = radioService[slotId]->mRadioResponse->writeSmsToRuimResponse(responseInfo, ret);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::writeSmsToRuimResponse: radioService[%d]->mRadioResponse == NULL", slotId);
+        RLOGE("writeSmsToRuimResponse: radioService[%d]->mRadioResponse == NULL", slotId);
     }
 
     return 0;
 }
 
-int radio::deleteSmsOnRuimResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::deleteSmsOnRuimResponse(int slotId,
                                   int responseType, int serial, RIL_Errno e,
                                   void *response, size_t responseLen) {
-    RLOGD("radio::deleteSmsOnRuimResponse: serial %d", serial);
+#if VDBG
+    RLOGD("deleteSmsOnRuimResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -4217,16 +5398,18 @@ int radio::deleteSmsOnRuimResponse(android::Parcel &p, int slotId, int requestNu
                 = radioService[slotId]->mRadioResponse->deleteSmsOnRuimResponse(responseInfo);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::deleteSmsOnRuimResponse: radioService[%d]->mRadioResponse == NULL", slotId);
+        RLOGE("deleteSmsOnRuimResponse: radioService[%d]->mRadioResponse == NULL", slotId);
     }
 
     return 0;
 }
 
-int radio::getDeviceIdentityResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::getDeviceIdentityResponse(int slotId,
                                     int responseType, int serial, RIL_Errno e, void *response,
                                     size_t responseLen) {
-    RLOGD("radio::getDeviceIdentityResponse: serial %d", serial);
+#if VDBG
+    RLOGD("getDeviceIdentityResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -4235,7 +5418,7 @@ int radio::getDeviceIdentityResponse(android::Parcel &p, int slotId, int request
         int numStrings = responseLen / sizeof(char *);
         hidl_string emptyString;
         if (response == NULL || numStrings != 4) {
-            RLOGE("radio::getDeviceIdentityResponse Invalid response: NULL");
+            RLOGE("getDeviceIdentityResponse Invalid response: NULL");
             if (e == RIL_E_SUCCESS) responseInfo.error = RadioError::INVALID_RESPONSE;
             Return<void> retStatus
                     = radioService[slotId]->mRadioResponse->getDeviceIdentityResponse(responseInfo,
@@ -4252,17 +5435,19 @@ int radio::getDeviceIdentityResponse(android::Parcel &p, int slotId, int request
             radioService[slotId]->checkReturnStatus(retStatus);
         }
     } else {
-        RLOGE("radio::getDeviceIdentityResponse: radioService[%d]->mRadioResponse == NULL",
+        RLOGE("getDeviceIdentityResponse: radioService[%d]->mRadioResponse == NULL",
                 slotId);
     }
 
     return 0;
 }
 
-int radio::exitEmergencyCallbackModeResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::exitEmergencyCallbackModeResponse(int slotId,
                                             int responseType, int serial, RIL_Errno e,
                                             void *response, size_t responseLen) {
-    RLOGD("radio::exitEmergencyCallbackModeResponse: serial %d", serial);
+#if VDBG
+    RLOGD("exitEmergencyCallbackModeResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -4272,17 +5457,19 @@ int radio::exitEmergencyCallbackModeResponse(android::Parcel &p, int slotId, int
                 responseInfo);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::exitEmergencyCallbackModeResponse: radioService[%d]->mRadioResponse == NULL",
+        RLOGE("exitEmergencyCallbackModeResponse: radioService[%d]->mRadioResponse == NULL",
                 slotId);
     }
 
     return 0;
 }
 
-int radio::getSmscAddressResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::getSmscAddressResponse(int slotId,
                                   int responseType, int serial, RIL_Errno e,
                                   void *response, size_t responseLen) {
-    RLOGD("radio::getSmscAddressResponse: serial %d", serial);
+#if VDBG
+    RLOGD("getSmscAddressResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -4292,16 +5479,18 @@ int radio::getSmscAddressResponse(android::Parcel &p, int slotId, int requestNum
                 convertCharPtrToHidlString((char *) response));
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::getSmscAddressResponse: radioService[%d]->mRadioResponse == NULL", slotId);
+        RLOGE("getSmscAddressResponse: radioService[%d]->mRadioResponse == NULL", slotId);
     }
 
     return 0;
 }
 
-int radio::setSmscAddressResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::setSmscAddressResponse(int slotId,
                                              int responseType, int serial, RIL_Errno e,
                                              void *response, size_t responseLen) {
-    RLOGD("radio::setSmscAddressResponse: serial %d", serial);
+#if VDBG
+    RLOGD("setSmscAddressResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -4310,16 +5499,18 @@ int radio::setSmscAddressResponse(android::Parcel &p, int slotId, int requestNum
                 = radioService[slotId]->mRadioResponse->setSmscAddressResponse(responseInfo);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::setSmscAddressResponse: radioService[%d]->mRadioResponse == NULL", slotId);
+        RLOGE("setSmscAddressResponse: radioService[%d]->mRadioResponse == NULL", slotId);
     }
 
     return 0;
 }
 
-int radio::reportSmsMemoryStatusResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::reportSmsMemoryStatusResponse(int slotId,
                                         int responseType, int serial, RIL_Errno e,
                                         void *response, size_t responseLen) {
-    RLOGD("radio::reportSmsMemoryStatusResponse: serial %d", serial);
+#if VDBG
+    RLOGD("reportSmsMemoryStatusResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -4328,17 +5519,19 @@ int radio::reportSmsMemoryStatusResponse(android::Parcel &p, int slotId, int req
                 = radioService[slotId]->mRadioResponse->reportSmsMemoryStatusResponse(responseInfo);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::reportSmsMemoryStatusResponse: radioService[%d]->mRadioResponse == NULL",
+        RLOGE("reportSmsMemoryStatusResponse: radioService[%d]->mRadioResponse == NULL",
                 slotId);
     }
 
     return 0;
 }
 
-int radio::reportStkServiceIsRunningResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::reportStkServiceIsRunningResponse(int slotId,
                                              int responseType, int serial, RIL_Errno e,
                                              void *response, size_t responseLen) {
-    RLOGD("radio::reportStkServiceIsRunningResponse: serial %d", serial);
+#if VDBG
+    RLOGD("reportStkServiceIsRunningResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -4347,17 +5540,19 @@ int radio::reportStkServiceIsRunningResponse(android::Parcel &p, int slotId, int
                 reportStkServiceIsRunningResponse(responseInfo);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::reportStkServiceIsRunningResponse: radioService[%d]->mRadioResponse == NULL",
+        RLOGE("reportStkServiceIsRunningResponse: radioService[%d]->mRadioResponse == NULL",
                 slotId);
     }
 
     return 0;
 }
 
-int radio::getCdmaSubscriptionSourceResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::getCdmaSubscriptionSourceResponse(int slotId,
                                             int responseType, int serial, RIL_Errno e,
                                             void *response, size_t responseLen) {
-    RLOGD("radio::getCdmaSubscriptionSourceResponse: serial %d", serial);
+#if VDBG
+    RLOGD("getCdmaSubscriptionSourceResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -4367,17 +5562,19 @@ int radio::getCdmaSubscriptionSourceResponse(android::Parcel &p, int slotId, int
                 responseInfo, (CdmaSubscriptionSource) ret);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::getCdmaSubscriptionSourceResponse: radioService[%d]->mRadioResponse == NULL",
+        RLOGE("getCdmaSubscriptionSourceResponse: radioService[%d]->mRadioResponse == NULL",
                 slotId);
     }
 
     return 0;
 }
 
-int radio::requestIsimAuthenticationResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::requestIsimAuthenticationResponse(int slotId,
                                             int responseType, int serial, RIL_Errno e,
                                             void *response, size_t responseLen) {
-    RLOGD("radio::requestIsimAuthenticationResponse: serial %d", serial);
+#if VDBG
+    RLOGD("requestIsimAuthenticationResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -4388,18 +5585,20 @@ int radio::requestIsimAuthenticationResponse(android::Parcel &p, int slotId, int
                 convertCharPtrToHidlString((char *) response));
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::requestIsimAuthenticationResponse: radioService[%d]->mRadioResponse == NULL",
+        RLOGE("requestIsimAuthenticationResponse: radioService[%d]->mRadioResponse == NULL",
                 slotId);
     }
 
     return 0;
 }
 
-int radio::acknowledgeIncomingGsmSmsWithPduResponse(android::Parcel &p, int slotId,
-                                                   int requestNumber, int responseType,
+int radio::acknowledgeIncomingGsmSmsWithPduResponse(int slotId,
+                                                   int responseType,
                                                    int serial, RIL_Errno e, void *response,
                                                    size_t responseLen) {
-    RLOGD("radio::acknowledgeIncomingGsmSmsWithPduResponse: serial %d", serial);
+#if VDBG
+    RLOGD("acknowledgeIncomingGsmSmsWithPduResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -4409,17 +5608,19 @@ int radio::acknowledgeIncomingGsmSmsWithPduResponse(android::Parcel &p, int slot
                 responseInfo);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::acknowledgeIncomingGsmSmsWithPduResponse: radioService[%d]->mRadioResponse "
+        RLOGE("acknowledgeIncomingGsmSmsWithPduResponse: radioService[%d]->mRadioResponse "
                 "== NULL", slotId);
     }
 
     return 0;
 }
 
-int radio::sendEnvelopeWithStatusResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::sendEnvelopeWithStatusResponse(int slotId,
                                          int responseType, int serial, RIL_Errno e, void *response,
                                          size_t responseLen) {
-    RLOGD("radio::sendEnvelopeWithStatusResponse: serial %d", serial);
+#if VDBG
+    RLOGD("sendEnvelopeWithStatusResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -4431,17 +5632,19 @@ int radio::sendEnvelopeWithStatusResponse(android::Parcel &p, int slotId, int re
                 result);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::sendEnvelopeWithStatusResponse: radioService[%d]->mRadioResponse == NULL",
+        RLOGE("sendEnvelopeWithStatusResponse: radioService[%d]->mRadioResponse == NULL",
                 slotId);
     }
 
     return 0;
 }
 
-int radio::getVoiceRadioTechnologyResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::getVoiceRadioTechnologyResponse(int slotId,
                                           int responseType, int serial, RIL_Errno e,
                                           void *response, size_t responseLen) {
-    RLOGD("radio::getVoiceRadioTechnologyResponse: serial %d", serial);
+#if VDBG
+    RLOGD("getVoiceRadioTechnologyResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -4451,18 +5654,20 @@ int radio::getVoiceRadioTechnologyResponse(android::Parcel &p, int slotId, int r
                 responseInfo, (RadioTechnology) ret);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::getVoiceRadioTechnologyResponse: radioService[%d]->mRadioResponse == NULL",
+        RLOGE("getVoiceRadioTechnologyResponse: radioService[%d]->mRadioResponse == NULL",
                 slotId);
     }
 
     return 0;
 }
 
-int radio::getCellInfoListResponse(android::Parcel &p, int slotId,
-                                   int requestNumber, int responseType,
+int radio::getCellInfoListResponse(int slotId,
+                                   int responseType,
                                    int serial, RIL_Errno e, void *response,
                                    size_t responseLen) {
-    RLOGD("radio::getCellInfoListResponse: serial %d", serial);
+#if VDBG
+    RLOGD("getCellInfoListResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -4470,7 +5675,7 @@ int radio::getCellInfoListResponse(android::Parcel &p, int slotId,
 
         hidl_vec<CellInfo> ret;
         if (response == NULL || responseLen % sizeof(RIL_CellInfo_v12) != 0) {
-            RLOGE("radio::getCellInfoListResponse: Invalid response");
+            RLOGE("getCellInfoListResponse: Invalid response");
             if (e == RIL_E_SUCCESS) responseInfo.error = RadioError::INVALID_RESPONSE;
         } else {
             convertRilCellInfoListToHal(response, responseLen, ret);
@@ -4480,17 +5685,19 @@ int radio::getCellInfoListResponse(android::Parcel &p, int slotId,
                 responseInfo, ret);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::getCellInfoListResponse: radioService[%d]->mRadioResponse == NULL", slotId);
+        RLOGE("getCellInfoListResponse: radioService[%d]->mRadioResponse == NULL", slotId);
     }
 
     return 0;
 }
 
-int radio::setCellInfoListRateResponse(android::Parcel &p, int slotId,
-                                       int requestNumber, int responseType,
+int radio::setCellInfoListRateResponse(int slotId,
+                                       int responseType,
                                        int serial, RIL_Errno e, void *response,
                                        size_t responseLen) {
-    RLOGD("radio::setCellInfoListRateResponse: serial %d", serial);
+#if VDBG
+    RLOGD("setCellInfoListRateResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -4499,17 +5706,19 @@ int radio::setCellInfoListRateResponse(android::Parcel &p, int slotId,
                 = radioService[slotId]->mRadioResponse->setCellInfoListRateResponse(responseInfo);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::setCellInfoListRateResponse: radioService[%d]->mRadioResponse == NULL",
+        RLOGE("setCellInfoListRateResponse: radioService[%d]->mRadioResponse == NULL",
                 slotId);
     }
 
     return 0;
 }
 
-int radio::setInitialAttachApnResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::setInitialAttachApnResponse(int slotId,
                                        int responseType, int serial, RIL_Errno e,
                                        void *response, size_t responseLen) {
-    RLOGD("radio::setInitialAttachApnResponse: serial %d", serial);
+#if VDBG
+    RLOGD("setInitialAttachApnResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -4518,17 +5727,19 @@ int radio::setInitialAttachApnResponse(android::Parcel &p, int slotId, int reque
                 = radioService[slotId]->mRadioResponse->setInitialAttachApnResponse(responseInfo);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::setInitialAttachApnResponse: radioService[%d]->mRadioResponse == NULL",
+        RLOGE("setInitialAttachApnResponse: radioService[%d]->mRadioResponse == NULL",
                 slotId);
     }
 
     return 0;
 }
 
-int radio::getImsRegistrationStateResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::getImsRegistrationStateResponse(int slotId,
                                            int responseType, int serial, RIL_Errno e,
                                            void *response, size_t responseLen) {
-    RLOGD("radio::getImsRegistrationStateResponse: serial %d", serial);
+#if VDBG
+    RLOGD("getImsRegistrationStateResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -4537,7 +5748,7 @@ int radio::getImsRegistrationStateResponse(android::Parcel &p, int slotId, int r
         int ratFamily = 0;
         int numInts = responseLen / sizeof(int);
         if (response == NULL || numInts != 2) {
-            RLOGE("radio::getImsRegistrationStateResponse Invalid response: NULL");
+            RLOGE("getImsRegistrationStateResponse Invalid response: NULL");
             if (e == RIL_E_SUCCESS) responseInfo.error = RadioError::INVALID_RESPONSE;
         } else {
             int *pInt = (int *) response;
@@ -4549,17 +5760,19 @@ int radio::getImsRegistrationStateResponse(android::Parcel &p, int slotId, int r
                 responseInfo, isRegistered, (RadioTechnologyFamily) ratFamily);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::getImsRegistrationStateResponse: radioService[%d]->mRadioResponse == NULL",
+        RLOGE("getImsRegistrationStateResponse: radioService[%d]->mRadioResponse == NULL",
                 slotId);
     }
 
     return 0;
 }
 
-int radio::sendImsSmsResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::sendImsSmsResponse(int slotId,
                               int responseType, int serial, RIL_Errno e, void *response,
                               size_t responseLen) {
-    RLOGD("radio::sendImsSmsResponse: serial %d", serial);
+#if VDBG
+    RLOGD("sendImsSmsResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -4570,16 +5783,18 @@ int radio::sendImsSmsResponse(android::Parcel &p, int slotId, int requestNumber,
                 = radioService[slotId]->mRadioResponse->sendImsSmsResponse(responseInfo, result);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::sendSmsResponse: radioService[%d]->mRadioResponse == NULL", slotId);
+        RLOGE("sendSmsResponse: radioService[%d]->mRadioResponse == NULL", slotId);
     }
 
     return 0;
 }
 
-int radio::iccTransmitApduBasicChannelResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::iccTransmitApduBasicChannelResponse(int slotId,
                                                int responseType, int serial, RIL_Errno e,
                                                void *response, size_t responseLen) {
-    RLOGD("radio::iccTransmitApduBasicChannelResponse: serial %d", serial);
+#if VDBG
+    RLOGD("iccTransmitApduBasicChannelResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -4591,17 +5806,19 @@ int radio::iccTransmitApduBasicChannelResponse(android::Parcel &p, int slotId, i
                 responseInfo, result);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::iccTransmitApduBasicChannelResponse: radioService[%d]->mRadioResponse "
+        RLOGE("iccTransmitApduBasicChannelResponse: radioService[%d]->mRadioResponse "
                 "== NULL", slotId);
     }
 
     return 0;
 }
 
-int radio::iccOpenLogicalChannelResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::iccOpenLogicalChannelResponse(int slotId,
                                          int responseType, int serial, RIL_Errno e, void *response,
                                          size_t responseLen) {
-    RLOGD("radio::iccOpenLogicalChannelResponse: serial %d", serial);
+#if VDBG
+    RLOGD("iccOpenLogicalChannelResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -4610,7 +5827,7 @@ int radio::iccOpenLogicalChannelResponse(android::Parcel &p, int slotId, int req
         hidl_vec<int8_t> selectResponse;
         int numInts = responseLen / sizeof(int);
         if (response == NULL || responseLen % sizeof(int) != 0) {
-            RLOGE("radio::iccOpenLogicalChannelResponse Invalid response: NULL");
+            RLOGE("iccOpenLogicalChannelResponse Invalid response: NULL");
             if (e == RIL_E_SUCCESS) responseInfo.error = RadioError::INVALID_RESPONSE;
         } else {
             int *pInt = (int *) response;
@@ -4625,17 +5842,19 @@ int radio::iccOpenLogicalChannelResponse(android::Parcel &p, int slotId, int req
                 channelId, selectResponse);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::iccOpenLogicalChannelResponse: radioService[%d]->mRadioResponse == NULL",
+        RLOGE("iccOpenLogicalChannelResponse: radioService[%d]->mRadioResponse == NULL",
                 slotId);
     }
 
     return 0;
 }
 
-int radio::iccCloseLogicalChannelResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::iccCloseLogicalChannelResponse(int slotId,
                                           int responseType, int serial, RIL_Errno e,
                                           void *response, size_t responseLen) {
-    RLOGD("radio::iccCloseLogicalChannelResponse: serial %d", serial);
+#if VDBG
+    RLOGD("iccCloseLogicalChannelResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -4645,17 +5864,19 @@ int radio::iccCloseLogicalChannelResponse(android::Parcel &p, int slotId, int re
                 responseInfo);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::iccCloseLogicalChannelResponse: radioService[%d]->mRadioResponse == NULL",
+        RLOGE("iccCloseLogicalChannelResponse: radioService[%d]->mRadioResponse == NULL",
                 slotId);
     }
 
     return 0;
 }
 
-int radio::iccTransmitApduLogicalChannelResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::iccTransmitApduLogicalChannelResponse(int slotId,
                                                  int responseType, int serial, RIL_Errno e,
                                                  void *response, size_t responseLen) {
-    RLOGD("radio::iccTransmitApduLogicalChannelResponse: serial %d", serial);
+#if VDBG
+    RLOGD("iccTransmitApduLogicalChannelResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -4667,17 +5888,19 @@ int radio::iccTransmitApduLogicalChannelResponse(android::Parcel &p, int slotId,
                 responseInfo, result);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::iccTransmitApduLogicalChannelResponse: radioService[%d]->mRadioResponse "
+        RLOGE("iccTransmitApduLogicalChannelResponse: radioService[%d]->mRadioResponse "
                 "== NULL", slotId);
     }
 
     return 0;
 }
 
-int radio::nvReadItemResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::nvReadItemResponse(int slotId,
                               int responseType, int serial, RIL_Errno e,
                               void *response, size_t responseLen) {
-    RLOGD("radio::nvReadItemResponse: serial %d", serial);
+#if VDBG
+    RLOGD("nvReadItemResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -4687,16 +5910,18 @@ int radio::nvReadItemResponse(android::Parcel &p, int slotId, int requestNumber,
                 convertCharPtrToHidlString((char *) response));
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::nvReadItemResponse: radioService[%d]->mRadioResponse == NULL", slotId);
+        RLOGE("nvReadItemResponse: radioService[%d]->mRadioResponse == NULL", slotId);
     }
 
     return 0;
 }
 
-int radio::nvWriteItemResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::nvWriteItemResponse(int slotId,
                                int responseType, int serial, RIL_Errno e,
                                void *response, size_t responseLen) {
-    RLOGD("radio::nvWriteItemResponse: serial %d", serial);
+#if VDBG
+    RLOGD("nvWriteItemResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -4705,16 +5930,18 @@ int radio::nvWriteItemResponse(android::Parcel &p, int slotId, int requestNumber
                 = radioService[slotId]->mRadioResponse->nvWriteItemResponse(responseInfo);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::nvWriteItemResponse: radioService[%d]->mRadioResponse == NULL", slotId);
+        RLOGE("nvWriteItemResponse: radioService[%d]->mRadioResponse == NULL", slotId);
     }
 
     return 0;
 }
 
-int radio::nvWriteCdmaPrlResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::nvWriteCdmaPrlResponse(int slotId,
                                   int responseType, int serial, RIL_Errno e,
                                   void *response, size_t responseLen) {
-    RLOGD("radio::nvWriteCdmaPrlResponse: serial %d", serial);
+#if VDBG
+    RLOGD("nvWriteCdmaPrlResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -4723,16 +5950,18 @@ int radio::nvWriteCdmaPrlResponse(android::Parcel &p, int slotId, int requestNum
                 = radioService[slotId]->mRadioResponse->nvWriteCdmaPrlResponse(responseInfo);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::nvWriteCdmaPrlResponse: radioService[%d]->mRadioResponse == NULL", slotId);
+        RLOGE("nvWriteCdmaPrlResponse: radioService[%d]->mRadioResponse == NULL", slotId);
     }
 
     return 0;
 }
 
-int radio::nvResetConfigResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::nvResetConfigResponse(int slotId,
                                  int responseType, int serial, RIL_Errno e,
                                  void *response, size_t responseLen) {
-    RLOGD("radio::nvResetConfigResponse: serial %d", serial);
+#if VDBG
+    RLOGD("nvResetConfigResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -4741,16 +5970,18 @@ int radio::nvResetConfigResponse(android::Parcel &p, int slotId, int requestNumb
                 = radioService[slotId]->mRadioResponse->nvResetConfigResponse(responseInfo);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::nvResetConfigResponse: radioService[%d]->mRadioResponse == NULL", slotId);
+        RLOGE("nvResetConfigResponse: radioService[%d]->mRadioResponse == NULL", slotId);
     }
 
     return 0;
 }
 
-int radio::setUiccSubscriptionResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::setUiccSubscriptionResponse(int slotId,
                                        int responseType, int serial, RIL_Errno e,
                                        void *response, size_t responseLen) {
-    RLOGD("radio::setUiccSubscriptionResponse: serial %d", serial);
+#if VDBG
+    RLOGD("setUiccSubscriptionResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -4759,17 +5990,19 @@ int radio::setUiccSubscriptionResponse(android::Parcel &p, int slotId, int reque
                 = radioService[slotId]->mRadioResponse->setUiccSubscriptionResponse(responseInfo);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::setUiccSubscriptionResponse: radioService[%d]->mRadioResponse == NULL",
+        RLOGE("setUiccSubscriptionResponse: radioService[%d]->mRadioResponse == NULL",
                 slotId);
     }
 
     return 0;
 }
 
-int radio::setDataAllowedResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::setDataAllowedResponse(int slotId,
                                   int responseType, int serial, RIL_Errno e,
                                   void *response, size_t responseLen) {
-    RLOGD("radio::setDataAllowedResponse: serial %d", serial);
+#if VDBG
+    RLOGD("setDataAllowedResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -4778,16 +6011,18 @@ int radio::setDataAllowedResponse(android::Parcel &p, int slotId, int requestNum
                 = radioService[slotId]->mRadioResponse->setDataAllowedResponse(responseInfo);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::setDataAllowedResponse: radioService[%d]->mRadioResponse == NULL", slotId);
+        RLOGE("setDataAllowedResponse: radioService[%d]->mRadioResponse == NULL", slotId);
     }
 
     return 0;
 }
 
-int radio::getHardwareConfigResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::getHardwareConfigResponse(int slotId,
                                      int responseType, int serial, RIL_Errno e,
                                      void *response, size_t responseLen) {
-    RLOGD("radio::getHardwareConfigResponse: serial %d", serial);
+#if VDBG
+    RLOGD("getHardwareConfigResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -4795,7 +6030,7 @@ int radio::getHardwareConfigResponse(android::Parcel &p, int slotId, int request
 
         hidl_vec<HardwareConfig> result;
         if (response == NULL || responseLen % sizeof(RIL_HardwareConfig) != 0) {
-            RLOGE("radio::hardwareConfigChangedInd: invalid response");
+            RLOGE("hardwareConfigChangedInd: invalid response");
             if (e == RIL_E_SUCCESS) responseInfo.error = RadioError::INVALID_RESPONSE;
         } else {
             convertRilHardwareConfigListToHal(response, responseLen, result);
@@ -4805,16 +6040,18 @@ int radio::getHardwareConfigResponse(android::Parcel &p, int slotId, int request
                 responseInfo, result);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::getHardwareConfigResponse: radioService[%d]->mRadioResponse == NULL", slotId);
+        RLOGE("getHardwareConfigResponse: radioService[%d]->mRadioResponse == NULL", slotId);
     }
 
     return 0;
 }
 
-int radio::requestIccSimAuthenticationResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::requestIccSimAuthenticationResponse(int slotId,
                                                int responseType, int serial, RIL_Errno e,
                                                void *response, size_t responseLen) {
-    RLOGD("radio::requestIccSimAuthenticationResponse: serial %d", serial);
+#if VDBG
+    RLOGD("requestIccSimAuthenticationResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -4826,17 +6063,19 @@ int radio::requestIccSimAuthenticationResponse(android::Parcel &p, int slotId, i
                 responseInfo, result);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::requestIccSimAuthenticationResponse: radioService[%d]->mRadioResponse "
+        RLOGE("requestIccSimAuthenticationResponse: radioService[%d]->mRadioResponse "
                 "== NULL", slotId);
     }
 
     return 0;
 }
 
-int radio::setDataProfileResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::setDataProfileResponse(int slotId,
                                   int responseType, int serial, RIL_Errno e,
                                   void *response, size_t responseLen) {
-    RLOGD("radio::setDataProfileResponse: serial %d", serial);
+#if VDBG
+    RLOGD("setDataProfileResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -4845,16 +6084,18 @@ int radio::setDataProfileResponse(android::Parcel &p, int slotId, int requestNum
                 = radioService[slotId]->mRadioResponse->setDataProfileResponse(responseInfo);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::setDataProfileResponse: radioService[%d]->mRadioResponse == NULL", slotId);
+        RLOGE("setDataProfileResponse: radioService[%d]->mRadioResponse == NULL", slotId);
     }
 
     return 0;
 }
 
-int radio::requestShutdownResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::requestShutdownResponse(int slotId,
                                   int responseType, int serial, RIL_Errno e,
                                   void *response, size_t responseLen) {
-    RLOGD("radio::requestShutdownResponse: serial %d", serial);
+#if VDBG
+    RLOGD("requestShutdownResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -4863,7 +6104,7 @@ int radio::requestShutdownResponse(android::Parcel &p, int slotId, int requestNu
                 = radioService[slotId]->mRadioResponse->requestShutdownResponse(responseInfo);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::requestShutdownResponse: radioService[%d]->mRadioResponse == NULL", slotId);
+        RLOGE("requestShutdownResponse: radioService[%d]->mRadioResponse == NULL", slotId);
     }
 
     return 0;
@@ -4882,10 +6123,12 @@ void responseRadioCapability(RadioResponseInfo& responseInfo, int serial,
     }
 }
 
-int radio::getRadioCapabilityResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::getRadioCapabilityResponse(int slotId,
                                      int responseType, int serial, RIL_Errno e,
                                      void *response, size_t responseLen) {
-    RLOGD("radio::getRadioCapabilityResponse: serial %d", serial);
+#if VDBG
+    RLOGD("getRadioCapabilityResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -4896,16 +6139,18 @@ int radio::getRadioCapabilityResponse(android::Parcel &p, int slotId, int reques
                 responseInfo, result);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::getRadioCapabilityResponse: radioService[%d]->mRadioResponse == NULL", slotId);
+        RLOGE("getRadioCapabilityResponse: radioService[%d]->mRadioResponse == NULL", slotId);
     }
 
     return 0;
 }
 
-int radio::setRadioCapabilityResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::setRadioCapabilityResponse(int slotId,
                                      int responseType, int serial, RIL_Errno e,
                                      void *response, size_t responseLen) {
-    RLOGD("radio::setRadioCapabilityResponse: serial %d", serial);
+#if VDBG
+    RLOGD("setRadioCapabilityResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -4916,7 +6161,7 @@ int radio::setRadioCapabilityResponse(android::Parcel &p, int slotId, int reques
                 responseInfo, result);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::setRadioCapabilityResponse: radioService[%d]->mRadioResponse == NULL", slotId);
+        RLOGE("setRadioCapabilityResponse: radioService[%d]->mRadioResponse == NULL", slotId);
     }
 
     return 0;
@@ -4938,10 +6183,12 @@ LceStatusInfo responseLceStatusInfo(RadioResponseInfo& responseInfo, int serial,
     return result;
 }
 
-int radio::startLceServiceResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::startLceServiceResponse(int slotId,
                                    int responseType, int serial, RIL_Errno e,
                                    void *response, size_t responseLen) {
-    RLOGD("radio::startLceServiceResponse: serial %d", serial);
+#if VDBG
+    RLOGD("startLceServiceResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -4953,16 +6200,18 @@ int radio::startLceServiceResponse(android::Parcel &p, int slotId, int requestNu
                 result);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::startLceServiceResponse: radioService[%d]->mRadioResponse == NULL", slotId);
+        RLOGE("startLceServiceResponse: radioService[%d]->mRadioResponse == NULL", slotId);
     }
 
     return 0;
 }
 
-int radio::stopLceServiceResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::stopLceServiceResponse(int slotId,
                                   int responseType, int serial, RIL_Errno e,
                                   void *response, size_t responseLen) {
-    RLOGD("radio::stopLceServiceResponse: serial %d", serial);
+#if VDBG
+    RLOGD("stopLceServiceResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -4974,16 +6223,18 @@ int radio::stopLceServiceResponse(android::Parcel &p, int slotId, int requestNum
                 result);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::stopLceServiceResponse: radioService[%d]->mRadioResponse == NULL", slotId);
+        RLOGE("stopLceServiceResponse: radioService[%d]->mRadioResponse == NULL", slotId);
     }
 
     return 0;
 }
 
-int radio::pullLceDataResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::pullLceDataResponse(int slotId,
                                int responseType, int serial, RIL_Errno e,
                                void *response, size_t responseLen) {
-    RLOGD("radio::pullLceDataResponse: serial %d", serial);
+#if VDBG
+    RLOGD("pullLceDataResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -4991,7 +6242,7 @@ int radio::pullLceDataResponse(android::Parcel &p, int slotId, int requestNumber
 
         LceDataInfo result = {};
         if (response == NULL || responseLen != sizeof(RIL_LceDataInfo)) {
-            RLOGE("radio::pullLceDataResponse: Invalid response");
+            RLOGE("pullLceDataResponse: Invalid response");
             if (e == RIL_E_SUCCESS) responseInfo.error = RadioError::INVALID_RESPONSE;
         } else {
             convertRilLceDataInfoToHal(response, responseLen, result);
@@ -5001,23 +6252,25 @@ int radio::pullLceDataResponse(android::Parcel &p, int slotId, int requestNumber
                 responseInfo, result);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::pullLceDataResponse: radioService[%d]->mRadioResponse == NULL", slotId);
+        RLOGE("pullLceDataResponse: radioService[%d]->mRadioResponse == NULL", slotId);
     }
 
     return 0;
 }
 
-int radio::getModemActivityInfoResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::getModemActivityInfoResponse(int slotId,
                                         int responseType, int serial, RIL_Errno e,
                                         void *response, size_t responseLen) {
-    RLOGD("radio::getModemActivityInfoResponse: serial %d", serial);
+#if VDBG
+    RLOGD("getModemActivityInfoResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
         populateResponseInfo(responseInfo, serial, responseType, e);
         ActivityStatsInfo info;
         if (response == NULL || responseLen != sizeof(RIL_ActivityStatsInfo)) {
-            RLOGE("radio::getModemActivityInfoResponse Invalid response: NULL");
+            RLOGE("getModemActivityInfoResponse Invalid response: NULL");
             if (e == RIL_E_SUCCESS) responseInfo.error = RadioError::INVALID_RESPONSE;
         } else {
             RIL_ActivityStatsInfo *resp = (RIL_ActivityStatsInfo *)response;
@@ -5034,17 +6287,19 @@ int radio::getModemActivityInfoResponse(android::Parcel &p, int slotId, int requ
                 info);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::getModemActivityInfoResponse: radioService[%d]->mRadioResponse == NULL",
+        RLOGE("getModemActivityInfoResponse: radioService[%d]->mRadioResponse == NULL",
                 slotId);
     }
 
     return 0;
 }
 
-int radio::setAllowedCarriersResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::setAllowedCarriersResponse(int slotId,
                                       int responseType, int serial, RIL_Errno e,
                                       void *response, size_t responseLen) {
-    RLOGD("radio::setAllowedCarriersResponse: serial %d", serial);
+#if VDBG
+    RLOGD("setAllowedCarriersResponse: serial %d", serial);
+#endif
 
     if (radioService[slotId]->mRadioResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -5054,25 +6309,33 @@ int radio::setAllowedCarriersResponse(android::Parcel &p, int slotId, int reques
                 ret);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::setAllowedCarriersResponse: radioService[%d]->mRadioResponse == NULL",
+        RLOGE("setAllowedCarriersResponse: radioService[%d]->mRadioResponse == NULL",
                 slotId);
     }
 
     return 0;
 }
 
-int radio::getAllowedCarriersResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::getAllowedCarriersResponse(int slotId,
                                       int responseType, int serial, RIL_Errno e,
                                       void *response, size_t responseLen) {
-    RLOGD("radio::getAllowedCarriersResponse: serial %d", serial);
+#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("radio::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;
@@ -5106,35 +6369,170 @@ int radio::getAllowedCarriersResponse(android::Parcel &p, int slotId, int reques
                 allAllowed, carrierInfo);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::getAllowedCarriersResponse: radioService[%d]->mRadioResponse == NULL",
+        RLOGE("getAllowedCarriersResponse: radioService[%d]->mRadioResponse == NULL",
                 slotId);
     }
 
     return 0;
 }
 
-int radio::setSimCardPowerResponse(android::Parcel &p, int slotId, int requestNumber,
-                                   int responseType, int serial, RIL_Errno e,
-                                   void *response, size_t responseLen) {
-    RLOGD("radio::setSimCardPowerResponse: serial %d", serial);
+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 = {};
+        populateResponseInfo(responseInfo, serial, responseType, e);
+        Return<void> retStatus
+                = radioService[slotId]->mRadioResponse->sendDeviceStateResponse(responseInfo);
+        radioService[slotId]->checkReturnStatus(retStatus);
+    } else {
+        RLOGE("sendDeviceStateResponse: radioService[%d]->mRadioResponse == NULL", slotId);
+    }
+
+    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 = {};
         populateResponseInfo(responseInfo, serial, responseType, e);
         Return<void> retStatus
-                = radioService[slotId]->mRadioResponse->setSimCardPowerResponse(responseInfo);
+                = radioService[slotId]->mRadioResponse->setIndicationFilterResponse(responseInfo);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::setSimCardPowerResponse: radioService[%d]->mRadioResponse == NULL", slotId);
+        RLOGE("setIndicationFilterResponse: radioService[%d]->mRadioResponse == NULL",
+                slotId);
+    }
+
+    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<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("stopNetworkScanResponse: radioService[%d]->mRadioResponse == NULL", slotId);
     }
 
     return 0;
 }
 
-int radio::sendRequestRawResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::sendRequestRawResponse(int slotId,
                                   int responseType, int serial, RIL_Errno e,
                                   void *response, size_t responseLen) {
-   RLOGD("radio::sendRequestRawResponse: serial %d", serial);
+#if VDBG
+   RLOGD("sendRequestRawResponse: serial %d", serial);
+#endif
 
     if (oemHookService[slotId]->mOemHookResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -5142,26 +6540,28 @@ int radio::sendRequestRawResponse(android::Parcel &p, int slotId, int requestNum
         hidl_vec<uint8_t> data;
 
         if (response == NULL) {
-            RLOGE("radio::sendRequestRawResponse: Invalid response");
+            RLOGE("sendRequestRawResponse: Invalid response");
             if (e == RIL_E_SUCCESS) responseInfo.error = RadioError::INVALID_RESPONSE;
         } else {
             data.setToExternal((uint8_t *) response, responseLen);
         }
         Return<void> retStatus = oemHookService[slotId]->mOemHookResponse->
                 sendRequestRawResponse(responseInfo, data);
-        checkReturnStatus(slotId, retStatus);
+        checkReturnStatus(slotId, retStatus, false);
     } else {
-        RLOGE("radio::sendRequestRawResponse: oemHookService[%d]->mOemHookResponse == NULL",
+        RLOGE("sendRequestRawResponse: oemHookService[%d]->mOemHookResponse == NULL",
                 slotId);
     }
 
     return 0;
 }
 
-int radio::sendRequestStringsResponse(android::Parcel &p, int slotId, int requestNumber,
+int radio::sendRequestStringsResponse(int slotId,
                                       int responseType, int serial, RIL_Errno e,
                                       void *response, size_t responseLen) {
-    RLOGD("radio::sendRequestStringsResponse: serial %d", serial);
+#if VDBG
+    RLOGD("sendRequestStringsResponse: serial %d", serial);
+#endif
 
     if (oemHookService[slotId]->mOemHookResponse != NULL) {
         RadioResponseInfo responseInfo = {};
@@ -5169,7 +6569,7 @@ int radio::sendRequestStringsResponse(android::Parcel &p, int slotId, int reques
         hidl_vec<hidl_string> data;
 
         if (response == NULL || responseLen % sizeof(char *) != 0) {
-            RLOGE("radio::sendRequestStringsResponse Invalid response: NULL");
+            RLOGE("sendRequestStringsResponse Invalid response: NULL");
             if (e == RIL_E_SUCCESS) responseInfo.error = RadioError::INVALID_RESPONSE;
         } else {
             char **resp = (char **) response;
@@ -5182,9 +6582,9 @@ int radio::sendRequestStringsResponse(android::Parcel &p, int slotId, int reques
         Return<void> retStatus
                 = oemHookService[slotId]->mOemHookResponse->sendRequestStringsResponse(
                 responseInfo, data);
-        checkReturnStatus(slotId, retStatus);
+        checkReturnStatus(slotId, retStatus, false);
     } else {
-        RLOGE("radio::sendRequestStringsResponse: oemHookService[%d]->mOemHookResponse == "
+        RLOGE("sendRequestStringsResponse: oemHookService[%d]->mOemHookResponse == "
                 "NULL", slotId);
     }
 
@@ -5198,42 +6598,51 @@ RadioIndicationType convertIntToRadioIndicationType(int indicationType) {
             (RadioIndicationType::UNSOLICITED_ACK_EXP);
 }
 
-void radio::radioStateChangedInd(int slotId, int indicationType, RIL_RadioState radioState) {
+int radio::radioStateChangedInd(int slotId,
+                                 int indicationType, int token, RIL_Errno e, void *response,
+                                 size_t responseLen) {
     if (radioService[slotId] != NULL && radioService[slotId]->mRadioIndication != NULL) {
-        RLOGD("radio::radioStateChangedInd: radioState %d", radioState);
+        RadioState radioState = (RadioState) s_vendorFunctions->onStateRequest();
+        RLOGD("radioStateChangedInd: radioState %d", radioState);
         Return<void> retStatus = radioService[slotId]->mRadioIndication->radioStateChanged(
-                convertIntToRadioIndicationType(indicationType), (RadioState) radioState);
+                convertIntToRadioIndicationType(indicationType), radioState);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::radioStateChangedInd: radioService[%d]->mRadioIndication == NULL", slotId);
+        RLOGE("radioStateChangedInd: radioService[%d]->mRadioIndication == NULL", slotId);
     }
+
+    return 0;
 }
 
-int radio::callStateChangedInd(android::Parcel &p, int slotId, int requestNumber,
+int radio::callStateChangedInd(int slotId,
                                int indicationType, int token, RIL_Errno e, void *response,
                                size_t responseLen) {
     if (radioService[slotId] != NULL && radioService[slotId]->mRadioIndication != NULL) {
-        RLOGD("radio::callStateChangedInd");
+#if VDBG
+        RLOGD("callStateChangedInd");
+#endif
         Return<void> retStatus = radioService[slotId]->mRadioIndication->callStateChanged(
                 convertIntToRadioIndicationType(indicationType));
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::callStateChangedInd: radioService[%d]->mRadioIndication == NULL", slotId);
+        RLOGE("callStateChangedInd: radioService[%d]->mRadioIndication == NULL", slotId);
     }
 
     return 0;
 }
 
-int radio::networkStateChangedInd(android::Parcel &p, int slotId, int requestNumber,
-                                       int indicationType, int token, RIL_Errno e, void *response,
-                                       size_t responseLen) {
+int radio::networkStateChangedInd(int slotId,
+                                  int indicationType, int token, RIL_Errno e, void *response,
+                                  size_t responseLen) {
     if (radioService[slotId] != NULL && radioService[slotId]->mRadioIndication != NULL) {
-        RLOGD("radio::networkStateChangedInd");
+#if VDBG
+        RLOGD("networkStateChangedInd");
+#endif
         Return<void> retStatus = radioService[slotId]->mRadioIndication->networkStateChanged(
                 convertIntToRadioIndicationType(indicationType));
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::networkStateChangedInd: radioService[%d]->mRadioIndication == NULL",
+        RLOGE("networkStateChangedInd: radioService[%d]->mRadioIndication == NULL",
                 slotId);
     }
 
@@ -5276,121 +6685,131 @@ uint8_t * convertHexStringToBytes(void *response, size_t responseLen) {
     return bytes;
 }
 
-int radio::newSmsInd(android::Parcel &p, int slotId, int requestNumber, int indicationType,
+int radio::newSmsInd(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("radio::newSmsInd: invalid response");
+            RLOGE("newSmsInd: invalid response");
             return 0;
         }
 
         uint8_t *bytes = convertHexStringToBytes(response, responseLen);
         if (bytes == NULL) {
-            RLOGE("radio::newSmsInd: convertHexStringToBytes failed");
+            RLOGE("newSmsInd: convertHexStringToBytes failed");
             return 0;
         }
 
         hidl_vec<uint8_t> pdu;
         pdu.setToExternal(bytes, responseLen/2);
-        RLOGD("radio::newSmsInd");
+#if VDBG
+        RLOGD("newSmsInd");
+#endif
         Return<void> retStatus = radioService[slotId]->mRadioIndication->newSms(
                 convertIntToRadioIndicationType(indicationType), pdu);
         radioService[slotId]->checkReturnStatus(retStatus);
         free(bytes);
     } else {
-        RLOGE("radio::newSmsInd: radioService[%d]->mRadioIndication == NULL", slotId);
+        RLOGE("newSmsInd: radioService[%d]->mRadioIndication == NULL", slotId);
     }
 
     return 0;
 }
 
-int radio::newSmsStatusReportInd(android::Parcel &p, int slotId, int requestNumber,
+int radio::newSmsStatusReportInd(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("radio::newSmsStatusReportInd: invalid response");
+            RLOGE("newSmsStatusReportInd: invalid response");
             return 0;
         }
 
         uint8_t *bytes = convertHexStringToBytes(response, responseLen);
         if (bytes == NULL) {
-            RLOGE("radio::newSmsStatusReportInd: convertHexStringToBytes failed");
+            RLOGE("newSmsStatusReportInd: convertHexStringToBytes failed");
             return 0;
         }
 
         hidl_vec<uint8_t> pdu;
         pdu.setToExternal(bytes, responseLen/2);
-        RLOGD("radio::newSmsStatusReportInd");
+#if VDBG
+        RLOGD("newSmsStatusReportInd");
+#endif
         Return<void> retStatus = radioService[slotId]->mRadioIndication->newSmsStatusReport(
                 convertIntToRadioIndicationType(indicationType), pdu);
         radioService[slotId]->checkReturnStatus(retStatus);
         free(bytes);
     } else {
-        RLOGE("radio::newSmsStatusReportInd: radioService[%d]->mRadioIndication == NULL", slotId);
+        RLOGE("newSmsStatusReportInd: radioService[%d]->mRadioIndication == NULL", slotId);
     }
 
     return 0;
 }
 
-int radio::newSmsOnSimInd(android::Parcel &p, int slotId, int requestNumber, int indicationType,
+int radio::newSmsOnSimInd(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 != sizeof(int)) {
-            RLOGE("radio::newSmsOnSimInd: invalid response");
+            RLOGE("newSmsOnSimInd: invalid response");
             return 0;
         }
         int32_t recordNumber = ((int32_t *) response)[0];
-        RLOGD("radio::newSmsOnSimInd: slotIndex %d", recordNumber);
+#if VDBG
+        RLOGD("newSmsOnSimInd: slotIndex %d", recordNumber);
+#endif
         Return<void> retStatus = radioService[slotId]->mRadioIndication->newSmsOnSim(
                 convertIntToRadioIndicationType(indicationType), recordNumber);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::newSmsOnSimInd: radioService[%d]->mRadioIndication == NULL", slotId);
+        RLOGE("newSmsOnSimInd: radioService[%d]->mRadioIndication == NULL", slotId);
     }
 
     return 0;
 }
 
-int radio::onUssdInd(android::Parcel &p, int slotId, int requestNumber, int indicationType,
+int radio::onUssdInd(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 != 2 * sizeof(char *)) {
-            RLOGE("radio::onUssdInd: invalid response");
+            RLOGE("onUssdInd: invalid response");
             return 0;
         }
         char **strings = (char **) response;
         char *mode = strings[0];
         hidl_string msg = convertCharPtrToHidlString(strings[1]);
         UssdModeType modeType = (UssdModeType) atoi(mode);
-        RLOGD("radio::onUssdInd: mode %s", mode);
+#if VDBG
+        RLOGD("onUssdInd: mode %s", mode);
+#endif
         Return<void> retStatus = radioService[slotId]->mRadioIndication->onUssd(
                 convertIntToRadioIndicationType(indicationType), modeType, msg);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::onUssdInd: radioService[%d]->mRadioIndication == NULL", slotId);
+        RLOGE("onUssdInd: radioService[%d]->mRadioIndication == NULL", slotId);
     }
 
     return 0;
 }
 
-int radio::nitzTimeReceivedInd(android::Parcel &p, int slotId, int requestNumber,
+int radio::nitzTimeReceivedInd(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("radio::nitzTimeReceivedInd: invalid response");
+            RLOGE("nitzTimeReceivedInd: invalid response");
             return 0;
         }
         hidl_string nitzTime = convertCharPtrToHidlString((char *) response);
         int64_t timeReceived = android::elapsedRealtime();
-        RLOGD("radio::nitzTimeReceivedInd: nitzTime %s receivedTime %" PRId64, nitzTime.c_str(),
+#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);
     } else {
-        RLOGE("radio::nitzTimeReceivedInd: radioService[%d]->mRadioIndication == NULL", slotId);
+        RLOGE("nitzTimeReceivedInd: radioService[%d]->mRadioIndication == NULL", slotId);
         return -1;
     }
 
@@ -5440,24 +6859,26 @@ void convertRilSignalStrengthToHal(void *response, size_t responseLen,
     signalStrength.tdScdma.rscp = rilSignalStrength->TD_SCDMA_SignalStrength.rscp;
 }
 
-int radio::currentSignalStrengthInd(android::Parcel &p, int slotId, int requestNumber,
+int radio::currentSignalStrengthInd(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 != sizeof(RIL_SignalStrength_v10)) {
-            RLOGE("radio::currentSignalStrengthInd: invalid response");
+            RLOGE("currentSignalStrengthInd: invalid response");
             return 0;
         }
 
         SignalStrength signalStrength = {};
         convertRilSignalStrengthToHal(response, responseLen, signalStrength);
 
-        RLOGD("radio::currentSignalStrengthInd");
+#if VDBG
+        RLOGD("currentSignalStrengthInd");
+#endif
         Return<void> retStatus = radioService[slotId]->mRadioIndication->currentSignalStrength(
                 convertIntToRadioIndicationType(indicationType), signalStrength);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::currentSignalStrengthInd: radioService[%d]->mRadioIndication == NULL",
+        RLOGE("currentSignalStrengthInd: radioService[%d]->mRadioIndication == NULL",
                 slotId);
     }
 
@@ -5466,7 +6887,7 @@ int radio::currentSignalStrengthInd(android::Parcel &p, int slotId, int requestN
 
 void convertRilDataCallToHal(RIL_Data_Call_Response_v11 *dcResponse,
         SetupDataCallResult& dcResult) {
-    dcResult.status = dcResponse->status;
+    dcResult.status = (DataCallFailCause) dcResponse->status;
     dcResult.suggestedRetryTime = dcResponse->suggestedRetryTime;
     dcResult.cid = dcResponse->cid;
     dcResult.active = dcResponse->active;
@@ -5490,32 +6911,34 @@ void convertRilDataCallListToHal(void *response, size_t responseLen,
     }
 }
 
-int radio::dataCallListChangedInd(android::Parcel &p, int slotId, int requestNumber,
+int radio::dataCallListChangedInd(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 % sizeof(RIL_Data_Call_Response_v11) != 0) {
-            RLOGE("radio::dataCallListChangedInd: invalid response");
+            RLOGE("dataCallListChangedInd: invalid response");
             return 0;
         }
         hidl_vec<SetupDataCallResult> dcList;
         convertRilDataCallListToHal(response, responseLen, dcList);
-        RLOGD("radio::dataCallListChangedInd");
+#if VDBG
+        RLOGD("dataCallListChangedInd");
+#endif
         Return<void> retStatus = radioService[slotId]->mRadioIndication->dataCallListChanged(
                 convertIntToRadioIndicationType(indicationType), dcList);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::dataCallListChangedInd: radioService[%d]->mRadioIndication == NULL", slotId);
+        RLOGE("dataCallListChangedInd: radioService[%d]->mRadioIndication == NULL", slotId);
     }
 
     return 0;
 }
 
-int radio::suppSvcNotifyInd(android::Parcel &p, int slotId, int requestNumber, int indicationType,
+int radio::suppSvcNotifyInd(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 != sizeof(RIL_SuppSvcNotification)) {
-            RLOGE("radio::suppSvcNotifyInd: invalid response");
+            RLOGE("suppSvcNotifyInd: invalid response");
             return 0;
         }
 
@@ -5527,110 +6950,122 @@ int radio::suppSvcNotifyInd(android::Parcel &p, int slotId, int requestNumber, i
         suppSvc.type = ssn->type;
         suppSvc.number = convertCharPtrToHidlString(ssn->number);
 
-        RLOGD("radio::suppSvcNotifyInd: isMT %d code %d index %d type %d",
+#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);
     } else {
-        RLOGE("radio::suppSvcNotifyInd: radioService[%d]->mRadioIndication == NULL", slotId);
+        RLOGE("suppSvcNotifyInd: radioService[%d]->mRadioIndication == NULL", slotId);
     }
 
     return 0;
 }
 
-int radio::stkSessionEndInd(android::Parcel &p, int slotId, int requestNumber, int indicationType,
+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) {
-        RLOGD("radio::stkSessionEndInd");
+#if VDBG
+        RLOGD("stkSessionEndInd");
+#endif
         Return<void> retStatus = radioService[slotId]->mRadioIndication->stkSessionEnd(
                 convertIntToRadioIndicationType(indicationType));
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::stkSessionEndInd: radioService[%d]->mRadioIndication == NULL", slotId);
+        RLOGE("stkSessionEndInd: radioService[%d]->mRadioIndication == NULL", slotId);
     }
 
     return 0;
 }
 
-int radio::stkProactiveCommandInd(android::Parcel &p, int slotId, int requestNumber,
+int radio::stkProactiveCommandInd(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("radio::stkProactiveCommandInd: invalid response");
+            RLOGE("stkProactiveCommandInd: invalid response");
             return 0;
         }
-        RLOGD("radio::stkProactiveCommandInd");
+#if VDBG
+        RLOGD("stkProactiveCommandInd");
+#endif
         Return<void> retStatus = radioService[slotId]->mRadioIndication->stkProactiveCommand(
                 convertIntToRadioIndicationType(indicationType),
                 convertCharPtrToHidlString((char *) response));
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::stkProactiveCommandInd: radioService[%d]->mRadioIndication == NULL", slotId);
+        RLOGE("stkProactiveCommandInd: radioService[%d]->mRadioIndication == NULL", slotId);
     }
 
     return 0;
 }
 
-int radio::stkEventNotifyInd(android::Parcel &p, int slotId, int requestNumber, int indicationType,
+int radio::stkEventNotifyInd(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("radio::stkEventNotifyInd: invalid response");
+            RLOGE("stkEventNotifyInd: invalid response");
             return 0;
         }
-        RLOGD("radio::stkEventNotifyInd");
+#if VDBG
+        RLOGD("stkEventNotifyInd");
+#endif
         Return<void> retStatus = radioService[slotId]->mRadioIndication->stkEventNotify(
                 convertIntToRadioIndicationType(indicationType),
                 convertCharPtrToHidlString((char *) response));
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::stkEventNotifyInd: radioService[%d]->mRadioIndication == NULL", slotId);
+        RLOGE("stkEventNotifyInd: radioService[%d]->mRadioIndication == NULL", slotId);
     }
 
     return 0;
 }
 
-int radio::stkCallSetupInd(android::Parcel &p, int slotId, int requestNumber, int indicationType,
+int radio::stkCallSetupInd(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 != sizeof(int)) {
-            RLOGE("radio::stkCallSetupInd: invalid response");
+            RLOGE("stkCallSetupInd: invalid response");
             return 0;
         }
         int32_t timeout = ((int32_t *) response)[0];
-        RLOGD("radio::stkCallSetupInd: timeout %d", timeout);
+#if VDBG
+        RLOGD("stkCallSetupInd: timeout %d", timeout);
+#endif
         Return<void> retStatus = radioService[slotId]->mRadioIndication->stkCallSetup(
                 convertIntToRadioIndicationType(indicationType), timeout);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::stkCallSetupInd: radioService[%d]->mRadioIndication == NULL", slotId);
+        RLOGE("stkCallSetupInd: radioService[%d]->mRadioIndication == NULL", slotId);
     }
 
     return 0;
 }
 
-int radio::simSmsStorageFullInd(android::Parcel &p, int slotId, int requestNumber,
+int radio::simSmsStorageFullInd(int slotId,
                                 int indicationType, int token, RIL_Errno e, void *response,
                                 size_t responseLen) {
     if (radioService[slotId] != NULL && radioService[slotId]->mRadioIndication != NULL) {
-        RLOGD("radio::simSmsStorageFullInd");
+#if VDBG
+        RLOGD("simSmsStorageFullInd");
+#endif
         Return<void> retStatus = radioService[slotId]->mRadioIndication->simSmsStorageFull(
                 convertIntToRadioIndicationType(indicationType));
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::simSmsStorageFullInd: radioService[%d]->mRadioIndication == NULL", slotId);
+        RLOGE("simSmsStorageFullInd: radioService[%d]->mRadioIndication == NULL", slotId);
     }
 
     return 0;
 }
 
-int radio::simRefreshInd(android::Parcel &p, int slotId, int requestNumber, int indicationType,
+int radio::simRefreshInd(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 != sizeof(RIL_SimRefreshResponse_v7)) {
-            RLOGE("radio::simRefreshInd: invalid response");
+            RLOGE("simRefreshInd: invalid response");
             return 0;
         }
 
@@ -5641,12 +7076,14 @@ int radio::simRefreshInd(android::Parcel &p, int slotId, int requestNumber, int
         refreshResult.efId = simRefreshResponse->ef_id;
         refreshResult.aid = convertCharPtrToHidlString(simRefreshResponse->aid);
 
-        RLOGD("radio::simRefreshInd: type %d efId %d", refreshResult.type, refreshResult.efId);
+#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);
     } else {
-        RLOGE("radio::simRefreshInd: radioService[%d]->mRadioIndication == NULL", slotId);
+        RLOGE("simRefreshInd: radioService[%d]->mRadioIndication == NULL", slotId);
     }
 
     return 0;
@@ -5660,7 +7097,7 @@ void convertRilCdmaSignalInfoRecordToHal(RIL_CDMA_SignalInfoRecord *signalInfoRe
     record.signal = signalInfoRecord->signal;
 }
 
-int radio::callRingInd(android::Parcel &p, int slotId, int requestNumber, int indicationType,
+int radio::callRingInd(int slotId, int indicationType,
                        int token, RIL_Errno e, void *response, size_t responseLen) {
     if (radioService[slotId] != NULL && radioService[slotId]->mRadioIndication != NULL) {
         bool isGsm;
@@ -5670,43 +7107,47 @@ int radio::callRingInd(android::Parcel &p, int slotId, int requestNumber, int in
         } else {
             isGsm = false;
             if (responseLen != sizeof (RIL_CDMA_SignalInfoRecord)) {
-                RLOGE("radio::callRingInd: invalid response");
+                RLOGE("callRingInd: invalid response");
                 return 0;
             }
             convertRilCdmaSignalInfoRecordToHal((RIL_CDMA_SignalInfoRecord *) response, record);
         }
 
-        RLOGD("radio::callRingInd: isGsm %d", isGsm);
+#if VDBG
+        RLOGD("callRingInd: isGsm %d", isGsm);
+#endif
         Return<void> retStatus = radioService[slotId]->mRadioIndication->callRing(
                 convertIntToRadioIndicationType(indicationType), isGsm, record);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::callRingInd: radioService[%d]->mRadioIndication == NULL", slotId);
+        RLOGE("callRingInd: radioService[%d]->mRadioIndication == NULL", slotId);
     }
 
     return 0;
 }
 
-int radio::simStatusChangedInd(android::Parcel &p, int slotId, int requestNumber,
+int radio::simStatusChangedInd(int slotId,
                                int indicationType, int token, RIL_Errno e, void *response,
                                size_t responseLen) {
     if (radioService[slotId] != NULL && radioService[slotId]->mRadioIndication != NULL) {
-        RLOGD("radio::simStatusChangedInd");
+#if VDBG
+        RLOGD("simStatusChangedInd");
+#endif
         Return<void> retStatus = radioService[slotId]->mRadioIndication->simStatusChanged(
                 convertIntToRadioIndicationType(indicationType));
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::simStatusChangedInd: radioService[%d]->mRadioIndication == NULL", slotId);
+        RLOGE("simStatusChangedInd: radioService[%d]->mRadioIndication == NULL", slotId);
     }
 
     return 0;
 }
 
-int radio::cdmaNewSmsInd(android::Parcel &p, int slotId, int requestNumber, int indicationType,
+int radio::cdmaNewSmsInd(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 != sizeof(RIL_CDMA_SMS_Message)) {
-            RLOGE("radio::cdmaNewSmsInd: invalid response");
+            RLOGE("cdmaNewSmsInd: invalid response");
             return 0;
         }
 
@@ -5737,98 +7178,108 @@ int radio::cdmaNewSmsInd(android::Parcel &p, int slotId, int requestNumber, int
         digitLimit = MIN((rilMsg->uBearerDataLen), RIL_CDMA_SMS_BEARER_DATA_MAX);
         msg.bearerData.setToExternal(rilMsg->aBearerData, digitLimit);
 
-        RLOGD("radio::cdmaNewSmsInd");
+#if VDBG
+        RLOGD("cdmaNewSmsInd");
+#endif
         Return<void> retStatus = radioService[slotId]->mRadioIndication->cdmaNewSms(
                 convertIntToRadioIndicationType(indicationType), msg);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::cdmaNewSmsInd: radioService[%d]->mRadioIndication == NULL", slotId);
+        RLOGE("cdmaNewSmsInd: radioService[%d]->mRadioIndication == NULL", slotId);
     }
 
     return 0;
 }
 
-int radio::newBroadcastSmsInd(android::Parcel &p, int slotId, int requestNumber,
+int radio::newBroadcastSmsInd(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("radio::newBroadcastSmsInd: invalid response");
+            RLOGE("newBroadcastSmsInd: invalid response");
             return 0;
         }
 
         hidl_vec<uint8_t> data;
         data.setToExternal((uint8_t *) response, responseLen);
-        RLOGD("radio::newBroadcastSmsInd");
+#if VDBG
+        RLOGD("newBroadcastSmsInd");
+#endif
         Return<void> retStatus = radioService[slotId]->mRadioIndication->newBroadcastSms(
                 convertIntToRadioIndicationType(indicationType), data);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::newBroadcastSmsInd: radioService[%d]->mRadioIndication == NULL", slotId);
+        RLOGE("newBroadcastSmsInd: radioService[%d]->mRadioIndication == NULL", slotId);
     }
 
     return 0;
 }
 
-int radio::cdmaRuimSmsStorageFullInd(android::Parcel &p, int slotId, int requestNumber,
+int radio::cdmaRuimSmsStorageFullInd(int slotId,
                                      int indicationType, int token, RIL_Errno e, void *response,
                                      size_t responseLen) {
     if (radioService[slotId] != NULL && radioService[slotId]->mRadioIndication != NULL) {
-        RLOGD("radio::cdmaRuimSmsStorageFullInd");
+#if VDBG
+        RLOGD("cdmaRuimSmsStorageFullInd");
+#endif
         Return<void> retStatus = radioService[slotId]->mRadioIndication->cdmaRuimSmsStorageFull(
                 convertIntToRadioIndicationType(indicationType));
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::cdmaRuimSmsStorageFullInd: radioService[%d]->mRadioIndication == NULL",
+        RLOGE("cdmaRuimSmsStorageFullInd: radioService[%d]->mRadioIndication == NULL",
                 slotId);
     }
 
     return 0;
 }
 
-int radio::restrictedStateChangedInd(android::Parcel &p, int slotId, int requestNumber,
+int radio::restrictedStateChangedInd(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 != sizeof(int)) {
-            RLOGE("radio::restrictedStateChangedInd: invalid response");
+            RLOGE("restrictedStateChangedInd: invalid response");
             return 0;
         }
         int32_t state = ((int32_t *) response)[0];
-        RLOGD("radio::restrictedStateChangedInd: state %d", state);
+#if VDBG
+        RLOGD("restrictedStateChangedInd: state %d", state);
+#endif
         Return<void> retStatus = radioService[slotId]->mRadioIndication->restrictedStateChanged(
                 convertIntToRadioIndicationType(indicationType), (PhoneRestrictedState) state);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::restrictedStateChangedInd: radioService[%d]->mRadioIndication == NULL",
+        RLOGE("restrictedStateChangedInd: radioService[%d]->mRadioIndication == NULL",
                 slotId);
     }
 
     return 0;
 }
 
-int radio::enterEmergencyCallbackModeInd(android::Parcel &p, int slotId, int requestNumber,
+int radio::enterEmergencyCallbackModeInd(int slotId,
                                          int indicationType, int token, RIL_Errno e, void *response,
                                          size_t responseLen) {
     if (radioService[slotId] != NULL && radioService[slotId]->mRadioIndication != NULL) {
-        RLOGD("radio::enterEmergencyCallbackModeInd");
+#if VDBG
+        RLOGD("enterEmergencyCallbackModeInd");
+#endif
         Return<void> retStatus = radioService[slotId]->mRadioIndication->enterEmergencyCallbackMode(
                 convertIntToRadioIndicationType(indicationType));
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::enterEmergencyCallbackModeInd: radioService[%d]->mRadioIndication == NULL",
+        RLOGE("enterEmergencyCallbackModeInd: radioService[%d]->mRadioIndication == NULL",
                 slotId);
     }
 
     return 0;
 }
 
-int radio::cdmaCallWaitingInd(android::Parcel &p, int slotId, int requestNumber,
+int radio::cdmaCallWaitingInd(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 != sizeof(RIL_CDMA_CallWaiting_v6)) {
-            RLOGE("radio::cdmaCallWaitingInd: invalid response");
+            RLOGE("cdmaCallWaitingInd: invalid response");
             return 0;
         }
 
@@ -5843,44 +7294,48 @@ int radio::cdmaCallWaitingInd(android::Parcel &p, int slotId, int requestNumber,
         callWaitingRecord.numberType = (CdmaCallWaitingNumberType) callWaitingRil->number_type;
         callWaitingRecord.numberPlan = (CdmaCallWaitingNumberPlan) callWaitingRil->number_plan;
 
-        RLOGD("radio::cdmaCallWaitingInd");
+#if VDBG
+        RLOGD("cdmaCallWaitingInd");
+#endif
         Return<void> retStatus = radioService[slotId]->mRadioIndication->cdmaCallWaiting(
                 convertIntToRadioIndicationType(indicationType), callWaitingRecord);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::cdmaCallWaitingInd: radioService[%d]->mRadioIndication == NULL", slotId);
+        RLOGE("cdmaCallWaitingInd: radioService[%d]->mRadioIndication == NULL", slotId);
     }
 
     return 0;
 }
 
-int radio::cdmaOtaProvisionStatusInd(android::Parcel &p, int slotId, int requestNumber,
+int radio::cdmaOtaProvisionStatusInd(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 != sizeof(int)) {
-            RLOGE("radio::cdmaOtaProvisionStatusInd: invalid response");
+            RLOGE("cdmaOtaProvisionStatusInd: invalid response");
             return 0;
         }
         int32_t status = ((int32_t *) response)[0];
-        RLOGD("radio::cdmaOtaProvisionStatusInd: status %d", status);
+#if VDBG
+        RLOGD("cdmaOtaProvisionStatusInd: status %d", status);
+#endif
         Return<void> retStatus = radioService[slotId]->mRadioIndication->cdmaOtaProvisionStatus(
                 convertIntToRadioIndicationType(indicationType), (CdmaOtaProvisionStatus) status);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::cdmaOtaProvisionStatusInd: radioService[%d]->mRadioIndication == NULL",
+        RLOGE("cdmaOtaProvisionStatusInd: radioService[%d]->mRadioIndication == NULL",
                 slotId);
     }
 
     return 0;
 }
 
-int radio::cdmaInfoRecInd(android::Parcel &p, int slotId, int requestNumber,
+int radio::cdmaInfoRecInd(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 != sizeof(RIL_CDMA_InformationRecords)) {
-            RLOGE("radio::cdmaInfoRecInd: invalid response");
+            RLOGE("cdmaInfoRecInd: invalid response");
             return 0;
         }
 
@@ -5890,7 +7345,7 @@ int radio::cdmaInfoRecInd(android::Parcel &p, int slotId, int requestNumber,
         char* string8 = NULL;
         int num = MIN(recordsRil->numberOfInfoRecs, RIL_CDMA_MAX_NUMBER_OF_INFO_RECS);
         if (recordsRil->numberOfInfoRecs > RIL_CDMA_MAX_NUMBER_OF_INFO_RECS) {
-            RLOGE("radio::cdmaInfoRecInd: received %d recs which is more than %d, dropping "
+            RLOGE("cdmaInfoRecInd: received %d recs which is more than %d, dropping "
                     "additional ones", recordsRil->numberOfInfoRecs,
                     RIL_CDMA_MAX_NUMBER_OF_INFO_RECS);
         }
@@ -5912,14 +7367,14 @@ int radio::cdmaInfoRecInd(android::Parcel &p, int slotId, int requestNumber,
                 case RIL_CDMA_DISPLAY_INFO_REC:
                 case RIL_CDMA_EXTENDED_DISPLAY_INFO_REC: {
                     if (infoRec->rec.display.alpha_len > CDMA_ALPHA_INFO_BUFFER_LENGTH) {
-                        RLOGE("radio::cdmaInfoRecInd: invalid display info response length %d "
+                        RLOGE("cdmaInfoRecInd: invalid display info response length %d "
                                 "expected not more than %d", (int) infoRec->rec.display.alpha_len,
                                 CDMA_ALPHA_INFO_BUFFER_LENGTH);
                         return 0;
                     }
                     string8 = (char*) malloc((infoRec->rec.display.alpha_len + 1) * sizeof(char));
                     if (string8 == NULL) {
-                        RLOGE("radio::cdmaInfoRecInd: Memory allocation failed for "
+                        RLOGE("cdmaInfoRecInd: Memory allocation failed for "
                                 "responseCdmaInformationRecords");
                         return 0;
                     }
@@ -5937,14 +7392,14 @@ int radio::cdmaInfoRecInd(android::Parcel &p, int slotId, int requestNumber,
                 case RIL_CDMA_CALLING_PARTY_NUMBER_INFO_REC:
                 case RIL_CDMA_CONNECTED_NUMBER_INFO_REC: {
                     if (infoRec->rec.number.len > CDMA_NUMBER_INFO_BUFFER_LENGTH) {
-                        RLOGE("radio::cdmaInfoRecInd: invalid display info response length %d "
+                        RLOGE("cdmaInfoRecInd: invalid display info response length %d "
                                 "expected not more than %d", (int) infoRec->rec.number.len,
                                 CDMA_NUMBER_INFO_BUFFER_LENGTH);
                         return 0;
                     }
                     string8 = (char*) malloc((infoRec->rec.number.len + 1) * sizeof(char));
                     if (string8 == NULL) {
-                        RLOGE("radio::cdmaInfoRecInd: Memory allocation failed for "
+                        RLOGE("cdmaInfoRecInd: Memory allocation failed for "
                                 "responseCdmaInformationRecords");
                         return 0;
                     }
@@ -5974,7 +7429,7 @@ int radio::cdmaInfoRecInd(android::Parcel &p, int slotId, int requestNumber,
                 case RIL_CDMA_REDIRECTING_NUMBER_INFO_REC: {
                     if (infoRec->rec.redir.redirectingNumber.len >
                                                   CDMA_NUMBER_INFO_BUFFER_LENGTH) {
-                        RLOGE("radio::cdmaInfoRecInd: invalid display info response length %d "
+                        RLOGE("cdmaInfoRecInd: invalid display info response length %d "
                                 "expected not more than %d\n",
                                 (int)infoRec->rec.redir.redirectingNumber.len,
                                 CDMA_NUMBER_INFO_BUFFER_LENGTH);
@@ -5983,7 +7438,7 @@ int radio::cdmaInfoRecInd(android::Parcel &p, int slotId, int requestNumber,
                     string8 = (char*) malloc((infoRec->rec.redir.redirectingNumber.len + 1) *
                             sizeof(char));
                     if (string8 == NULL) {
-                        RLOGE("radio::cdmaInfoRecInd: Memory allocation failed for "
+                        RLOGE("cdmaInfoRecInd: Memory allocation failed for "
                                 "responseCdmaInformationRecords");
                         return 0;
                     }
@@ -6031,149 +7486,163 @@ int radio::cdmaInfoRecInd(android::Parcel &p, int slotId, int requestNumber,
                 }
 
                 case RIL_CDMA_T53_RELEASE_INFO_REC:
-                    RLOGE("radio::cdmaInfoRecInd: RIL_CDMA_T53_RELEASE_INFO_REC: INVALID");
+                    RLOGE("cdmaInfoRecInd: RIL_CDMA_T53_RELEASE_INFO_REC: INVALID");
                     return 0;
 
                 default:
-                    RLOGE("radio::cdmaInfoRecInd: Incorrect name value");
+                    RLOGE("cdmaInfoRecInd: Incorrect name value");
                     return 0;
             }
         }
 
-        RLOGD("radio::cdmaInfoRecInd");
+#if VDBG
+        RLOGD("cdmaInfoRecInd");
+#endif
         Return<void> retStatus = radioService[slotId]->mRadioIndication->cdmaInfoRec(
                 convertIntToRadioIndicationType(indicationType), records);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::cdmaInfoRecInd: radioService[%d]->mRadioIndication == NULL", slotId);
+        RLOGE("cdmaInfoRecInd: radioService[%d]->mRadioIndication == NULL", slotId);
     }
 
     return 0;
 }
 
-int radio::indicateRingbackToneInd(android::Parcel &p, int slotId, int requestNumber,
+int radio::indicateRingbackToneInd(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 != sizeof(int)) {
-            RLOGE("radio::indicateRingbackToneInd: invalid response");
+            RLOGE("indicateRingbackToneInd: invalid response");
             return 0;
         }
         bool start = ((int32_t *) response)[0];
-        RLOGD("radio::indicateRingbackToneInd: start %d", start);
+#if VDBG
+        RLOGD("indicateRingbackToneInd: start %d", start);
+#endif
         Return<void> retStatus = radioService[slotId]->mRadioIndication->indicateRingbackTone(
                 convertIntToRadioIndicationType(indicationType), start);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::indicateRingbackToneInd: radioService[%d]->mRadioIndication == NULL", slotId);
+        RLOGE("indicateRingbackToneInd: radioService[%d]->mRadioIndication == NULL", slotId);
     }
 
     return 0;
 }
 
-int radio::resendIncallMuteInd(android::Parcel &p, int slotId, int requestNumber,
+int radio::resendIncallMuteInd(int slotId,
                                int indicationType, int token, RIL_Errno e, void *response,
                                size_t responseLen) {
     if (radioService[slotId] != NULL && radioService[slotId]->mRadioIndication != NULL) {
-        RLOGD("radio::resendIncallMuteInd");
+#if VDBG
+        RLOGD("resendIncallMuteInd");
+#endif
         Return<void> retStatus = radioService[slotId]->mRadioIndication->resendIncallMute(
                 convertIntToRadioIndicationType(indicationType));
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::resendIncallMuteInd: radioService[%d]->mRadioIndication == NULL", slotId);
+        RLOGE("resendIncallMuteInd: radioService[%d]->mRadioIndication == NULL", slotId);
     }
 
     return 0;
 }
 
-int radio::cdmaSubscriptionSourceChangedInd(android::Parcel &p, int slotId, int requestNumber,
+int radio::cdmaSubscriptionSourceChangedInd(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 != sizeof(int)) {
-            RLOGE("radio::cdmaSubscriptionSourceChangedInd: invalid response");
+            RLOGE("cdmaSubscriptionSourceChangedInd: invalid response");
             return 0;
         }
         int32_t cdmaSource = ((int32_t *) response)[0];
-        RLOGD("radio::cdmaSubscriptionSourceChangedInd: cdmaSource %d", cdmaSource);
+#if VDBG
+        RLOGD("cdmaSubscriptionSourceChangedInd: cdmaSource %d", cdmaSource);
+#endif
         Return<void> retStatus = radioService[slotId]->mRadioIndication->
                 cdmaSubscriptionSourceChanged(convertIntToRadioIndicationType(indicationType),
                 (CdmaSubscriptionSource) cdmaSource);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::cdmaSubscriptionSourceChangedInd: radioService[%d]->mRadioIndication == NULL",
+        RLOGE("cdmaSubscriptionSourceChangedInd: radioService[%d]->mRadioIndication == NULL",
                 slotId);
     }
 
     return 0;
 }
 
-int radio::cdmaPrlChangedInd(android::Parcel &p, int slotId, int requestNumber,
+int radio::cdmaPrlChangedInd(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 != sizeof(int)) {
-            RLOGE("radio::cdmaPrlChangedInd: invalid response");
+            RLOGE("cdmaPrlChangedInd: invalid response");
             return 0;
         }
         int32_t version = ((int32_t *) response)[0];
-        RLOGD("radio::cdmaPrlChangedInd: version %d", version);
+#if VDBG
+        RLOGD("cdmaPrlChangedInd: version %d", version);
+#endif
         Return<void> retStatus = radioService[slotId]->mRadioIndication->cdmaPrlChanged(
                 convertIntToRadioIndicationType(indicationType), version);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::cdmaPrlChangedInd: radioService[%d]->mRadioIndication == NULL", slotId);
+        RLOGE("cdmaPrlChangedInd: radioService[%d]->mRadioIndication == NULL", slotId);
     }
 
     return 0;
 }
 
-int radio::exitEmergencyCallbackModeInd(android::Parcel &p, int slotId, int requestNumber,
+int radio::exitEmergencyCallbackModeInd(int slotId,
                                         int indicationType, int token, RIL_Errno e, void *response,
                                         size_t responseLen) {
     if (radioService[slotId] != NULL && radioService[slotId]->mRadioIndication != NULL) {
-        RLOGD("radio::exitEmergencyCallbackModeInd");
+#if VDBG
+        RLOGD("exitEmergencyCallbackModeInd");
+#endif
         Return<void> retStatus = radioService[slotId]->mRadioIndication->exitEmergencyCallbackMode(
                 convertIntToRadioIndicationType(indicationType));
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::exitEmergencyCallbackModeInd: radioService[%d]->mRadioIndication == NULL",
+        RLOGE("exitEmergencyCallbackModeInd: radioService[%d]->mRadioIndication == NULL",
                 slotId);
     }
 
     return 0;
 }
 
-int radio::rilConnectedInd(android::Parcel &p, int slotId, int requestNumber,
+int radio::rilConnectedInd(int slotId,
                            int indicationType, int token, RIL_Errno e, void *response,
                            size_t responseLen) {
     if (radioService[slotId] != NULL && radioService[slotId]->mRadioIndication != NULL) {
-        RLOGD("radio::rilConnectedInd");
+        RLOGD("rilConnectedInd");
         Return<void> retStatus = radioService[slotId]->mRadioIndication->rilConnected(
                 convertIntToRadioIndicationType(indicationType));
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::rilConnectedInd: radioService[%d]->mRadioIndication == NULL", slotId);
+        RLOGE("rilConnectedInd: radioService[%d]->mRadioIndication == NULL", slotId);
     }
 
     return 0;
 }
 
-int radio::voiceRadioTechChangedInd(android::Parcel &p, int slotId, int requestNumber,
+int radio::voiceRadioTechChangedInd(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 != sizeof(int)) {
-            RLOGE("radio::voiceRadioTechChangedInd: invalid response");
+            RLOGE("voiceRadioTechChangedInd: invalid response");
             return 0;
         }
         int32_t rat = ((int32_t *) response)[0];
-        RLOGD("radio::voiceRadioTechChangedInd: rat %d", rat);
+#if VDBG
+        RLOGD("voiceRadioTechChangedInd: rat %d", rat);
+#endif
         Return<void> retStatus = radioService[slotId]->mRadioIndication->voiceRadioTechChanged(
                 convertIntToRadioIndicationType(indicationType), (RadioTechnology) rat);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::voiceRadioTechChangedInd: radioService[%d]->mRadioIndication == NULL",
+        RLOGE("voiceRadioTechChangedInd: radioService[%d]->mRadioIndication == NULL",
                 slotId);
     }
 
@@ -6317,86 +7786,97 @@ void convertRilCellInfoListToHal(void *response, size_t responseLen, hidl_vec<Ce
                         rillCellInfo->CellInfo.tdscdma.signalStrengthTdscdma.rscp;
                 break;
             }
+            default: {
+                break;
+            }
         }
         rillCellInfo += 1;
     }
 }
 
-int radio::cellInfoListInd(android::Parcel &p, int slotId, int requestNumber,
+int radio::cellInfoListInd(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 % sizeof(RIL_CellInfo_v12) != 0) {
-            RLOGE("radio::cellInfoListInd: invalid response");
+            RLOGE("cellInfoListInd: invalid response");
             return 0;
         }
 
         hidl_vec<CellInfo> records;
         convertRilCellInfoListToHal(response, responseLen, records);
 
-        RLOGD("radio::cellInfoListInd");
+#if VDBG
+        RLOGD("cellInfoListInd");
+#endif
         Return<void> retStatus = radioService[slotId]->mRadioIndication->cellInfoList(
                 convertIntToRadioIndicationType(indicationType), records);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::cellInfoListInd: radioService[%d]->mRadioIndication == NULL", slotId);
+        RLOGE("cellInfoListInd: radioService[%d]->mRadioIndication == NULL", slotId);
     }
 
     return 0;
 }
 
-int radio::imsNetworkStateChangedInd(android::Parcel &p, int slotId, int requestNumber,
+int radio::imsNetworkStateChangedInd(int slotId,
                                      int indicationType, int token, RIL_Errno e, void *response,
                                      size_t responseLen) {
     if (radioService[slotId] != NULL && radioService[slotId]->mRadioIndication != NULL) {
-        RLOGD("radio::imsNetworkStateChangedInd");
+#if VDBG
+        RLOGD("imsNetworkStateChangedInd");
+#endif
         Return<void> retStatus = radioService[slotId]->mRadioIndication->imsNetworkStateChanged(
                 convertIntToRadioIndicationType(indicationType));
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::imsNetworkStateChangedInd: radioService[%d]->mRadioIndication == NULL",
+        RLOGE("imsNetworkStateChangedInd: radioService[%d]->mRadioIndication == NULL",
                 slotId);
     }
 
     return 0;
 }
 
-int radio::subscriptionStatusChangedInd(android::Parcel &p, int slotId, int requestNumber,
+int radio::subscriptionStatusChangedInd(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 != sizeof(int)) {
-            RLOGE("radio::subscriptionStatusChangedInd: invalid response");
+            RLOGE("subscriptionStatusChangedInd: invalid response");
             return 0;
         }
         bool activate = ((int32_t *) response)[0];
-        RLOGD("radio::subscriptionStatusChangedInd: activate %d", activate);
+#if VDBG
+        RLOGD("subscriptionStatusChangedInd: activate %d", activate);
+#endif
         Return<void> retStatus = radioService[slotId]->mRadioIndication->subscriptionStatusChanged(
                 convertIntToRadioIndicationType(indicationType), activate);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::subscriptionStatusChangedInd: radioService[%d]->mRadioIndication == NULL",
+        RLOGE("subscriptionStatusChangedInd: radioService[%d]->mRadioIndication == NULL",
                 slotId);
     }
 
     return 0;
 }
 
-int radio::srvccStateNotifyInd(android::Parcel &p, int slotId, int requestNumber,
+int radio::srvccStateNotifyInd(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 != sizeof(int)) {
-            RLOGE("radio::srvccStateNotifyInd: invalid response");
+            RLOGE("srvccStateNotifyInd: invalid response");
             return 0;
         }
         int32_t state = ((int32_t *) response)[0];
-        RLOGD("radio::srvccStateNotifyInd: rat %d", state);
+#if VDBG
+        RLOGD("srvccStateNotifyInd: rat %d", state);
+#endif
         Return<void> retStatus = radioService[slotId]->mRadioIndication->srvccStateNotify(
                 convertIntToRadioIndicationType(indicationType), (SrvccState) state);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::srvccStateNotifyInd: radioService[%d]->mRadioIndication == NULL", slotId);
+        RLOGE("srvccStateNotifyInd: radioService[%d]->mRadioIndication == NULL", slotId);
     }
 
     return 0;
@@ -6435,24 +7915,26 @@ void convertRilHardwareConfigListToHal(void *response, size_t responseLen,
     }
 }
 
-int radio::hardwareConfigChangedInd(android::Parcel &p, int slotId, int requestNumber,
+int radio::hardwareConfigChangedInd(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 % sizeof(RIL_HardwareConfig) != 0) {
-            RLOGE("radio::hardwareConfigChangedInd: invalid response");
+            RLOGE("hardwareConfigChangedInd: invalid response");
             return 0;
         }
 
         hidl_vec<HardwareConfig> configs;
         convertRilHardwareConfigListToHal(response, responseLen, configs);
 
-        RLOGD("radio::hardwareConfigChangedInd");
+#if VDBG
+        RLOGD("hardwareConfigChangedInd");
+#endif
         Return<void> retStatus = radioService[slotId]->mRadioIndication->hardwareConfigChanged(
                 convertIntToRadioIndicationType(indicationType), configs);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::hardwareConfigChangedInd: radioService[%d]->mRadioIndication == NULL",
+        RLOGE("hardwareConfigChangedInd: radioService[%d]->mRadioIndication == NULL",
                 slotId);
     }
 
@@ -6468,24 +7950,26 @@ void convertRilRadioCapabilityToHal(void *response, size_t responseLen, RadioCap
     rc.status = (android::hardware::radio::V1_0::RadioCapabilityStatus) rilRadioCapability->status;
 }
 
-int radio::radioCapabilityIndicationInd(android::Parcel &p, int slotId, int requestNumber,
+int radio::radioCapabilityIndicationInd(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 != sizeof(RIL_RadioCapability)) {
-            RLOGE("radio::radioCapabilityIndicationInd: invalid response");
+            RLOGE("radioCapabilityIndicationInd: invalid response");
             return 0;
         }
 
         RadioCapability rc = {};
         convertRilRadioCapabilityToHal(response, responseLen, rc);
 
-        RLOGD("radio::radioCapabilityIndicationInd");
+#if VDBG
+        RLOGD("radioCapabilityIndicationInd");
+#endif
         Return<void> retStatus = radioService[slotId]->mRadioIndication->radioCapabilityIndication(
                 convertIntToRadioIndicationType(indicationType), rc);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::radioCapabilityIndicationInd: radioService[%d]->mRadioIndication == NULL",
+        RLOGE("radioCapabilityIndicationInd: radioService[%d]->mRadioIndication == NULL",
                 slotId);
     }
 
@@ -6505,12 +7989,12 @@ bool isServiceTypeCfQuery(RIL_SsServiceType serType, RIL_SsRequestType reqType)
     return false;
 }
 
-int radio::onSupplementaryServiceIndicationInd(android::Parcel &p, int slotId, int requestNumber,
+int radio::onSupplementaryServiceIndicationInd(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 != sizeof(RIL_StkCcUnsolSsResponse)) {
-            RLOGE("radio::onSupplementaryServiceIndicationInd: invalid response");
+            RLOGE("onSupplementaryServiceIndicationInd: invalid response");
             return 0;
         }
 
@@ -6523,10 +8007,12 @@ int radio::onSupplementaryServiceIndicationInd(android::Parcel &p, int slotId, i
         ss.result = (RadioError) rilSsResponse->result;
 
         if (isServiceTypeCfQuery(rilSsResponse->serviceType, rilSsResponse->requestType)) {
-            RLOGD("radio::onSupplementaryServiceIndicationInd CF type, num of Cf elements %d",
+#if VDBG
+            RLOGD("onSupplementaryServiceIndicationInd CF type, num of Cf elements %d",
                     rilSsResponse->cfData.numValidIndexes);
+#endif
             if (rilSsResponse->cfData.numValidIndexes > NUM_SERVICE_CLASSES) {
-                RLOGE("radio::onSupplementaryServiceIndicationInd numValidIndexes is greater than "
+                RLOGE("onSupplementaryServiceIndicationInd numValidIndexes is greater than "
                         "max value %d, truncating it to max value", NUM_SERVICE_CLASSES);
                 rilSsResponse->cfData.numValidIndexes = NUM_SERVICE_CLASSES;
             }
@@ -6547,9 +8033,11 @@ int radio::onSupplementaryServiceIndicationInd(android::Parcel &p, int slotId, i
                  cfInfo->toa = cf.toa;
                  cfInfo->number = convertCharPtrToHidlString(cf.number);
                  cfInfo->timeSeconds = cf.timeSeconds;
-                 RLOGD("radio::onSupplementaryServiceIndicationInd: "
+#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);
@@ -6558,40 +8046,46 @@ int radio::onSupplementaryServiceIndicationInd(android::Parcel &p, int slotId, i
             /* each int */
             ss.ssInfo[0].ssInfo.resize(SS_INFO_MAX);
             for (int i = 0; i < SS_INFO_MAX; i++) {
-                 RLOGD("radio::onSupplementaryServiceIndicationInd: Data: %d",
+#if VDBG
+                 RLOGD("onSupplementaryServiceIndicationInd: Data: %d",
                         rilSsResponse->ssInfo[i]);
+#endif
                  ss.ssInfo[0].ssInfo[i] = rilSsResponse->ssInfo[i];
             }
         }
 
-        RLOGD("radio::onSupplementaryServiceIndicationInd");
+#if VDBG
+        RLOGD("onSupplementaryServiceIndicationInd");
+#endif
         Return<void> retStatus = radioService[slotId]->mRadioIndication->
                 onSupplementaryServiceIndication(convertIntToRadioIndicationType(indicationType),
                 ss);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::onSupplementaryServiceIndicationInd: "
+        RLOGE("onSupplementaryServiceIndicationInd: "
                 "radioService[%d]->mRadioIndication == NULL", slotId);
     }
 
     return 0;
 }
 
-int radio::stkCallControlAlphaNotifyInd(android::Parcel &p, int slotId, int requestNumber,
+int radio::stkCallControlAlphaNotifyInd(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("radio::stkCallControlAlphaNotifyInd: invalid response");
+            RLOGE("stkCallControlAlphaNotifyInd: invalid response");
             return 0;
         }
-        RLOGD("radio::stkCallControlAlphaNotifyInd");
+#if VDBG
+        RLOGD("stkCallControlAlphaNotifyInd");
+#endif
         Return<void> retStatus = radioService[slotId]->mRadioIndication->stkCallControlAlphaNotify(
                 convertIntToRadioIndicationType(indicationType),
                 convertCharPtrToHidlString((char *) response));
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::stkCallControlAlphaNotifyInd: radioService[%d]->mRadioIndication == NULL",
+        RLOGE("stkCallControlAlphaNotifyInd: radioService[%d]->mRadioIndication == NULL",
                 slotId);
     }
 
@@ -6605,34 +8099,36 @@ void convertRilLceDataInfoToHal(void *response, size_t responseLen, LceDataInfo&
     lce.lceSuspended = rilLceDataInfo->lce_suspended;
 }
 
-int radio::lceDataInd(android::Parcel &p, int slotId, int requestNumber,
+int radio::lceDataInd(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 != sizeof(RIL_LceDataInfo)) {
-            RLOGE("radio::lceDataInd: invalid response");
+            RLOGE("lceDataInd: invalid response");
             return 0;
         }
 
         LceDataInfo lce = {};
         convertRilLceDataInfoToHal(response, responseLen, lce);
-        RLOGD("radio::lceDataInd");
+#if VDBG
+        RLOGD("lceDataInd");
+#endif
         Return<void> retStatus = radioService[slotId]->mRadioIndication->lceData(
                 convertIntToRadioIndicationType(indicationType), lce);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::lceDataInd: radioService[%d]->mRadioIndication == NULL", slotId);
+        RLOGE("lceDataInd: radioService[%d]->mRadioIndication == NULL", slotId);
     }
 
     return 0;
 }
 
-int radio::pcoDataInd(android::Parcel &p, int slotId, int requestNumber,
+int radio::pcoDataInd(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 != sizeof(RIL_PCO_Data)) {
-            RLOGE("radio::pcoDataInd: invalid response");
+            RLOGE("pcoDataInd: invalid response");
             return 0;
         }
 
@@ -6643,54 +8139,133 @@ int radio::pcoDataInd(android::Parcel &p, int slotId, int requestNumber,
         pco.pcoId = rilPcoData->pco_id;
         pco.contents.setToExternal((uint8_t *) rilPcoData->contents, rilPcoData->contents_length);
 
-        RLOGD("radio::pcoDataInd");
+#if VDBG
+        RLOGD("pcoDataInd");
+#endif
         Return<void> retStatus = radioService[slotId]->mRadioIndication->pcoData(
                 convertIntToRadioIndicationType(indicationType), pco);
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::pcoDataInd: radioService[%d]->mRadioIndication == NULL", slotId);
+        RLOGE("pcoDataInd: radioService[%d]->mRadioIndication == NULL", slotId);
     }
 
     return 0;
 }
 
-int radio::modemResetInd(android::Parcel &p, int slotId, int requestNumber,
+int radio::modemResetInd(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("radio::modemResetInd: invalid response");
+            RLOGE("modemResetInd: invalid response");
             return 0;
         }
-        RLOGD("radio::modemResetInd");
+#if VDBG
+        RLOGD("modemResetInd");
+#endif
         Return<void> retStatus = radioService[slotId]->mRadioIndication->modemReset(
                 convertIntToRadioIndicationType(indicationType),
                 convertCharPtrToHidlString((char *) response));
         radioService[slotId]->checkReturnStatus(retStatus);
     } else {
-        RLOGE("radio::modemResetInd: radioService[%d]->mRadioIndication == NULL", slotId);
+        RLOGE("modemResetInd: radioService[%d]->mRadioIndication == NULL", slotId);
+    }
+
+    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(android::Parcel &p, int slotId, int requestNumber,
+int radio::oemHookRawInd(int slotId,
                          int indicationType, int token, RIL_Errno e, void *response,
                          size_t responseLen) {
     if (oemHookService[slotId] != NULL && oemHookService[slotId]->mOemHookIndication != NULL) {
         if (response == NULL || responseLen == 0) {
-            RLOGE("radio::oemHookRawInd: invalid response");
+            RLOGE("oemHookRawInd: invalid response");
             return 0;
         }
 
         hidl_vec<uint8_t> data;
         data.setToExternal((uint8_t *) response, responseLen);
-        RLOGD("radio::oemHookRawInd");
+#if VDBG
+        RLOGD("oemHookRawInd");
+#endif
         Return<void> retStatus = oemHookService[slotId]->mOemHookIndication->oemHookRaw(
                 convertIntToRadioIndicationType(indicationType), data);
-        checkReturnStatus(slotId, retStatus);
+        checkReturnStatus(slotId, retStatus, false);
     } else {
-        RLOGE("radio::oemHookRawInd: oemHookService[%d]->mOemHookIndication == NULL", slotId);
+        RLOGE("oemHookRawInd: oemHookService[%d]->mOemHookIndication == NULL", slotId);
     }
 
     return 0;
@@ -6700,26 +8275,13 @@ void radio::registerService(RIL_RadioFunctions *callbacks, CommandInfo *commands
     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
@@ -6739,9 +8301,10 @@ void radio::registerService(RIL_RadioFunctions *callbacks, CommandInfo *commands
         radioService[i]->mSlotId = i;
         oemHookService[i] = new OemHookImpl;
         oemHookService[i]->mSlotId = i;
-        RLOGD("radio::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);