From 6291f24aabcf9d3dec016f57fe94dbd9c63acf46 Mon Sep 17 00:00:00 2001 From: "gs86.lee" Date: Thu, 30 Jul 2015 14:52:44 +0900 Subject: [PATCH] Launch lockscreen after boot animation is finished Change-Id: Id2e5cd2bf54d7408db559e86e19762c24643b5d5 --- CMakeLists.txt | 5 +++-- include/status.h | 3 ++- src/mobile/lock_mgr.c | 6 ++++++ src/mobile/starter.c | 20 +++++++++++++++++++- src/status.c | 32 ++++++++++++++++++-------------- 5 files changed, 48 insertions(+), 18 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7a12819..8599263 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -165,7 +165,7 @@ SET(BUILD_SOURCE src/mobile/hw_key.c ) ENDIF(X11_SUPPORT) -ELSE() +ELSE("${TIZEN_PROFILE_NAME}" STREQUAL "MOBILE") SET(BUILD_SOURCE src/dbus_util.c src/package_mgr.c @@ -183,7 +183,8 @@ SET(BUILD_SOURCE src/wearable/hw_key.c ) ENDIF(X11_SUPPORT) -ENDIF() +ENDIF("${TIZEN_PROFILE_NAME}" STREQUAL "MOBILE") + ADD_EXECUTABLE(${PROJECT_NAME} ${BUILD_SOURCE}) TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS}) INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${BINDIR}) diff --git a/include/status.h b/include/status.h index a5d58e3..52a5ac1 100644 --- a/include/status.h +++ b/include/status.h @@ -38,6 +38,7 @@ typedef enum { STATUS_ACTIVE_KEY_STARTER_SEQUENCE, STATUS_ACTIVE_KEY_SYSMAN_POWER_OFF_STATUS, STATUS_ACTIVE_KEY_LANGSET, + STATUS_ACTIVE_KEY_BOOT_ANIMATION_FINISHED, STATUS_ACTIVE_KEY_MAX, } status_active_key_e; @@ -49,6 +50,7 @@ struct status_active_s { int pm_state; int starter_sequence; int sysman_power_off_status; + int boot_animation_finished; }; struct status_passive_s { @@ -66,7 +68,6 @@ struct status_passive_s { int setappl_sound_lock_bool; int setappl_motion_activation; int setappl_use_pick_up; - int boot_animation_finished; char *setappl_3rd_lock_pkg_name_str; }; diff --git a/src/mobile/lock_mgr.c b/src/mobile/lock_mgr.c index 7dc0a3f..8aa9969 100644 --- a/src/mobile/lock_mgr.c +++ b/src/mobile/lock_mgr.c @@ -447,6 +447,7 @@ static void _on_lcd_changed_receive(void *data, DBusMessage *msg) } } else { _D("Password lock is OFF"); +#if 0 char *lcd_off_source = dbus_util_msg_arg_get_str(msg); ret_if(!lcd_off_source); @@ -472,6 +473,11 @@ static void _on_lcd_changed_receive(void *data, DBusMessage *msg) } free(lcd_off_source); +#else + if (!lock_mgr_lockscreen_launch()) { + _E("Failed to launch lockscreen"); + } +#endif } } else { _E("%s dbus_message_is_signal error", DEVICED_INTERFACE_DISPLAY); diff --git a/src/mobile/starter.c b/src/mobile/starter.c index d9eb6d2..960df8e 100644 --- a/src/mobile/starter.c +++ b/src/mobile/starter.c @@ -121,6 +121,21 @@ static int _power_off_cb(status_active_key_e key, void *data) +static int _boot_animation_finished_cb(status_active_key_e key, void *data) +{ + int val = status_active_get()->boot_animation_finished; + _D("boot animation finished : %d", val); + + if (val == 1) { + lock_mgr_daemon_start(); + _show_home(); + } + + return 1; +} + + + static void _language_changed_cb(keynode_t *node, void *data) { char *lang = NULL; @@ -237,12 +252,14 @@ static void _init(struct appdata *ad) status_register(); status_active_register_cb(STATUS_ACTIVE_KEY_SYSMAN_POWER_OFF_STATUS, _power_off_cb, NULL); + status_active_register_cb(STATUS_ACTIVE_KEY_BOOT_ANIMATION_FINISHED, _boot_animation_finished_cb, NULL); /* Ordering : _hide_home -> process_mgr_must_launch(pwlock) -> _show_home */ _hide_home(); +#if 0 process_mgr_must_launch(PWLOCK_LITE_PKG_NAME, NULL, NULL, _fail_to_launch_pwlock, _after_launch_pwlock); +#endif - lock_mgr_daemon_start(); #ifdef HAVE_X11 hw_key_create_window(); #endif @@ -262,6 +279,7 @@ static void _fini(struct appdata *ad) lock_mgr_daemon_end(); status_active_unregister_cb(STATUS_ACTIVE_KEY_SYSMAN_POWER_OFF_STATUS, _power_off_cb); + status_active_unregister_cb(STATUS_ACTIVE_KEY_BOOT_ANIMATION_FINISHED, _boot_animation_finished_cb); status_unregister(); if (vconf_ignore_key_changed(VCONFKEY_LANGSET, _language_changed_cb) < 0) { diff --git a/src/status.c b/src/status.c index 818cca5..f0d145d 100644 --- a/src/status.c +++ b/src/status.c @@ -43,6 +43,7 @@ static struct status_active_s s_status_active = { .pm_state = -1, .starter_sequence = -1, .sysman_power_off_status = -1, + .boot_animation_finished = -1, }; @@ -61,7 +62,6 @@ static struct status_passive_s s_status_passive = { .setappl_sound_lock_bool = -1, .setappl_motion_activation = -1, .setappl_use_pick_up = -1, - .boot_animation_finished = -1, .setappl_3rd_lock_pkg_name_str = NULL, }; @@ -197,6 +197,12 @@ static void _status_active_change_cb(keynode_t* node, void *data) continue_if(!info->func); if (0 == info->func(STATUS_ACTIVE_KEY_LANGSET, info->data)) break; } + } else if (!strcmp(key_name, VCONFKEY_BOOT_ANIMATION_FINISHED)) { + s_status_active.boot_animation_finished = vconf_keynode_get_int(node); + EINA_LIST_FOREACH(s_status_active.list[STATUS_ACTIVE_KEY_BOOT_ANIMATION_FINISHED], l, info) { + continue_if(!info->func); + if (0 == info->func(STATUS_ACTIVE_KEY_BOOT_ANIMATION_FINISHED, info->data)) break; + } #if 0 } else if (!strcmp(key_name, )) { s_status_active. = vconf_keynode_get_int(node); @@ -240,8 +246,6 @@ static void _status_passive_change_cb(keynode_t* node, void *data) s_status_passive.setappl_psmode = vconf_keynode_get_int(node); } else if (!strcmp(key_name, VCONFKEY_STARTER_RESERVED_APPS_STATUS)) { s_status_passive.starter_reserved_apps_status = vconf_keynode_get_int(node); - } else if (!strcmp(key_name, VCONFKEY_BOOT_ANIMATION_FINISHED)) { - s_status_passive.boot_animation_finished = vconf_keynode_get_int(node); } else if (!strcmp(key_name, VCONFKEY_SETAPPL_3RD_LOCK_PKG_NAME_STR)) { char *tmp = vconf_keynode_get_str(node); char *a_tmp; @@ -322,6 +326,13 @@ int status_register(void) _E("Failed to get vconfkey[%s]", VCONFKEY_LANGSET); } + if (vconf_notify_key_changed(VCONFKEY_BOOT_ANIMATION_FINISHED, _status_active_change_cb, NULL) < 0) { + _E("Failed to register add the callback for %s", VCONFKEY_BOOT_ANIMATION_FINISHED); + } else if (vconf_get_int(VCONFKEY_BOOT_ANIMATION_FINISHED, &s_status_active.boot_animation_finished) < 0) { + _E("Failed to get vconfkey[%s]", VCONFKEY_BOOT_ANIMATION_FINISHED); + s_status_active.boot_animation_finished = -1; + } + #if 0 if (vconf_notify_key_changed(, _status_active_change_cb, NULL) < 0) { _E("Failed to register add the callback for %s", ); @@ -419,13 +430,6 @@ int status_register(void) s_status_passive.setappl_use_pick_up = -1; } - if (vconf_notify_key_changed(VCONFKEY_BOOT_ANIMATION_FINISHED, _status_passive_change_cb, NULL) < 0) { - _E("Failed to register add the callback for %s", VCONFKEY_BOOT_ANIMATION_FINISHED); - } else if (vconf_get_int(VCONFKEY_BOOT_ANIMATION_FINISHED, &s_status_passive.boot_animation_finished) < 0) { - _E("Failed to get vconfkey[%s]", VCONFKEY_BOOT_ANIMATION_FINISHED); - s_status_passive.boot_animation_finished = -1; - } - if (vconf_notify_key_changed(VCONFKEY_SETAPPL_3RD_LOCK_PKG_NAME_STR, _status_passive_change_cb, NULL) < 0) { _E("Failed to register add the callback for %s", VCONFKEY_SETAPPL_3RD_LOCK_PKG_NAME_STR); } @@ -481,6 +485,10 @@ void status_unregister(void) } free(s_status_active.langset); + if (vconf_ignore_key_changed(VCONFKEY_BOOT_ANIMATION_FINISHED, _status_active_change_cb) < 0) { + _E("Failed to unregister the callback for %s", VCONFKEY_BOOT_ANIMATION_FINISHED); + } + #if 0 if (vconf_ignore_key_changed(, _status_active_change_cb) < 0) { _E("Failed to unregister the callback for %s", ); @@ -539,10 +547,6 @@ void status_unregister(void) _E("Failed to unregister the callback for %s", VCONFKEY_SETAPPL_USE_PICK_UP); } - if (vconf_ignore_key_changed(VCONFKEY_BOOT_ANIMATION_FINISHED, _status_passive_change_cb) < 0) { - _E("Failed to unregister the callback for %s", VCONFKEY_BOOT_ANIMATION_FINISHED); - } - if (vconf_ignore_key_changed(VCONFKEY_SETAPPL_3RD_LOCK_PKG_NAME_STR, _status_passive_change_cb) < 0) { _E("Failed to unregister ther callback for %s", VCONFKEY_SETAPPL_3RD_LOCK_PKG_NAME_STR); } -- 2.7.4