Fixes TIVI-2600 - HFP calls not ended when app closes 35/17235/1
authorJimmy Huang <jimmy.huang@intel.com>
Wed, 5 Mar 2014 23:58:19 +0000 (15:58 -0800)
committerJimmy Huang <jimmy.huang@intel.com>
Wed, 5 Mar 2014 23:58:19 +0000 (15:58 -0800)
- 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 <jimmy.huang@intel.com>
dialer/gui.c
utils/ofono.c

index 04bb454..e8df9c4 100644 (file)
@@ -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);
index 757ba86..4f5c51d 100644 (file)
@@ -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);