Send home key event using app control to wearable homescreen 36/90036/1 accepted/tizen/3.0/common/20161114.105007 accepted/tizen/3.0/mobile/20161015.034104 accepted/tizen/3.0/wearable/20161015.083949 accepted/tizen/common/20160930.174731 accepted/tizen/mobile/20160930.054043 accepted/tizen/wearable/20160930.054133 submit/tizen/20160930.040728 submit/tizen_3.0_common/20161104.104000 submit/tizen_3.0_mobile/20161015.000006 submit/tizen_3.0_wearable/20161015.000005
authorGeunsun, Lee <gs86.lee@samsung.com>
Wed, 28 Sep 2016 06:05:38 +0000 (15:05 +0900)
committerGeunsun, Lee <gs86.lee@samsung.com>
Wed, 28 Sep 2016 06:05:38 +0000 (15:05 +0900)
Change-Id: Iaa606931563a486292520181a8f256ae6a8e885a

include/wearable/home_mgr.h
src/wearable/home_mgr.c
src/wearable/hw_key.c

index d01a8ea..25a4c73 100644 (file)
@@ -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);
index 906f678..e5dc125 100644 (file)
@@ -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);
 }
 
 
index d76ee58..9c11c20 100644 (file)
@@ -387,6 +387,7 @@ void hw_key_destroy_window(void)
 #include <dd-display.h>
 #include <feedback.h>
 #include <vconf.h>
+#include <aul.h>
 
 #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;