summaryrefslogtreecommitdiffstats
path: root/ril
diff options
context:
space:
mode:
Diffstat (limited to 'ril')
-rw-r--r--ril/atchannel.h3
-rw-r--r--ril/reference-ril.c7
2 files changed, 8 insertions, 2 deletions
diff --git a/ril/atchannel.h b/ril/atchannel.h
index 92829153..94011417 100644
--- a/ril/atchannel.h
+++ b/ril/atchannel.h
@@ -112,7 +112,8 @@ void at_response_free(ATResponse *p_response);
typedef enum {
CME_ERROR_NON_CME = -1,
CME_SUCCESS = 0,
- CME_SIM_NOT_INSERTED = 10
+ CME_SIM_NOT_INSERTED = 10,
+ CME_INVALID_INDEX = 21,
} AT_CME_Error;
AT_CME_Error at_get_cme_error(const ATResponse *p_response);
diff --git a/ril/reference-ril.c b/ril/reference-ril.c
index 084c4add..3bca5810 100644
--- a/ril/reference-ril.c
+++ b/ril/reference-ril.c
@@ -1878,9 +1878,14 @@ static void requestSimCloseChannel(void *data, size_t datalen, RIL_Token t)
err = at_send_command_singleline(cmd, "+CCHC", &p_response);
if (err < 0 || p_response == NULL || p_response->success == 0) {
+ AT_CME_Error cme = p_response ? at_get_cme_error(p_response) :
+ CME_ERROR_NON_CME;
+ RIL_Errno ril_e = (cme == CME_INVALID_INDEX) ? RIL_E_INVALID_ARGUMENTS :
+ RIL_E_GENERIC_FAILURE;
+
ALOGE("Error %d closing logical channel %d: %d",
err, session_id, p_response ? p_response->success : 0);
- RIL_onRequestComplete(t, RIL_E_GENERIC_FAILURE, NULL, 0);
+ RIL_onRequestComplete(t, ril_e, NULL, 0);
at_response_free(p_response);
return;
}