From b8fb0677fab72a19d9a04734de39601804d06412 Mon Sep 17 00:00:00 2001 From: Tushar Janefalkar Date: Thu, 20 Jun 2013 15:41:59 -0700 Subject: [PATCH] Return ATL Close failure if no handle found When a request to RELEASE ATL finds no active subscribers, return ATL close failure Change-Id: I591d5456d5ce1218cc82bf7ba430176ec4f13174 CRs-fixed: 502024 --- loc_api/libloc_api_50001/loc_eng.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index 0422f505..77322c97 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -1800,8 +1800,14 @@ static void loc_eng_deferred_action_thread(void* arg) arlMsg->handle); LOC_LOGD("%s:%d]: Request to stop Emergency call. Handle: %d\n", __func__, __LINE__, arlMsg->handle); - loc_eng_data_p->ds_nif->unsubscribeRsrc((Subscriber*)&s3); - LOC_LOGD("%s:%d]: Unsubscribed from ds_nif", __func__, __LINE__); + if(loc_eng_data_p->ds_nif->unsubscribeRsrc((Subscriber*)&s3)) { + LOC_LOGD("%s:%d]: Unsubscribed from ds_nif", __func__, __LINE__); + } + else { + LOC_LOGE("%s:%d]: Could not release ATL. No subscribers found\n", + __func__, __LINE__); + loc_eng_data_p->client_handle->atlCloseStatus(arlMsg->handle, 0); + } } #endif }