#define MEMBER_LCD_ON "LCDOn"
#define MEMBER_LCD_OFF "LCDOff"
-extern void dbus_util_send_home_raise_signal(void);
extern int dbus_util_send_oomadj(int pid, int oom_adj_value);
extern void dbus_util_send_cpu_booster_signal(void);
extern void dbus_util_send_poweroff_signal(void);
void home_mgr_relaunch_volume(void);
void home_mgr_relaunch_indicator(void);
void home_mgr_relaunch_quickpanel(void);
-extern int home_mgr_open_home(const char *pkgname);
-
+extern void home_mgr_open_home(const char *appid, const char *key, const char *val);
// End of a file
+#if 0
static int _dbus_message_send(const char *path, const char *interface, const char *member)
{
int ret = 0;
_D("dbus_connection_send, ret=%d", ret);
return 0;
}
-
-
-
-void dbus_util_send_home_raise_signal(void)
-{
- int ret = 0;
-
- ret = _dbus_message_send(
- DBUS_HOME_RAISE_PATH,
- DBUS_HOME_RAISE_INTERFACE,
- DBUS_HOME_RAISE_MEMBER);
- _E("Sending HOME RAISE signal, result:%d", ret);
-}
+#endif
-#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;
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;
}
+#define HOME_OP_KEY "__HOME_OP__"
+#define HOME_OP_VAL_LAUNCH_BY_HOME_KEY "__LAUNCH_BY_HOME_KEY__"
static Eina_Bool _launch_by_home_key(void *data)
{
- int ret = 0;
-
if (status_passive_get()->idle_lock_state > VCONFKEY_IDLE_UNLOCK) {
return ECORE_CALLBACK_CANCEL;
}
- ret = home_mgr_open_home(NULL);
- if(ret > 0) {
- dbus_util_send_home_raise_signal();
- }
+ home_mgr_open_home(NULL, HOME_OP_KEY, HOME_OP_VAL_LAUNCH_BY_HOME_KEY);
return ECORE_CALLBACK_CANCEL;
}
key_info.home_multi_press_timer = NULL;
- if(0 == key_info.homekey_count % 2) {
+ if (0 == key_info.homekey_count % 2) {
key_info.homekey_count = 0;
return ECORE_CALLBACK_CANCEL;
} else if(key_info.homekey_count >= 3) {
+#define HOME_OP_KEY "__HOME_OP__"
+#define HOME_OP_VAL_LAUNCH_BY_HOME_KEY "__LAUNCH_BY_HOME_KEY__"
static Eina_Bool _launch_by_home_key(void *data)
{
- int ret = 0;
-
if (status_passive_get()->idle_lock_state > VCONFKEY_IDLE_UNLOCK) {
return ECORE_CALLBACK_CANCEL;
}
- ret = home_mgr_open_home(NULL);
- if(ret > 0) {
- dbus_util_send_home_raise_signal();
- }
+ home_mgr_open_home(NULL, HOME_OP_KEY, HOME_OP_VAL_LAUNCH_BY_HOME_KEY);
return ECORE_CALLBACK_CANCEL;
}
key_info.home_multi_press_timer = NULL;
- if(0 == key_info.homekey_count % 2) {
+ if (0 == key_info.homekey_count % 2) {
key_info.homekey_count = 0;
return ECORE_CALLBACK_CANCEL;
} else if(key_info.homekey_count >= 3) {
#include <sys/time.h>
#include <sys/resource.h>
#include <bundle_internal.h>
+#include <app_manager.h>
+#include <app_control.h>
#include "process_mgr.h"
#include "util.h"
static int _try_to_launch(const char *appid, const char *key, const char *value, after_func afn)
{
int pid = -1;
- bundle *b = NULL;
retv_if(!appid, -1);
- if (key) {
- b = bundle_create();
- if (!b) {
- _E("Failed to create a bundle");
+ int ret = 0;
+ app_control_h app_control_handle = NULL;
+ app_context_h app_context_handle = NULL;
+
+ ret = app_control_create(&app_control_handle);
+ if (ret != APP_CONTROL_ERROR_NONE) {
+ _E("Failed to create appcontrol");
+ return -1;
+ }
+
+ ret = app_control_set_operation(app_control_handle, APP_CONTROL_OPERATION_DEFAULT);
+ if (ret != APP_CONTROL_ERROR_NONE) {
+ _E("Failed to set operation to appcontrol");
+ app_control_destroy(app_control_handle);
+ return -1;
+ }
+
+ if (key && value) {
+ _D("key(%s), value(%s)", key, value);
+ ret = app_control_add_extra_data(app_control_handle, key, value);
+ if (ret != APP_CONTROL_ERROR_NONE) {
+ _E("Failed to add extra data to appcontrol");
+ app_control_destroy(app_control_handle);
return -1;
}
- bundle_add(b, key, value);
}
- pid = aul_launch_app(appid, b);
- if (b) bundle_free(b);
- if (pid > 0) {
- _D("Succeed to launch %s", appid);
- if (afn) afn(pid);
+ ret = app_control_set_app_id(app_control_handle, appid);
+ if (ret != APP_CONTROL_ERROR_NONE) {
+ _E("Failed to set app id to appcontrol");
+ app_control_destroy(app_control_handle);
+ return -1;
+ }
+
+ ret = app_control_send_launch_request(app_control_handle, NULL, NULL);
+ if (ret != APP_CONTROL_ERROR_NONE) {
+ _E("Failed to send launch request : %s", appid);
+ app_control_destroy(app_control_handle);
+ return -1;
+ }
+
+ app_control_destroy(app_control_handle);
+
+ ret = app_manager_get_app_context(appid, &app_context_handle);
+ if (ret != APP_MANAGER_ERROR_NONE) {
+ _E("Failed to get app context : %s", appid);
+ return -1;
}
+ ret = app_context_get_pid(app_context_handle, &pid);
+ if (ret != APP_MANAGER_ERROR_NONE) {
+ _E("Failed to get pid : %s", appid);
+ app_context_destroy(app_context_handle);
+ return -1;
+ }
+
+ app_context_destroy(app_context_handle);
+
+ _D("Succeed to launch : %s(%d)", appid, pid);
+ if (afn) afn(pid);
+
return pid;
}
launch_info_s *launch_info = NULL;
int pid = -1;
- _D("Must launch %s", appid);
+ _D("Must launch : %s", appid);
pid = _try_to_launch(appid, key, value, afn);
if (pid > 0) return;