From 1cf7caba866f44108c2c27b8030aac40053b0095 Mon Sep 17 00:00:00 2001 From: Kartik Tidke Date: Wed, 24 Apr 2019 23:56:35 +0530 Subject: [PATCH] Added Indicator App launch sequence in Common profile Change-Id: Ic4dce7e8407078857141ee9d7cf7530554edf50e Signed-off-by: Kartik Tidke --- include/common/home_mgr.h | 2 ++ src/common/home_mgr.c | 33 ++++++++++++++++++++++++--------- src/common/starter.c | 5 +++++ 3 files changed, 31 insertions(+), 9 deletions(-) diff --git a/include/common/home_mgr.h b/include/common/home_mgr.h index 8e48998..9ec8e18 100644 --- a/include/common/home_mgr.h +++ b/include/common/home_mgr.h @@ -20,11 +20,13 @@ extern int home_mgr_get_home_pid(void); extern int home_mgr_get_volume_pid(void); +extern int home_mgr_get_indicator_pid(void); extern void home_mgr_init(void *data); extern void home_mgr_fini(void); void home_mgr_relaunch_homescreen(void); void home_mgr_relaunch_volume(void); +void home_mgr_relaunch_indicator(void); extern void home_mgr_open_home(const char *appid, const char *key, const char *val); // End of a file diff --git a/src/common/home_mgr.c b/src/common/home_mgr.c index 08df060..42130b0 100644 --- a/src/common/home_mgr.c +++ b/src/common/home_mgr.c @@ -42,12 +42,13 @@ #define DEAD_TIMER_SEC 10.0 #define DEAD_TIMER_COUNT_MAX 2 - +#define APPID_INDICATOR "org.tizen.indicator" int errno; static struct { pid_t home_pid; pid_t volume_pid; + pid_t indicator_pid; int power_off; Ecore_Timer *dead_timer; @@ -57,6 +58,7 @@ static struct { } s_home_mgr = { .home_pid = (pid_t)-1, .volume_pid = (pid_t)-1, + .indicator_pid = (pid_t)-1, .power_off = 0, .dead_timer = NULL, @@ -78,7 +80,10 @@ int home_mgr_get_volume_pid(void) return s_home_mgr.volume_pid; } - +int home_mgr_get_indicator_pid(void) +{ + return s_home_mgr.indicator_pid; +} static void _after_launch_home(int pid) { @@ -254,6 +259,11 @@ static void _after_launch_volume(int pid) #endif +static void _after_launch_indicator(int pid) +{ + s_home_mgr.indicator_pid = pid; +} + static void _launch_after_home(int pid) { @@ -389,6 +399,11 @@ void home_mgr_relaunch_volume(void) } +void home_mgr_relaunch_indicator(void) +{ + process_mgr_must_launch(APPID_INDICATOR, NULL, NULL, NULL, _after_launch_indicator); +} + static int _power_off_cb(status_active_key_e key, void *data) { @@ -407,14 +422,16 @@ static int _power_off_cb(status_active_key_e key, void *data) -#if VOLUME_ENABLE -static Eina_Bool _launch_volume_idler_cb(void *data) + +static Eina_Bool _launch_apps_idler_cb(void *data) { +#if VOLUME_ENABLE process_mgr_must_syspopup_launch(SYSPOPUPID_VOLUME, NULL, NULL, NULL, _after_launch_volume); - return ECORE_CALLBACK_CANCEL; -} #endif + process_mgr_must_launch(APPID_INDICATOR, NULL, NULL, NULL, _after_launch_indicator); + return ECORE_CALLBACK_CANCEL; +} void home_mgr_init(void *data) @@ -426,9 +443,7 @@ void home_mgr_init(void *data) status_active_register_cb(STATUS_ACTIVE_KEY_SETAPPL_SELECTED_PACKAGE_NAME, _change_selected_package_name, NULL); _change_selected_package_name(STATUS_ACTIVE_KEY_SETAPPL_SELECTED_PACKAGE_NAME, NULL); -#if VOLUME_ENABLE - ecore_idler_add(_launch_volume_idler_cb, NULL); -#endif + ecore_idler_add(_launch_apps_idler_cb, NULL); } diff --git a/src/common/starter.c b/src/common/starter.c index 6e76c79..3f34eb1 100755 --- a/src/common/starter.c +++ b/src/common/starter.c @@ -191,6 +191,7 @@ static int _set_i18n(const char *domain, const char *dir) static int _check_dead_signal(int pid, void *data) { int home_pid = 0; + int indicator_pid = 0; #if LOCKSCREEN_ENABLE int volume_pid = 0; int lock_pid = 0; @@ -204,6 +205,7 @@ static int _check_dead_signal(int pid, void *data) } home_pid = home_mgr_get_home_pid(); + indicator_pid = home_mgr_get_indicator_pid(); #if LOCKSCREEN_ENABLE volume_pid = home_mgr_get_volume_pid(); lock_pid = lock_mgr_get_lock_pid(); @@ -220,6 +222,9 @@ static int _check_dead_signal(int pid, void *data) _D("lockscreen is dead"); lock_mgr_unlock(); #endif + } else if (pid == indicator_pid) { + _D("indicator is dead"); + home_mgr_relaunch_indicator(); } else { _D("Unknown process, ignore it"); } -- 2.7.4