Fix bug in dead timer cb 92/43892/3
authorgs86.lee <gs86.lee@samsung.com>
Wed, 15 Jul 2015 06:02:07 +0000 (15:02 +0900)
committergs86.lee <gs86.lee@samsung.com>
Wed, 15 Jul 2015 06:47:49 +0000 (15:47 +0900)
Change-Id: I4e3ba7f8b4657f2dfc74ee92ce1db9d465cbaf0b

src/mobile/home_mgr.c

index 952bcba28c9d3044e8d0b39273ea2a59e1ad5fd0..454d208ec652b607f265e4572c14af63808487a9 100644 (file)
@@ -41,9 +41,6 @@
 #define DEAD_TIMER_SEC 10.0
 #define DEAD_TIMER_COUNT_MAX 2
 
-#define VCONFKEY_PRIVATE_STARTER_IS_FALLBACK "db/private/starter/is_fallback"
-#define VCONFKEY_PRIVATE_STARTER_FALLBACK_PKG "db/private/starter/fallback_pkg"
-
 
 
 int errno;
@@ -148,19 +145,19 @@ static int _show_home_cb(status_active_key_e key, void *data)
                }
                break;
        case 1:
-               if (vconf_get_int(VCONFKEY_PRIVATE_STARTER_IS_FALLBACK, &is_fallback) < 0) {
-                       _E("Failed to get vconfkey : %s", VCONFKEY_PRIVATE_STARTER_IS_FALLBACK);
+               if (vconf_get_int(VCONFKEY_STARTER_IS_FALLBACK, &is_fallback) < 0) {
+                       _E("Failed to get vconfkey : %s", VCONFKEY_STARTER_IS_FALLBACK);
                }
 
                if (is_fallback) {
-                       if (vconf_set_int(VCONFKEY_PRIVATE_STARTER_IS_FALLBACK, 0)) {
-                               _E("Failed to set vconfkey : %s", VCONFKEY_PRIVATE_STARTER_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_PRIVATE_STARTER_FALLBACK_PKG);
+                               fallback_pkg = vconf_get_str(VCONFKEY_STARTER_FALLBACK_PKG);
                                _D("fallback pkg : %s", fallback_pkg);
                                if (fallback_pkg) {
                                        int status;
@@ -172,7 +169,7 @@ static int _show_home_cb(status_active_key_e key, void *data)
                                        }
                                        _E("Failed to set vconfkey : %s (%d)", VCONFKEY_SETAPPL_SELECTED_PACKAGE_NAME, status);
                                } else {
-                                       _E("Failed to get vconfkey : %s", VCONFKEY_PRIVATE_STARTER_FALLBACK_PKG);
+                                       _E("Failed to get vconfkey : %s", VCONFKEY_STARTER_FALLBACK_PKG);
                                }
                        }
                }
@@ -295,9 +292,13 @@ static Eina_Bool _dead_timer_cb(void *data)
        Evas_Object *popup = NULL;
        char title[BUF_SIZE_128] = { 0, };
        char text[BUF_SIZE_1024] = { 0, };
+       char *appid = NULL;
 
-       char *appid = (char *)data;
-       retv_if(!appid, ECORE_CALLBACK_CANCEL);
+       appid = status_active_get()->setappl_selected_package_name;
+       if (!appid) {
+               _E("appid is NULL");
+               return ECORE_CALLBACK_CANCEL;
+       }
 
        _D("dead count : %s(%d)", appid, s_home_mgr.dead_count);
 
@@ -326,12 +327,12 @@ static Eina_Bool _dead_timer_cb(void *data)
                }
 
                /* set fallback status */
-               if (vconf_set_int(VCONFKEY_PRIVATE_STARTER_IS_FALLBACK, 1) < 0) {
-                       _E("Failed to set vconfkey : %s", VCONFKEY_PRIVATE_STARTER_IS_FALLBACK);
+               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_PRIVATE_STARTER_FALLBACK_PKG, appid) < 0) {
-                       _E("Failed to set vconfkey : %s", VCONFKEY_PRIVATE_STARTER_FALLBACK_PKG);
+               if (vconf_set_str(VCONFKEY_STARTER_FALLBACK_PKG, appid) < 0) {
+                       _E("Failed to set vconfkey : %s", VCONFKEY_STARTER_FALLBACK_PKG);
                }
        }
 
@@ -363,7 +364,7 @@ void home_mgr_relaunch_homescreen(void)
 
        if (!s_home_mgr.dead_timer) {
                _D("Add dead timer");
-               s_home_mgr.dead_timer = ecore_timer_add(DEAD_TIMER_SEC, _dead_timer_cb, (void *)appid);
+               s_home_mgr.dead_timer = ecore_timer_add(DEAD_TIMER_SEC, _dead_timer_cb, NULL);
                if (!s_home_mgr.dead_timer) {
                        _E("Failed to add a dead timer");
                }