From 88c9ecb32840656b48a43dd6f81aa637b304c7bb Mon Sep 17 00:00:00 2001 From: Ziyan Date: Fri, 9 Sep 2016 11:13:08 +0200 Subject: libsecril-shim: fix RIL_REQUEST_LAST_CALL_FAIL_CAUSE Remove extra element, crashing stuff on >=M. Change-Id: Id41750456cf5460a827700df44e8c89233fad383 --- rilsrc/libsecril-shim/secril-shim.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/rilsrc/libsecril-shim/secril-shim.c b/rilsrc/libsecril-shim/secril-shim.c index 2c71709..4ddb21c 100644 --- a/rilsrc/libsecril-shim/secril-shim.c +++ b/rilsrc/libsecril-shim/secril-shim.c @@ -119,6 +119,13 @@ static void onRequestCompleteShim(RIL_Token t, RIL_Errno e, void *response, size request = pRI->pCI->requestNumber; switch (request) { + case RIL_REQUEST_LAST_CALL_FAIL_CAUSE: + /* Remove extra element (ignored on pre-M, now crashing the framework) */ + if (responselen > sizeof(int)) { + rilEnv->OnRequestComplete(t, e, response, sizeof(int)); + return; + } + break; case RIL_REQUEST_QUERY_AVAILABLE_NETWORKS: /* Remove the extra (unused) element from the operator info, freaking out the framework. * Formerly, this is know as the mQANElements override. */ -- cgit v1.1