summaryrefslogtreecommitdiff
path: root/src/starter.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/starter.c')
-rwxr-xr-x[-rw-r--r--]src/starter.c607
1 files changed, 463 insertions, 144 deletions
diff --git a/src/starter.c b/src/starter.c
index 1be63e4..b551f52 100644..100755
--- a/src/starter.c
+++ b/src/starter.c
@@ -1,9 +1,5 @@
/*
- * starter
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Seungtaek Chung <seungtaek.chung@samsung.com>, Mi-Ju Lee <miju52.lee@samsung.com>, Xi Zhichan <zhichan.xi@samsung.com>
+ * Copyright (c) 2000 - 2015 Samsung Electronics Co., Ltd. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,7 +12,6 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
- *
*/
#include <Elementary.h>
@@ -28,178 +23,408 @@
#include <unistd.h>
#include <string.h>
#include <poll.h>
-#include <errno.h>
-#include <string.h>
+#include <aul.h>
#include <vconf.h>
#include <signal.h>
+//#include <bincfg.h>
#include "starter.h"
#include "starter-util.h"
#include "x11.h"
+#include "lock-daemon.h"
#include "lockd-debug.h"
-#include "hw_key.h"
-#include "util.h"
-
-int errno;
+#include "menu_daemon.h"
#ifndef PACKAGE_NAME
-#define PACKAGE_NAME "org.tizen.starter"
+#define PACKAGE_NAME "com.samsung.starter"
#endif
#define DEFAULT_THEME "tizen"
-
-#define W_LAUNCHER_PKGNAME "org.tizen.w-launcher-app"
-#define W_LOCKSCREEN_PKGNAME "org.tizen.w-lockscreen"
-
-#ifdef FEATURE_TIZENW2
-#define SETUP_WIZARD_PKGNAME "org.tizen.b2-setup-wizard"
+#define PWLOCK_PATH "/usr/apps/com.samsung.pwlock/bin/pwlock"
+#define PWLOCK_PKG_NAME "com.samsung.pwlock"
+#define PWLOCK_LITE_PKG_NAME "com.samsung.pwlock-lite"
+
+#define DATA_UNENCRYPTED "unencrypted"
+#define DATA_MOUNTED "mounted"
+#define SD_DATA_ENCRYPTED "encrypted"
+#define SD_CRYPT_META_FILE ".MetaEcfsFile"
+#define MMC_MOUNT_POINT "/opt/storage/sdcard"
+
+#ifdef FEATURE_LITE
+#define _FIRST_HOME 1
#else
-#define SETUP_WIZARD_PKGNAME "org.tizen.b2-setup-wizard"
+#define _FIRST_HOME 1
#endif
+static int _check_encrypt_sdcard()
+{
+ int ret = 0;
+ struct stat src_stat;
+ const char * cryptTempFile = SD_CRYPT_META_FILE;
+ char *mMetaDataFile;
+
+ mMetaDataFile = malloc(strlen (MMC_MOUNT_POINT) + strlen (cryptTempFile) +2);
+ if (mMetaDataFile)
+ {
+ sprintf (mMetaDataFile, "%s%s%s", MMC_MOUNT_POINT, "/", cryptTempFile);
+ if (lstat (mMetaDataFile, &src_stat) < 0)
+ if (errno == ENOENT)
+ ret = -1;
+ free(mMetaDataFile);
+ }
+ _DBG("check sd card ecryption : %d", ret);
+ return ret;
+}
-static void _signal_handler(int signum, siginfo_t *info, void *unused)
+static void lock_menu_screen(void)
{
- _DBG("_signal_handler : Terminated...");
- elm_exit();
+ vconf_set_int(VCONFKEY_STARTER_SEQUENCE, 0);
}
-int w_launch_app(char *pkgname, bundle *b)
+static void unlock_menu_screen(void)
{
- int r = AUL_R_OK;
+ int r;
+ int show_menu;
- _SECURE_D("w_launch_app:[%s]", pkgname);
+ show_menu = 0;
+ r = vconf_get_int(VCONFKEY_STARTER_SEQUENCE, &show_menu);
+ if (r || !show_menu) {
+ vconf_set_int(VCONFKEY_STARTER_SEQUENCE, 1);
+ }
+}
- r = aul_launch_app(pkgname, b);
+static void _set_elm_theme(void)
+{
+ char *vstr;
+ char *theme;
+ Elm_Theme *th = NULL;
+ vstr = vconf_get_str(VCONFKEY_SETAPPL_WIDGET_THEME_STR);
+ if (vstr == NULL)
+ theme = DEFAULT_THEME;
+ else
+ theme = vstr;
+
+ th = elm_theme_new();
+ _DBG("theme vconf[%s]\n set[%s]\n", vstr, theme);
+ elm_theme_set(th, theme);
+
+ if (vstr)
+ free(vstr);
+}
- if (r < 0) {
- _ERR("launch failed [%s] ret=[%d]", pkgname, r);
+#if 0
+static void _set_elm_entry(void)
+{
+ int v;
+ int r;
+
+ r = vconf_get_bool(VCONFKEY_SETAPPL_AUTOCAPITAL_ALLOW_BOOL, &v);
+ if (!r) {
+ prop_int_set("ENLIGHTENMENT_AUTOCAPITAL_ALLOW", v);
+ _DBG("vconf autocatipal[%d]", v);
}
- return r;
+ r = vconf_get_bool(VCONFKEY_SETAPPL_AUTOPERIOD_ALLOW_BOOL, &v);
+ if (!r) {
+ prop_int_set("ENLIGHTENMENT_AUTOPERIOD_ALLOW", v);
+ _DBG("vconf autoperiod[%d]", v);
+ }
}
+#endif
-static int _w_app_dead_cb(int pid, void *data)
+static int _launch_pwlock(void)
{
- _DBG("app dead cb call! (pid : %d)", pid);
+ int r;
+ //int i = 0;
- struct appdata *ad = (struct appdata *)data;
+ _DBG("%s", __func__);
- if (pid == ad->launcher_pid) {
- _ERR("w-launcher-app (pid:%d) is destroyed.", pid);
- ad->launcher_pid = w_launch_app(W_LAUNCHER_PKGNAME, NULL);
+#ifdef FEATURE_LITE
+ r = aul_launch_app(PWLOCK_LITE_PKG_NAME, NULL);
+ if (r < 0) {
+ _ERR("PWLock launch error: error(%d)", r);
+ if (r == AUL_R_ETIMEOUT) {
+ _DBG("Launch pwlock is failed for AUL_R_ETIMEOUT, again launch pwlock-lite");
+ r = aul_launch_app(PWLOCK_LITE_PKG_NAME, NULL);
+ if (r < 0) {
+ _ERR("2'nd PWLock launch error: error(%d)", r);
+ return -1;
+ } else {
+ _DBG("Launch pwlock-lite");
+ return r;
+ }
+ } else {
+ return -1;
+ }
+ } else {
+ _DBG("Launch pwlock-lite");
+ return r;
}
-
- return 0;
+#else
+ r = aul_launch_app(PWLOCK_LITE_PKG_NAME, NULL);
+ if (r < 0) {
+ _ERR("PWLock launch error: error(%d)", r);
+ if (r == AUL_R_ETIMEOUT) {
+ _DBG("Launch pwlock is failed for AUL_R_ETIMEOUT, again launch pwlock");
+ r = aul_launch_app(PWLOCK_LITE_PKG_NAME, NULL);
+ if (r < 0) {
+ _ERR("2'nd PWLock launch error: error(%d)", r);
+ return -1;
+ } else {
+ _DBG("Launch pwlock");
+ return r;
+ }
+ } else {
+ return -1;
+ }
+ } else {
+ _DBG("Launch pwlock");
+ return r;
+ }
+#endif
+#if 0
+ retry_con:
+ r = aul_launch_app("com.samsung.pwlock", NULL);
+ if (r < 0) {
+ _ERR("PWLock launch error: error(%d)", r);
+ if (r == AUL_R_ETIMEOUT) {
+ i++;
+ _DBG("Launching pwlock is failed [%d]times for AUL_R_ETIMEOUT ", i);
+ goto retry_con;
+ } else {
+ return -1;
+ }
+ } else {
+ _DBG("Launch pwlock");
+ return 0;
+ }
+#endif
}
-static int _w_check_first_boot(void)
+static void _signal_handler(int signum, siginfo_t *info, void *unused)
{
- int is_first = 0;
- int ret = 0;
+ _DBG("_signal_handler : Terminated...");
+ elm_exit();
+}
-#if 1 // NOT YET define vconfkey from setting "VCONFKEY_SETUP_WIZARD_FIRST_BOOT"
- ret = vconf_get_bool(VCONFKEY_SETUP_WIZARD_FIRST_BOOT, &is_first);
- if (ret < 0){
- _ERR("can't get vconfkey value of [%s], ret=[%d]", VCONFKEY_SETUP_WIZARD_FIRST_BOOT, ret);
- is_first = 0;
- } else if (is_first == 1) {
- _ERR("[%s] value is [%d], first booting..!!", VCONFKEY_SETUP_WIZARD_FIRST_BOOT, is_first);
- }
+#if 0
+static void _heynoti_event_power_off(void *data)
+{
+ _DBG("_heynoti_event_power_off : Terminated...");
+ elm_exit();
+}
#endif
- return is_first;
+static void _poweroff_control_cb(keynode_t *in_key, void *data)
+{
+ int val;
+ if (vconf_get_int(VCONFKEY_SYSMAN_POWER_OFF_STATUS, &val) == 0 &&
+ (val == VCONFKEY_SYSMAN_POWER_OFF_DIRECT || val == VCONFKEY_SYSMAN_POWER_OFF_RESTART)) {
+ _DBG("_poweroff_control_cb : Terminated...");
+ elm_exit();
+ }
}
-static Eina_Bool _w_starter_idler_cb(void *data)
+#define APP_ID_SPLIT_LAUNCHER "com.samsung.split-launcher"
+static Eina_Bool _fini_boot(void *data)
{
- struct appdata *ad = (struct appdata *)data;
+ _DBG("%s %d\n", __func__, __LINE__);
- _DBG("%s, %d", __func__, __LINE__);
+ int multiwindow_enabled = 0;
+ int val = 0;
+
+ if (vconf_set_int(VCONFKEY_BOOT_ANIMATION_FINISHED, 1) != 0) {
+ _ERR("Failed to set boot animation finished set");
+ }
+
+ if (vconf_get_bool(VCONFKEY_QUICKSETTING_MULTIWINDOW_ENABLED, &multiwindow_enabled) < 0) {
+ _ERR("Cannot get VCONFKEY");
+ multiwindow_enabled = 0;
+ }
+
+ if (vconf_get_bool(VCONFKEY_SETAPPL_ACCESSIBILITY_TTS, &val) < 0) {
+ _DBG("Cannot get VCONFKEY");
+ val = 0;
+ }
+
+ if ((val == 1) || (multiwindow_enabled == 0)) {
+ _DBG("TTS : %d, Multiwindow enabled : %d", val, multiwindow_enabled);
+ return ECORE_CALLBACK_CANCEL;
+ }
- ad->launcher_pid = w_launch_app(W_LAUNCHER_PKGNAME, NULL);
+ _DBG("Launch the split-launcher");
+
+ int ret = aul_launch_app(APP_ID_SPLIT_LAUNCHER, NULL);
+ if (0 > ret) _ERR("cannot launch the split-launcher (%d)", ret);
return ECORE_CALLBACK_CANCEL;
}
-#define TEMP_VCONFKEY_LOCK_TYPE "db/setting/lock_type"
-static void _w_wms_changed_cb(keynode_t* node, void *data)
+static Eina_Bool _init_idle(void *data)
{
- int wms_state = -1;
- int lock_type = -1;
- int test_mode = -1;
- struct appdata *ad = (struct appdata *)data;
+ _DBG("%s %d\n", __func__, __LINE__);
+ int pwlock_pid = 0;
+#ifdef FEATURE_SDK
+ _fini_boot(NULL);
+#else
+ if ((pwlock_pid = _launch_pwlock()) < 0) {
+ _ERR("launch pwlock error");
+ }
+ else{
+ lockd_process_mgr_set_pwlock_priority(pwlock_pid);
+ }
+ _fini_boot(NULL);
+#endif
+ return ECORE_CALLBACK_CANCEL;
+}
- _DBG("%s, %d", __func__, __LINE__);
+static void _lock_state_cb(keynode_t * node, void *data)
+{
+ _DBG("%s %d\n", __func__, __LINE__);
+#if 0
+ if (_launch_pwlock() < 0) {
+ _ERR("launch pwlock error");
+ }
+ menu_daemon_init(NULL);
+#else
+ _fini_boot(NULL);
+#endif
+ if (vconf_ignore_key_changed(VCONFKEY_IDLE_LOCK_STATE,
+ _lock_state_cb) != 0) {
+ LOCKD_DBG("Fail to unregister");
+ }
+}
- if (node) {
- wms_state = vconf_keynode_get_bool(node);
+static Eina_Bool _init_lock_lite(void *data)
+{
+#ifdef FEATURE_SDK
+ if (start_lock_daemon_lite(TRUE, FALSE) == 1) {
+ if (vconf_notify_key_changed(VCONFKEY_IDLE_LOCK_STATE,
+ _lock_state_cb, NULL) != 0) {
+ _ERR("[Error] vconf notify : lock state");
+ ecore_timer_add(0.5, _fini_boot, NULL);
+ }
+ } else{
+ _init_idle(NULL);
+ }
+#else
+ char *file = NULL;
+ int pwlock_pid = 0;
+
+ _DBG("%s %d\n", __func__, __LINE__);
+
+ /* Check SD card encription */
+ file = vconf_get_str(VCONFKEY_SDE_CRYPTO_STATE);
+ if (file && !strncmp(SD_DATA_ENCRYPTED, file, strlen(file)) && _check_encrypt_sdcard() == 0) {
+ _ERR("SD card is encripted");
+ if (start_lock_daemon_lite(FALSE, FALSE) == 1) {
+ if ((pwlock_pid = _launch_pwlock()) < 0) {
+ _ERR("launch pwlock error");
+ }
+ else{
+ lockd_process_mgr_set_pwlock_priority(pwlock_pid);
+ }
+ ecore_timer_add(0.5, _fini_boot, NULL);
+ } else {
+ _init_idle(NULL);
+ }
} else {
- if (vconf_get_bool(VCONFKEY_WMS_WMANAGER_CONNECTED, &wms_state) < 0) {
- _ERR("Failed to get %s", VCONFKEY_WMS_WMANAGER_CONNECTED);
- return;
+ if (start_lock_daemon_lite(TRUE, FALSE) == 1) {
+ if ((pwlock_pid = _launch_pwlock()) < 0) {
+ _ERR("launch pwlock error");
+ }
+ else{
+ lockd_process_mgr_set_pwlock_priority(pwlock_pid);
+ }
+ if (vconf_notify_key_changed(VCONFKEY_IDLE_LOCK_STATE,
+ _lock_state_cb, NULL) != 0) {
+ _ERR("[Error] vconf notify : lock state");
+ ecore_timer_add(0.5, _fini_boot, NULL);
+ }
+ } else {
+ _init_idle(NULL);
}
}
- _DBG("WMS key value:[%d], previous state:[%d]", wms_state, ad->wms_connected);
-
- vconf_get_int(TEMP_VCONFKEY_LOCK_TYPE, &lock_type);
- vconf_get_int(VCONFKEY_TESTMODE_SCREEN_LOCK, &test_mode);
+ free(file);
+#endif
+ return ECORE_CALLBACK_CANCEL;
+}
- if ((lock_type != 1) || (test_mode == VCONFKEY_TESTMODE_SCREEN_LOCK_DISABLE)) {
- ad->wms_connected = wms_state;
- return;
- }
+static Eina_Bool _init_lock(void *data)
+{
+ char *file = NULL;
- if (wms_state == FALSE) {
- if (ad->wms_connected == TRUE) {
- _ERR("WMS connect state is changed from [%d] to [%d]", ad->wms_connected, wms_state);
- w_launch_app(W_LOCKSCREEN_PKGNAME, NULL);
+ _DBG("%s %d\n", __func__, __LINE__);
+
+ /* Check SD card encription */
+ file = vconf_get_str(VCONFKEY_SDE_CRYPTO_STATE);
+ if (file && !strncmp(SD_DATA_ENCRYPTED, file, strlen(file)) && _check_encrypt_sdcard() == 0) {
+ _ERR("SD card is encripted");
+ if (start_lock_daemon(FALSE, FALSE) == 1) {
+ if (_launch_pwlock() < 0) {
+ _ERR("launch pwlock error");
+ }
+ ecore_timer_add(0.5, _fini_boot, NULL);
+ } else {
+ _init_idle(NULL);
+ }
+ } else {
+ if (start_lock_daemon(TRUE, FALSE) == 1) {
+ if (_launch_pwlock() < 0) {
+ _ERR("launch pwlock error");
+ }
+ if (vconf_notify_key_changed(VCONFKEY_IDLE_LOCK_STATE,
+ _lock_state_cb, NULL) != 0) {
+ _ERR("[Error] vconf notify : lock state");
+ ecore_timer_add(0.5, _fini_boot, NULL);
+ }
+ } else {
+ _init_idle(NULL);
}
}
- ad->wms_connected = wms_state;
-
- return;
+ free(file);
+ return ECORE_CALLBACK_CANCEL;
}
-static void _w_power_off_cb(keynode_t* node, void *data)
+static void _data_encryption_cb(keynode_t * node, void *data)
{
- int val = VCONFKEY_SYSMAN_POWER_OFF_NONE;
+ char *file = NULL;
- vconf_get_int(VCONFKEY_SYSMAN_POWER_OFF_STATUS, &val);
+ _DBG("%s %d\n", __func__, __LINE__);
- if (val > VCONFKEY_SYSMAN_POWER_OFF_POPUP) {
- _ERR("power off status : %d", val);
- if (vconf_ignore_key_changed(VCONFKEY_WMS_WMANAGER_CONNECTED, _w_wms_changed_cb) < 0)
- _ERR("Failed to ignore the callback for [%s]", VCONFKEY_WMS_WMANAGER_CONNECTED);
- exit(0);
+ file = vconf_get_str(VCONFKEY_ODE_CRYPTO_STATE);
+ if (file != NULL) {
+ _DBG("get VCONFKEY : %s\n", file);
+ if (!strcmp(file, DATA_MOUNTED)) {
+#ifdef FEATURE_LITE
+ start_lock_daemon_lite(FALSE, FALSE);
+#else
+ start_lock_daemon(FALSE, FALSE);
+#endif
+ menu_daemon_init(NULL);
+ }
+ free(file);
}
}
-static void _w_lang_changed_cb(keynode_t* node, void *data)
+static Eina_Bool _start_sequence_cb(void *data)
{
- char *locale = NULL;
_DBG("%s, %d", __func__, __LINE__);
- locale = vconf_get_str(VCONFKEY_LANGSET);
+ unlock_menu_screen();
- if (locale != NULL) {
- elm_language_set(locale);
- }
+ return ECORE_CALLBACK_CANCEL;
}
-//TO DO. later remove this definition after applying DB structure
-#define LAUNCHER_XML_PATH "/opt/usr/share/w-launcher"
static void _init(struct appdata *ad)
{
int r;
struct sigaction act;
char *file = NULL;
int first = -1;
- int lock_type = -1;
- int wms_state = -1;
- int test_mode = -1;
+ int pwlock_pid = 0;
memset(&act,0x00,sizeof(struct sigaction));
act.sa_sigaction = _signal_handler;
@@ -221,54 +446,128 @@ static void _init(struct appdata *ad)
memset(ad, 0, sizeof(struct appdata));
gettimeofday(&ad->tv_start, NULL);
- aul_launch_init(NULL,NULL);
-
- aul_listen_app_dead_signal(_w_app_dead_cb, ad);
-
- //TO DO. later remove this after applying DB structure
- if (chmod(LAUNCHER_XML_PATH, 0777) < 0) {
- _ERR("chmod: %s\n", strerror(errno));
- }
-
- if (vconf_notify_key_changed(VCONFKEY_LANGSET, _w_lang_changed_cb, NULL) < 0) {
- _ERR("Failed to add the callback for [%s]", VCONFKEY_LANGSET);
- }
- if (vconf_notify_key_changed(VCONFKEY_WMS_WMANAGER_CONNECTED, _w_wms_changed_cb, ad) < 0) {
- _ERR("Failed to add the callback for %s changed", VCONFKEY_WMS_WMANAGER_CONNECTED);
- }
- if (vconf_get_bool(VCONFKEY_WMS_WMANAGER_CONNECTED, &wms_state) < 0) {
- _ERR("Failed to get [%s]", VCONFKEY_WMS_WMANAGER_CONNECTED);
- } else {
- ad->wms_connected = wms_state;
- _DBG("ad->wms_connected : [%d]", ad->wms_connected);
- }
+#ifdef FEATURE_SDK
+ _DBG("Emulator booting sequence");
+ lock_menu_screen();
- if (_w_check_first_boot() == TRUE) {
- w_launch_app(SETUP_WIZARD_PKGNAME, NULL);
- ecore_idler_add(_w_starter_idler_cb, ad);
+ //_FIRST_HOME
+ _DBG("First home");
+#ifdef FEATURE_LITE
+ _init_lock_lite(NULL);
+#else
+ _init_lock(NULL);
+#endif
+ menu_daemon_init(NULL);
+ ecore_idler_add(_start_sequence_cb, NULL);
+
+#else /* Target binary */
+/* if (bincfg_is_factory_binary() == 1) {
+ _DBG("Factory binary..!!");
+ _set_elm_theme();
+ unlock_menu_screen();
+ menu_daemon_init(NULL);
} else {
- _DBG("Not first booting, launch [%s]..!!", W_LAUNCHER_PKGNAME);
-
- vconf_get_int(VCONFKEY_TESTMODE_SCREEN_LOCK, &test_mode);
- vconf_get_int(TEMP_VCONFKEY_LOCK_TYPE, &lock_type);
+*/ _DBG("%s %d\n", __func__, __LINE__);
+ lock_menu_screen();
+ _set_elm_theme();
+
+ /* Check data encrption */
+ file = vconf_get_str(VCONFKEY_ODE_CRYPTO_STATE);
+ if (file != NULL) {
+ _DBG("get VCONFKEY : %s\n", file);
+ if (strncmp(DATA_UNENCRYPTED, file, strlen(file))) {
+ if (vconf_notify_key_changed(VCONFKEY_ODE_CRYPTO_STATE,
+ _data_encryption_cb, NULL) != 0) {
+ _ERR("[Error] vconf notify changed is failed: %s", VCONFKEY_ODE_CRYPTO_STATE);
+ } else {
+ _DBG("waiting mount..!!");
+ if ((pwlock_pid = _launch_pwlock()) < 0) {
+ _ERR("launch pwlock error");
+ }
+ else{
+ lockd_process_mgr_set_pwlock_priority(pwlock_pid);
+ }
+ free(file);
+ return;
+ }
+ }
+ free(file);
+ }
- if ((wms_state == FALSE) && (lock_type == 1) && (test_mode != VCONFKEY_TESTMODE_SCREEN_LOCK_DISABLE)) {
- _ERR("BT disconneted and privacy lock is set");
- w_launch_app(W_LOCKSCREEN_PKGNAME, NULL);
- ecore_idler_add(_w_starter_idler_cb, ad);
+#if 0
+ /* Check SD card encription */
+ file = vconf_get_str(VCONFKEY_SDE_CRYPTO_STATE);
+ if (file && !strncmp(SD_DATA_ENCRYPTED, file, strlen(file)) && _check_encrypt_sdcard() == 0) {
} else {
- ad->launcher_pid = w_launch_app(W_LAUNCHER_PKGNAME, NULL);
}
- }
-
- create_key_window();
- init_hourly_alert(ad);
-
- if (vconf_notify_key_changed(VCONFKEY_SYSMAN_POWER_OFF_STATUS, _w_power_off_cb, NULL) < 0)
- _ERR("Failed to add the callback for [%s]", VCONFKEY_SYSMAN_POWER_OFF_STATUS);
+#endif
+ /* change the launching order of pwlock and lock mgr in booting time */
+ /* TODO: menu screen is showed before phone lock is showed in booting time */
+ /* FIXME Here lock daemon start..!! */
+#if 0
+ r = start_lock_daemon(TRUE);
+ if (r == 1) {
+ if (vconf_notify_key_changed(VCONFKEY_IDLE_LOCK_STATE,
+ _lock_state_cb, NULL) != 0) {
+ _ERR("[Error] vconf notify : lock state");
+ ecore_timer_add(1.5, _init_idle, NULL);
+ }
+ } else {
+ if (_launch_pwlock() < 0) {
+ _ERR("launch pwlock error");
+ }
+ menu_daemon_init(NULL);
+ }
+#else
- return;
+ r = vconf_get_bool(VCONFKEY_PWLOCK_FIRST_BOOT, &first);
+ _ERR("vconf get First boot result:%d, get_value:%d", r, first);
+ if (r == 0 && first == 0){
+ _DBG("Not first booting time");
+
+#if (!_FIRST_HOME)
+ _DBG("Not First home");
+ unlock_menu_screen();
+ menu_daemon_init(NULL);
+#ifdef FEATURE_LITE
+ _init_lock_lite(NULL);
+#else
+ _init_lock(NULL);
+#endif
+#else //_FIRST_HOME
+ _DBG("First home");
+#ifdef FEATURE_LITE
+ _init_lock_lite(NULL);
+#else
+ _init_lock(NULL);
+#endif
+ menu_daemon_init(NULL);
+ ecore_idler_add(_start_sequence_cb, NULL);
+#endif
+ } else {
+ _ERR("First booting time");
+ menu_daemon_init(NULL);
+#ifdef FEATURE_LITE
+ r = start_lock_daemon_lite(TRUE, TRUE);
+#else
+ r = start_lock_daemon(TRUE, TRUE);
+#endif
+ _DBG("start_lock_daemon ret:%d", r);
+ if ((pwlock_pid = _launch_pwlock()) < 0) {
+ _ERR("launch pwlock error");
+ if (vconf_set_int(VCONFKEY_BOOT_ANIMATION_FINISHED, 1) != 0) {
+ _ERR("Failed to set boot animation finished set");
+ }
+ unlock_menu_screen();
+ } else {
+ lockd_process_mgr_set_pwlock_priority(pwlock_pid);
+ ecore_timer_add(1, _fini_boot, NULL);
+ }
+ }
+#endif
+// }
+#endif /*end of sdk feature */
}
static void _fini(struct appdata *ad)
@@ -280,8 +579,8 @@ static void _fini(struct appdata *ad)
return;
}
- destroy_key_window();
- fini_hourly_alert(ad);
+ unlock_menu_screen();
+ menu_daemon_fini();
gettimeofday(&tv, NULL);
timersub(&tv, &ad->tv_start, &res);
@@ -292,12 +591,32 @@ int main(int argc, char *argv[])
{
struct appdata ad;
- WRITE_FILE_LOG("%s", "Main function is started in starter");
_DBG("starter is launched..!!");
#if 0
set_window_scale(); /* not in loop */
#endif
+#if 0
+ int heyfd = heynoti_init();
+ if (heyfd < 0) {
+ _ERR("Failed to heynoti_init[%d]", heyfd);
+ return -1;
+ }
+
+ int ret = heynoti_subscribe(heyfd, "power_off_start", _heynoti_event_power_off, NULL);
+ if (ret < 0) {
+ _ERR("Failed to heynoti_subscribe[%d]", ret);
+ }
+ ret = heynoti_attach_handler(heyfd);
+ if (ret < 0) {
+ _ERR("Failed to heynoti_attach_handler[%d]", ret);
+ }
+#else
+ if (vconf_notify_key_changed(VCONFKEY_SYSMAN_POWER_OFF_STATUS, (void *)_poweroff_control_cb, NULL) < 0) {
+ _ERR("Vconf notify key chaneged failed: VCONFKEY_SYSMAN_POWER_OFF_STATUS");
+ }
+#endif
+
elm_init(argc, argv);
_init(&ad);