#include <aul_svc.h>
#include <aul_app_com.h>
#include <widget_service.h>
+#include <widget_service_internal.h>
#include <app.h>
#include "widget_errno.h"
#define WIDGET_CLASS_DELIMITER "@"
#define QUERY_MAX_LEN 8192
+#define DLP_K_DEBUG_ARG "__DLP_DEBUG_ARG__"
+#define DLP_K_GDBSERVER_PATH "__DLP_GDBSERVER_PATH__"
+#define DLP_K_VALGRIND_ARG "__DLP_VALGRIND_ARG__"
+#define DLP_K_VALGRIND_PATH "__DLP_VALGRIND_PATH__"
+#define SDK_DEBUG "DEBUG"
+#define SDK_VALGRIND "VALGRIND"
+
#ifndef TIZEN_PATH_MAX
#define TIZEN_PATH_MAX 1024
#endif
static GHashTable *lifecycle_tbl;
static int is_status_handler_connected;
+static char *sdk_util = NULL;
+static char *sdk_util_path = NULL;
+static char *sdk_util_arg = NULL;
+static char *sdk_caller_pid = NULL;
+
static char *package_id;
struct lifecycle_local_s {
bundle *b;
widget_instance_h instance;
+
_D("launch: %s", instance_id);
if (instance_id == NULL) {
bundle_add_str(b, AUL_K_WAYLAND_DISPLAY, wayland_display);
bundle_add_str(b, AUL_K_WAYLAND_WORKING_DIR, xdg_runtime_dir);
bundle_add_str(b, WIDGET_K_OPERATION, "create");
+
+ if (sdk_util != NULL) {
+ bundle_add_str(b, AUL_K_ORG_CALLER_PID, sdk_caller_pid);
+ if (strcmp(sdk_util, SDK_DEBUG) == 0) {
+ bundle_add_str(b, AUL_K_SDK, SDK_DEBUG);
+ if (sdk_util_path)
+ bundle_add_str(b, DLP_K_GDBSERVER_PATH, sdk_util_path);
+ if (sdk_util_arg)
+ bundle_add_str(b, DLP_K_DEBUG_ARG, sdk_util_arg);
+ } else if (strcmp(sdk_util, SDK_VALGRIND) == 0) {
+ bundle_add_str(b, AUL_K_SDK, SDK_VALGRIND);
+ if (sdk_util_path)
+ bundle_add_str(b, DLP_K_VALGRIND_PATH, sdk_util_path);
+ if (sdk_util_arg)
+ bundle_add_str(b, DLP_K_VALGRIND_ARG, sdk_util_arg);
+ }
+ }
+
if (content_info) {
bundle_add_str(b, WIDGET_K_CONTENT_INFO, content_info);
instance->content_info = strdup(content_info);
return 0;
}
+
+EAPI int widget_service_set_sdk_util(bundle *data)
+{
+ char *util = NULL;
+ char *util_path = NULL;
+ char *util_arg = NULL;
+ char *caller_pid = NULL;
+
+ if (sdk_util) {
+ free(sdk_util);
+ sdk_util = NULL;
+ }
+
+ if (sdk_util_path) {
+ free(sdk_util_path);
+ sdk_util_path = NULL;
+ }
+
+ if (sdk_util_arg) {
+ free(sdk_util_arg);
+ sdk_util_arg = NULL;
+ }
+
+ if (sdk_caller_pid) {
+ free(sdk_caller_pid);
+ sdk_caller_pid = NULL;
+ }
+
+ bundle_get_str(data, AUL_K_SDK, &util);
+ bundle_get_str(data, AUL_K_ORG_CALLER_PID, &caller_pid);
+ if (caller_pid == NULL)
+ bundle_get_str(data, AUL_K_CALLER_PID, &caller_pid);
+
+ if (util) {
+ sdk_util = strdup(util);
+
+ if (strcmp(util, SDK_DEBUG) == 0) {
+ bundle_get_str(data, DLP_K_GDBSERVER_PATH, &util_path);
+ bundle_get_str(data, DLP_K_DEBUG_ARG, &util_arg);
+ } else if (strcmp(util, SDK_VALGRIND) == 0) {
+ bundle_get_str(data, DLP_K_VALGRIND_PATH, &util_path);
+ bundle_get_str(data, DLP_K_VALGRIND_ARG, &util_arg);
+ }
+
+ if (util_path)
+ sdk_util_path = strdup(util_path);
+
+ if (util_arg)
+ sdk_util_arg = strdup(util_arg);
+
+ if (caller_pid)
+ sdk_caller_pid = strdup(caller_pid);
+ }
+
+ return 0;
+}