#include <fcntl.h>
#include <pkgmgr-info.h>
#include <stdio.h>
-#include <dd-deviced.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
#define HOME_TERMINATED "home_terminated"
#define ISTRUE "TRUE"
-#define SYSPOPUPID_VOLUME "volume"
+#define SYSPOPUPID_VOLUME "org.tizen.volume"
#define APPID_INDICATOR "org.tizen.indicator"
#define APPID_QUICKPANEL "org.tizen.quickpanel"
static void _after_launch_home(int pid)
{
- if (dbus_util_send_oomadj(pid, OOM_ADJ_VALUE_HOMESCREEN) < 0){
- _E("failed to send oom dbus signal");
+ if (pid != s_home_mgr.home_pid) {
+ _I("home is created by power key new[%d] != old[%d]", pid, s_home_mgr.home_pid);
+ if (pid > 0) {
+ dbus_util_send_perceptible_signal(pid);
+ }
+ s_home_mgr.home_pid = pid;
}
- s_home_mgr.home_pid = pid;
}
-#define SERVICE_OPERATION_MAIN_KEY "__APP_SVC_OP_TYPE__"
-#define SERVICE_OPERATION_MAIN_VALUE "http://tizen.org/appcontrol/operation/main"
-void home_mgr_open_home(const char *appid)
+void home_mgr_open_home(const char *appid, const char *key, const char *val)
{
char *home_appid = NULL;
-#ifndef TIZEN_BUILD_TARGET_64
if (!appid) {
home_appid = status_active_get()->setappl_selected_package_name;
} else {
home_appid = (char *) appid;
}
ret_if(!home_appid);
-#else
- /*
- * If the architecture is 64bit,
- * starter will launch menu-screen only.
- */
- _D("[64bit] menu-screen will be launched.");
- home_appid = MENU_SCREEN_PKG_NAME;
-#endif
-
- process_mgr_must_launch(home_appid, SERVICE_OPERATION_MAIN_KEY, SERVICE_OPERATION_MAIN_VALUE, _change_home_cb, _after_launch_home);
+
+ process_mgr_must_launch(home_appid, key, val, _change_home_cb, _after_launch_home);
}
}
}
- home_mgr_open_home(NULL);
+ home_mgr_open_home(NULL, NULL, NULL);
break;
default:
_E("False sequence [%d]", seq);
}
}
- home_mgr_open_home(appid);
+ home_mgr_open_home(appid, NULL, NULL);
return 1;
}
static void _after_launch_volume(int pid)
{
- if (dbus_util_send_oomadj(pid, OOM_ADJ_VALUE_DEFAULT) < 0){
- _E("failed to send oom dbus signal");
+ if (pid != s_home_mgr.volume_pid) {
+ _I("volume is launched new[%d] != old[%d]", pid, s_home_mgr.volume_pid);
+ if (pid > 0) {
+ dbus_util_send_perceptible_signal(pid);
+ }
+ s_home_mgr.volume_pid = pid;
}
- s_home_mgr.volume_pid = pid;
}
static void _launch_after_home(int pid)
{
- if (pid > 0) {
- if(dbus_util_send_oomadj(pid, OOM_ADJ_VALUE_HOMESCREEN) < 0){
- _E("failed to send oom dbus signal");
+ if (pid != s_home_mgr.home_pid) {
+ _I("home is created by power key new[%d] != old[%d]", pid, s_home_mgr.home_pid);
+ if (pid > 0) {
+ dbus_util_send_perceptible_signal(pid);
}
+ s_home_mgr.home_pid = pid;
}
- s_home_mgr.home_pid = pid;
}
{
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) {
s_home_mgr.power_off = 1;
} else {
s_home_mgr.power_off = 0;
static Eina_Bool _launch_apps_idler_cb(void *data)
{
-#ifndef TIZEN_BUILD_TARGET_64
process_mgr_must_syspopup_launch(SYSPOPUPID_VOLUME, NULL, NULL, NULL, _after_launch_volume);
process_mgr_must_launch(APPID_INDICATOR, NULL, NULL, NULL, _after_launch_indicator);
process_mgr_must_launch(APPID_QUICKPANEL, NULL, NULL, NULL, _after_launch_quickpanel);
-#endif
return ECORE_CALLBACK_CANCEL;
}
void home_mgr_init(void *data)
{
- _D( "[MENU_DAEMON]home_mgr_init is invoked");
+ _D("[MENU_DAEMON]home_mgr_init is invoked");
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);
}