summaryrefslogtreecommitdiff
path: root/tool
diff options
context:
space:
mode:
authorHwankyu Jhun <h.jhun@samsung.com>2017-06-22 20:51:24 +0900
committerHwankyu Jhun <h.jhun@samsung.com>2017-06-22 20:54:42 +0900
commit5ad33f7427a5de46de00b157c2031f90faa8a045 (patch)
tree0b6df2f30253eee6416607c27570fb965229f6c4 /tool
parent841d260165a4efb93d35a6c794b10138468bcf7b (diff)
downloadaul-1-5ad33f7427a5de46de00b157c2031f90faa8a045.tar.gz
aul-1-5ad33f7427a5de46de00b157c2031f90faa8a045.tar.bz2
aul-1-5ad33f7427a5de46de00b157c2031f90faa8a045.zip
Deprecate fast launch option
AMD starts in system-session. So, the option is not needed. Change-Id: If0c8d1618df64787ebcf57e080ec724f4f005bc3 Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
Diffstat (limited to 'tool')
-rw-r--r--tool/app_launcher.c130
1 files changed, 7 insertions, 123 deletions
diff --git a/tool/app_launcher.c b/tool/app_launcher.c
index 00d51e0f..4d5730d6 100644
--- a/tool/app_launcher.c
+++ b/tool/app_launcher.c
@@ -47,14 +47,6 @@ struct launch_arg {
bool debug;
bool web_debug;
bool sync;
- bool fast;
-};
-
-struct monitor {
- int fd;
- int wd;
- GIOChannel *io;
- guint wid;
};
enum command_e {
@@ -86,7 +78,6 @@ struct command {
static int result;
static GMainLoop *loop;
static gchar *help;
-static struct monitor amd_monitor;
static gpointer cmd_opt[CMD_MAX];
static GOptionEntry cmd_entries[] = {
{
@@ -149,7 +140,7 @@ static GOptionEntry cmd_entries[] = {
.flags = 0,
.arg = G_OPTION_ARG_STRING,
.arg_data = &cmd_opt[CMD_FAST_START],
- .description = "Execute the application quickly",
+ .description = "[Deprecated] Execute the application quickly",
.arg_description = "APPLICATION ID"
},
{
@@ -322,12 +313,8 @@ static int __app_dead_signal_cb(int pid, void *data)
{
struct launch_arg *arg = (struct launch_arg *)data;
- if (arg->pid == pid) {
- if (amd_monitor.wid)
- printf("... launch failed\n");
-
+ if (arg->pid == pid)
g_main_loop_quit(loop);
- }
return 0;
}
@@ -574,123 +561,20 @@ static int __cmd_fast_start_run(struct launch_arg *arg)
arg->pid = app_send_cmd_to_launchpad(LAUNCHPAD_PROCESS_POOL_SOCK,
arg->uid, 0, arg->b);
- if (arg->pid < 0) {
+ if (arg->pid <= 0) {
printf("... launch failed\n");
return -1;
}
- arg->fast = true;
-
- return 0;
-}
-
-static gboolean __monitor_amd_sock_cb(GIOChannel *io, GIOCondition cond,
- gpointer data)
-{
- char buf[INOTIFY_BUF];
- ssize_t len = 0;
- int i = 0;
- struct inotify_event *event;
- char *p;
- int fd = g_io_channel_unix_get_fd(io);
- struct launch_arg *arg = (struct launch_arg *)data;
-
- len = read(fd, buf, sizeof(buf));
- if (len < 0)
- return TRUE;
-
- while (i < len) {
- event = (struct inotify_event *)&buf[i];
- if (event->len) {
- p = event->name;
- if (p && !strcmp(p, AMD_SOCK)) {
- aul_app_register_pid(arg->appid, arg->pid);
- amd_monitor.wid = 0;
- printf("... successfully launched pid = %d\n",
- arg->pid);
- return G_SOURCE_REMOVE;
- }
- }
- i += offsetof(struct inotify_event, name) + event->len;
- if (i >= INOTIFY_BUF)
- break;
- }
-
- return G_SOURCE_CONTINUE;
-}
-
-static void __monitor_amd_sock_destroy_cb(gpointer data)
-{
- struct launch_arg *arg = (struct launch_arg *)data;
-
- if (!arg->sync)
- g_main_loop_quit(loop);
-
- g_io_channel_unref(amd_monitor.io);
- inotify_rm_watch(amd_monitor.fd, amd_monitor.wd);
- close(amd_monitor.fd);
-}
-
-static int __monitor_amd_sock_creation(struct launch_arg *arg)
-{
- amd_monitor.fd = inotify_init();
- if (amd_monitor.fd < 0)
- return -1;
-
- amd_monitor.wd = inotify_add_watch(amd_monitor.fd, PATH_AUL_DAEMONS,
- IN_CREATE);
- if (amd_monitor.wd < 0) {
- close(amd_monitor.fd);
- return -1;
- }
-
- amd_monitor.io = g_io_channel_unix_new(amd_monitor.fd);
- if (!amd_monitor.io) {
- inotify_rm_watch(amd_monitor.fd, amd_monitor.wd);
- close(amd_monitor.fd);
- return -1;
- }
-
- amd_monitor.wid = g_io_add_watch_full(amd_monitor.io,
- G_PRIORITY_DEFAULT, G_IO_IN, __monitor_amd_sock_cb,
- arg, __monitor_amd_sock_destroy_cb);
-
- return 1;
-}
-
-static int __register_appinfo(struct launch_arg *arg)
-{
- if (!access(PATH_AMD_SOCK, F_OK)) {
- aul_app_register_pid(arg->appid, arg->pid);
- return 0;
- }
- return __monitor_amd_sock_creation(arg);
-}
+ printf("... successfully launched pid = %d with debug %d\n",
+ arg->pid, arg->debug);
-static gboolean __register_dead_signal(gpointer data)
-{
- int ret;
-
- ret = aul_listen_app_dead_signal(__app_dead_signal_cb, data);
- if (ret < 0)
- return G_SOURCE_CONTINUE;
-
- return G_SOURCE_REMOVE;
+ return 0;
}
static void __cmd_fast_start_finish(struct launch_arg *arg)
{
- if (!arg->fast) {
- __cmd_start_finish(arg);
- return;
- }
-
- if (__register_appinfo(arg) > 0) {
- g_timeout_add_seconds(1, __register_dead_signal, arg);
- return;
- }
-
- g_main_loop_quit(loop);
+ __cmd_start_finish(arg);
}
static int __cmd_direct_start_run(struct launch_arg *arg)