From e593f410d7c3f0924033e71c84dcb1ace32fd6a0 Mon Sep 17 00:00:00 2001 From: Denis 'GNUtoo' Carikli Date: Thu, 15 Oct 2020 08:24:47 +0200 Subject: Convert to use separate SIM status In 2001, in the RIL repository[1], the SIM states were separated from the radio states by the following commit: 2bc78d614e349574426d198c37e51ccb7455b5bb 2bc78d61 Separate SIM states from Radio States Then in 2016 the SIM states were removed from the RADIO_STATES by the following commit: 2baf72329c43d9e3f7850973f087176f535e31e8 2baf7232 Remove deprecated RADIO_STATES So to be compatible with recent rild, we need to convert the code to use separate SIM states. This was tested on Replicant 4.2 with a Galaxy SIII (GT-I9300) and a Nexus S (GT-I9023) and in both cases: - It compiled fine - Calling worked fine too: I called an invalid number I got an automatic voice reply telling me that this number was invalid. Similarly that was also tested on Replicant 6.0 0004 RC3 both by compiling it and calling an invalid number, as this commit was part of the Replicant 6.0 0004 RC3 release. Since then only the commit message was modified to add information about the tests as it didn't have them but had the following text instead: TODO: - Test this code with Replicant 4.2!!!! [1]https://android.googlesource.com/platform/hardware/ril Signed-off-by: Denis 'GNUtoo' Carikli --- data.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'data.c') diff --git a/data.c b/data.c index 93fda8c..ff6df5e 100644 --- a/data.c +++ b/data.c @@ -467,7 +467,7 @@ int ril_request_setup_data_call(void *data, size_t size, RIL_Token token) if (data == NULL || size < 6 * sizeof(char *)) goto error; - rc = ril_radio_has_reached_state(RADIO_STATE_SIM_READY); + rc = ril_sim_has_reached_state(SIM_STATE_READY); if (rc < 0) { ril_request_complete(token, RIL_E_OP_NOT_ALLOWED_BEFORE_REG_TO_NW, NULL, 0); return RIL_REQUEST_COMPLETED; @@ -663,7 +663,7 @@ int ril_request_data_call_list(__attribute__((unused)) void *data, { int rc; - rc = ril_radio_has_reached_state(RADIO_STATE_SIM_NOT_READY); + rc = ril_radio_has_reached_state(RADIO_STATE_ON); if (rc < 0) { ril_request_complete(token, RIL_E_SUCCESS, NULL, 0); return RIL_REQUEST_COMPLETED; @@ -729,7 +729,7 @@ int ril_request_deactivate_data_call(void *data, size_t size, RIL_Token token) if (data == NULL || size < 2 * sizeof(char *)) goto error; - rc = ril_radio_has_reached_state(RADIO_STATE_SIM_READY); + rc = ril_sim_has_reached_state(SIM_STATE_READY); if (rc < 0) return RIL_REQUEST_UNHANDLED; @@ -876,7 +876,7 @@ int ipc_gprs_call_status(struct ipc_message *message) if (message == NULL || message->data == NULL || message->size < sizeof(struct ipc_gprs_call_status_data)) return -1; - rc = ril_radio_has_reached_state(RADIO_STATE_SIM_READY); + rc = ril_sim_has_reached_state(SIM_STATE_READY); if (rc < 0) return 0; @@ -1021,7 +1021,7 @@ int ril_request_last_data_call_fail_cause(__attribute__((unused)) void *data, int fail_cause; int rc; - rc = ril_radio_has_reached_state(RADIO_STATE_SIM_NOT_READY); + rc = ril_radio_has_reached_state(RADIO_STATE_ON); if (rc < 0) return RIL_REQUEST_UNHANDLED; -- cgit v1.2.3