Modified setting debug information 43/184043/2
authorHwankyu Jhun <h.jhun@samsung.com>
Fri, 13 Jul 2018 07:28:50 +0000 (16:28 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Sun, 15 Jul 2018 23:41:47 +0000 (08:41 +0900)
- Uses AUL debug info functions

Change-Id: If1042a07afc109e43867133324910bd52307f07e
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
widget_viewer_sdk/src/main.c

index b3debb6..a0bbefd 100644 (file)
@@ -32,6 +32,7 @@
 #include <app_control_internal.h>
 #include <efl_extension.h>
 #include <aul.h>
+#include <aul_debug_info.h>
 #include <appsvc.h>
 #include <watch_control.h>
 #include <pkgmgr-info.h>
@@ -51,10 +52,6 @@ int errno;
 #define VCONFKEY_WMS_CLOCKS_SET_IDLE "db/wms/clocks_set_idle"
 #endif
 
-#define DLP_K_DEBUG_ARG "__DLP_DEBUG_ARG__"
-#define DLP_K_VALGRIND_ARG "__DLP_VALGRIND_ARG__"
-#define SDK_DEBUG "DEBUG"
-#define SDK_VALGRIND "VALGRIND"
 #define LAZY_LOADER "__LAZY_LOADER__"
 #define DEFAULT_WATCH "org.tizen.idle-clock-digital"
 
@@ -105,6 +102,7 @@ static struct info {
 
 static char *__watch_pkgid;
 static Evas_Object *__clock;
+static bool __debug_info_initialized;
 
 static void back_key_cb(void *data, Evas_Object *obj, void *event_info)
 {
@@ -441,6 +439,10 @@ static void app_terminate(void *data)
 {
        eext_object_event_callback_del(s_info.win, EEXT_CALLBACK_BACK, back_key_cb);
 
+       if (__debug_info_initialized) {
+               aul_debug_info_fini();
+               __debug_info_initialized = false;
+       }
        unload_widget();
 
        /* WIDGET fini */
@@ -688,23 +690,6 @@ static void _run_widget(char *widget_id, app_control_h service, char *lazy_loade
        }
 }
 
-static void __copy_bundle(bundle *src_b, bundle *dst_b, const char *key)
-{
-       const char **str_arr;
-       char *str = NULL;
-       int len = 0;
-
-       if (bundle_get_type(src_b, key) == BUNDLE_TYPE_STR_ARRAY) {
-               str_arr = bundle_get_str_array(src_b, key, &len);
-               if (str_arr)
-                       bundle_add_str_array(dst_b, key, str_arr, len);
-       } else {
-               bundle_get_str(src_b, key, &str);
-               if (str)
-                       bundle_add_str(dst_b, key, str);
-       }
-}
-
 static void __set_bundle_for_watchapp(bundle *app_control_b, bundle *b)
 {
        char *sdk_util = NULL;
@@ -749,12 +734,9 @@ static void __set_bundle_for_watchapp(bundle *app_control_b, bundle *b)
 
        bundle_get_str(app_control_b, AUL_K_SDK, &sdk_util);
        if (sdk_util != NULL) {
-               bundle_add_str(b, AUL_K_SDK, sdk_util);
-               if (strcmp(sdk_util, SDK_VALGRIND) == 0)
-                       __copy_bundle(app_control_b, b, DLP_K_VALGRIND_ARG);
-               else if (strcmp(sdk_util, SDK_DEBUG) == 0)
-                       __copy_bundle(app_control_b, b, DLP_K_DEBUG_ARG);
-
+               aul_debug_info_init();
+               aul_debug_info_set(app_control_b, b);
+               __debug_info_initialized = true;
                DbgPrint("util %s", sdk_util);
        }
 }