# Set required packages
INCLUDE(FindPkgConfig)
-SET(AUL-1_PKG_CHECK_MODULES dlog ecore libprivilege-control app-checker rua glib-2.0 ecore-input evas vconf pkgmgr-info privacy-manager-client)
-OPTION(WITH_WAYLAND "Build with wayland" OFF)
-IF(WITH_WAYLAND)
- ADD_DEFINITIONS("-DWAYLAND")
- pkg_check_modules(pkgs REQUIRED ${AUL-1_PKG_CHECK_MODULES} ecore-wayland)
-ELSE(WITH_WAYLAND)
- ADD_DEFINITIONS("-DX11")
- pkg_check_modules(pkgs REQUIRED ${AUL-1_PKG_CHECK_MODULES} x11 ecore-x)
-ENDIF(WITH_WAYLAND)
+SET(AUL-1_PKG_CHECK_MODULES dlog libprivilege-control app-checker rua glib-2.0 vconf pkgmgr-info privacy-manager-client)
+pkg_check_modules(pkgs REQUIRED ${AUL-1_PKG_CHECK_MODULES} )
pkg_check_modules(libpkgs REQUIRED dlog bundle dbus-glib-1 ail xdgmime app-checker libtzplatform-config)
PKG_CHECK_MODULES(PKGS REQUIRED glib-2.0 gio-2.0 dlog bundle)
add_executable(amd
am_daemon/amd_main.c
- am_daemon/amd_key.c
am_daemon/amd_request.c
am_daemon/amd_appinfo.c
am_daemon/amd_cgutil.c
am_daemon/amd_status.c
)
SET(AUL-1_LINK_LIBRARY amd aul_mods app-checker-server rua glib-2.0 bundle ail aul)
-IF (WITH_WAYLAND)
target_link_libraries(${AUL-1_LINK_LIBRARY} ${pkgs_LDFLAGS})
-ELSE(WITH_WAYLAND)
-target_link_libraries(${AUL-1_LINK_LIBRARY} utilX ${pkgs_LDFLAGS})
-ENDIF(WITH_WAYLAND)
SET(REL_AGENT daemon-manager-release-agent)
ADD_EXECUTABLE(${REL_AGENT} agent/${REL_AGENT}.c)
static int __app_info_insert_handler (const pkgmgrinfo_appinfo_h handle, void *data)
{
struct appinfo *c;
- struct appinfomgr *cf = (struct appinfomgr *)data;
gboolean r;
+ struct appinfomgr *cf = (struct appinfomgr *)data;
char *exec;
char *type;
char *appid;
+++ /dev/null
-/*
- * aul
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Jayoun Lee <airjany@samsung.com>, Sewook Park <sewook7.park@samsung.com>, Jaeho Lee <jaeho81.lee@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * 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 <Ecore.h>
-#include <Evas.h>
-#include <Ecore_Input.h>
-#ifdef X11
-#include <Ecore_X.h>
-#include <utilX.h>
-#endif
-#ifdef WAYLAND
-#include <Ecore_Wayland.h>
-#endif
-#include <aul.h>
-#include <glib.h>
-
-#include "amd_config.h"
-#include "simple_util.h"
-#include "app_sock.h"
-#include "launch.h"
-
-static struct {
- Evas_Object *win;
- Ecore_Event_Handler *key_up;
- Ecore_Event_Handler *key_down;
-} key_info = {
- .win = NULL,
- .key_up = NULL,
- .key_down = NULL,
-};
-
-GSList *key_pid_list = NULL;
-
-static Eina_Bool __key_release_cb(void *data, int type, void *event);
-static Eina_Bool __key_press_cb(void *data, int type, void *event);
-
-static Eina_Bool __key_release_cb(void *data, int type, void *event)
-{
- Evas_Event_Key_Up *ev = event;
- int ret;
- GSList *entry;
- int *pid_data;
- bundle *kb;
-
- _D("Released");
-
- if (!ev) {
- _D("Invalid event object");
- return ECORE_CALLBACK_RENEW;
- }
-
- entry = key_pid_list;
- if (entry && entry->data) {
- pid_data = (int *) entry->data;
-
- kb = bundle_create();
- bundle_add(kb, AUL_K_MULTI_KEY, ev->keyname);
- bundle_add(kb, AUL_K_MULTI_KEY_EVENT, AUL_V_KEY_RELEASED);
-
- ret = app_send_cmd(*pid_data, APP_KEY_EVENT, kb);
- if (ret < 0)
- _E("app_send_cmd failed with error %d\n", ret);
-
- bundle_free(kb);
- }
-
- return ECORE_CALLBACK_RENEW;
-}
-
-
-static Eina_Bool __key_press_cb(void *data, int type, void *event)
-{
- Evas_Event_Key_Down *ev = event;
- int ret;
- GSList *entry;
- int *pid_data;
- bundle *kb;
-
- _D("Pressed");
-
- if (!ev) {
- _D("Invalid event object");
- return ECORE_CALLBACK_RENEW;
- }
-
- entry = key_pid_list;
- if (entry && entry->data) {
- pid_data = (int *) entry->data;
-
- kb = bundle_create();
- bundle_add(kb, AUL_K_MULTI_KEY, ev->keyname);
- bundle_add(kb, AUL_K_MULTI_KEY_EVENT, AUL_V_KEY_PRESSED);
-
- ret = app_send_cmd(*pid_data, APP_KEY_EVENT, kb);
- if (ret < 0)
- _E("app_send_cmd failed with error %d\n", ret);
-
- bundle_free(kb);
- }
-
- return ECORE_CALLBACK_RENEW;
-}
-
-int _register_key_event(int pid)
-{
- int *pid_data;
- GSList *entry;
-
- pid_data = malloc(sizeof(int));
- *pid_data = pid;
-
- key_pid_list = g_slist_prepend(key_pid_list, pid_data);
-
- _D("===key stack===");
-
- for (entry = key_pid_list; entry; entry = entry->next) {
- if (entry->data) {
- pid_data = (int *) entry->data;
- _D("pid : %d",*pid_data);
- }
- }
-
- return 0;
-}
-
-int _unregister_key_event(int pid)
-{
- GSList *entry;
- int *pid_data;
-
- for (entry = key_pid_list; entry;) {
- if (entry->data) {
- pid_data = (int *) entry->data;
- entry = entry->next;
- if(pid == *pid_data) {
- key_pid_list = g_slist_remove(key_pid_list, pid_data);
- free(pid_data);
- }
- }
- }
-
- _D("===key stack===");
-
- for (entry = key_pid_list; entry; entry = entry->next) {
- if (entry->data) {
- pid_data = (int *) entry->data;
- _D("pid : %d",*pid_data);
- }
- }
-
- return 0;
-}
-
-int _key_init()
-{
-#ifdef X11
- key_info.win = ecore_x_window_input_new(0, 0, 0, 1, 1);
- if (!key_info.win) {
- _D("Failed to create hidden window");
- }
-
- ecore_x_icccm_title_set(key_info.win, "acdaemon,key,receiver");
- ecore_x_netwm_name_set(key_info.win, "acdaemon,key,receiver");
- ecore_x_netwm_pid_set(key_info.win, getpid());
-
- utilx_grab_key(ecore_x_display_get(), key_info.win, KEY_PLAYCD, EXCLUSIVE_GRAB);
- utilx_grab_key(ecore_x_display_get(), key_info.win, KEY_STOPCD, EXCLUSIVE_GRAB);
- utilx_grab_key(ecore_x_display_get(), key_info.win, KEY_PAUSECD, EXCLUSIVE_GRAB);
- utilx_grab_key(ecore_x_display_get(), key_info.win, KEY_NEXTSONG, EXCLUSIVE_GRAB);
- utilx_grab_key(ecore_x_display_get(), key_info.win, KEY_PREVIOUSSONG, EXCLUSIVE_GRAB);
- utilx_grab_key(ecore_x_display_get(), key_info.win, KEY_REWIND, EXCLUSIVE_GRAB);
- utilx_grab_key(ecore_x_display_get(), key_info.win, KEY_FASTFORWARD, EXCLUSIVE_GRAB);
-
- key_info.key_up = ecore_event_handler_add(ECORE_EVENT_KEY_UP, __key_release_cb, NULL);
- if (!key_info.key_up) {
- _D("Failed to register a key up event handler");
- }
-
- key_info.key_down = ecore_event_handler_add(ECORE_EVENT_KEY_DOWN, __key_press_cb, NULL);
- if (!key_info.key_down) {
- _D("Failed to register a key down event handler");
- }
-#endif // X11
-
- return 0;
-}
-
+++ /dev/null
-/*
- * aul
- *
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Contact: Jayoun Lee <airjany@samsung.com>, Sewook Park <sewook7.park@samsung.com>, Jaeho Lee <jaeho81.lee@samsung.com>
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * 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.
- *
- */
-
-#ifndef __AUL_AMD_KEY_H_
-#define __AUL_AMD_KEY_H_
-
-int _key_init(void);
-int _register_key_event(int pid);
-int _unregister_key_event(int pid);
-
-#endif
-
#include <sys/stat.h>
#include <fcntl.h>
#include <string.h>
-#include <Ecore.h>
-#include <Ecore_Input.h>
-#include <Evas.h>
-#ifdef X11
-#include <Ecore_X.h>
-#include <utilX.h>
-#endif
-#ifdef WAYLAND
-#include <Ecore_Wayland.h>
-#endif
#include <aul.h>
#include <vconf.h>
#include <app-checker-server.h>
#include <ail.h>
#include <glib.h>
+#include <stdlib.h>
#include "amd_config.h"
#include "simple_util.h"
#include "aul_util.h"
#include "amd_appinfo.h"
#include "amd_cgutil.h"
-#include "amd_key.h"
#include "amd_status.h"
#include "amd_launch.h"
#include "amd_request.h"
// this function was called in single user mode as a callback to aul_listen_app_dead_signal
// but in multiuser mode, AMD daemon can't listen any more on DBUS system to catch those events
// AMD Agents must connect to AMD Daemon to signal a dead process
- _unregister_key_event(pid);
__remove_item_running_list(pid, user);
_status_remove_app_info_list(pid, user);
return 0;
int ret=0;
- ecore_init();
- evas_init();
- ecore_event_init();
-#ifdef X11
- ret = ecore_x_init(NULL);
- _D("ecore_x_init initialized %d times\n", ret);
-#endif
-#ifdef WAYLAND
- ecore_wl_init(NULL);
-#endif
-
appinfo_init(&amd.af);
cgutil_create(MOUNT_PATH, AGENT_PATH, &amd.cg);
_requset_init(&amd);
_launch_init(&amd);
_status_init(&amd);
-#ifndef __emul__
- if (ret > 0)
- _key_init();
-#endif
if (vconf_notify_key_changed(VCONFKEY_SETAPPL_DEVOPTION_BGPROCESS, __vconf_cb, NULL) != 0)
_E("Unable to register callback for VCONFKEY_SETAPPL_DEVOPTION_BGPROCESS\n");
gboolean __amd_ready(gpointer user_data)
{
int fd;
- int ret;
fd = creat("/run/amd_ready", S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH);
int main(int argc, char *argv[])
{
+ GMainLoop *mainloop = NULL;
+
if (ac_server_initialize() != AC_R_OK){
_E("ac_server_initialize failed!\n");
return -1;
g_idle_add(__amd_ready, NULL);
- ecore_main_loop_begin();
+ mainloop = g_main_loop_new(NULL, FALSE);
+ if (!mainloop) {
+ _E("failed to create glib main loop");
+ return -1;
+ }
+ g_main_loop_run(mainloop);
return 0;
}
#include "app_sock.h"
#include "aul_util.h"
#include "amd_request.h"
-#include "amd_key.h"
#include "amd_launch.h"
#include "amd_appinfo.h"
#include "amd_cgutil.h"
_D("APP_GET_APPID_BYPID : %d : %d", pid, ret);
break;
case APP_KEY_RESERVE:
- ret = _register_key_event(cr.pid);
- __send_result_to_client(clifd, ret);
+ // support for key events has been removed (sdx-20140813)
+ __send_result_to_client(clifd, 0);
break;
case APP_KEY_RELEASE:
- ret = _unregister_key_event(cr.pid);
- __send_result_to_client(clifd, ret);
+ // support for key events has been removed (sdx-20140813)
+ __send_result_to_client(clifd, 0);
break;
case APP_STATUS_UPDATE:
status = (int *)pkt->data;
#include <glib.h>
#include <aul.h>
#include <string.h>
-#include <Ecore.h>
#include "amd_config.h"
#include "amd_status.h"
return 0;
}
-static Eina_Bool __app_terminate_timer_cb(void *data)
-{
- int pid = (int)data;
- int ret = 0;
-
- _D("pid(%d)", pid);
-
- ret = kill(pid, SIGKILL);
- if (ret == -1)
- _D("send SIGKILL: %s", strerror(errno));
-
- return ECORE_CALLBACK_CANCEL;
-}
-
int _status_update_app_info_list(int pid, int status, uid_t uid)
{
GSList *iter = NULL;
info_t = (app_status_info_t *)iter->data;
if((pid == info_t->pid) && ((info_t->user == uid) || (info_t->user == 0))) {
info_t->status = status;
- if(status == STATUS_DYING) {
- if(info_t->pad_pid != DEBUG_LAUNCHPAD_PID)
- ecore_timer_add(2, __app_terminate_timer_cb, info_t->pid);
- }
break;
}
}
/*
* AMD user session agent
*/
-
#include <stdio.h>
#include <string.h>
#include <dlfcn.h>
_static_ int __parser(const char *arg, char *out, int out_size);
_static_ void __modify_bundle(bundle * kb, int caller_pid,
app_info_from_db * menu_info, int cmd);
-_static_ int __child_raise_win_by_x(int pid, void *priv);
-_static_ int __raise_win_by_x(int pid);
_static_ int __send_to_sigkill(int pid);
_static_ int __term_app(int pid);
_static_ int __resume_app(int pid);
_static_ void __set_env(app_info_from_db * menu_info, bundle * kb)
{
const char *str;
- const char **str_array;
setenv("PKG_NAME", _get_pkgname(menu_info), 1);
}
}
-_static_ int __child_raise_win_by_x(int pid, void *priv)
-{
-#ifdef X11
- return x_util_raise_win(pid);
-#else
- return 0;
-#endif
-}
-
-_static_ int __raise_win_by_x(int pid)
-{
- int pgid;
- if (x_util_raise_win(pid) == 0)
- return 0;
-
- /* support app launched by shell script*/
- pgid = getpgid(pid);
- _D("X raise failed. try to find first child & raise it - c:%d p:%d\n",
- pgid, pid);
-
- if (pgid <= 1)
- return -1;
- if (__proc_iter_pgid(pgid, __child_raise_win_by_x, NULL) < 0)
- return -1;
-
- return 0;
-}
-
_static_ int __send_to_sigkill(int pid)
{
int pgid;
sizeof(int))) < 0) {
if (ret == -EAGAIN)
_E("resume packet timeout error");
- else {
- _D("resume packet send error - use raise win");
- if (__raise_win_by_x(pid) < 0) {
- _E("raise failed - %d resume fail\n", pid);
- _E("we will term the app - %d\n", pid);
- __send_to_sigkill(pid);
- ret = -1;
- } else
- ret = 0;
- }
}
_D("resume done\n");
return ret;
if (uid_str == NULL)
return -1;
-end:
uid = atoi(uid_str);
if (uid <0)
return -1;
// Callee application
#include <aul.h>
#include <bundle.h>
-#include <Ecore.h>
static int aul_handler(aul_type type, bundle *kb,void* data)
{
int main(int argc, char** argv)
{
- ecore_init();
-
aul_launch_init(aul_handler,NULL);
// enable this if you want to handle at aul_handler when launch
aul_launch_argv_handler(argc, argv);
- ecore_main_loop_begin(); // You must need ecore or glib mainloop
+ ecore_main_loop_begin(); // You must need ecore or glib mainloop
return 0;
}
@endcode
* @retval AUL_R_OK - success
* @retval AUL_R_ECANCELD - aul handler was installed already by others
* @retval AUL_R_ECOMM - error to create internal ipc
- * @retval AUL_R_ERROR - error to attach glib main loop or ecore main loop
+ * @retval AUL_R_ERROR - error to attach glib main loop
*
* @warning If you use AppCore, you should NOT use this API.\n
- * You need glib main loop or ecore main loop.\n
+ * You need glib main loop.\n
* @pre
* you must have aul handler to use this API.
* aul_luanch_init register aul handler.
* return 0;
* }
*
+ * static GMainLoop *mainloop = NULL;
+ *
* int main(int argc, char **argv)
* {
- * ecore_init();
* aul_launch_init(aul_handler,NULL);
* aul_launch_argv_handler(argc, argv);
- * ecore_main_loop_begin();
+ *
+ * mainloop = g_main_loop_new(NULL, FALSE);
+ * g_main_loop_run(mainloop);
* }
*
* @endcode
#include <ail.h>
#include <string.h>
#include <stdio.h>
+#include <stdlib.h>
#include "simple_util.h"
#define MAX_PATH_LEN 1024
else
ret = ail_appinfo_get_str(handle, AIL_PROP_PACKAGE_STR, &str);
if (str) {
- menu_info->pkg_name = strdup(str);
+ menu_info->pkg_name = strdup(str);
str = NULL;
}
//is_admin is global
menu_info->pkg_type = strdup(str);
str = NULL;
}
-
+
ret = ail_destroy_appinfo(handle);
if (ret != AIL_ERROR_OK) {
_E("ail_destroy_appinfo failed");
ail_filter_h filter;
ail_error_e ret;
int count;
-
+
if (apppath == NULL)
return NULL;
menu_info->original_app_path = strdup(apppath);
return menu_info;
-
+
}
-%bcond_with wayland
-%bcond_with x
Name: aul
Summary: App utility library
Version: 0.0.300
BuildRequires: cmake
BuildRequires: pkgconfig(dbus-glib-1)
BuildRequires: pkgconfig(sqlite3)
-BuildRequires: pkgconfig(ecore)
BuildRequires: pkgconfig(bundle)
BuildRequires: pkgconfig(dlog)
BuildRequires: pkgconfig(ail)
BuildRequires: pkgconfig(app-checker)
BuildRequires: pkgconfig(app-checker-server)
BuildRequires: pkgconfig(rua)
-%if %{with wayland}
-BuildRequires: pkgconfig(ecore-wayland)
-%endif
-%if %{with x}
-BuildRequires: pkgconfig(ecore-x)
-BuildRequires: pkgconfig(x11)
-BuildRequires: pkgconfig(utilX)
-%endif
-BuildRequires: pkgconfig(ecore-input)
BuildRequires: pkgconfig(vconf)
BuildRequires: pkgconfig(pkgmgr-info)
BuildRequires: libattr-devel
CFLAGS="%{optflags} -D__emul__"; export CFLAGS
%endif
-%cmake . \
-%if %{with wayland}
- -DWITH_WAYLAND=On \
-%else
- -DWITH_WAYLAND=Off \
-%endif
+%cmake .
make %{?jobs:-j%jobs}
int __create_server_sock_by_path(char *path)
{
struct sockaddr_un saddr;
- struct sockaddr_un p_saddr;
int fd = socket(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0);
/* support above version 2.6.27*/
if (fd < 0) {
int retry = 1;
int ret = -1;
- fd = socket(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0);
+ fd = socket(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0);
/* support above version 2.6.27*/
if (fd < 0) {
if (errno == EINVAL) {
int retry = 1;
int ret = -1;
- fd = socket(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0);
+ fd = socket(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0);
/* support above version 2.6.27*/
if (fd < 0) {
if (errno == EINVAL) {
error = 0;
if ((ret = connect(fd, (struct sockaddr *)saptr, salen)) < 0) {
if (errno != EAGAIN && errno != EINPROGRESS) {
- fcntl(fd, F_SETFL, flags);
+ fcntl(fd, F_SETFL, flags);
return (-2);
}
}
int fd;
int len;
int ret;
- int res = 0;
app_pkt_t *pkt = NULL;
if (kb_data == NULL || datalen > AUL_SOCK_MAXBUFF - 8) {
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
-#ifdef X11
-#include <utilX.h>
-#endif
#include <glib.h>
#include <poll.h>
#include <bundle.h>
#include <sys/types.h>
#include <sys/stat.h>
+#include <sys/time.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
}
/**
- * @brief caller & callee's sock handler
+ * @brief caller & callee's sock handler
*/
int aul_sock_handler(int fd)
{
_E("Malloc failed");
return AUL_R_ERROR;
}
-
+
bundle_add(*kb, AUL_K_ARGV0, buf);
}
if (buf) { /*Prevent FIX: ID 38717 */
}
ptr++;
- if (*ptr == NULL)
+ if (!(*ptr))
break;
// ignore trailing "--"
{
char buf[MAX_CMD_BUFSZ];
char buf2[MAX_CMD_BUFSZ];
- int ret;
ssize_t len;
snprintf(buf, sizeof(buf), "/proc/%d/exe", pid);
#include <poll.h>
#include <stdio.h>
#include <unistd.h>
+#include <stdlib.h>
+#include <sys/time.h>
+#include <glib.h>
#include "aul.h"
-/* ecore-glib integration */
-
-#include <Ecore.h>
-
extern int aul_listen_app_dead_signal(int (*func) (int, void *), void *data);
+static GMainLoop *mainloop = NULL;
+
void do_create()
{
/* call real create callback*/
printf("=================================\n");
}
-static Eina_Bool send_result(void *data)
-{
- bundle *kb;
- bundle *res_b;
- kb = (bundle *) data;
-
- aul_create_result_bundle(kb, &res_b);
- if (res_b == NULL)
- return 0;
-
- aul_send_service_result(res_b);
- bundle_free(res_b);
-
- bundle_free(kb);
-
- return 0;
-}
-
static void prt_bundle(const char *key, const char *value, void *d)
{
printf("bundle - key: %s, value: %s\n", key, value);
bundle_iterate(kb, prt_bundle, NULL);
- ecore_timer_add(5, send_result, bundle_dup(kb));
-
return 0;
}
__attribute__ ((visibility("default")))
int main(int argc, char **argv)
{
- ecore_init();
-
do_create();
if (aul_launch_init(aul_handler, NULL) < 0)
exit(0);
}
- ecore_main_loop_begin();
+ mainloop = g_main_loop_new(NULL, FALSE);
+ if (!mainloop) {
+ printf("failed to create glib main loop\n");
+ exit(EXIT_FAILURE);
+ }
+ g_main_loop_run(mainloop);
+
return 0;
}
/* vi: set ts=8 sts=8 sw=8: */
-
-
-
-/* vi: set ts=8 sts=8 sw=8: */
#include <stdio.h>
#include <sys/time.h>
#include <unistd.h>
-#include <Ecore.h>
+#include <stdlib.h>
+#include <glib.h>
#include "menu_db_util.h"
#include "aul.h"
static int gargc;
static char *cmd;
static int apn_pid;
+static GMainLoop *mainloop = NULL;
typedef struct _test_func_t {
char *name;
if ((strcmp(cmd, "launch_res") == 0)
|| (strcmp(cmd, "open_svc_res") == 0))
- ecore_main_loop_quit();
+ g_main_loop_quit(mainloop);
+
}
int open_test()
{"n", launch_test, "launch_test", ""}
};
-static Eina_Bool run_all_test(void *data)
+static gboolean run_all_test(void *data)
{
static int pos = 0;
int ret;
if (pos > sizeof(scn_func) / sizeof(test_func_t) - 1) {
printf("all internal test done\n");
- ecore_main_loop_quit();
+ g_main_loop_quit(mainloop);
return 0;
}
int all_test()
{
- ecore_timer_add(2, run_all_test, NULL);
+ static int pos = 0;
+ int ret;
+
+ if (pos > sizeof(scn_func) / sizeof(test_func_t) - 1) {
+ printf("all internal test done\n");
+ return 0;
+ }
+
+ if (strncmp(scn_func[pos].name, "n", 1) == 0) {
+ printf("[test %d] %s , pkgname = %s\n", pos, scn_func[pos].desc,
+ gargv[2]);
+ apn_pid = scn_func[pos].func();
+ printf("... return pid = %d\n", apn_pid);
+ } else {
+ printf("[test %d] %s , pid = %d\n", pos, scn_func[pos].desc,
+ apn_pid);
+ ret = scn_func[pos].func();
+ printf("... return res = %d\n", ret);
+ }
+ pos++;
+
return 0;
}
pkgname = gargv[2];
apppath = gargv[3];
-
+
appname = strrchr(apppath,'/')+1;
snprintf(ai.app_icon_path, PATH_LEN, "aul_test_icon_path/%d",getpid());
- snprintf(ai.desktop_path, PATH_LEN,
+ snprintf(ai.desktop_path, PATH_LEN,
"aul_test_desktop_path/%d",getpid());
snprintf (query, sizeof(query), "insert into "TABLE_MENU"(\
"[usage] getallpkg all"},
{"getpkgpid", get_pkgpid_test, "aul_app_get_appid_bypid test",
"[usage] getpkgpid <pid>"},
-
+
{"open_file", open_file_test, "aul_open_file test",
"[usage] open_file <filename>"},
{"open_content", open_content_test, "aul_open_content test",
"[usage] set_defapp_svc <svcname> <defapp to be set>"},
{"get_defapp_svc", get_defapp_svc_test, "aul_get_defapp_from_svc test"
"[usage] get_defapp_svc <svcname>"},
-
+
{"getpkg", get_pkg_func, "get package",
"[usage] getpkg <pkgname>"},
{"update_list", update_running_list, "update running list",
"cmd is internal purpose\n");
}
-static Eina_Bool run_func(void *data)
+static gboolean run_func(void *data)
{
callfunc(cmd);
|| strcmp(cmd, "open_svc_res") == 0)
return 0;
else
- ecore_main_loop_quit();
+ g_main_loop_quit(mainloop);
return 0;
}
exit(0);
}
- ecore_init();
-
cmd = argv[1];
gargc = argc;
gargv = argv;
/*aul_listen_app_dead_signal(dead_tracker,NULL); */
/*aul_listen_app_dead_signal(NULL,NULL); */
- ecore_idler_add(run_func, NULL);
+ g_idle_add(run_func,NULL);
- ecore_main_loop_begin();
+ mainloop = g_main_loop_new(NULL, FALSE);
+ if (!mainloop) {
+ printf("failed to create glib main loop\n");
+ exit(EXIT_FAILURE);
+ }
+ g_main_loop_run(mainloop);
return 0;
}
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
+#include <string.h>
+#include <glib.h>
-#include <Ecore.h>
#include "aul.h"
#define ROOT_UID 0
static int gargc;
bundle *kb = NULL;
+static GMainLoop *mainloop = NULL;
static bundle *create_internal_bundle(int start)
{
int listen_pid = (int) data;
if(listen_pid == pid)
- ecore_main_loop_quit();
+ g_main_loop_quit(mainloop);
return 0;
}
-static Eina_Bool run_func(void *data)
+static gboolean run_func(void *data)
{
int pid = -1;
char *str = NULL;
if( str && strcmp(str, "SYNC") == 0 ) {
aul_listen_app_dead_signal(__launch_app_dead_handler, pid);
} else {
- ecore_main_loop_quit();
+ g_main_loop_quit(mainloop);
}
} else {
printf("... launch failed\n");
- ecore_main_loop_quit();
+ g_main_loop_quit(mainloop);
}
if (kb) {
kb = NULL;
}
- return 0;
+ return TRUE;
}
-
int main(int argc, char **argv)
{
if (argc < 2) {
exit(EXIT_FAILURE);
}
- ecore_init();
-
gargc = argc;
gargv = argv;
aul_launch_init(NULL, NULL);
- ecore_idler_add(run_func, NULL);
+ g_idle_add(run_func, NULL);
- ecore_main_loop_begin();
+ mainloop = g_main_loop_new(NULL, FALSE);
+ if (!mainloop) {
+ printf("failed to create glib main loop\n");
+ exit(EXIT_FAILURE);
+ }
+ g_main_loop_run(mainloop);
return 0;
}
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
+#include <string.h>
+#include <glib.h>
-#include <Ecore.h>
#include "aul.h"
#define ROOT_UID 0
static int gargc;
bundle *kb = NULL;
+static GMainLoop *mainloop = NULL;
static bundle *create_internal_bundle(int start)
{
int listen_pid = (int) data;
if(listen_pid == pid)
- ecore_main_loop_quit();
+ g_main_loop_quit(mainloop);
return 0;
}
-static Eina_Bool run_func(void *data)
+static gboolean run_func(void *data)
{
int pid = -1;
char *str = NULL;
if( str && strcmp(str, "SYNC") == 0 ) {
aul_listen_app_dead_signal(__launch_app_dead_handler, pid);
} else {
- ecore_main_loop_quit();
+ g_main_loop_quit(mainloop);
}
if (kb) {
kb = NULL;
}
- return 0;
+ return TRUE;
}
+
int main(int argc, char **argv)
{
if (argc < 2) {
exit(EXIT_FAILURE);
}
- ecore_init();
-
gargc = argc;
gargv = argv;
aul_launch_init(NULL, NULL);
- ecore_idler_add(run_func, NULL);
+ g_idle_add(run_func, NULL);
- ecore_main_loop_begin();
+ mainloop = g_main_loop_new(NULL, FALSE);
+ if (!mainloop) {
+ printf("failed to create glib main loop\n");
+ exit(EXIT_FAILURE);
+ }
+ g_main_loop_run(mainloop);
return 0;
}