From: junkyu.han Date: Wed, 15 Jul 2015 08:06:21 +0000 (+0900) Subject: Remove old code X-Git-Tag: accepted/tizen/mobile/20150903.053617~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b41b0945cad0581ab5f1b4017abfcca93ea0c21c;p=apps%2Fnative%2Fboot-animation.git Remove old code Change-Id: I34312e1edf018b4d6303e970bd4921295132b20c --- diff --git a/src/animation.c b/src/animation.c index d75f409..4f27378 100644 --- a/src/animation.c +++ b/src/animation.c @@ -53,76 +53,7 @@ static struct animation { int state; Evas_Object *txt; } s_animation = { -.txt = NULL,}; - -#define CHECK_Xorg "/tmp/.wm_ready" -#define CHECK_LCD "/sys/class/lcd" - -static int run_child(const char *argv[]) -{ - pid_t pid; - struct sigaction act, oldact; - int i, r = 0, status; - - if (!argv) - return -EINVAL; - - /* Use default signal handler */ - act.sa_handler = SIG_DFL; - act.sa_sigaction = NULL; - act.sa_flags = 0; - sigemptyset(&act.sa_mask); - - if (sigaction(SIGCHLD, &act, &oldact) < 0) - return -errno; - - pid = fork(); - if (pid < 0) { - r = -errno; - } else if (pid == 0) { - for (i = 0; i < _NSIG; ++i) - signal(i, SIG_DFL); - r = execv(argv[0], (char **)argv); - if (r < 0) - exit(EXIT_FAILURE); - } else { - /* wait for child */ - if (waitpid(pid, &status, 0) != -1) - /* terminated normally */ - if (WIFEXITED(status)) - return WEXITSTATUS(status); - } - - if (sigaction(SIGCHLD, &oldact, NULL) < 0) - _E("Failed to restore sigaction"); - return r; -} - -static int check_window_validity(void) -{ - _D("Check window validity"); - printf("Check window validity\n"); - DIR *dp; - struct dirent *dentry; - int ret = -1; - dp = opendir(CHECK_LCD); - if (!dp) { - _E("Failed to get lcd node"); - printf("Failed to get lcd node\n"); - return -1; - } - while ((dentry = readdir(dp)) != NULL) { - if ((!strcmp(dentry->d_name, ".")) || (!strcmp(dentry->d_name, ".."))) { - continue; - } - else { - ret = 0; - break; - } - } - closedir(dp); - return ret; -} + .txt = NULL,}; static void win_del(void *data, Evas_Object * obj, void *event_info) { @@ -132,18 +63,12 @@ static void win_del(void *data, Evas_Object * obj, void *event_info) static Eina_Bool _end_cb(void *data) { - static const char *argv[5] = { - "/usr/bin/xset", - "dpms", "force", "off", NULL, - }; _D("_end_cb is invoked"); + printf("_end_cb is invoked\n"); if (vconf_set_int(VCONFKEY_BOOT_ANIMATION_FINISHED, 1) != 0) _E("Failed to set finished set"); if (s_animation.state == TYPE_OFF || s_animation.state == TYPE_OFF_WITH_MSG) - run_child(argv); - _D("_end_cb is invoked"); elm_exit(); - _D("_end_cb is invoked"); return ECORE_CALLBACK_CANCEL; } @@ -315,40 +240,6 @@ static int create_window(void) return EXIT_SUCCESS; } -static Eina_Bool _count_for_xorg_timer_cb(void *data) -{ - int ret = 0; - static int count = 0; - - ret = access(CHECK_Xorg, F_OK); - if (ret == 0) { - if (init_layout(data) == EXIT_FAILURE) { - _E("Failed to init the layout object"); - if (data) { - evas_object_del(s_animation.txt); - } - evas_object_del(s_animation.win); - } - count = 0; - return ECORE_CALLBACK_CANCEL; - } - if (count > OVER_COUNT) { - _E("Getting Xorg is delaying, Something is wrong"); - if (init_layout(data) == EXIT_FAILURE) { - _E("Failed to init the layout object"); - if (data) { - evas_object_del(s_animation.txt); - } - evas_object_del(s_animation.win); - } - count = 0; - return ECORE_CALLBACK_CANCEL; - } - count ++; - - return ECORE_CALLBACK_RENEW; -} - int init_animation(int state, const char *msg) { _D("Init animation"); @@ -356,12 +247,6 @@ int init_animation(int state, const char *msg) Ecore_Timer *timer = NULL; - //if (check_window_validity()) { - // _E("Failed to access LCD"); - // printf("Failed to access LCD\n"); - // return EXIT_FAILURE; - //} - s_animation.state = state; if (create_window() == EXIT_FAILURE) { @@ -370,11 +255,12 @@ int init_animation(int state, const char *msg) return EXIT_FAILURE; } - /* waiting initialzing Xorg process during 2 seconds */ - timer = ecore_timer_add(0.1f, _count_for_xorg_timer_cb, msg); - if (!timer) { - _E("Critical Error"); - return EXIT_FAILURE; + if (init_layout(msg) == EXIT_FAILURE) { + _E("Failed to init the layout object"); + if (msg) { + evas_object_del(s_animation.txt); + } + evas_object_del(s_animation.win); } return EXIT_SUCCESS; diff --git a/src/boot.c b/src/boot.c index 647cf50..cf79715 100644 --- a/src/boot.c +++ b/src/boot.c @@ -211,7 +211,6 @@ static void _boot_ani_ui_set_scale(void) } #endif -//int elm_main(int argc, char *argv[]) int main(int argc, char *argv[]) { int fd = 0;