From: Paul Kocialkowski Date: Fri, 31 Aug 2012 16:19:37 +0000 (+0200) Subject: RIL: return error to requests when freeze is going on X-Git-Url: http://git.legacy.paulk.fr/gitweb/?p=hayes-ril.git;a=commitdiff_plain;h=d2367ee7f1e76d3607a680b473efeeca8d927be3 RIL: return error to requests when freeze is going on Signed-off-by: Paul Kocialkowski --- diff --git a/at.c b/at.c index b0d47c9..427292b 100644 --- a/at.c +++ b/at.c @@ -690,6 +690,8 @@ void at_handling_init(void) pthread_mutex_init(&(at_handling.sync_requests_queue.mutex), NULL); pthread_mutex_init(&(at_handling.async_requests_queue.mutex), NULL); + at_handling.freeze = AT_FREEZE_OFF; + // First lock to the queues mutexes AT_RESPONSES_QUEUE_LOCK(); AT_SYNC_QUEUE_LOCK(); diff --git a/hayes-ril.c b/hayes-ril.c index 50b4701..4a66fd0 100644 --- a/hayes-ril.c +++ b/hayes-ril.c @@ -35,6 +35,11 @@ struct ril_dispatch_unsol ril_dispatch_unsol[] = { void ril_on_request(int request, void *data, size_t length, RIL_Token t) { + if(at_freeze_get() != AT_FREEZE_OFF) { + RIL_onRequestComplete(t, RIL_E_RADIO_NOT_AVAILABLE, NULL, 0); + return; + } + switch(request) { // Power case RIL_REQUEST_RADIO_POWER: