summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>2022-09-29 18:02:38 +0200
committerDenis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>2022-09-29 18:06:07 +0200
commite0e1cad512e9e7f182b5da6160b977fec4bb2afa (patch)
tree11becccae33999490d6ea7428104a28e21543ba9
parent2dcbf6c811a371466112d5e34cbeb60c1d03f4dd (diff)
downloadhardware_replicant_libsamsung-ril-for-main.tar.gz
hardware_replicant_libsamsung-ril-for-main.tar.bz2
hardware_replicant_libsamsung-ril-for-main.zip
sim: ipc_sec_pin_status: log errorsfor-main
Without that patch, if for some reasons there is an error, we cannot know why ril_sim_state_update was not reached without needing to modify the source code and recompile libsamsung-ril. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
-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;
}