Fix pkgmgr fr native build
[scm/bb/meta-tizen.git] / recipes-tizen / aul / files / remove-dlog-for-native-build.patch
1 diff --git a/CMakeLists.txt b/CMakeLists.txt
2 index c99e444..2753a59 100644
3 --- a/CMakeLists.txt
4 +++ b/CMakeLists.txt
5 @@ -19,11 +19,11 @@ MESSAGE("Build type: ${CMAKE_BUILD_TYPE}")
6  
7  # Set required packages
8  INCLUDE(FindPkgConfig)
9 -SET(AUL-1_PKG_CHECK_MODULES dlog libprivilege-control app-checker rua glib-2.0 vconf pkgmgr-info privacy-manager-client)
10 +SET(AUL-1_PKG_CHECK_MODULES  libprivilege-control app-checker rua glib-2.0 vconf pkgmgr-info privacy-manager-client)
11  pkg_check_modules(pkgs REQUIRED  ${AUL-1_PKG_CHECK_MODULES} )
12  
13 -pkg_check_modules(libpkgs REQUIRED dlog bundle dbus-glib-1 ail xdgmime app-checker libtzplatform-config)
14 -PKG_CHECK_MODULES(PKGS REQUIRED glib-2.0 gio-2.0 dlog bundle)
15 +pkg_check_modules(libpkgs REQUIRED  bundle dbus-glib-1 ail xdgmime app-checker libtzplatform-config)
16 +PKG_CHECK_MODULES(PKGS REQUIRED glib-2.0 gio-2.0  bundle)
17  
18  FIND_LIBRARY(LIB_DL dl)
19  
20 diff --git a/am_daemon/amd_appinfo.c b/am_daemon/amd_appinfo.c
21 index 0e1b862..990d784 100755
22 --- a/am_daemon/amd_appinfo.c
23 +++ b/am_daemon/amd_appinfo.c
24 @@ -197,7 +197,7 @@ static int __app_info_insert_handler (const pkgmgrinfo_appinfo_h handle, void *d
25         r = pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid);
26         c->val[_AI_PKGID] = strdup(pkgid);
27  
28 -       SECURE_LOGD("%s : %s : %s", c->val[_AI_FILE], c->val[_AI_COMP], c->val[_AI_TYPE]);
29 +       //SECURE_LOGD("%s : %s : %s", c->val[_AI_FILE], c->val[_AI_COMP], c->val[_AI_TYPE]);
30  
31         g_hash_table_insert(cf->tbl, c->val[_AI_FILE], c);
32  
33 @@ -259,7 +259,7 @@ static void __vconf_cb(keynode_t *key, void *data)
34                 return;
35         }
36  
37 -       SECURE_LOGD("noti_string : %s",noti_string);
38 +       //SECURE_LOGD("noti_string : %s",noti_string);
39         type_string = strtok_r(noti_string, ":", &saveptr);
40         appid = strtok_r(NULL, ":", &saveptr);
41         uid_string = strtok_r(NULL, ":", &saveptr);
42 @@ -278,7 +278,7 @@ static void __vconf_cb(keynode_t *key, void *data)
43                         _E("pkgmgrinfo_appinfo_get_appinfo fail");
44                 }
45  
46 -               SECURE_LOGD("appid : %s /handle : %x", appid, handle);
47 +               //SECURE_LOGD("appid : %s /handle : %x", appid, handle);
48  
49                 __app_info_insert_handler(handle, data);
50  
51 @@ -304,7 +304,7 @@ int app_func(pkgmgrinfo_appinfo_h handle, void *user_data)
52  
53         pkgmgrinfo_appinfo_get_appid(handle, &appid);
54         r = g_hash_table_remove(cf->tbl, appid);
55 -       SECURE_LOGD("upgrading... (%s)", appid);
56 +       //SECURE_LOGD("upgrading... (%s)", appid);
57  
58         return 0;
59  }
60 @@ -316,7 +316,7 @@ static int __cb(int req_id, const char *pkg_type,
61         int ret = 0;
62         pkgmgrinfo_pkginfo_h handle;
63  
64 -       SECURE_LOGD("appid(%s), key(%s), value(%s)", pkgid, key, val);
65 +       //SECURE_LOGD("appid(%s), key(%s), value(%s)", pkgid, key, val);
66  
67         if((strncmp(key,"start", 5) == 0) && (strncmp(val, "update", 6) == 0) ) {
68                 ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgid, &handle);
69 @@ -533,7 +533,7 @@ const struct appinfo *appinfo_find(uid_t caller_uid, const char *appid)
70         r = pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid);
71         res->val[_AI_PKGID] = strdup(pkgid);
72  
73 -       SECURE_LOGD("%s : %s : %s", res->val[_AI_FILE], res->val[_AI_COMP], res->val[_AI_TYPE]);
74 +       //SECURE_LOGD("%s : %s : %s", res->val[_AI_FILE], res->val[_AI_COMP], res->val[_AI_TYPE]);
75  
76         return res;
77  }
78 @@ -563,7 +563,7 @@ const char *appinfo_get_filename(const struct appinfo *c)
79  {
80         if (!c) {
81                 errno = EINVAL;
82 -               SECURE_LOGE("appinfo get filename: %s", strerror(errno));
83 +               //SECURE_LOGE("appinfo get filename: %s", strerror(errno));
84                 return NULL;
85         }
86  
87 diff --git a/am_daemon/amd_launch.c b/am_daemon/amd_launch.c
88 index 685699a..4993870 100755
89 --- a/am_daemon/amd_launch.c
90 +++ b/am_daemon/amd_launch.c
91 @@ -713,7 +713,7 @@ int _start_app(char* appid, bundle* kb, int cmd, int caller_pid, uid_t caller_ui
92                         if (_status_get_app_info_status(pid) == STATUS_DYING) {
93                                 pid = -ETERMINATING;
94                         } else if (caller_pid == pid) {
95 -                               SECURE_LOGD("caller process & callee process is same.[%s:%d]", appid, pid);
96 +                               //SECURE_LOGD("caller process & callee process is same.[%s:%d]", appid, pid);
97                                 pid = -ELOCALLAUNCH_ID;
98                         } else {
99                                 if ((ret = __nofork_processing(cmd, pid, kb, fd)) < 0) {
100 diff --git a/am_daemon/amd_request.c b/am_daemon/amd_request.c
101 index 349cfd3..c1923bb 100755
102 --- a/am_daemon/amd_request.c
103 +++ b/am_daemon/amd_request.c
104 @@ -188,7 +188,7 @@ static gboolean __add_history_handler(gpointer user_data)
105                 rec.arg = (char *)pkt_uid->pkt->data;
106         }
107  
108 -       SECURE_LOGD("add rua history %s %s", rec.pkg_name, rec.app_path);
109 +       //SECURE_LOGD("add rua history %s %s", rec.pkg_name, rec.app_path);
110  
111         ret = rua_add_history(&rec);
112         if (ret == -1)
113 @@ -219,14 +219,14 @@ static int __release_srv(uid_t caller_uid, const char *filename)
114  
115         ai = (struct appinfo *)appinfo_find(caller_uid, filename);
116         if (!ai) {
117 -               SECURE_LOGE("release service: '%s' not found", filename);
118 +               //SECURE_LOGE("release service: '%s' not found", filename);
119                 return -1;
120         }
121  
122         r = appinfo_get_boolean(ai, AIT_RESTART);
123         if (r == 1) {
124                 /* Auto restart */
125 -               SECURE_LOGD("Auto restart set: '%s'", filename);
126 +               //SECURE_LOGD("Auto restart set: '%s'", filename);
127                 return _start_srv(ai, NULL);
128         }
129  
130 @@ -349,7 +349,7 @@ static gboolean __request_handler(gpointer data)
131                         appid = malloc(MAX_PACKAGE_STR_SIZE);
132                         strncpy(appid, (const char*)pkt->data, MAX_PACKAGE_STR_SIZE-1);
133                         ret = _status_app_is_running(appid, cr.uid);
134 -                       SECURE_LOGD("APP_IS_RUNNING : %s : %d",appid, ret);
135 +                       //SECURE_LOGD("APP_IS_RUNNING : %s : %d",appid, ret);
136                         __send_result_to_client(clifd, ret);
137                         free(appid);
138                         break;
139 diff --git a/am_daemon/amd_status.c b/am_daemon/amd_status.c
140 index 12f595e..525134f 100755
141 --- a/am_daemon/amd_status.c
142 +++ b/am_daemon/amd_status.c
143 @@ -70,7 +70,7 @@ int _status_add_app_info_list(char *appid, char *app_path, int pid, int pad_pid,
144         {
145                 info_t = (app_status_info_t *)iter->data;
146  
147 -               SECURE_LOGD(" [%d] : %s, %d, %d", info_t->user, info_t->appid, info_t->pid, info_t->status);
148 +               //SECURE_LOGD(" [%d] : %s, %d, %d", info_t->user, info_t->appid, info_t->pid, info_t->status);
149         }
150  
151         return 0;
152 @@ -94,7 +94,7 @@ int _status_update_app_info_list(int pid, int status, uid_t uid)
153         {
154                 info_t = (app_status_info_t *)iter->data;
155  
156 -               //SECURE_LOGD("%s, %d, %d", info_t->appid, info_t->pid, info_t->status);
157 +               ////SECURE_LOGD("%s, %d, %d", info_t->appid, info_t->pid, info_t->status);
158         }
159  
160         return 0;
161 @@ -119,7 +119,7 @@ int _status_remove_app_info_list(int pid, uid_t uid)
162         {
163                 info_t = (app_status_info_t *)iter->data;
164  
165 -               //SECURE_LOGD("%s, %d, %d", info_t->appid, info_t->pid, info_t->status);
166 +               ////SECURE_LOGD("%s, %d, %d", info_t->appid, info_t->pid, info_t->status);
167         }
168  
169         return 0;
170 @@ -336,7 +336,7 @@ int _status_get_appid_bypid(int fd, int pid)
171         pkt->cmd = APP_GET_APPID_BYPID_ERROR;
172  
173         if (__get_pkgname_bypid(pid, (char *)pkt->data, MAX_PACKAGE_STR_SIZE) == 0) {
174 -               SECURE_LOGD("appid for %d is %s", pid, pkt->data);
175 +               //SECURE_LOGD("appid for %d is %s", pid, pkt->data);
176                 pkt->cmd = APP_GET_APPID_BYPID_OK;
177                 goto out;
178         }
179 diff --git a/include/simple_util.h b/include/simple_util.h
180 index e0dc4c7..edb1600 100755
181 --- a/include/simple_util.h
182 +++ b/include/simple_util.h
183 @@ -25,7 +25,7 @@
184  
185  #include <unistd.h>
186  #include <ctype.h>
187 -#include <dlog.h>
188 +//#include <dlog.h>
189  #include <tzplatform_config.h>
190  
191  #define GLOBAL_USER tzplatform_getuid(TZ_SYS_GLOBALAPP_USER)
192 @@ -52,9 +52,9 @@
193  #define MAX_LOCAL_BUFSZ 128
194  #define MAX_PID_STR_BUFSZ 20
195  
196 -#define _E(fmt, arg...) LOGE(fmt, ##arg)
197 -#define _D(fmt, arg...) LOGD(fmt, ##arg)
198 -#define _W(fmt, arg...) LOGW(fmt, ##arg)
199 +#define _E(fmt, arg...) //LOGE(fmt, ##arg)
200 +#define _D(fmt, arg...) //LOGD(fmt, ##arg)
201 +#define _W(fmt, arg...) //LOGW(fmt, ##arg)
202  
203  #define retvm_if(expr, val, fmt, arg...) do { \
204         if (expr) { \
205 diff --git a/src/launch.c b/src/launch.c
206 index 1e7a925..bc69a16 100755
207 --- a/src/launch.c
208 +++ b/src/launch.c
209 @@ -319,7 +319,7 @@ int app_request_to_launchpad(int cmd, const char *pkgname, bundle *kb)
210         int must_free = 0;
211         int ret = 0;
212  
213 -       SECURE_LOGD("launch request : %s", pkgname);
214 +       //SECURE_LOGD("launch request : %s", pkgname);
215         if (kb == NULL) {
216                 kb = bundle_create();
217                 must_free = 1;
218 diff --git a/src/mida.c b/src/mida.c
219 index 9bb37fc..61dc852 100755
220 --- a/src/mida.c
221 +++ b/src/mida.c
222 @@ -334,7 +334,7 @@ int mida_add_app(const char *mime_type, const char *pkg_name)
223         cnt = __count_with_field(MIDA_TBL_NAME, MIDA_F_MIMETYPE, mime_type, 0);
224  
225         if (cnt == 0) {
226 -               SECURE_LOGD("Inserting (%s, %s)", pkg_name, mime_type);
227 +               //SECURE_LOGD("Inserting (%s, %s)", pkg_name, mime_type);
228                 /* insert */
229                 _sqlbuf = sqlite3_mprintf(
230                             "INSERT INTO %s (%s,%s) values (\"%s\", \"%s\");",
231 @@ -344,7 +344,7 @@ int mida_add_app(const char *mime_type, const char *pkg_name)
232                 rc = _exec(mida_db, _sqlbuf);
233                 sqlite3_free(_sqlbuf);
234         } else {
235 -               SECURE_LOGD("Setting %s for %s", pkg_name, mime_type);
236 +               //SECURE_LOGD("Setting %s for %s", pkg_name, mime_type);
237                 /* update */
238                 _sqlbuf = sqlite3_mprintf(
239                                     "UPDATE %s SET %s = '%s' where %s = '%s';",
240 @@ -443,7 +443,7 @@ int svc_add_app(const char *svc_name, const char *pkg_name)
241  
242         if (cnt == 0) {
243                 /* insert */
244 -               SECURE_LOGD("Inserting (%s, %s)", pkg_name, svc_name);
245 +               //SECURE_LOGD("Inserting (%s, %s)", pkg_name, svc_name);
246                 _sqlbuf = sqlite3_mprintf(
247                      "INSERT INTO %s (%s,%s) values (\"%s\", \"%s\");",
248                      SVC_TBL_NAME, SVC_F_PKGNAME, SVC_F_SVCNAME, pkg_name,
249 @@ -453,7 +453,7 @@ int svc_add_app(const char *svc_name, const char *pkg_name)
250                 sqlite3_free(_sqlbuf);
251         } else {
252                 /* update */
253 -               SECURE_LOGD("Setting %s for %s", pkg_name, svc_name);
254 +               //SECURE_LOGD("Setting %s for %s", pkg_name, svc_name);
255                 _sqlbuf = sqlite3_mprintf(
256                                     "UPDATE %s SET %s = '%s' where %s = '%s';",
257                                     SVC_TBL_NAME, SVC_F_PKGNAME, pkg_name,
258 @@ -509,7 +509,7 @@ int is_supported_svc(const char *svc_name)
259         if (cnt > 0)
260                 rc = 1;
261         else
262 -               SECURE_LOGD("%s is not supported.", svc_name);
263 +               //SECURE_LOGD("%s is not supported.", svc_name);
264  
265         __fini();
266         return rc;
267 diff --git a/src/mime.c b/src/mime.c
268 index 0649e16..6ef272b 100755
269 --- a/src/mime.c
270 +++ b/src/mime.c
271 @@ -70,7 +70,7 @@ SLPAPI int aul_get_mime_from_content(const char *content, char *mimetype,
272                 if (__match_content_with_regex(content,
273                         &(miregex_tbl->regex_preg))) {
274                         founded = miregex_tbl->mimetype;
275 -                       SECURE_LOGD("content %s => mimetype %s\n", content, founded);
276 +                       //SECURE_LOGD("content %s => mimetype %s\n", content, founded);
277                         break;
278                 }
279                 miregex_tbl = miregex_tbl->next;
280 @@ -360,9 +360,9 @@ static int __launch_with_defapp(const char *mime_type, const char *mime_content)
281         if (_aul_get_defapp_from_mime
282             (mime_type, unaliased_mime_type, defapp,
283              sizeof(unaliased_mime_type), sizeof(defapp)) < 0) {
284 -               SECURE_LOGD("mimetype : %s, unaliased mimetype : %s, mime_content : %s,"
285 -                       " no default app", mime_type, 
286 -                               unaliased_mime_type, mime_content);
287 +               //SECURE_LOGD("mimetype : %s, unaliased mimetype : %s, mime_content : %s,"
288 +               //      " no default app", mime_type, 
289 +               //              unaliased_mime_type, mime_content);
290                 bundle_add(kb, AUL_K_UNALIASED_MIME_TYPE, unaliased_mime_type);
291                 ret = aul_launch_app(MIME_APP_SELECTOR, kb);
292                 /* TODO: When launching MIME APP SELECTOR, what should 
293 @@ -379,22 +379,22 @@ static int __launch_with_defapp(const char *mime_type, const char *mime_content)
294  
295                 if (ail_ret == AIL_ERROR_OK) {
296                         ail_destroy_appinfo(handle);
297 -                       SECURE_LOGD("mimetype : %s, unaliased mimetype : %s, "
298 -                               "mime_content : %s, defapp : %s", mime_type, 
299 -                                       unaliased_mime_type, 
300 -                                               mime_content, defapp);
301 +                       //SECURE_LOGD("mimetype : %s, unaliased mimetype : %s, "
302 +                       //      "mime_content : %s, defapp : %s", mime_type, 
303 +                       //              unaliased_mime_type, 
304 +                       //                      mime_content, defapp);
305                         bundle_add(kb, AUL_K_UNALIASED_MIME_TYPE,
306                                    unaliased_mime_type);
307                         ret = aul_launch_app(defapp, kb);
308                 } else if (ail_ret == AIL_ERROR_NO_DATA) {
309 -                       SECURE_LOGD("defapp %s for mimetype : %s, mime_content : %s "
310 -                               "does NOT exist", defapp, 
311 -                                       mime_type, mime_content);
312 +                       //SECURE_LOGD("defapp %s for mimetype : %s, mime_content : %s "
313 +                       //      "does NOT exist", defapp, 
314 +                       //              mime_type, mime_content);
315                         mida_delete_with_pkgname(defapp);
316                         ail_destroy_appinfo(handle);
317                         goto retry;
318                 } else {
319 -                       SECURE_LOGE("ail_get_appinfo with %s failed", defapp);
320 +                       //SECURE_LOGE("ail_get_appinfo with %s failed", defapp);
321                         if (kb) {
322                                 bundle_free(kb);
323                                 kb = NULL;
324 diff --git a/src/pkginfo.c b/src/pkginfo.c
325 index 975c01e..7cb4771 100755
326 --- a/src/pkginfo.c
327 +++ b/src/pkginfo.c
328 @@ -123,7 +123,7 @@ SLPAPI int aul_app_get_appid_bypid(int pid, char *appid, int len)
329  
330         if(pid == getpid() || getuid()==0 || geteuid()==0) {
331                 if (__get_pkgname_bypid(pid, appid, len) == 0) {
332 -                       SECURE_LOGD("appid for %d is %s", pid, appid);
333 +                       //SECURE_LOGD("appid for %d is %s", pid, appid);
334                         return AUL_R_OK;
335                 }
336                 /* support app launched by shell script*/diff --git a/am_session_agent/agent.c b/am_session_agent/agent.c
337 index 1d1efd0..1968f49 100644
338 --- a/am_session_agent/agent.c
339 +++ b/am_session_agent/agent.c
340 @@ -216,13 +216,13 @@ _static_ void __real_launch(const char *app_path, bundle * kb)
341         for (i = 0; i < app_argc; i++) {
342                 if( (i%2) == 1)
343                         continue;
344 -               SECURE_LOGD("input argument %d : %s##", i, app_argv[i]);
345 +               //SECURE_LOGD("input argument %d : %s##", i, app_argv[i]);
346         }
347  
348         PERF("setup argument done");
349  
350         /* Temporary log: launch time checking */
351 -       LOG(LOG_DEBUG, "LAUNCH", "[%s:Platform:agent:done]", app_path);
352 +       //LOG(LOG_DEBUG, "LAUNCH", "[%s:Platform:agent:done]", app_path);
353  #ifdef PRELOAD_ACTIVATE
354         __preload_exec(app_argc, app_argv);
355  #endif
356 @@ -347,7 +347,7 @@ _static_ void __modify_bundle(bundle * kb, int caller_pid,
357                         char value[256];
358  
359                         ptr += flag;
360 -                       SECURE_LOGD("parsing app_path: EXEC - %s\n", exe);
361 +                       //SECURE_LOGD("parsing app_path: EXEC - %s\n", exe);
362  
363                         do {
364                                 flag = __parser(ptr, key, sizeof(key));
365 @@ -604,7 +604,7 @@ _static_ void __agent_main_loop(int main_fd)
366         PERF("packet processing start");
367  
368         pkg_name = bundle_get_val(kb, AUL_K_PKG_NAME);
369 -       SECURE_LOGD("pkg name : %s\n", pkg_name);
370 +       //SECURE_LOGD("pkg name : %s\n", pkg_name);
371  
372         /* get caller uid and check if not coming from someone else than AMD */
373         uid = __get_caller_uid(kb);
374 @@ -660,8 +660,8 @@ _static_ void __agent_main_loop(int main_fd)
375  
376                         if (__prepare_exec(pkg_name, app_path,
377                                            menu_info, kb) < 0) {
378 -                               SECURE_LOGE("preparing work fail to launch - "
379 -                                  "can not launch %s\n", pkg_name);
380 +                               //SECURE_LOGE("preparing work fail to launch - "
381 +                               //   "can not launch %s\n", pkg_name);
382                                 exit(-1);
383                         }
384  
385 @@ -672,7 +672,7 @@ _static_ void __agent_main_loop(int main_fd)
386  
387                         exit(-1);
388                 }
389 -               SECURE_LOGD("==> real launch pid : %d %s\n", pid, app_path);
390 +               //SECURE_LOGD("==> real launch pid : %d %s\n", pid, app_path);
391                 is_real_launch = 1;
392         }
393   end: