Removing dependency of ode package.
[apps/native/starter.git] / src / mobile / starter.c
index 5319647..2ff0ea8 100755 (executable)
@@ -27,7 +27,7 @@
 
 #include <E_DBus.h>
 #include <systemd/sd-daemon.h>
-#include <ode/internal-encryption.h>
+//#include <ode/internal-encryption.h>
 
 #include <aul.h>
 #include <vconf.h>
@@ -62,8 +62,7 @@ static int _power_off_cb(status_active_key_e key, void *data)
 {
        int val = status_active_get()->sysman_power_off_status;
 
-       if (val == VCONFKEY_SYSMAN_POWER_OFF_DIRECT
-               || val == VCONFKEY_SYSMAN_POWER_OFF_RESTART) {
+       if (val > VCONFKEY_SYSMAN_POWER_OFF_NONE) {
            _D("_power_off_cb : Terminated...");
            elm_exit();
        }
@@ -132,6 +131,7 @@ static int _check_dead_signal(int pid, void *data)
        int volume_pid = 0;
        int indicator_pid = 0;
        int quickpanel_pid = 0;
+       int taskbar_pid = 0;
        int lock_pid = 0;
 
        _D("Process %d is termianted", pid);
@@ -148,6 +148,7 @@ static int _check_dead_signal(int pid, void *data)
        volume_pid = home_mgr_get_volume_pid();
        indicator_pid = home_mgr_get_indicator_pid();
        quickpanel_pid = home_mgr_get_quickpanel_pid();
+       taskbar_pid = home_mgr_get_taskbar_pid();
        lock_pid = lock_mgr_get_lock_pid();
 
        if (pid == home_pid) {
@@ -162,6 +163,9 @@ static int _check_dead_signal(int pid, void *data)
        } else if (pid == quickpanel_pid) {
                _D("quickpanel is dead");
                home_mgr_relaunch_quickpanel();
+       } else if (pid == taskbar_pid) {
+               _D("taskbar is dead");
+               home_mgr_relaunch_taskbar();
        } else if (pid == lock_pid) {
                _D("lockscreen is dead");
                lock_mgr_unlock();
@@ -238,10 +242,10 @@ static void _init(void)
         */
        _set_starter_sequence(0);
 
-       ret = starter_execute_ode_process(BEFORE_LOCKSCREEN);
-       if (!ret) {
-               _E("Failed to execute ode process");
-       }
+       // ret = starter_execute_ode_process(BEFORE_LOCKSCREEN);
+       // if (!ret) {
+               // _E("Failed to execute ode process");
+       // }
 
        aul_listen_app_dead_signal(_check_dead_signal, NULL);
 }
@@ -324,47 +328,47 @@ static void _mount_complete_cb(void *user_data)
 
 
 
-int starter_execute_ode_process(int booting_state)
-{
-       _D("This call is before or after Lockscreen: %d", booting_state);
-       int ret = ODE_ERROR_NONE;
-       int ode_state = 0;
-
-       ret = ode_internal_encryption_get_state(&ode_state);
-       if (ret != ODE_ERROR_NONE) {
-               _E("Failed to get ODE state, ret: %d", ret);
-               return 0;
-       }
-
-       if (booting_state == BEFORE_LOCKSCREEN) {
-               if (ode_state == ODE_STATE_ENCRYPTED) {
-                       lock_mgr_init();
-
-                       ret = ode_internal_encryption_set_mount_event_cb(_mount_complete_cb, NULL);
-                       if (ret != ODE_ERROR_NONE) {
-                               _E("Failed to set mount event cb");
-                       }
-               } else {
-                       _launch_apps();
-               }
-       } else if (booting_state == AFTER_LOCKSCREEN) {
-               if (ode_state == ODE_STATE_ENCRYPTED) {
-                       _D("ODE state is: %d, and we should mount at this time", ode_state);
-
-                       ret = ode_internal_encryption_mount();
-                       if (ret != ODE_ERROR_NONE) {
-                               _E("Failed to mount");
-                               return 0;
-                       }
-
-                       sd_notify(0, "READY=1");
-                       home_mgr_init(NULL);
-
-                       vconf_set_int(VCONFKEY_STARTER_SEQUENCE, 1);
-               } else {
-                       _D("ODE state is: %d, Do nothing");
-               }
-       }
-
-       return 1;
-}
+// int starter_execute_ode_process(int booting_state)
+// {
+       // _D("This call is before or after Lockscreen: %d", booting_state);
+       // int ret = ODE_ERROR_NONE;
+       // int ode_state = 0;
+
+       // ret = ode_internal_encryption_get_state(&ode_state);
+       // if (ret != ODE_ERROR_NONE) {
+               // _E("Failed to get ODE state, ret: %d", ret);
+               // return 0;
+       // }
+
+       // if (booting_state == BEFORE_LOCKSCREEN) {
+               // if (ode_state == ODE_STATE_ENCRYPTED) {
+                       // lock_mgr_init();
+
+                       // ret = ode_internal_encryption_set_mount_event_cb(_mount_complete_cb, NULL);
+                       // if (ret != ODE_ERROR_NONE) {
+                               // _E("Failed to set mount event cb");
+                       // }
+               // } else {
+                       // _launch_apps();
+               // }
+       // } else if (booting_state == AFTER_LOCKSCREEN) {
+               // if (ode_state == ODE_STATE_ENCRYPTED) {
+                       // _D("ODE state is: %d, and we should mount at this time", ode_state);
+
+                       // ret = ode_internal_encryption_mount();
+                       // if (ret != ODE_ERROR_NONE) {
+                               // _E("Failed to mount");
+                               // return 0;
+                       // }
+
+                       // sd_notify(0, "READY=1");
+                       // home_mgr_init(NULL);
+
+                       // vconf_set_int(VCONFKEY_STARTER_SEQUENCE, 1);
+               // } else {
+                       // _D("ODE state is: %d, Do nothing", ode_state);
+               // }
+       // }
+
+       // return 1;
+// }