From: junkyu.han Date: Tue, 14 Jul 2015 02:46:35 +0000 (+0900) Subject: Add window role for window stack X-Git-Tag: accepted/tizen/mobile/20150714.075057^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fc928194f2d477be4dbc026e8d42141f6643a6d8;p=apps%2Fnative%2Fboot-animation.git Add window role for window stack Change-Id: Ia6bc06c1ad4e491b7f30a7af81afdbbd9bd9db55 --- diff --git a/boot-animation.manifest b/boot-animation.manifest index 9c28294..985bf08 100755 --- a/boot-animation.manifest +++ b/boot-animation.manifest @@ -1,14 +1,5 @@ - - - + - - - - - - - diff --git a/packaging/boot-animation.service b/packaging/boot-animation.service index b997524..a257169 100644 --- a/packaging/boot-animation.service +++ b/packaging/boot-animation.service @@ -1,6 +1,6 @@ [Unit] Description=Boot Animation -After=wm_ready.service sound-server.service pulseaudio.service sound-init.service system-server.service +After=sound-server.service pulseaudio.service sound-init.service system-server.service Before=tizen-system.target ConditionPathExists=!/tmp/restart ConditionKernelCommandLine=|!bootmode=silent diff --git a/packaging/boot-animation.spec b/packaging/boot-animation.spec index 0185335..ad1f953 100644 --- a/packaging/boot-animation.spec +++ b/packaging/boot-animation.spec @@ -63,7 +63,6 @@ cp -f LICENSE %{buildroot}/usr/share/license/%{name} mkdir -p %{buildroot}/usr/lib/systemd/system/multi-user.target.wants install -m 0644 %SOURCE1 %{buildroot}/usr/lib/systemd/system/boot-animation.service -ln -s ../boot-animation.service %{buildroot}/usr/lib/systemd/system/multi-user.target.wants/ install -m 0644 %SOURCE2 %{buildroot}/usr/lib/systemd/system/shutdown-animation.service install -m 0644 %SOURCE3 %{buildroot}/usr/lib/systemd/system/silent-animation.service ln -s ../silent-animation.service %{buildroot}/usr/lib/systemd/system/multi-user.target.wants/ @@ -98,7 +97,6 @@ make clean /usr/share/license/%{name} %{_bindir}/boot-animation /usr/lib/systemd/system/boot-animation.service -/usr/lib/systemd/system/multi-user.target.wants/boot-animation.service /usr/lib/systemd/system/shutdown-animation.service /usr/lib/systemd/system/silent-animation.service /usr/lib/systemd/system/multi-user.target.wants/silent-animation.service diff --git a/src/animation.c b/src/animation.c index 740c188..d75f409 100644 --- a/src/animation.c +++ b/src/animation.c @@ -101,27 +101,25 @@ static int run_child(const char *argv[]) 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); - _D("Check window validity"); if (!dp) { _E("Failed to get lcd node"); + printf("Failed to get lcd node\n"); return -1; } while ((dentry = readdir(dp)) != NULL) { - _D("Check window validity"); if ((!strcmp(dentry->d_name, ".")) || (!strcmp(dentry->d_name, ".."))) { continue; } else { - _D("Check window validity"); ret = 0; break; } } - _D("Check window validity"); closedir(dp); return ret; } @@ -267,12 +265,15 @@ static void fini_layout(void) static int create_window(void) { _D("Create Window"); + printf("Create Window\n"); int x, y = 0; - s_animation.win = elm_win_add(NULL, "", ELM_WIN_NOTIFICATION); + s_animation.win = elm_win_add(NULL, "BOOT_ANIMATION", ELM_WIN_NOTIFICATION); + elm_win_role_set(s_animation.win, "alert"); if (!s_animation.win) { _E("Failed to create a new window"); + printf("Failed to create a new window\n"); return EXIT_FAILURE; } if (s_animation.state == TYPE_OFF || s_animation.state == TYPE_OFF_WITH_MSG) { @@ -351,11 +352,13 @@ static Eina_Bool _count_for_xorg_timer_cb(void *data) int init_animation(int state, const char *msg) { _D("Init animation"); + printf("Init animation\n"); Ecore_Timer *timer = NULL; //if (check_window_validity()) { // _E("Failed to access LCD"); + // printf("Failed to access LCD\n"); // return EXIT_FAILURE; //} @@ -363,6 +366,7 @@ int init_animation(int state, const char *msg) if (create_window() == EXIT_FAILURE) { _E("Failed to create a new window"); + printf("Failed to create a new window\n"); return EXIT_FAILURE; } @@ -380,5 +384,7 @@ int fini_animation(void) { fini_layout(); evas_object_del(s_animation.win); + fflush(stdout); + close(1); return EXIT_SUCCESS; } diff --git a/src/boot.c b/src/boot.c index e3306be..647cf50 100644 --- a/src/boot.c +++ b/src/boot.c @@ -89,6 +89,7 @@ static int xready_cb(keynode_t * node, void *user_data) int argc; char **argv; int type = TYPE_UNKNOWN; + int clear_type = TYPE_UNKNOWN; int soundon = 1; /* default sound on */ struct args *args = user_data; char wav_path[256]; @@ -103,9 +104,11 @@ static int xready_cb(keynode_t * node, void *user_data) static int invoked_flag = 0; _D("xready_cb"); + printf("xready_cb\n"); if (invoked_flag == 1) { _E("Already launched"); + printf("Error Already launched\n"); return EXIT_FAILURE; } @@ -114,6 +117,11 @@ static int xready_cb(keynode_t * node, void *user_data) argc = args->argc; argv = args->argv; + int i; + for (i = 0; i < argc; i++) { + _D("argc %d [%s]", i, argv[i]); + printf("argc %d [%s]\n", i, argv[i]); + } while ((c = getopt_long(argc, argv, "spom:c", long_options, NULL)) >= 0) { switch (c) { @@ -133,9 +141,13 @@ static int xready_cb(keynode_t * node, void *user_data) if (!args->msg) perror("strdup"); continue; + case 'c': + clear_type = TYPE_CLEAR; + continue; default: type = TYPE_UNKNOWN; _D("[Boot-ani] unknown arg [%s]", optarg); + printf("[Boot-anim] unknown arg [%s]\n", optarg); return EXIT_FAILURE; } } @@ -143,17 +155,24 @@ static int xready_cb(keynode_t * node, void *user_data) /* check sound profile */ if (vconf_get_bool(VCONFKEY_SETAPPL_SOUND_STATUS_BOOL, &soundon) < 0) { _D("VCONFKEY_SETAPPL_SOUND_STATUS_BOOL ==> FAIL!!"); + printf("VCONFKEY_SETAPPL_SOUND_STATUS_BOOL ==> FAIL!!\n"); } _D("Sound status: %d", soundon); + printf("Sound status: %d\n", soundon); if (init_animation(type, args->msg) != EXIT_SUCCESS) { _D("Exit boot-animation"); + printf("Exit boot-animation\n"); return EXIT_FAILURE; } if (soundon) { + _D("Sound on!!"); + printf("Sound on!!\n"); if (!get_wav_file(type, wav_path)) { + _D("File path: %s", wav_path); + printf("File path: %s\n", wav_path); mm_sound_boot_ready(3); mm_sound_boot_play_sound(wav_path); } @@ -195,6 +214,7 @@ static void _boot_ani_ui_set_scale(void) //int elm_main(int argc, char *argv[]) int main(int argc, char *argv[]) { + int fd = 0; struct args args; setenv("HOME", "/home/root", 1); @@ -211,10 +231,16 @@ int main(int argc, char *argv[]) _boot_ani_ui_set_scale(); #endif + close(1); + fd = open("/tmp/myfile.txt", O_CREAT|O_RDWR, S_IRWXU|S_IRWXO); + _D("result of open: %d", fd); + printf("[%s/%s/%d] fd == %d\n", __FILE__, __func__, __LINE__, fd); + elm_init(argc, argv); if (vconf_set_int(VCONFKEY_BOOT_ANIMATION_FINISHED, 0) != 0) { _D("Failed to set finished value to 0\n"); + printf("[%s/%s/%d] Failed to set finished value to 0\n", __FILE__, __func__, __LINE__); } if (xready_cb(NULL, &args) != EXIT_SUCCESS) { vconf_set_int(VCONFKEY_BOOT_ANIMATION_FINISHED, 1);