summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sim.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/sim.c b/sim.c
index 6bb0f4c..e627dbb 100644
--- a/sim.c
+++ b/sim.c
@@ -201,32 +201,47 @@ int ipc_sec_pin_status(struct ipc_message *message)
return -1;
rc = ril_radio_has_reached_state(RADIO_STATE_ON);
- if (rc < 0)
+ if (rc < 0) {
+ RIL_LOGD("%s: radio state has not reached RADIO_STATE_ON yet", __func__);
return 0;
+ }
data = (struct ipc_sec_pin_status_response_data *) message->data;
sim_state = ipc2ril_sec_pin_status_response(data, &card_status);
- if (sim_state == SIM_STATE_ERROR)
+ if (sim_state == SIM_STATE_ERROR) {
+ RIL_LOGD("%s: SIM state: SIM_STATE_ERROR", __func__);
return 0;
+ }
if (card_status.applications[0].app_type == RIL_APPTYPE_SIM && card_status.applications[0].app_state == RIL_APPSTATE_PIN && ril_data->sim_pin != NULL) {
ril_request_data_set_uniq(RIL_REQUEST_GET_SIM_STATUS, (void *) &card_status, sizeof(card_status));
rc = ipc_sec_pin_status_setup(&request_data, IPC_SEC_PIN_TYPE_PIN1, ril_data->sim_pin, NULL);
if (rc < 0) {
+ RIL_LOGD("%s: "
+ "ipc_sec_pin_status_setup "
+ "failed with error %d",
+ __func__, rc);
ril_request_data_free(RIL_REQUEST_GET_SIM_STATUS);
return 0;
}
rc = ipc_gen_phone_res_expect_callback(message->aseq, IPC_SEC_PIN_STATUS, ipc_sec_pin_status_callback);
if (rc < 0) {
+ RIL_LOGD("%s: "
+ "ipc_gen_phone_res_expect_callback "
+ "failed with error %d",
+ __func__, rc);
ril_request_data_free(RIL_REQUEST_GET_SIM_STATUS);
return 0;
}
rc = ipc_fmt_send(message->aseq, IPC_SEC_PIN_STATUS, IPC_TYPE_SET, (void *) &request_data, sizeof(request_data));
if (rc < 0) {
+ RIL_LOGD("%s: "
+ "ipc_fmt_send failed with error %d",
+ __func__, rc);
ril_request_data_free(RIL_REQUEST_GET_SIM_STATUS);
return 0;
}