#include <unistd.h>
#include <string.h>
#include <malloc.h>
+#include <Ecore_Wl2.h>
#include <E_DBus.h>
-#include <lazy_mount.h>
#include <systemd/sd-daemon.h>
+//#include <ode/internal-encryption.h>
#include <aul.h>
#include <vconf.h>
#include "hw_key.h"
#include "dbus_util.h"
-#define APPID_SYS_LOCK "org.tizen.sys-lock"
-
-
static void _set_starter_sequence(int val)
{
vconf_set_int(VCONFKEY_STARTER_SEQUENCE, val);
static void _signal_handler(int signum, siginfo_t *info, void *unused)
{
- _D("_signal_handler : Terminated...");
- elm_exit();
+ _D("_signal_handler : Terminated...");
+ elm_exit();
}
{
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();
}
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);
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) {
} 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();
-static void _mount_and_launch_apps(void)
+static void _launch_apps(void)
{
- int ret = 0;
-
- /*
- * Do mount user data partition
- */
- ret = do_mount_user();
- if (ret != 0) {
- _E("Failed to do mount [/opt] area");
- return;
- }
-
- /*
- * Wait user data partition mount
- */
- ret = wait_mount_user();
- if (ret != 0) {
- _E("Failed to wait mount [/opt] area");
- return;
- }
-
/* Tells the service manager that service startup is finished */
sd_notify(0, "READY=1");
-static void _sys_lock_status_changed_cb(void *data, DBusMessage *msg)
-{
- int is_unlock = 0;
-
- is_unlock = dbus_message_is_signal(msg, SYS_LOCK_INTERFACE_UNLOCK, SYS_LOCK_MEMBER_UNLOCK);
-
- _D("sys-lock signal is received. unlock state(%d).", is_unlock);
-
- if (is_unlock) {
- _mount_and_launch_apps();
-
- /*
- * Send DBus signal to terminate sys-lock
- */
- dbus_util_send_sys_lock_teminate_signal();
- }
-}
-
-
-
-static void _init(struct appdata *ad)
+static void _init(void)
{
struct sigaction act;
char err_buf[128] = { 0, };
- int is_lazy_mount = 0;
int ret = 0;
- memset(&act,0x00,sizeof(struct sigaction));
+ memset(&act, 0x00, sizeof(struct sigaction));
act.sa_sigaction = _signal_handler;
act.sa_flags = SA_SIGINFO;
*/
_set_starter_sequence(0);
- is_lazy_mount = get_need_ui_for_lazy_mount();
- _D("Lazy mount : %d", is_lazy_mount);
- if (is_lazy_mount) {
- /*
- * Launch Sys-lock
- */
- process_mgr_must_launch(APPID_SYS_LOCK, NULL, NULL, NULL, NULL);
-
- /*
- * Register sys-lock status changed cb
- */
- dbus_util_receive_sys_lock_status(_sys_lock_status_changed_cb, NULL);
- } else {
- _mount_and_launch_apps();
- }
+ // ret = starter_execute_ode_process(BEFORE_LOCKSCREEN);
+ // if (!ret) {
+ // _E("Failed to execute ode process");
+ // }
aul_listen_app_dead_signal(_check_dead_signal, NULL);
}
-static void _fini(struct appdata *ad)
+static void _fini(void)
{
home_mgr_fini();
lock_mgr_fini();
int main(int argc, char *argv[])
{
- struct appdata ad;
+ int ret = 0;
+ Ecore_Wl2_Display *display = NULL;
+ struct wl_display *displ = NULL;
_D("starter is launched..!!");
- elm_init(argc, argv);
- _init(&ad);
+ ret = elm_init(argc, argv);
+ if (!ret) {
+ _E("elm_init() failed : %d", ret);
+ return -1;
+ }
+
+ ret = ecore_wl2_init();
+ if (!ret) {
+ _E("ecore_wl2_init() failed : %d", ret);
+ elm_shutdown();
+ return -1;
+ }
+
+ displ = ecore_wl2_display_get(NULL);
+ if (!displ) {
+ _W("There's no display");
+ display = ecore_wl2_display_connect(NULL);
+ if (!display) {
+ _E("Failed to connect display");
+ return -1;
+ }
+ }
+
+ _init();
malloc_trim(0);
elm_run();
- _fini(&ad);
+ _fini();
+
+ if (display) {
+ ecore_wl2_display_disconnect(display);
+ ecore_wl2_shutdown();
+ }
+
elm_shutdown();
return 0;
}
+
+
+
+static void _mount_complete_cb(void *user_data)
+{
+ _D("Mount is successfully completed");
+}
+
+
+
+// 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;
+// }