summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndroid Build Role Account android-build-prod <android-build-team-robot@google.com>2018-04-01 15:53:03 +0000
committerAndroid Build Role Account android-build-prod <android-build-team-robot@google.com>2018-04-01 15:53:03 +0000
commit318eac68410c0177c6c9157a4a19d9f2f7869561 (patch)
tree96f67a86eaefdba63e2706d4153bcfae8f647737
parent47fcbad454b2598a5fb0d0f659d8ee422634dcf0 (diff)
parent8ca23e6a4c424c4ce6edab1ce25c14d7b199ce8e (diff)
downloadandroid_hardware_ril-318eac68410c0177c6c9157a4a19d9f2f7869561.tar.gz
android_hardware_ril-318eac68410c0177c6c9157a4a19d9f2f7869561.tar.bz2
android_hardware_ril-318eac68410c0177c6c9157a4a19d9f2f7869561.zip
Snap for 4691350 from 8ca23e6a4c424c4ce6edab1ce25c14d7b199ce8e to p-keystone-qcom-release
Change-Id: Ib96fbb2218f406dc4353a4c15e639f5523bc222f
-rw-r--r--libril/Android.mk4
-rw-r--r--libril/ril_service.cpp21
2 files changed, 22 insertions, 3 deletions
diff --git a/libril/Android.mk b/libril/Android.mk
index 681e3c4..ee0530f 100644
--- a/libril/Android.mk
+++ b/libril/Android.mk
@@ -35,6 +35,10 @@ ifeq ($(SIM_COUNT), 2)
LOCAL_CFLAGS += -DANDROID_SIM_COUNT_2
endif
+ifneq ($(DISABLE_RILD_OEM_HOOK),)
+ LOCAL_CFLAGS += -DOEM_HOOK_DISABLED
+endif
+
LOCAL_C_INCLUDES += external/nanopb-c
LOCAL_C_INCLUDES += $(LOCAL_PATH)/../include
LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/../include
diff --git a/libril/ril_service.cpp b/libril/ril_service.cpp
index 6396d1d..cb8801d 100644
--- a/libril/ril_service.cpp
+++ b/libril/ril_service.cpp
@@ -60,6 +60,12 @@ using android::sp;
#define CALL_ONSTATEREQUEST(a) s_vendorFunctions->onStateRequest()
#endif
+#ifdef OEM_HOOK_DISABLED
+constexpr bool kOemHookEnabled = false;
+#else
+constexpr bool kOemHookEnabled = true;
+#endif
+
RIL_RadioFunctions *s_vendorFunctions = NULL;
static CommandInfo *s_commands;
@@ -6717,6 +6723,8 @@ int radio::sendRequestRawResponse(int slotId,
RLOGD("sendRequestRawResponse: serial %d", serial);
#endif
+ if (!kOemHookEnabled) return 0;
+
if (oemHookService[slotId]->mOemHookResponse != NULL) {
RadioResponseInfo responseInfo = {};
populateResponseInfo(responseInfo, serial, responseType, e);
@@ -6746,6 +6754,8 @@ int radio::sendRequestStringsResponse(int slotId,
RLOGD("sendRequestStringsResponse: serial %d", serial);
#endif
+ if (!kOemHookEnabled) return 0;
+
if (oemHookService[slotId]->mOemHookResponse != NULL) {
RadioResponseInfo responseInfo = {};
populateResponseInfo(responseInfo, serial, responseType, e);
@@ -8456,6 +8466,8 @@ int radio::keepaliveStatusInd(int slotId,
int radio::oemHookRawInd(int slotId,
int indicationType, int token, RIL_Errno e, void *response,
size_t responseLen) {
+ if (!kOemHookEnabled) return 0;
+
if (oemHookService[slotId] != NULL && oemHookService[slotId]->mOemHookIndication != NULL) {
if (response == NULL || responseLen == 0) {
RLOGE("oemHookRawInd: invalid response");
@@ -8505,12 +8517,15 @@ void radio::registerService(RIL_RadioFunctions *callbacks, CommandInfo *commands
radioService[i] = new RadioImpl;
radioService[i]->mSlotId = i;
- oemHookService[i] = new OemHookImpl;
- oemHookService[i]->mSlotId = 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(serviceNames[i]);
+
+ if (kOemHookEnabled) {
+ oemHookService[i] = new OemHookImpl;
+ oemHookService[i]->mSlotId = i;
+ status = oemHookService[i]->registerAsService(serviceNames[i]);
+ }
ret = pthread_rwlock_unlock(radioServiceRwlockPtr);
assert(ret == 0);