[mobile] Fix booting logic to enhance booting time 83/73983/1 accepted/tizen/common/20160613.044606 accepted/tizen/ivi/20160613.022221 accepted/tizen/mobile/20160613.022243 accepted/tizen/wearable/20160613.022254 submit/tizen/20160612.224139
authorgs86.lee <gs86.lee@samsung.com>
Fri, 10 Jun 2016 08:34:46 +0000 (17:34 +0900)
committergs86.lee <gs86.lee@samsung.com>
Fri, 10 Jun 2016 08:34:46 +0000 (17:34 +0900)
Change-Id: Id57bb4d70226772b72903047b180cadb91c88e24

include/mobile/lock_mgr.h
src/mobile/home_mgr.c
src/mobile/lock_mgr.c
src/mobile/starter.c

index 60cb6ab..21d0b95 100644 (file)
@@ -55,7 +55,7 @@ void lock_mgr_idle_lock_state_set(int lock_state);
 Eina_Bool lock_mgr_lockscreen_launch(void);
 void lock_mgr_unlock(void);
 
-int lock_mgr_daemon_start(void);
-void lock_mgr_daemon_end(void);
+int lock_mgr_init(void);
+void lock_mgr_fini(void);
 
 #endif                         /* __LOCK_DAEMON_H__ */
index eea4561..6c92937 100644 (file)
@@ -465,7 +465,6 @@ void home_mgr_init(void *data)
        status_active_register_cb(STATUS_ACTIVE_KEY_STARTER_SEQUENCE, _show_home_cb, NULL);
        status_active_register_cb(STATUS_ACTIVE_KEY_SYSMAN_POWER_OFF_STATUS, _power_off_cb, NULL);
        status_active_register_cb(STATUS_ACTIVE_KEY_SETAPPL_SELECTED_PACKAGE_NAME, _change_selected_package_name, NULL);
-       _change_selected_package_name(STATUS_ACTIVE_KEY_SETAPPL_SELECTED_PACKAGE_NAME, NULL);
 
        ecore_idler_add(_launch_apps_idler_cb, NULL);
 }
index dec24dd..08a51e6 100644 (file)
@@ -329,7 +329,6 @@ Eina_Bool lock_mgr_lockscreen_launch(void)
                _E("set default lockscreen");
                lock_appid = STATUS_DEFAULT_LOCK_PKG_NAME;
        }
-
        _I("lockscreen appid : %s", lock_appid);
 
        switch (lock_type) {
@@ -360,16 +359,6 @@ ERROR:
 
 
 
-static void _lock_daemon_init(void)
-{
-       _SECURE_I("lockscreen : %s", status_passive_get()->setappl_3rd_lock_pkg_name_str);
-
-       /* register lcd changed cb */
-       dbus_util_receive_lcd_status(_on_lcd_changed_receive, NULL);
-}
-
-
-
 static int _lock_type_changed_cb(status_active_key_e key, void *data)
 {
        int lock_type = status_active_get()->setappl_screen_lock_type_int;
@@ -384,38 +373,49 @@ static int _lock_type_changed_cb(status_active_key_e key, void *data)
 
 
 
-int lock_mgr_daemon_start(void)
+int lock_mgr_init(void)
 {
        int lock_type = 0;
        int ret = 0;
 
-       _lock_daemon_init();
+       _D("[LOCK_DAEMON]lock_mgr_init is invoked : lockscreen(%s)", status_passive_get()->setappl_3rd_lock_pkg_name_str);
+
+       /* Register lcd changed cb */
+       dbus_util_receive_lcd_status(_on_lcd_changed_receive, NULL);
 
        lock_type = status_active_get()->setappl_screen_lock_type_int;
        _D("lock type : %d", lock_type);
 
+       /* Register lock type changed cb */
        status_active_register_cb(STATUS_ACTIVE_KEY_SETAPPL_SCREEN_LOCK_TYPE_INT, _lock_type_changed_cb, NULL);
 
+       /* Check that telephony is supported */
        s_lock_mgr.is_support_telephony = _check_support_telephony();
        if (s_lock_mgr.is_support_telephony == true) {
+               /*
+                * If telephony is supported,
+                * initilize telephony module.
+                */
                _init_telephony();
        }
 
+       /* Initialize feedback */
+       if (feedback_initialize() != FEEDBACK_ERROR_NONE) {
+               _E("Failed to initialize feedback");
+       }
+
+       /* Launch lockscreen */
        ret = lock_mgr_lockscreen_launch();
        if (ret != EINA_TRUE) {
                _E("Failed to launch lockscreen");
        }
 
-       if (feedback_initialize() != FEEDBACK_ERROR_NONE) {
-               _E("Failed to initialize feedback");
-       }
-
        return ret;
 }
 
 
 
-void lock_mgr_daemon_end(void)
+void lock_mgr_fini(void)
 {
        status_active_unregister_cb(STATUS_ACTIVE_KEY_SETAPPL_SCREEN_LOCK_TYPE_INT, _lock_type_changed_cb);
 
index d994a0d..818eeb5 100755 (executable)
@@ -47,6 +47,7 @@
 
 
 
+#if 0
 static void _hide_home(void)
 {
        int seq = status_active_get()->starter_sequence;
@@ -54,6 +55,7 @@ static void _hide_home(void)
 
        vconf_set_int(VCONFKEY_STARTER_SEQUENCE, 0);
 }
+#endif
 
 
 
@@ -64,36 +66,6 @@ static void _show_home(void)
 
 
 
-#if 0
-static Eina_Bool _finish_boot_animation(void *data)
-{
-       if (vconf_set_int(VCONFKEY_BOOT_ANIMATION_FINISHED, 1) != 0) {
-               _E("Failed to set boot animation finished set");
-       }
-       _show_home();
-
-       return ECORE_CALLBACK_CANCEL;
-}
-
-
-
-static int _fail_to_launch_pwlock(const char *appid, const char *key, const char *value, void *cfn, void *afn)
-{
-       _finish_boot_animation(NULL);
-       return 0;
-}
-
-
-
-static void _after_launch_pwlock(int pid)
-{
-       process_mgr_set_pwlock_priority(pid);
-       ecore_timer_add(0.5, _finish_boot_animation, NULL);
-}
-#endif
-
-
-
 static void _signal_handler(int signum, siginfo_t *info, void *unused)
 {
     _D("_signal_handler : Terminated...");
@@ -118,21 +90,6 @@ 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;
@@ -277,26 +234,13 @@ static void _init(struct appdata *ad)
        status_register();
        status_active_register_cb(STATUS_ACTIVE_KEY_SYSMAN_POWER_OFF_STATUS, _power_off_cb, NULL);
 
-       /*
-        * If 'VCONFKEY_BOOT_ANIMATION_FINISHED' is already 1,
-        * it is not necessary to register vconfkey callback function.
-        */
-       if (status_active_get()->boot_animation_finished == 1) {
-               lock_mgr_daemon_start();
-               _show_home();
-       } else {
-               /* 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
-
-               status_active_register_cb(STATUS_ACTIVE_KEY_BOOT_ANIMATION_FINISHED, _boot_animation_finished_cb, NULL);
-       }
-
        hw_key_create_window();
+
+       lock_mgr_init();
        home_mgr_init(NULL);
 
+       _show_home();
+
        aul_listen_app_dead_signal(_check_dead_signal, NULL);
 }
 
@@ -304,12 +248,12 @@ static void _init(struct appdata *ad)
 
 static void _fini(struct appdata *ad)
 {
-       home_mgr_fini();
        hw_key_destroy_window();
-       lock_mgr_daemon_end();
+
+       home_mgr_fini();
+       lock_mgr_fini();
 
        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) {