From: Geunsun, Lee Date: Wed, 28 Sep 2016 06:05:38 +0000 (+0900) Subject: Send home key event using app control to wearable homescreen X-Git-Tag: accepted/tizen/3.0/common/20161114.105007^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F36%2F90036%2F1;p=apps%2Fnative%2Fstarter.git Send home key event using app control to wearable homescreen Change-Id: Iaa606931563a486292520181a8f256ae6a8e885a --- diff --git a/include/wearable/home_mgr.h b/include/wearable/home_mgr.h index d01a8ea..25a4c73 100644 --- a/include/wearable/home_mgr.h +++ b/include/wearable/home_mgr.h @@ -19,7 +19,7 @@ extern void home_mgr_launch_home(void); extern void home_mgr_launch_home_first(void); -extern void home_mgr_launch_home_by_power(void); +extern void home_mgr_launch_home_by_power(const char *val); extern void home_mgr_init(void); extern void home_mgr_fini(void); diff --git a/src/wearable/home_mgr.c b/src/wearable/home_mgr.c index 906f678..e5dc125 100644 --- a/src/wearable/home_mgr.c +++ b/src/wearable/home_mgr.c @@ -60,9 +60,9 @@ void home_mgr_launch_home_first(void) -void home_mgr_launch_home_by_power(void) +void home_mgr_launch_home_by_power(const char *val) { - process_mgr_must_launch(s_home_mgr.home_appid, "home_op", "powerkey", NULL, _after_launch_home); + process_mgr_must_launch(s_home_mgr.home_appid, "home_op", val, NULL, _after_launch_home); } diff --git a/src/wearable/hw_key.c b/src/wearable/hw_key.c index d76ee58..9c11c20 100644 --- a/src/wearable/hw_key.c +++ b/src/wearable/hw_key.c @@ -387,6 +387,7 @@ void hw_key_destroy_window(void) #include #include #include +#include #include "hw_key.h" #include "util.h" @@ -460,6 +461,7 @@ static struct { Eina_Bool is_long_press; int powerkey_count; Eina_Bool is_cancel; + Eina_Bool is_home_focused; } key_info = { .key_up = NULL, .key_down = NULL, @@ -475,6 +477,7 @@ static struct { .is_long_press = EINA_FALSE, .powerkey_count = 0, .is_cancel = EINA_FALSE, + .is_home_focused = EINA_FALSE, }; @@ -590,7 +593,7 @@ static Eina_Bool _powerkey_timer_cb(void *data) return ECORE_CALLBACK_CANCEL; } - home_mgr_launch_home_by_power(); + home_mgr_launch_home_by_power((key_info.is_home_focused == EINA_TRUE) ? "powerkey_focused" : "powerkey_unfocused"); return ECORE_CALLBACK_CANCEL; } @@ -666,6 +669,8 @@ static Eina_Bool _key_press_cb(void *data, int type, void *event) _D("_key_press_cb : %s Pressed", ev->keyname); if (!strcmp(ev->keyname, key_name[KEY_POWER])) { + int status = 0; + _W("POWER Key is pressed"); /** @@ -699,6 +704,10 @@ static Eina_Bool _key_press_cb(void *data, int type, void *event) if(!key_info.power_long_press_timer) { _E("Failed to add power_long_press_timer"); } + + status = aul_app_get_status("org.tizen.w-home"); + key_info.is_home_focused = (status == STATUS_FOCUS) ? EINA_TRUE : EINA_FALSE; + _D("home focus status : %d", key_info.is_home_focused); } else if (!strcmp(ev->keyname, key_name[KEY_CANCEL])) { _D("CANCEL key is pressed"); key_info.is_cancel = EINA_TRUE;