Change launch order of softkey in commom profile [TIZENIOT-2001] 69/244669/1 accepted/tizen_6.0_unified tizen_6.0 accepted/tizen/6.0/unified/20201030.122855 accepted/tizen/6.0/unified/hotfix/20201103.052020 accepted/tizen/unified/20200924.072500 submit/tizen/20200923.061637 submit/tizen_6.0/20201029.205101 submit/tizen_6.0_hotfix/20201102.192501 submit/tizen_6.0_hotfix/20201103.114801 tizen_6.0.m2_release
authoraman.jeph <aman.jeph@samsung.com>
Wed, 23 Sep 2020 05:57:12 +0000 (11:27 +0530)
committeraman.jeph <aman.jeph@samsung.com>
Wed, 23 Sep 2020 05:57:12 +0000 (11:27 +0530)
Change-Id: I25d30c39e00538bf905cfc15b963250474b47e8d
Signed-off-by: aman.jeph <aman.jeph@samsung.com>
include/common/home_mgr.h
src/common/home_mgr.c
src/common/starter.c

index 5cf92ad..9a340c4 100755 (executable)
@@ -23,6 +23,7 @@ extern int home_mgr_get_volume_pid(void);
 extern int home_mgr_get_indicator_pid(void);
 extern int home_mgr_get_quickpanel_pid(void);
 extern int home_mgr_get_softkey_pid(void);
+extern void home_mgr_softkey_dead_signal_received();
 
 extern void home_mgr_init(void *data);
 extern void home_mgr_fini(void);
index c6b0343..b4fcd9a 100755 (executable)
@@ -73,6 +73,7 @@ static struct {
        .popup = NULL,
 };
 
+ static void home_mgr_softkey_change(void *user_data);
 
 int home_mgr_get_home_pid(void)
 {
@@ -101,6 +102,11 @@ int home_mgr_get_softkey_pid(void)
        return s_home_mgr.softkey_pid;
 }
 
+void home_mgr_softkey_dead_signal_received()
+{
+       s_home_mgr.softkey_pid = 0;
+}
+
 static void _after_launch_home(int pid)
 {
        if (pid != s_home_mgr.home_pid) {
@@ -152,7 +158,7 @@ static int _show_home_cb(status_active_key_e key, void *data)
        int seq = status_active_get()->starter_sequence;
        int is_fallback = 0;
 
-       _D("[MENU_DAEMON] _show_home_cb is invoked(%d)", seq);
+       _D("[MENU_DAEMON] _show_home_cb is invoked(%d) (key: %d)", seq, key);
 
        switch (seq) {
        case 0:
@@ -195,6 +201,8 @@ static int _show_home_cb(status_active_key_e key, void *data)
                }
 
                home_mgr_open_home(NULL, NULL, NULL);
+               // we need to launch softkey after home-screen.
+               home_mgr_softkey_change(NULL);
                break;
        default:
                _E("False sequence [%d]", seq);
@@ -443,6 +451,12 @@ static void home_mgr_softkey_change(void *user_data)
        }
 
        _D("VCONFKEY_SETAPPL_SOFT_KEY STATUS == %d ", state);
+       int pid = home_mgr_get_softkey_pid();
+       if(state == TRUE && pid > 0)
+       {
+               _D("softkey is already running with PID: %d", pid);
+               return ;
+       }
        if(state == TRUE) {
                process_mgr_must_launch(APPID_SOFTKEY, NULL, NULL, NULL, _after_launch_softkey);
        } else {
@@ -501,7 +515,6 @@ static Eina_Bool _launch_apps_idler_cb(void *data)
 #endif
        process_mgr_must_launch(APPID_INDICATOR, NULL, NULL, NULL, _after_launch_indicator);
        process_mgr_must_launch(APPID_QUICKPANEL, NULL, NULL, NULL, _after_launch_quickpanel);
-       home_mgr_softkey_change(NULL);
        return ECORE_CALLBACK_CANCEL;
 }
 
index 7f4b791..007b163 100755 (executable)
@@ -199,6 +199,7 @@ static int _check_dead_signal(int pid, void *data)
        int lock_pid = 0;
 #endif
        int oobe_setup_pid = 0;
+       int softkey_pid = 0;
 
        _D("Process %d is termianted", pid);
 
@@ -216,6 +217,10 @@ static int _check_dead_signal(int pid, void *data)
 #endif
        oobe_setup_pid = oobe_mgr_get_oobe_setup_pid();
 
+       // we checking softkey signal here , because we need to reset the softkey pid
+       // so that softkey is only launched when softkey is dead only not on every _show_home_cb.
+       softkey_pid = home_mgr_get_softkey_pid();
+
        if (pid == home_pid) {
                _D("Homescreen is dead");
                home_mgr_relaunch_homescreen();
@@ -236,6 +241,9 @@ static int _check_dead_signal(int pid, void *data)
        } else if (pid == oobe_setup_pid) {
                _D("oobe setup is dead");
                oobe_mgr_oobe_setup_terminated();
+       } else if (pid == softkey_pid) {
+               _D("softkey is dead");
+               home_mgr_softkey_dead_signal_received();
        } else {
                _D("Unknown process, ignore it");
        }