Fix libril.so crash issue caused by wrong switch logic of onRequest in reference-ril.c
If the tech is not CDMA, it will fall-through to the default case.
But the new added RIL_REQUEST_GET_CELL_INFO_LIST and RIL_REQUEST_SET_UNSOL_CELL_INFO_LIST_RATE
cases will intercept it and cause the request call into wrong request functions.
Move these two new requests before the CDMA cases to fix the logic issue.
Bug: 9193696
Change-Id: I2cb03cbdb6be8eb1afd92c01c764e87b6aa62796
Signed-off-by: Jun Tian <jun.j.tian@intel.com>
Signed-off-by: Panfeng Chang <panfengx.chang@intel.com>
Signed-off-by: Yanglin Zhu <yanglinx.zhu@intel.com>
Signed-off-by: Jackie Wu <jackie.wu@intel.com>
diff --git a/reference-ril/reference-ril.c b/reference-ril/reference-ril.c
index facd223..77c6f31 100644
--- a/reference-ril/reference-ril.c
+++ b/reference-ril/reference-ril.c
@@ -2185,6 +2185,14 @@
requestGetPreferredNetworkType(request, data, datalen, t);
break;
+ case RIL_REQUEST_GET_CELL_INFO_LIST:
+ requestGetCellInfoList(data, datalen, t);
+ break;
+
+ case RIL_REQUEST_SET_UNSOL_CELL_INFO_LIST_RATE:
+ requestSetCellInfoListRate(data, datalen, t);
+ break;
+
/* CDMA Specific Requests */
case RIL_REQUEST_BASEBAND_VERSION:
if (TECH_BIT(sMdmInfo) == MDM_CDMA) {
@@ -2234,14 +2242,6 @@
break;
} // Fall-through if tech is not cdma
- case RIL_REQUEST_GET_CELL_INFO_LIST:
- requestGetCellInfoList(data, datalen, t);
- break;
-
- case RIL_REQUEST_SET_UNSOL_CELL_INFO_LIST_RATE:
- requestSetCellInfoListRate(data, datalen, t);
- break;
-
default:
RLOGD("Request not supported. Tech: %d",TECH(sMdmInfo));
RIL_onRequestComplete(t, RIL_E_REQUEST_NOT_SUPPORTED, NULL, 0);