From 5523d858ebc1ab2416a1882ffb80d860967e17fd Mon Sep 17 00:00:00 2001 From: Jimmy Huang Date: Wed, 5 Mar 2014 15:58:19 -0800 Subject: [PATCH] Fixes TIVI-2600 - HFP calls not ended when app closes - Changed elm policy so that app can be closed using close button on the title bar - Fixed bug where ofono wasn't hanging up the call during cleanup Change-Id: I521ca4e56dc2fd77a29f39bd3a717a7f373e27c7 Signed-off-by: Jimmy Huang --- dialer/gui.c | 11 +++++++++-- utils/ofono.c | 1 + 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/dialer/gui.c b/dialer/gui.c index 04bb454..e8df9c4 100644 --- a/dialer/gui.c +++ b/dialer/gui.c @@ -211,6 +211,12 @@ static void _gui_quit(void) elm_exit(); } +static void _on_del(void *data __UNUSED__, Evas *e __UNUSED__, + Evas_Object *obj __UNUSED__, void *event __UNUSED__) +{ + _gui_quit(); +} + static void _on_clicked(void *data __UNUSED__, Evas_Object *o __UNUSED__, const char *emission, const char *source __UNUSED__) { @@ -353,11 +359,12 @@ Eina_Bool gui_init(void) Evas_Coord w, h; /* dialer should never, ever quit */ - elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_NONE); + elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED); win = elm_win_util_standard_add("ofono-dialer", "oFono Dialer"); EINA_SAFETY_ON_NULL_RETURN_VAL(win, EINA_FALSE); - elm_win_autodel_set(win, EINA_FALSE); + elm_win_autodel_set(win, EINA_TRUE); + evas_object_event_callback_add(win, EVAS_CALLBACK_DEL, _on_del, NULL); #ifdef HAVE_TIZEN appcore_set_i18n("lemolo", NULL); diff --git a/utils/ofono.c b/utils/ofono.c index 757ba86..4f5c51d 100644 --- a/utils/ofono.c +++ b/utils/ofono.c @@ -519,6 +519,7 @@ error_path: static void _call_free(OFono_Call *c) { DBG("c=%p %s", c, c->base.path); + ofono_call_hangup(c, NULL, NULL); _notify_ofono_callbacks_call_list(cbs_call_removed, c); -- 2.7.4