From f4052259bd95f37c577d3614e6264bb780c4c1eb Mon Sep 17 00:00:00 2001 From: Amritanshu Date: Tue, 31 Aug 2021 16:20:30 +0530 Subject: [PATCH] Starter refactoring: remove home package id and resolve issue of setting multiple Home apps Change-Id: Iecb6d86bcc3d6d1f60d1deb28488c8489babb63e Signed-off-by: Amritanshu --- include/util.h | 6 ++---- src/common/home_mgr.c | 32 ++++++++++++++++---------------- src/status.c | 7 ++----- 3 files changed, 20 insertions(+), 25 deletions(-) diff --git a/include/util.h b/include/util.h index 55f0be2..3f84ef7 100644 --- a/include/util.h +++ b/include/util.h @@ -22,17 +22,15 @@ #include #define APP_TRAY_PKG_NAME "org.tizen.app-tray" -#define MENU_SCREEN_PKG_NAME "org.tizen.menu-screen" #define PROVIDER_PKG_NAME "org.tizen.data-provider-master" #define CLUSTER_HOME_PKG_NAME "org.tizen.cluster-home" #define EASY_HOME_PKG_NAME "org.tizen.easy-home" #define EASY_APPS_PKG_NAME "org.tizen.easy-apps" #define ISE_DEFAULT_PKG_NAME "ise-default" -#ifdef TIZEN_PROFILE_COMMON -#define HOMESCREEN_PKG_NAME "org.tizen.homescreen-efl" -#elif TIZEN_PROFILE_MOBILE +#ifdef TIZEN_PROFILE_MOBILE #define HOMESCREEN_PKG_NAME "org.tizen.homescreen-efl" +#define MENU_SCREEN_PKG_NAME "org.tizen.menu-screen" #elif TIZEN_PROFILE_WEARABLE #define IDLE_CLOCK_PKG_NAME "org.tizen.classic-watch" #define HOMESCREEN_PKG_NAME "org.tizen.w-home" diff --git a/src/common/home_mgr.c b/src/common/home_mgr.c index 12c2745..a0e1112 100755 --- a/src/common/home_mgr.c +++ b/src/common/home_mgr.c @@ -119,8 +119,8 @@ static void _after_launch_home(int pid) } - -static int _change_home_cb(const char *appid, const char *key, const char *value, void *cfn, void *afn) +/* Remove change home callback as no alternative home app in IoT profile */ +/*static int _change_home_cb(const char *appid, const char *key, const char *value, void *cfn, void *afn) { if (!strcmp(appid, MENU_SCREEN_PKG_NAME)) { _E("We cannot do anything anymore."); @@ -128,12 +128,12 @@ static int _change_home_cb(const char *appid, const char *key, const char *value if (vconf_set_str(VCONFKEY_SETAPPL_SELECTED_PACKAGE_NAME, MENU_SCREEN_PKG_NAME) != 0) { _E("cannot set the vconf key as %s", MENU_SCREEN_PKG_NAME); } - /* change_home func will be called by changing the home */ + // change_home func will be called by changing the home return 0; } _E("cannot change home"); return -1; -} +}*/ @@ -147,8 +147,7 @@ void home_mgr_open_home(const char *appid, const char *key, const char *val) home_appid = appid; } ret_if(!home_appid); - - process_mgr_must_launch(home_appid, key, val, _change_home_cb, _after_launch_home); + process_mgr_must_launch(home_appid, key, val, NULL, _after_launch_home); } @@ -175,14 +174,13 @@ static int _show_home_cb(status_active_key_e key, void *data) _E("Failed to get vconfkey : %s", VCONFKEY_STARTER_IS_FALLBACK); } - if (is_fallback) { + /* No need to set fallback package as no alternative home app in IoT profile */ + /*if (is_fallback) { if (vconf_set_int(VCONFKEY_STARTER_IS_FALLBACK, 0)) { _E("Failed to set vconfkey : %s", VCONFKEY_STARTER_IS_FALLBACK); } - if (!strcmp(status_active_get()->setappl_selected_package_name, MENU_SCREEN_PKG_NAME)) { char *fallback_pkg; - fallback_pkg = vconf_get_str(VCONFKEY_STARTER_FALLBACK_PKG); _D("fallback pkg : %s", fallback_pkg); if (fallback_pkg) { @@ -198,7 +196,7 @@ static int _show_home_cb(status_active_key_e key, void *data) _E("Failed to get vconfkey : %s", VCONFKEY_STARTER_FALLBACK_PKG); } } - } + }*/ home_mgr_open_home(NULL, NULL, NULL); // we need to launch softkey after home-screen. @@ -313,7 +311,7 @@ static void _launch_home(const char *appid) } ret_if(!home_appid); - process_mgr_must_launch(home_appid, HOME_TERMINATED, ISTRUE, _change_home_cb, _launch_after_home); + process_mgr_must_launch(home_appid, HOME_TERMINATED, ISTRUE, NULL, _launch_after_home); } @@ -346,13 +344,14 @@ static Eina_Bool _dead_timer_cb(void *data) _D("Change homescreen package to default"); /* set fallback status */ - if (vconf_set_int(VCONFKEY_STARTER_IS_FALLBACK, 1) < 0) { + /* No need to set fallback package as no alternative home app in IoT profile */ + /*if (vconf_set_int(VCONFKEY_STARTER_IS_FALLBACK, 1) < 0) { _E("Failed to set vconfkey : %s", VCONFKEY_STARTER_IS_FALLBACK); } if (vconf_set_str(VCONFKEY_STARTER_FALLBACK_PKG, appid) < 0) { _E("Failed to set vconfkey : %s", VCONFKEY_STARTER_FALLBACK_PKG); - } + }*/ strncpy(title, _("IDS_COM_POP_WARNING"), sizeof(title)); title[sizeof(title) - 1] = '\0'; @@ -370,10 +369,11 @@ static Eina_Bool _dead_timer_cb(void *data) } } - if (vconf_set_str(VCONFKEY_SETAPPL_SELECTED_PACKAGE_NAME, MENU_SCREEN_PKG_NAME) != 0) { - _E("cannot set the vconf key as %s", MENU_SCREEN_PKG_NAME); + /*if (vconf_set_str(VCONFKEY_SETAPPL_SELECTED_PACKAGE_NAME, appid) != 0) { + _E("cannot set the vconf key as %s", appid); return ECORE_CALLBACK_RENEW; - } + }*/ + home_mgr_relaunch_homescreen(); } s_home_mgr.dead_timer = NULL; diff --git a/src/status.c b/src/status.c index b241444..8e68859 100644 --- a/src/status.c +++ b/src/status.c @@ -107,7 +107,8 @@ static void _setappl_select_pkg_cb(keynode_t* node, void *data) { ret_if(!node); - _set_str_with_default(node, HOMESCREEN_PKG_NAME, + char *fallback_pkg = vconf_get_str(VCONFKEY_STARTER_FALLBACK_PKG); + _set_str_with_default(node, fallback_pkg, s_status_active.setappl_selected_package_name); if (!s_status_active.setappl_selected_package_name) _E("Package name is NULL"); @@ -335,10 +336,6 @@ int status_register(void) } if (!(s_status_active.setappl_selected_package_name = vconf_get_str(VCONFKEY_SETAPPL_SELECTED_PACKAGE_NAME))) { _E("Failed to get vconfkey[%s]", VCONFKEY_SETAPPL_SELECTED_PACKAGE_NAME); - s_status_active.setappl_selected_package_name = strdup(HOMESCREEN_PKG_NAME); - if (!s_status_active.setappl_selected_package_name) { - _E("Failed to duplicate string"); - } } if (vconf_notify_key_changed(VCONFKEY_SETAPPL_SCREEN_LOCK_TYPE_INT, _setappl_screen_lock_type_cb, NULL) < 0) { -- 2.7.4