4 * Copyright (c) 2015 Samsung Electronics Co., Ltd. All rights reserved.
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
24 #include <sys/types.h>
31 * @brief Return values in AUL.
33 typedef enum _aul_return_val {
34 AUL_R_EREJECTED = -14, /**< App disable for mode */
35 AUL_R_ENOAPP = -13, /**< Failed to find app ID or pkg ID */
36 AUL_R_EHIDDENFORGUEST = -11, /**< App hidden for guest mode */
37 AUL_R_ENOLAUNCHPAD = -10, /**< no launchpad */
38 AUL_R_ETERMINATING = -9, /**< application terminating */
39 AUL_R_EILLACC = -8, /**< Illegal Access */
40 AUL_R_LOCAL = -7, /**< Launch by himself */
41 AUL_R_ETIMEOUT = -6, /**< Timeout */
42 AUL_R_ECANCELED = -5, /**< Operation canceled */
43 AUL_R_EINVAL = -4, /**< Invalid argument */
44 AUL_R_ECOMM = -3, /**< Comunication Error */
45 AUL_R_ENOINIT = -2, /**< AUL handler NOT initialized */
46 AUL_R_ERROR = -1, /**< General error */
47 AUL_R_OK = 0 /**< General success */
62 typedef enum _aul_type {
72 /** AUL public key - To check caller's secuirty */
73 #define AUL_K_CALLER_PID "__AUL_CALLER_PID__"
74 /** AUL public key - To check callee's secuirty */
75 #define AUL_K_CALLEE_PID "__AUL_CALLEE_PID__"
76 /** AUL public key - added for multiuser mode */
77 #define AUL_K_CALLER_UID "__AUL_CALLER_UID__"
78 /** AUL public key - added for multiuser mode */
79 #define AUL_K_CALLEE_UID "__AUL_CALLEE_UID__"
80 /** AUL public key - added for multiuser mode */
81 #define AUL_K_TARGET_UID "__AUL_TARGET_UID__"
82 /** AUL public key - To check caller's secuirty */
83 #define AUL_K_CALLER_APPID "__AUL_CALLER_APPID__"
84 /** AUL public key - To check caller's secuirty */
85 #define AUL_K_CALLEE_APPID "__AUL_CALLEE_APPID__"
86 /** AUL public key - To find argv0 */
87 #define AUL_K_ARGV0 "__AUL_ARGV0__"
88 /** AUL public key - To measure launching time */
89 #define AUL_K_STARTTIME "__AUL_STARTTIME__"
90 /** AUL public key - To support launching based on mime type */
91 #define AUL_K_MIME_TYPE "__AUL_MIME_TYPE__"
92 /** AUL public key - To support launching based on mime type */
93 #define AUL_K_UNALIASED_MIME_TYPE "__AUL_UNALIASED_MIME_TYPE__"
94 /** AUL public key - To support launching based on mime type */
95 #define AUL_K_MIME_CONTENT "__AUL_MIME_CONTENT__"
96 /** AUL public key - To support launching based on service */
97 #define AUL_K_SERVICE_NAME "__AUL_SERVICE_NAME__"
98 /** AUL public key - To force launch app selector instead of lauchingn default app */
99 #define AUL_K_FORCE_LAUNCH_APP_SELECTOR "__AUL_FORCE_LAUNCH_APP_SELECTOR__"
100 /** AUL public key - To support debug argument */
101 #define AUL_K_DEBUG "__AUL_DEBUG__"
102 /** AUL public key - To support SDK */
103 #define AUL_K_SDK "__AUL_SDK__"
104 /** AUL public key - To support Media key */
105 #define AUL_K_MULTI_KEY "__AUL_MULTI_KEY__"
106 /** AUL public key - To support Media key */
107 #define AUL_K_MULTI_KEY_EVENT "__AUL_MULTI_KEY_EVENT__"
108 /** AUL public bundle value */
109 #define AUL_K_PRIVACY_APPID "__AUL_PRIVACY_APPID__"
110 /** AUL public bundle value - To support Media key*/
111 #define AUL_V_KEY_PRESSED "__AUL_KEY_PRESSED__"
112 /** AUL public bundle value - To support Media key*/
113 #define AUL_V_KEY_RELEASED "__AUL_KEY_RELEASED__"
114 /** AUL public key - To support rua stat */
115 #define AUL_SVC_K_RUA_STAT_CALLER "__K_RUA_STAT_CALLER__"
116 #define AUL_SVC_K_RUA_STAT_TAG "__K_RUA_STAT_TAG__"
117 /** AUL public key - To support rua delete */
118 #define AUL_K_RUA_PKGNAME "__K_RUA_PKGNAME"
119 /** AUL public key - To support rua delete */
120 #define AUL_K_RUA_APPPATH "__K_RUA_APPPATH"
124 /** AUL internal private key */
125 #define AUL_K_PKG_NAME "__AUL_PKG_NAME__"
126 /** AUL internal private key */
127 #define AUL_K_WAIT_RESULT "__AUL_WAIT_RESULT__"
128 /** AUL internal private key */
129 #define AUL_K_SEND_RESULT "__AUL_SEND_RESULT__"
130 /** AUL internal private key */
131 #define AUL_K_TASK_MANAGE "__AUL_TASK_MANAGE__"
132 /** AUL internal private key */
133 #define AUL_K_APP_TYPE "__AUL_APP_TYPE__"
134 /** AUL internal private key - To check original caller's identity */
135 #define AUL_K_ORG_CALLER_PID "__AUL_ORG_CALLER_PID__"
136 /** AUL internal private key - To check forwarded callee app's pid */
137 #define AUL_K_FWD_CALLEE_PID "__AUL_FWD_CALLEE_PID__"
138 /** AUL internal private key */
139 #define AUL_K_NO_CANCEL "__AUL_NO_CANCEL__"
140 /** AUL internal private key */
141 #define AUL_K_EXEC "__AUL_EXEC__"
142 /** AUL internal private key */
143 #define AUL_K_MULTIPLE "__AUL_MULTIPLE__"
144 /** AUL internal private key */
145 #define AUL_K_PACKAGETYPE "__AUL_PACKAGETYPE__"
146 /** AUL internal private key */
147 #define AUL_K_HWACC "__AUL_HWACC__"
148 /** AUL internal private key */
149 #define AUL_K_APPID "__AUL_APPID__"
150 /** AUL internal private key */
151 #define AUL_K_PID "__AUL_PID__"
152 /** AUL internal private key */
153 #define AUL_K_WID "__AUL_WID__"
154 /** AUL internal private key */
155 #define AUL_K_LEADER_PID "__AUL_LEADER_PID__"
156 /** AUL internal private key - To support data control */
157 #define AUL_K_DATA_CONTROL_TYPE "__AUL_DATA_CONTROL_TYPE__"
158 /** AUL internal private key */
159 #define AUL_K_PKGID "__AUL_PKGID_"
160 /** AUL internal private key */
161 #define AUL_K_INTERNAL_POOL "__AUL_INTERNAL_POOL__"
162 /** AUL internal private key */
163 #define AUL_TEP_PATH "_AUL_TEP_PATH_"
164 /** AUL internal private key */
165 #define AUL_K_COMP_TYPE "__AUL_COMP_TYPE__"
166 /** AUL internal private key */
167 #define AUL_K_LOADER_ID "__AUL_LOADER_ID__"
168 /** AUL internal private key */
169 #define AUL_K_LOADER_PATH "__AUL_LOADER_PATH__"
170 /** AUL internal private key */
171 #define AUL_K_LOADER_EXTRA "__AUL_LOADER_EXTRA__"
172 /** AUL internal private key */
173 #define AUL_K_WAYLAND_DISPLAY "__AUL_WAYLAND_DISPLAY__"
174 /** AUL internal private key */
175 #define AUL_K_WAYLAND_WORKING_DIR "__AUL_WAYLAND_WORKING_DIR__"
176 /** AUL internal private key */
177 #define AUL_K_COM_ENDPOINT "__AUL_COM_ENDPOINT__"
178 /** AUL internal private key */
179 #define AUL_K_COM_PRIVILEGE "__AUL_COM_PRIVILEGE__"
180 /** AUL internal private key */
181 #define AUL_K_COM_PROPAGATE "__AUL_COM_PROPAGATE__"
182 /** AUL internal private key */
183 #define AUL_K_COM_FILTER "__AUL_COM_FILTER__"
184 /** AUL internal private key */
185 #define AUL_K_COM_RESULT "__AUL_COM_RESULT__"
186 /** AUL internal private key */
187 #define AUL_K_ROOT_PATH "__AUL_ROOT_PATH__"
188 /** AUL internal private key */
189 #define AUL_K_SEQ_NUM "__AUL_SEQ_NUM__"
190 /** AUL internal private key */
191 #define AUL_K_API_VERSION "__AUL_API_VERSION__"
192 /** AUL internal private key */
193 #define AUL_K_ALLOWED_BG "__AUL_ALLOWED_BG__"
194 /** AUL internal private key */
195 #define AUL_K_OWNER_PID "__AUL_OWNER_PID__"
196 /** AUL internal private key */
197 #define AUL_K_CHILD_PID "__AUL_CHILD_PID__"
198 /** AUL internal private key */
199 #define AUL_K_WIDGET_VIEWER "__AUL_WIDGET_VIEWER__"
202 * @brief This is callback function for aul_launch_init
203 * @param[in] type event's type received from system
204 * @param[in] b In case of RESET events, bundle which is received from peer
205 * @param[in] data user-supplied data
207 typedef int (*aul_handler_fn)(aul_type type, bundle *b, void *data);
211 * This API install your AUL handler and setup AUL internal connection.
213 * AUL receive START(RESET), RESUME, TERMINATE events from system.\n
214 * This API use to handle the events. \n
215 * @par Typical use case:
216 * In general, you need not use this API.
217 * If you use AppCore, you should NOT use this API.
218 * AppCore will set default aul_handler.
220 * @param[in] handler aul main callback handler function
221 * @param[in] data user-supplied data for start_handler
222 * @return 0 if success, negative value(<0) if fail\n
223 * @retval AUL_R_OK - success
224 * @retval AUL_R_ECANCELD - aul handler was installed already by others
225 * @retval AUL_R_ECOMM - error to create internal ipc
226 * @retval AUL_R_ERROR - error to attach glib main loop
228 * @warning If you use AppCore, you should NOT use this API.\n
229 * You need glib main loop.\n
231 * you must have aul handler to use this API.
232 * aul_luanch_init register aul handler.
235 * #include <bundle.h>
237 * static int aul_handler(aul_type type, bundle *kb,void *data)
242 * // process RESET event
245 * // process RESUME event
247 * case AUL_TERMINATE:
248 * // preocess TERMINATE event
254 * static GMainLoop *mainloop = NULL;
256 * int main(int argc, char **argv)
258 * aul_launch_init(aul_handler,NULL);
259 * aul_launch_argv_handler(argc, argv);
261 * mainloop = g_main_loop_new(NULL, FALSE);
262 * g_main_loop_run(mainloop);
267 * This API is only available in User Session.
269 int aul_launch_init(aul_handler_fn handler, void *data);
273 * This API create internal RESET events with given argc, argv \n
275 * This API's purpose is to generate reset event.
276 * If you want to generate local RESET events with argument vector format, use this API
277 * @par Typical use case:
278 * In general, you need not use this API.
279 * AppCore use this API to create internal reset event.
281 * @param[in] argc # of args
282 * @param[in] argv list of arg strings
283 * @return 0 if success, negative value(<0) if fail
284 * @retval AUL_R_OK - success
285 * @retval AUL_R_ENOINIT - aul handler was NOT yet installed
286 * @retval AUL_R_ECANCLED - error to create internal bundle with given argc,argv.
287 * @retval AUL_R_ERROR - general error
290 * you must have aul handler to use this API.
291 * aul_luanch_init register aul handler.
296 * #include <bundle.h>
298 * int send_local_reset_event()
302 * argv[0] = "local.app";
303 * argv[1] = "event_type";
304 * argv[2] = "my_reset";
306 * aul_launch_argv_handler(argc,argv);
311 * If you use AppCore, you NEED NOT use this API.
312 * This API is only available in User Session.
314 int aul_launch_argv_handler(int argc, char **argv);
318 * This API creates internal RESET events with given bundle \n
320 * This API's purpose is to generate reset event.
321 * If you want to generate local RESET events with argument vector format, first use
322 * bundle_import_from_argv to create a bundle from the argument vector and then use this API
323 * Eventually, this API will replace aul_launch_argv_handler().
324 * @par Typical use case:
325 * In general, you need not use this API.
326 * AppCore use this API to create internal reset event.
328 * @param[in] b bundle
329 * @return 0 if success, negative value(<0) if fail
330 * @retval AUL_R_OK - success
331 * @retval AUL_R_ENOINIT - aul handler was NOT yet installed
332 * @retval AUL_R_ERROR - general error
335 * you must have aul handler to use this API.
336 * aul_luanch_init register aul handler.
340 * aul_launch_init, bundle_import_from_argv
343 * #include <bundle.h>
345 * int send_local_reset_event()
350 * argv[0] = "local.app";
351 * argv[1] = "event_type";
352 * argv[2] = "my_reset";
355 * b = bundle_import_from_argv(argc,argv);
356 * aul_launch_local(b);
361 * If you use AppCore, you NEED NOT to use this API.
362 * This API is only available in User Session.
364 int aul_launch_local(bundle *b);
368 * This API launches application with the given bundle.
369 * If the application is not running or a multiple-instance one, this API launches with the given bundle.
370 * If the application is running, this API sends a RESET event to the App.
371 * While the application is running, if the application cannot receive the RESET event,
372 * this API returns a general error(AUL_R_ERROR).\n
374 * This API is for caller.
375 * This API's purpose is to launch/reset application with given bundle.
376 * @par Typical use case:
377 * If you know the target application's pkgname and bundle types,
378 * you can use this API to launch/reset the application.
380 * @param[in] pkgname package name to be run as callee
381 * @param[in] kb bundle to be passed to callee
382 * @return callee's pid if success, negative value(<0) if fail
383 * @retval AUL_R_OK - success
384 * @retval AUL_R_EINVAL - invaild package name
385 * @retval AUL_R_ECOM - internal AUL IPC error
386 * @retval AUL_R_ERROR - general error
392 * #include <bundle.h>
394 * int launch_inhouse_contact_app()
397 * b = bundle_create();
398 * bundle_add(b,"type","SIM");
399 * aul_launch_app("org.tizen.contact",b);
404 * This API is only available in User Session.
406 int aul_launch_app(const char *appid, bundle *kb);
410 * This API launches application with the given bundle.
411 * If the application is not running or a multiple-instance one, this API launches with the given bundle.
412 * If the application is running, this API sends a RESET event to the App.
413 * While the application is running, if the application cannot receive the RESET event,
414 * this API returns a general error(AUL_R_ERROR).\n
416 * This API is for caller.
417 * This API's purpose is to launch/reset application with given bundle.
418 * @par Typical use case:
419 * If you know the target application's pkgname and bundle types,
420 * you can use this API to launch/reset the application.
422 * @param[in] pkgname package name to be run as callee
423 * @param[in] kb bundle to be passed to callee
424 * @param[in] uid User ID to launch
425 * @return callee's pid if success, negative value(<0) if fail
426 * @retval AUL_R_OK - success
427 * @retval AUL_R_EINVAL - invaild package name
428 * @retval AUL_R_ECOM - internal AUL IPC error
429 * @retval AUL_R_ERROR - general error
434 * This API is also available in System Session.
436 int aul_launch_app_for_uid(const char *appid, bundle *kb, uid_t uid);
440 * This API launches application, as menu screen launches the app.
441 * Thus, if the applocation is running, this API sends a RESUME event to the app.
442 * If the application is not running, this API launches the app.
443 * While the application is running, if the application cannot receive the RESUME event,
444 * AUL tries to raise the application's default window.
447 * This API is for caller.
448 * This API's purpose is to resume/launch application
449 * @par Typical use case:
450 * If you only want to show application with previous state or default state, Use this API.
452 * @param[in] pkgname package name to be resume as callee
453 * @return callee's pid if success, negative value(<0) if fail
454 * @retval AUL_R_OK - success
455 * @retval AUL_R_EINVAL - invaild package name
456 * @retval AUL_R_ECOM - internal AUL IPC error
457 * @retval AUL_R_ERROR - general error
460 * aul_launch_app, aul_app_is_running, aul_resume_pid
463 * #include <bundle.h>
465 * int open_inhouse_contact_app()
467 * if(aul_app_is_running("org.tizen.contact"))
468 * aul_open_app("org.tizen.contact");
473 * If you don't want to launch the app,
474 * you should check app's running state with aul_app_is_running.
475 * This API will launch the application if the application is not running.
476 * This API is only available in User Session.
478 int aul_open_app(const char *appid);
482 * This API launches application, as menu screen launches the app.
483 * Thus, if the applocation is running, this API sends a RESUME event to the app.
484 * If the application is not running, this API launches the app.
485 * While the application is running, if the application cannot receive the RESUME event,
486 * AUL tries to raise the application's default window.
489 * This API is for caller.
490 * This API's purpose is to resume/launch application
491 * @par Typical use case:
492 * If you only want to show application with previous state or default state, Use this API.
494 * @param[in] pkgname package name to be resume as callee
495 * @param[in] uid User ID
496 * @return callee's pid if success, negative value(<0) if fail
497 * @retval AUL_R_OK - success
498 * @retval AUL_R_EINVAL - invaild package name
499 * @retval AUL_R_ECOM - internal AUL IPC error
500 * @retval AUL_R_ERROR - general error
503 * If you don't want to launch the app,
504 * you should check app's running state with aul_app_is_running.
505 * This API will launch the application if the application is not running.
506 * This API is only available to System user.
508 int aul_open_app_for_uid(const char *appid, uid_t uid);
512 * This API trigger to resume application
513 * If the application is running, this API send a resume event to the App.
514 * If the application is not running, this API returns fail.
515 * Although the application is running, if the application cannot receive resume event,
516 * AUL try to raise the application's default windows.
518 * This API is for caller.
519 * This API's purpose is to send resume event.
520 * @par Typical use case:
521 * If you only want to show application with previous state or default state, Use this API.
523 * @param[in] pkgname package name to be resume as callee
524 * @return callee's pid if success, negative value(<0) if fail
525 * @retval AUL_R_OK - success
526 * @retval AUL_R_EINVAL - invaild package name
527 * @retval AUL_R_ECOM - internal AUL IPC error
528 * @retval AUL_R_ERROR - general error
531 * aul_launch_app, aul_app_is_running, aul_resume_pid
533 * This function will be deprecated. Use aul_open_add() instead.
536 * #include <bundle.h>
538 * int resume_inhouse_contact_app()
540 * if(aul_app_is_running("org.tizen.contact"))
541 * aul_resume_app("org.tizen.contact");
546 * If you don't want to launch the app,
547 * you should check app's running state with aul_app_is_running.
548 * This API will launch the application if the application is not running.
549 * If you want to only resume without launching in multiple instance application model,
550 * you should use aul_resume_pid.
551 * This API is only available in User Session.
553 int aul_resume_app(const char *appid);
557 * This API trigger to resume application
558 * If the application is running, this API send a resume event to the App.
559 * If the application is not running, this API returns fail.
560 * Although the application is running, if the application cannot receive resume event,
561 * AUL try to raise the application's default windows.
563 * This API is for caller.
564 * This API's purpose is to send resume event.
565 * @par Typical use case:
566 * If you only want to show application with previous state or default state, Use this API.
568 * @param[in] pkgname package name to be resume as callee
569 * @param[in] uid User ID
570 * @return callee's pid if success, negative value(<0) if fail
571 * @retval AUL_R_OK - success
572 * @retval AUL_R_EINVAL - invaild package name
573 * @retval AUL_R_ECOM - internal AUL IPC error
574 * @retval AUL_R_ERROR - general error
577 * If you don't want to launch the app,
578 * you should check app's running state with aul_app_is_running.
579 * This API will launch the application if the application is not running.
580 * If you want to only resume without launching in multiple instance application model,
581 * you should use aul_resume_pid.
582 * This API is only available to System user.
584 int aul_resume_app_for_uid(const char *appid, uid_t uid);
588 * This API trigger to resume application
589 * If the application is running, this API send a resume event to the App.
590 * If the application is not running, this API return AUL_R_ERROR.
591 * Although the application is running, if the application cannot receive resume event,
592 * AUL try to raise the application's default windows.
594 * This API is for caller.
595 * This API's purpose is to send resume event.
596 * @par Typical use case:
597 * In multiple application model, If you want to only resume specific application, Use this API
599 * @param[in] pid application's pid to be resumed
600 * @return 0 if success, negative value(<0) if fail
601 * @retval AUL_R_OK - success
602 * @retval AUL_R_EINVAL - invaild pid
603 * @retval AUL_R_ECOM - internal AUL IPC error
604 * @retval AUL_R_ERROR - general error (include application is not running)
605 * @warning This API need to require root or inhouse permisssion \n
606 * If you have not the permission, this API return AUL_R_ERROR. \n
611 * #include <bundle.h>
613 * int iterfunc(const aul_app_info *info, void *data)
615 * if(strcmp(info->pkg_name,"org.tizen.contact")==0)
616 * aul_resume_pid(info->pid);
619 * int iterate_running_apps()
621 * return aul_app_get_running_app_info(iterfunc,NULL);
626 * This API is only available in User Session.
628 int aul_resume_pid(int pid);
632 * This API trigger to resume application
633 * If the application is running, this API send a resume event to the App.
634 * If the application is not running, this API return AUL_R_ERROR.
635 * Although the application is running, if the application cannot receive resume event,
636 * AUL try to raise the application's default windows.
638 * This API is for caller.
639 * This API's purpose is to send resume event.
640 * @par Typical use case:
641 * In multiple application model, If you want to only resume specific application, Use this API
643 * @param[in] pid application's pid to be resumed
644 * @param[in] uid User ID
645 * @return 0 if success, negative value(<0) if fail
646 * @retval AUL_R_OK - success
647 * @retval AUL_R_EINVAL - invaild pid
648 * @retval AUL_R_ECOM - internal AUL IPC error
649 * @retval AUL_R_ERROR - general error (include application is not running)
650 * @warning This API need to require root or inhouse permisssion \n
651 * If you have not the permission, this API return AUL_R_ERROR. \n
653 * This API is only available to System user.
655 int aul_resume_pid_for_uid(int pid, uid_t uid);
659 * This API trigger to terminate application
661 * If the application is running, this API send a terminate event to the App. \n
662 * If the app cannot receive the event, AUL kill forcely the application.\n
664 * This API's purpose is to kill application
665 * @par Typical use case:
666 * In general, Application like Task Manager use this API.
668 * This API need to require root or inhouse permisssion. \n
670 * @param[in] pid application's pid to be terminated
671 * @return 0 if success, negative value(<0) if fail
672 * @retval AUL_R_OK - success
673 * @retval AUL_R_EINVAL - invaild pid
674 * @retval AUL_R_ECOM - internal AUL IPC error
675 * @retval AUL_R_ERROR - general error
676 * @warning This API need to require root or inhouse permisssion. \n
680 * #include <bundle.h>
682 * int iterfunc(const aul_app_info *info, void *data)
684 * if(strcmp(info->pkg_name,"org.tizen.contact")==0)
685 * aul_terminate_pid(info->pid);
688 * int iterate_running_apps()
690 * return aul_app_get_running_app_info(iterfunc,NULL);
695 * If you have not the permission, this API return AUL_R_ERROR. \n
696 * This API is only available in User Session.
698 int aul_terminate_pid(int pid);
702 * This API trigger to terminate application
704 * If the application is running, this API send a terminate event to the App. \n
705 * If the app cannot receive the event, AUL kill forcely the application.\n
707 * This API's purpose is to kill application
708 * @par Typical use case:
709 * In general, Application like Task Manager use this API.
711 * This API need to require root or inhouse permisssion. \n
713 * @param[in] pid application's pid to be terminated
714 * @param[in] uid User ID
715 * @return 0 if success, negative value(<0) if fail
716 * @retval AUL_R_OK - success
717 * @retval AUL_R_EINVAL - invaild pid
718 * @retval AUL_R_ECOM - internal AUL IPC error
719 * @retval AUL_R_ERROR - general error
720 * @warning This API need to require root or inhouse permisssion. \n
723 * If you have not the permission, this API return AUL_R_ERROR. \n
724 * This API is only available to System user.
726 int aul_terminate_pid_for_uid(int pid, uid_t uid);
730 * This API trigger to terminate application asynchronously
732 * If the application is running, this API send a terminate event to the App. \n
733 * If the app cannot receive the event, AUL kill forcely the application.\n
735 * This API's purpose is to kill application
736 * @par Typical use case:
737 * In general, Application like Task Manager use this API.
739 * This API need to require root or inhouse permisssion. \n
741 * @param[in] pid application's pid to be terminated
742 * @return 0 if success, negative value(<0) if fail
743 * @retval AUL_R_OK - success
744 * @retval AUL_R_EINVAL - invaild pid
745 * @retval AUL_R_ECOM - internal AUL IPC error
746 * @retval AUL_R_ERROR - general error
747 * @warning This API need to require root or inhouse permisssion. \n
749 * If you have not the permission, this API return AUL_R_ERROR. \n
750 * This API is only available in User Session.
752 int aul_terminate_pid_async(int pid);
756 * This API trigger to terminate application asynchronously
758 * If the application is running, this API send a terminate event to the App. \n
759 * If the app cannot receive the event, AUL kill forcely the application.\n
761 * This API's purpose is to kill application
762 * @par Typical use case:
763 * In general, Application like Task Manager use this API.
765 * This API need to require root or inhouse permisssion. \n
767 * @param[in] pid application's pid to be terminated
768 * @param[in] uid User ID
769 * @return 0 if success, negative value(<0) if fail
770 * @retval AUL_R_OK - success
771 * @retval AUL_R_EINVAL - invaild pid
772 * @retval AUL_R_ECOM - internal AUL IPC error
773 * @retval AUL_R_ERROR - general error
774 * @warning This API need to require root or inhouse permisssion. \n
776 * If you have not the permission, this API return AUL_R_ERROR. \n
777 * This API is only available to System user.
779 int aul_terminate_pid_async_for_uid(int pid, uid_t uid);
783 * This API trigger to terminate application synchronously
785 * If the application is running, this API sends a terminate event to the application. \n
786 * And then, this API waits until the application is terminated successfully. \n
787 * If the app cannot receive the event, AUL kill forcely the application. \n
789 * This API's purpose is to kill application
790 * @par Typical use case:
791 * In general, Application like Task Manager use this API.
793 * This API need to require root or platform level permisssion. \n
795 * @param[in] pid application's pid to be terminated
796 * @return 0 if success, negative value(<0) if fail
797 * @retval AUL_R_OK - success
798 * @retval AUL_R_EINVAL - invaild pid
799 * @retval AUL_R_ECOM - internal AUL IPC error
800 * @retval AUL_R_ERROR - general error
801 * @warning This API need to require root or platform level permisssion. \n
803 * If you have not the permission, this API return AUL_R_ERROR. \n
804 * This API is only available in User Session.
806 int aul_terminate_pid_sync(int pid);
810 * This API trigger to terminate application synchronously
812 * If the application is running, this API send a terminate event to the application. \n
813 * And then, this API waits until the application is terminated successfully. \n
814 * If the app cannot receive the event, AUL kill forcely the application. \n
816 * This API's purpose is to kill application
817 * @par Typical use case:
818 * In general, Application like Task Manager use this API.
820 * This API need to require root or platform level permisssion. \n
822 * @param[in] pid application's pid to be terminated
823 * @param[in] uid User ID
824 * @return 0 if success, negative value(<0) if fail
825 * @retval AUL_R_OK - success
826 * @retval AUL_R_EINVAL - invaild pid
827 * @retval AUL_R_ECOM - internal AUL IPC error
828 * @retval AUL_R_ERROR - general error
829 * @warning This API need to require root or platform level permisssion. \n
831 * If you have not the permission, this API return AUL_R_ERROR. \n
832 * This API is only available to System user.
834 int aul_terminate_pid_sync_for_uid(int pid, uid_t uid);
837 *@brief Running application's information structure retrieved by AUL
839 typedef struct _aul_app_info {
840 int pid; /**< app's pid if running*/
841 char *pkg_name; /**< application id */
842 char *app_path; /**< application excutable path */
844 char *pkgid; /**< package id */
845 int status; /**< app's status */
846 int is_sub_app; /**< state whether sub app of app group */
850 * @brief iterator function running with aul_app_get_running_app_info
851 * @param[out] ainfo aul_app_info retreived by aul_app_get_running_app_info
852 * @param[out] data user-supplied data
854 typedef int (*aul_app_info_iter_fn)(const aul_app_info *ainfo, void *data);
858 * This API ask a application is running by application package name.
860 * To know whether some application is running or not, use this API
861 * @par Typical use case:
862 * For example, If you want to know browser application running,
863 * you can check it by using this API.
865 * @param[in] pkgname application package name
866 * @return true / false
867 * @retval 1 app_name is running now.
868 * @retval 0 app_name is NOT running now.
873 * int is_running_browser_app()
875 * return aul_app_is_running("org.tizen.browser");
880 * This API is only available in User Session.
883 int aul_app_is_running(const char *appid);
887 * This API ask a application is running by application package name.
889 * To know whether some application is running or not, use this API
890 * @par Typical use case:
891 * For example, If you want to know browser application running,
892 * you can check it by using this API.
894 * @param[in] pkgname application package name
895 * @param[in] uid User ID
896 * @return true / false
897 * @retval 1 app_name is running now.
898 * @retval 0 app_name is NOT running now.
902 * This API is only available to System User.
904 int aul_app_is_running_for_uid(const char *appid, uid_t uid);
908 * This API use to get running application list.
909 * This API call iter_fn with each aul_app_info of running apps when running application is found.
911 * If you want to get running application list, use this API
912 * @par Typical use case:
913 * In general, this API is used by task manager appllication. (running application list viewer)
915 * @param[in] iter_fn iterator function
916 * @param[in] data user-supplied data for iter_fn
917 * @return 0 if success, negative value(<0) if fail
918 * @retval AUL_R_OK - success
919 * @retval AUL_R_ERROR - internal error
924 * int iterfunc(const aul_app_info* info, void* data)
926 * printf("\t==========================\n");
927 * printf("\t pkg_name: %s\n", info->appid);
928 * printf("\t app_path: %s\n", info->app_path);
929 * printf("\t running pid: %d\n", info->pid);
930 * printf("\t==========================\n");
934 * int iterate_running_apps()
936 * return aul_app_get_running_app_info(iterfunc,NULL);
941 * This API should use if you want to know running application which has desktop files.
942 * If you want to get all process list, you must iterate process information by using proc filesystem
943 * Or, If you want to get all window list, you must iterate XWindows by using XWindow APIs
944 * This API is only available in User Session.
946 int aul_app_get_running_app_info(aul_app_info_iter_fn iter_fn, void *data);
950 * This API use to get running application list.
951 * This API call iter_fn with each aul_app_info of running apps when running application is found.
953 * If you want to get running application list, use this API
954 * @par Typical use case:
955 * In general, this API is used by task manager appllication. (running application list viewer)
957 * @param[in] iter_fn iterator function
958 * @param[in] data user-supplied data for iter_fn
959 * @param[in] uid User ID
960 * @return 0 if success, negative value(<0) if fail
961 * @retval AUL_R_OK - success
962 * @retval AUL_R_ERROR - internal error
965 * This API should use if you want to know running application which has desktop files.
966 * If you want to get all process list, you must iterate process information by using proc filesystem
967 * Or, If you want to get all window list, you must iterate XWindows by using XWindow APIs
968 * This API is only available to System user.
970 int aul_app_get_running_app_info_for_uid(aul_app_info_iter_fn iter_fn, void *data, uid_t uid);
974 * This API use to get all running application list, including sub app.
975 * This API call iter_fn with each aul_app_info of running apps when running application is found.
977 * If you want to get all running application list, use this API
978 * @par Typical use case:
979 * In general, this API is used by task manager application. (running application list viewer)
981 * @param[in] iter_fn iterator function
982 * @param[in] data user-supplied data for iter_fn
983 * @return 0 if success, negative value(<0) if fail
984 * @retval AUL_R_OK - success
985 * @retval AUL_R_ERROR - internal error
990 * int iterfunc_status(const aul_app_info *info, void *data)
992 * printf("\t==========================\n");
993 * printf("\t pid: %d\n", info->pid);
994 * printf("\t appid: %s\n", info->appid);
995 * printf("\t app_path: %s\n", info->app_path);
996 * printf("\t pkgid: %s\n", info->pkgid);
997 * printf("\t status: %d\n", info->status);
998 * printf("\t is_sub_app : %d\n", info->is_sub_app);
999 * printf("\t==========================\n");
1003 * int iterate_running_apps()
1005 * return aul_app_get_all_running_app_info(iterfunc_status,NULL);
1010 * This API should use if you want to know running application which has desktop files.
1011 * If you want to get all process list, you must iterate process information by using proc filesystem
1012 * Or, If you want to get all window list, you must iterate XWindows by using XWindow APIs
1013 * This API is only available in User Session.
1015 int aul_app_get_all_running_app_info(aul_app_info_iter_fn iter_fn, void *data);
1019 * This API use to get all running application list, including sub app.
1020 * This API call iter_fn with each aul_app_info of running apps when running application is found.
1022 * If you want to get all running application list, use this API
1023 * @par Typical use case:
1024 * In general, this API is used by task manager application. (running application list viewer)
1026 * @param[in] iter_fn iterator function
1027 * @param[in] data user-supplied data for iter_fn
1028 * @param[in] uid User ID
1029 * @return 0 if success, negative value(<0) if fail
1030 * @retval AUL_R_OK - success
1031 * @retval AUL_R_ERROR - internal error
1034 * This API should use if you want to know running application which has desktop files.
1035 * If you want to get all process list, you must iterate process information by using proc filesystem
1036 * Or, If you want to get all window list, you must iterate XWindows by using XWindow APIs
1037 * This API is only available to System user.
1039 int aul_app_get_all_running_app_info_for_uid(aul_app_info_iter_fn iter_fn, void *data, uid_t uid);
1043 * This API get application package name by pid
1045 * If you want to get package name of running application, use this API
1046 * @par Typical use case:
1047 * In general, You can use this API when you want to know caller's information.
1049 * @param[in] pid given pid
1050 * @param[out] pkgname pkgname to be get
1051 * @param[in] len length of pkgname
1052 * @return 0 if success, negative value(<0) if fail
1053 * @retval AUL_R_OK - success
1054 * @retval AUL_R_ERROR - no such a package name
1057 * #include <bundle.h>
1059 * static int app_reset(bundle *b, void *data)
1062 * char appname[255];
1064 * pid = atoi(bundle_get_val(b,AUL_K_CALLER_PID));
1065 * aul_app_get_pkgname_bypid(pid, appname, sizeof(appname));
1070 * This API is only available in User Session.
1072 int aul_app_get_pkgname_bypid(int pid, char *pkgname, int len);
1076 * This API get application pkgid by pid
1078 * If you want to get pkgid of running application, use this API
1079 * @par Typical use case:
1080 * In general, You can use this API when you want to know caller's information.
1082 * @param[in] pid given pid
1083 * @param[out] pkgid package id
1084 * @param[in] len length of pkgid
1085 * @return 0 if success, negative value(<0) if fail
1086 * @retval AUL_R_OK - success
1087 * @retval AUL_R_ERROR - no such a appid
1091 * #include <bundle.h>
1093 * static int app_reset(bundle *b, void *data)
1098 * pid = atoi(bundle_get_val(b, AUL_K_CALLER_PID));
1099 * aul_app_get_pkgid_bypid(pid, pkgid, sizeof(pkgid));
1104 * This API is only available in User Session.
1106 int aul_app_get_pkgid_bypid(int pid, char *pkgid, int len);
1110 * This API get application pkgid by pid
1112 * If you want to get pkgid of running application, use this API
1113 * @par Typical use case:
1114 * In general, You can use this API when you want to know caller's information.
1116 * @param[in] pid given pid
1117 * @param[out] pkgid package id
1118 * @param[in] len length of pkgid
1119 * @param[in] uid User ID
1120 * @return 0 if success, negative value(<0) if fail
1121 * @retval AUL_R_OK - success
1122 * @retval AUL_R_ERROR - no such a appid
1125 * This API is also available to System user.
1127 int aul_app_get_pkgid_bypid_for_uid(int pid, char *pkgid, int len, uid_t uid);
1131 * This API get application appid by pid
1133 * If you want to get appid of running application, use this API
1134 * @par Typical use case:
1135 * In general, You can use this API when you want to know caller's information.
1137 * @param[in] pid given pid
1138 * @param[out] appid application id
1139 * @param[in] len length of pkgname
1140 * @return 0 if success, negative value(<0) if fail
1141 * @retval AUL_R_OK - success
1142 * @retval AUL_R_ERROR - no such a appid
1145 * #include <bundle.h>
1147 * static int app_reset(bundle *b, void *data)
1152 * pid = atoi(bundle_get_val(b,AUL_K_CALLER_PID));
1153 * aul_app_get_appid_bypid(pid, appid, sizeof(appid));
1158 * This API is only available in User Session.
1160 int aul_app_get_appid_bypid(int pid, char *appid, int len);
1164 * This API get application appid by pid
1166 * If you want to get appid of running application, use this API
1167 * @par Typical use case:
1168 * In general, You can use this API when you want to know caller's information.
1170 * @param[in] pid given pid
1171 * @param[out] appid application id
1172 * @param[in] len length of pkgname
1173 * @param[in] uid User ID
1174 * @return 0 if success, negative value(<0) if fail
1175 * @retval AUL_R_OK - success
1176 * @retval AUL_R_ERROR - no such a appid
1178 * This API is also available to System user.
1180 int aul_app_get_appid_bypid_for_uid(int pid, char *appid, int len, uid_t uid);
1184 * This API launch application associated with given filename
1186 * This API is for caller.
1187 * This API launch application based on mime type.
1188 * This API find mime_type associated with file name,
1189 * and then find default app associated with found mime_type
1190 * and then launch the app with filename argument.
1191 * @par Typical use case:
1192 * You can launch application to process given filename.
1193 * That is, Even if you don't know the specific application's pkgname,
1194 * you can launch the applicaiton processing given filename .
1195 * For example, If you want to process image file, you can simply launch image viewer.
1196 * At that time, you can use this APIs like aul_open_file("myimage.jpg");
1198 * @param[in] filename filename
1199 * @return callee's pid or 0 if success, negative value if fail\n
1200 * (when no found default app, return 0)
1201 * @retval AUL_R_OK - success
1202 * @retval AUL_R_EINVAL - invalid argument(filename)
1203 * @retval AUL_R_ECOM - internal AUL IPC error
1204 * @retval AUL_R_ERROR - general error
1209 * int view_image_file(char *filename)
1211 * aul_open_file(filename);
1216 * This API is only available in User Session.
1219 int aul_open_file(const char* filename);
1223 * This API launch application associated with given specific mimetype
1225 * This API is for caller.
1226 * This API launch application based on mime type like aul_open_file API.
1227 * But, This API don't find mime_type associated with file name.
1228 * This API use mimetype given by user. By using given mimetype, find default application.
1229 * and then launch the app with filename argument.
1230 * @par Typical use case:
1231 * Some files cannot extract exact mimetype automatically.
1232 * For example, To know mime type of files with DRM lock, first we should unlock DRM file.
1233 * In this case, You can use this API.
1234 * First, unlock DRM file, and extract mimetype from unlock file by using aul_get_mime_from_file,
1235 * and then, use this API with DRM file and extracted mime type.
1237 * @param[in] filename filename
1238 * @param[in] mimetype specific mimetype
1239 * @return callee's pid or 0 if success, negative value if fail\n
1240 * (when no found default app, return 0)
1241 * @retval AUL_R_OK - success
1242 * @retval AUL_R_EINVAL - invalid argument(filename,mimetype)
1243 * @retval AUL_R_ECOM - internal AUL IPC error
1244 * @retval AUL_R_ERROR - general error
1247 * aul_open_file, aul_get_mime_from_file
1251 * int view_drm_image_file(char *drm_filename)
1254 * // you must implement this function
1255 * mimetype = get_mimetype_from_drmfile(drm_filename);
1257 * aul_open_file_with_mimetype(drm_filename,mimetype);
1262 * This API is only available in User Session.
1264 int aul_open_file_with_mimetype(const char *filename, const char *mimetype);
1268 * This API launch application associated with content like "http://www.samsung.com"
1270 * This API is for caller.
1271 * This API launch application based on mime type.
1272 * This API find mime_type associated with content,
1273 * and then find default app associated with found mime_type,
1274 * and then launch the app with content argument.
1275 * @par Typical use case:
1276 * You can launch application to process given content.
1277 * That is, Even if you don't know the specific application's pkgname,
1278 * you can launch the applicaiton processing given content.
1279 * For example, If you want to process URL "http://www.samsung.com",
1280 * you can simply launch browser.
1281 * At that time, you can use this APIs like aul_open_content("http://www.samsung.com");
1283 * @param[in] content content
1284 * @return callee's pid or 0 if success, negative value if fail\n
1285 * (when no found default app, return 0)
1286 * @retval AUL_R_OK - success
1287 * @retval AUL_R_EINVAL - invalid argument(content)
1288 * @retval AUL_R_ECOM - internal AUL IPC error
1289 * @retval AUL_R_ERROR - general error or no found mimetype
1294 * int view_url(char *url)
1296 * aul_open_content(url);
1301 * This API is only available in User Session.
1304 int aul_open_content(const char* content);
1308 * This API get the default application(appid) associated with MIME type
1310 * This API use to get default application associteted with mimetype
1311 * In general, Setting Application need this API.
1312 * @par Typical use case:
1313 * Setting Application show mapping of default application / mimetype
1315 * @param[in] mimetype a mime type
1316 * @param[out] defapp a application appid of the app
1317 * @param[in] len length of defapp
1318 * @return 0 if success, negative value if fail
1319 * @retval AUL_R_OK - success
1320 * @retval AUL_R_EINVAL - invalid argument(mimetype)
1321 * @retval AUL_R_ERROR - general error or no found mimetype
1324 * aul_set_defapp_with_mime
1328 * void get_text_html_defapp()
1330 * char appname[255];
1331 * aul_get_defapp_from_mime("text/html",appname,sizeof(appname));
1336 * This API is only available in User Session.
1339 int aul_get_defapp_from_mime(const char *mimetype, char *defapp, int len);
1343 * This API set the default application(appid) associated with MIME type
1345 * This API use to change default application associteted with mimetype
1346 * In general, Setting Application or Installer need this API.
1347 * @par Typical use case:
1348 * Default Application associated with mimetype can be changed by Setting Application or installer
1349 * So, application to process specific mimetype can be substituted.
1351 * @param[in] mimetype a mime type
1352 * @param[in] defapp a application appid of the app to be set
1353 * @return 0 if success, negative value if fail
1354 * @retval AUL_R_OK - success
1355 * @retval AUL_R_EINVAL - invalid argument(mimetype)
1356 * @retval AUL_R_ERROR - general error
1359 * aul_get_defapp_from_mime
1363 * void set_text_html_defapp()
1365 * aul_set_defapp_with_mime("text/html","org.tizen.browser");
1370 * This API is only available in User Session.
1372 int aul_set_defapp_with_mime(const char *mimetype, const char *defapp);
1376 * This API get the mimetype associated with filename
1378 * This API use to get mimetype associteted with given filename
1379 * In general, This API use when you want to know only mimetype given filename.
1380 * @par Typical use case:
1381 * For example, In trasfering data through bluetooth,
1382 * additional information like mimetype should be added.
1383 * In such situation, You can get mimetype by using this API.
1385 * @param[in] filename file name
1386 * @param[out] mimetype a mime type
1387 * @param[in] len length of mimetype
1388 * @return 0 if success, negative value if fail
1389 * @retval AUL_R_OK - success
1390 * @retval AUL_R_EINVAL - invalid argument(filename)
1391 * @retval AUL_R_ERROR - general error
1396 * void get_mimetype()
1398 * char mimetype[255];
1399 * aul_get_mime_from_file("image.jpg",mimetype,sizeof(mimetype));
1404 * This API is only available in User Session.
1406 int aul_get_mime_from_file(const char *filename, char *mimetype, int len);
1410 * This API get the mimetype associated with given content
1412 * This API use to get mimetype associteted with given content
1413 * In general, This API use when you want to know only mimetype given content
1414 * @par Typical use case:
1415 * For example, In trasfering data through bluetooth,
1416 * additional information like mimetype should be added.
1417 * In such situation, You can get mimetype by using this API.
1419 * @param[in] content content string like "011-0000-0000"
1420 * @param[out] mimetype a mime type
1421 * @param[in] len length of mimetype
1422 * @return 0 if success, negative value if fail
1423 * @retval AUL_R_OK - success
1424 * @retval AUL_R_EINVAL - invalid argument(content)
1425 * @retval AUL_R_ERROR - general error
1430 * void get_mimetype()
1432 * char mimetype[255];
1433 * aul_get_mime_from_content("http://www.samsung.com",mimetype,sizeof(mimetype));
1438 * This API is only available in User Session.
1440 int aul_get_mime_from_content(const char *content, char *mimetype, int len);
1444 * This API get the icon's name associated with given mimetype
1446 * This API use to get icon's name associteted with given mimetype
1447 * @par Typical use case:
1448 * If you want to show mimetype's icon, use this API.
1450 * @param[in] mimetype a mime type
1451 * @param[out] iconname icon's name
1452 * @param[in] len length of iconname
1453 * @return 0 if success, negative value if fail
1454 * @retval AUL_R_OK - success
1455 * @retval AUL_R_EINVAL - invalid argument(content)
1456 * @retval AUL_R_ERROR - general error (no such mime type)
1461 * void get_mime_icon()
1464 * aul_get_mime_icon("text/html",icon,sizeof(icon));
1469 * This API is only available in User Session.
1471 int aul_get_mime_icon(const char *mimetype, char *iconname, int len);
1475 * This API get the extensions associated with given mimetype
1477 * This API use to get extensions associteted with given mimetype
1478 * @par Typical use case:
1479 * In general, user is not familiar with mimetype(text/html),
1480 * user is familiar with extenstions(*.html, *.htm)
1481 * So, To show mimetype information to user, use this API
1483 * @param[in] mimetype a mime type
1484 * @param[out] extlist extentions (ex> mpeg,mpg,mpe)
1485 * @param[in] len length of extlist
1486 * @return 0 if success, negative value if fail
1487 * @retval AUL_R_OK - success
1488 * @retval AUL_R_EINVAL - invalid argument(mimetype)
1489 * @retval AUL_R_ERROR - general error (no mimetype or no extenstion)
1492 * aul_get_mime_description
1496 * void get_extension()
1498 * char extlist[255];
1499 * aul_get_mime_extension("text/html",extlist,sizeof(extlist));
1504 * Some mimetype don't have extension.
1505 * In that case, You can use aul_get_mime_description.
1506 * This API is only available in User Session.
1508 int aul_get_mime_extension(const char *mimetype, char *extlist, int len);
1512 * This API get the description associated with given mimetype
1514 * This API use to get description associteted with given mimetype
1515 * @par Typical use case:
1516 * In general, user is not familiar with mimetype(text/html),
1517 * user is familiar with well-knowing information like extenstions(*.html, *.htm)
1518 * But, some mimetype don't have extenstion.
1519 * At that time,to show mimetype information to user, use this API
1521 * @param[in] mimetype a mime type
1522 * @param[out] desc description (ex> Call client)
1523 * @param[in] len length of desc
1524 * @return 0 if success, negative value if fail
1525 * @retval AUL_R_OK - success
1526 * @retval AUL_R_EINVAL - invalid argument(mimetype)
1527 * @retval AUL_R_ERROR - general error (no mimetype or no descrition)
1530 * aul_get_mime_extension
1534 * void get_information_from_mime()
1537 * if(aul_get_mime_extension("text/html",info,sizeof(info))<0){
1538 * aul_get_mime_description("text/html",info,sizeof(info));
1544 * This API is only available in User Session.
1546 int aul_get_mime_description(const char *mimetype, char *desc, int len);
1550 * This API create service result bundle based on bundle received in reset event.
1552 * This API use to create result bundle to send it to caller.
1553 * @par Typical use case:
1554 * This API is for callee which provide application service.\n
1555 * To send result to caller, You must create result bundle. \n
1556 * Callee(application providing the service) can send result by using this API and aul_send_service_result.
1558 * @param[in] inb bundle received in reset event
1559 * @param[out] outb bundle to use for returning result
1560 * @return 0 if success, negative value(<0) if fail
1561 * @retval AUL_R_OK - success
1562 * @retval AUL_R_EINVAL - inb is not bundle created by aul_open_service
1563 * @retval AUL_R_ERROR - general error
1566 * To create result bundle, You need received original bundle.
1567 * The original bundle can get from app_reset handler.
1571 * aul_send_service_result
1574 * #include <bundle.h>
1576 * int app_reset(bundle *b, void *data)
1578 * ad->recved_bundle = bundle_dup(b);
1583 * bundle* res_bundle;
1584 * aul_create_result_bundle(ad->recved_bundle,&res_bundle);
1585 * bundle_add(res_bundle, "result", "1");
1586 * aul_send_service_result(res_bundle);
1590 * This API is only available in User Session.
1593 int aul_create_result_bundle(bundle *inb, bundle **outb);
1597 * This API send service result to caller with bundle
1599 * This API is used to send result bundle to caller.
1600 * @par Typical use case:
1601 * This API is for callee which provide application service.\n
1602 * To send result to caller, You can use this API after creating result bundle. \n
1603 * Callee(application to provide service) can send result by using this API and aul_create_result_bundle.
1605 * @param[in] b Result data in bundle format
1606 * @return 0 if success, negative value(<0) if fail
1607 * @retval AUL_R_OK - success
1608 * @retval AUL_R_EINVAL - invalid result bundle
1609 * @retval AUL_R_ECOMM - internal AUL IPC error
1610 * @retval AUL_R_ERROR - general error
1613 * To send result bundle, You must create result bundle.
1614 * see aul_create_result_bundle
1618 * aul_create_result_bundle
1621 * #include <bundle.h>
1623 * int app_reset(bundle *b, void *data)
1625 * ad->recved_bundle = bundle_dup(b);
1630 * bundle* res_bundle;
1631 * aul_create_result_bundle(ad->recved_bundle,&res_bundle);
1632 * bundle_add(res_bundle, "result", "1");
1633 * aul_send_service_result(res_bundle);
1637 * This API is only available in User Session.
1640 int aul_send_service_result(bundle *b);
1644 * This API sets callback fuction that will be called when applications die.
1646 * This API's purpose is to listen the application dead event.
1647 * In general, task manager Application need this API.
1649 * @param[in] func callback function
1650 * @param[in] data user data
1651 * @return 0 if success, negative value if fail
1652 * @retval AUL_R_OK - success
1653 * @retval AUL_R_ERROR - general error
1656 * aul_listen_app_launch_signal
1660 * int app_dead_handler(int pid, void *data)
1662 * printf("===> %s : %d\n", __FUNCTION__, pid);
1666 * void dead_listen()
1668 * aul_listen_app_dead_signal(app_dead_handler, NULL);
1673 * This API is only available in User Session.
1676 int aul_listen_app_dead_signal(int (*func) (int, void *), void *data);
1680 * This API sets callback fuction that will be called when applications are launched.
1682 * This API's purpose is to listen the application launching event.
1683 * In general, task manager Application need this API.
1685 * @param[in] func callback function
1686 * @param[in] data user data
1687 * @return 0 if success, negative value if fail
1688 * @retval AUL_R_OK - success
1689 * @retval AUL_R_ERROR - general error
1692 * aul_listen_app_dead_signal
1696 * int app_launch_handler(int pid, void *data)
1698 * printf("===> %s : %d\n", __FUNCTION__, pid);
1702 * void dead_listen()
1704 * aul_listen_app_launch_signal(app_launch_handler, NULL);
1709 * This API is only available in User Session.
1712 int aul_listen_app_launch_signal(int (*func) (int, void *), void *data);
1716 * This API sets callback fuction that will be called when applications are launched.
1718 * This API's purpose is to listen the application launching event.
1719 * In general, task manager Application need this API.
1721 * @param[in] func callback function
1722 * @param[in] data user data
1723 * @return 0 if success, negative value if fail
1724 * @retval AUL_R_OK - success
1725 * @retval AUL_R_ERROR - general error
1728 * aul_listen_app_dead_signal
1732 * int app_launch_handler(int pid, const char *app_id, void *data)
1734 * printf("===> %s : %d, %s\n", __FUNCTION__, pid, app_id);
1738 * void dead_listen()
1740 * aul_listen_app_launch_signal(app_launch_handler, NULL);
1745 * This API is only available in User Session.
1748 int aul_listen_app_launch_signal_v2(int (*func) (int, const char *, void *), void *data);
1752 * This API gets status of specified application process id.
1754 * This API's purpose is to get the application's status.
1756 * @param[in] pid pid of application
1757 * @return 0 or greater if success, nagative value if fail
1758 * @retval STATUS_LAUNCHING
1759 * @retval STATUS_CREATED
1760 * @retval STATUS_FOCUS
1761 * @retval STATUS_VISIBLE
1763 * @retval STATUS_DYING
1764 * @retval STATUS_HOME
1765 * @retval STATUS_NORESTART
1771 * int iterfunc(const aul_app_info *info, void *data)
1774 * status = aul_app_get_status_bypid(info->pid);
1775 * if (status == STATUS_FOCUS) {
1776 * printf("%s has focus", info->app_id);
1777 * (int *)data = info->pid;
1783 * int find_focus_app_pid()
1786 * aul_app_get_running_app_info(iterfunc, &pid);
1791 * This API is only available in User Session.
1793 int aul_app_get_status_bypid(int pid);
1797 * This API gets status of specified application process id.
1799 * This API's purpose is to get the application's status.
1801 * @param[in] pid pid of application
1802 * @param[in] uid User ID
1803 * @return 0 or greater if success, nagative value if fail
1804 * @retval STATUS_LAUNCHING
1805 * @retval STATUS_CREATED
1806 * @retval STATUS_FOCUS
1807 * @retval STATUS_VISIBLE
1809 * @retval STATUS_DYING
1810 * @retval STATUS_HOME
1811 * @retval STATUS_NORESTART
1814 * This API is only available to System user.
1816 int aul_app_get_status_bypid_for_uid(int pid, uid_t uid);
1820 * This API gets the status of specified application id.
1822 * This API's purpose is to get the status of the application.
1824 * @param[in] appid application ID
1825 * @return 0 or greater if success, nagative value if fail
1826 * @retval STATUS_LAUNCHING
1827 * @retval STATUS_FOCUS
1828 * @retval STATUS_VISIBLE
1830 * @retval STATUS_DYING
1831 * @retval STATUS_NORESTART
1841 * status = aul_app_get_status("org.tizen.helloworld");
1842 * if (status == STATUS_FOCUS)
1843 * printf("org.tizen.helloworld has focus");
1850 * This API is only available in User Session.
1852 int aul_app_get_status(const char *appid);
1856 * This API gets the status of specified application id.
1858 * This API's purpose is to get the status of the application
1860 * @param[in] appid application ID
1861 * @param[in] uid User ID
1862 * @return 0 or greater if success, nagative value if fail
1863 * @retval STATUS_LAUNCHING
1864 * @retval STATUS_FOCUS
1865 * @retval STATUS_VISIBLE
1867 * @retval STATUS_DYING
1868 * @retval STATUS_NORESTART
1871 * This API is only available to System user.
1873 int aul_app_get_status_for_uid(const char *appid, uid_t uid);
1877 * This API sets callback function that on application status changed.
1879 * This API's purpose is to listen the application's status changed within
1880 * the caller process. In general, a library that required to release resource on
1881 * application's status may use this API.
1883 * @param[in] func callback function
1884 * @param[in] data user data
1885 * @return 0 if success, negative value if fail
1886 * @retval AUL_R_OK - success
1887 * @retval AUL_R_ERROR - general error
1889 * aul_remove_status_local_cb
1893 * int status_changed(int status, void *data)
1895 * if (status == STATUS_FOCUS)
1896 * printf("%d has focus\n", getpid());
1898 * if (status == STATUS_VISIBLE)
1899 * printf("%d resume\n", getpid());
1901 * if (status == STATUS_BG0
1902 * printf("%d pause\n", getpid());
1905 * void listen_app_status()
1907 * aul_add_status_local_cb(status_changed, NULL);
1911 * This API is only available in User Session.
1914 int aul_add_status_local_cb(int (*func) (int, void *), void *data);
1918 * This API unsets callback function that on application status changed.
1920 * This API's purpose is to remove callback that added by
1921 * aul_add_status_local_cb.
1923 * @param[in] func callback function
1924 * @param[in] data user data
1925 * @return 0 if success, negative value if fail
1926 * @retval AUL_R_OK - success
1927 * @retval AUL_R_ERROR - general error
1930 * aul_add_status_local_cb
1934 * int status_changed(int status, void *data)
1936 * if (status == STATUS_FOCUS)
1937 * printf("%d has focus\n", getpid());
1939 * if (status == STATUS_VISIBLE)
1940 * printf("%d resume\n", getpid());
1942 * if (status == STATUS_BG0
1943 * printf("%d pause\n", getpid());
1946 * void listen_app_status()
1948 * aul_add_status_local_cb(status_changed, NULL);
1951 * void ignore_app_status()
1953 * aul_remove_status_local_cb(status_changed, NULL);
1958 * This API is only available in User Session.
1961 int aul_remove_status_local_cb(int (*func) (int, void *), void *data);
1964 * This API is only for appfw internally.
1966 int aul_set_process_group(int parent_pid, int child_pid);
1969 * This API is only for Appfw internally.
1971 int aul_terminate_bgapp_pid(int pid);
1974 * This API is only for Appfw internally.
1976 int aul_terminate_pid_without_restart(int pid);
1979 * This API is only for Appfw internally.
1981 const char *aul_get_app_external_root_path(void);
1984 * This API is only for Appfw internally.
1986 const char *aul_get_app_root_path(void);
1989 * This API is only for Appfw internally.
1991 const char *aul_get_app_data_path(void);
1994 * This API is only for Appfw internally.
1996 const char *aul_get_app_cache_path(void);
1999 * This API is only for Appfw internally.
2001 const char *aul_get_app_resource_path(void);
2004 * This API is only for Appfw internally.
2006 const char *aul_get_app_tep_resource_path(void);
2009 * This API is only for Appfw internally.
2011 int aul_get_app_shared_data_path(char **path);
2014 * This API is only for Appfw internally.
2016 const char *aul_get_app_shared_resource_path(void);
2019 * This API is only for Appfw internally.
2021 const char *aul_get_app_shared_trusted_path(void);
2024 * This API is only for Appfw internally.
2026 const char *aul_get_app_external_data_path(void);
2029 * This API is only for Appfw internally.
2031 const char *aul_get_app_external_cache_path(void);
2034 * This API is only for Appfw internally.
2036 const char *aul_get_app_external_shared_data_path(void);
2039 * This API is only for Appfw internally.
2041 const char *aul_get_app_specific_path(void);
2044 * This API is only for Appfw internally.
2046 const char *aul_get_app_external_specific_path(void);
2049 * This API is only for Appfw internally.
2051 int aul_get_app_shared_data_path_by_appid(const char *app_id, char **path);
2054 * This API is only for Appfw internally.
2056 int aul_get_app_shared_resource_path_by_appid(const char *app_id, char **path);
2059 * This API is only for Appfw internally.
2061 int aul_get_app_shared_trusted_path_by_appid(const char *app_id, char **path);
2064 * This API is only for Appfw internally.
2066 int aul_get_app_external_shared_data_path_by_appid(const char *app_id, char **path);
2069 * This API is only for Appfw internally.
2071 int aul_get_usr_app_shared_data_path_by_appid(const char *app_id, char **path, uid_t uid);
2074 * This API is only for Appfw internally.
2076 int aul_get_usr_app_shared_resource_path_by_appid(const char *app_id, char **path, uid_t uid);
2079 * This API is only for Appfw internally.
2081 int aul_get_usr_app_shared_trusted_path_by_appid(const char *app_id, char **path, uid_t uid);
2084 * This API is only for Appfw internally.
2086 int aul_get_usr_app_external_shared_data_path_by_appid(const char *app_id, char **path, uid_t uid);
2089 * This type is only for Appfw internally.
2091 typedef int (*subapp_fn)(void *data);
2094 * This API is only for Appfw internally.
2096 int aul_set_subapp(subapp_fn cb, void *data);
2099 * This API is only for Appfw internally.
2101 int aul_subapp_terminate_request_pid(int pid);
2104 * This API is only for Appfw internally.
2106 int aul_is_subapp(void);
2109 * This API is only for Appfw internally.
2111 int aul_kill_pid(int pid);
2114 * This API is only for Appfw internally.
2116 int aul_add_caller_cb(int pid, void (*caller_cb) (int, void *), void *data);
2119 * This API is only for Appfw internally.
2121 int aul_remove_caller_cb(int pid, void *data);
2124 * This API is only for Appfw internally.
2126 int aul_invoke_caller_cb(void *data);
2129 * This API is only for Appfw internally.
2131 void aul_set_preinit_window(void *evas_object);
2134 * This API is only for Appfw internally.
2136 void* aul_get_preinit_window(const char *win_name);
2139 * This API is only for Appfw internally.
2141 void aul_set_preinit_background(void *evas_object);
2144 * This API is only for Appfw internally.
2146 void* aul_get_preinit_background(void);
2149 * This API is only for Appfw internally.
2151 void aul_set_preinit_conformant(void *evas_object);
2154 * This API is only for Appfw internally.
2156 void* aul_get_preinit_conformant(void);
2159 * This API is only for Appfw internally.
2161 void aul_set_preinit_appid(const char *appid);
2164 * This API is only for Appfw internally.
2166 void aul_set_preinit_pkgid(const char *pkgid);
2169 * This API is only for Appfw internally.
2171 void aul_set_preinit_root_path(const char *root_path);
2174 * This API is only for Appfw internally.
2176 const char *aul_get_preinit_root_path(void);
2179 * This API is only for Appfw internally.
2181 int aul_update_freezer_status(int pid, const char* type);
2184 * This API is only for Appfw internally.
2186 int aul_send_app_launch_request_signal(int pid, const char* appid, const char* pkgid, const char* type);
2189 * This API is only for Appfw internally.
2191 int aul_send_app_resume_request_signal(int pid, const char* appid, const char* pkgid, const char *type);
2194 * This API is only for Appfw internally.
2196 int aul_send_app_terminate_request_signal(int pid, const char* appid, const char* pkgid, const char *type);
2199 * This API is only for Appfw internally.
2201 int aul_send_app_status_change_signal(int pid, const char* appid, const char* pkgid, const char* status, const char *type);
2204 * This API is only for Appfw internally.
2206 int aul_send_app_terminated_signal(int pid);
2209 * This API is only for Appfw internally.
2211 int aul_send_app_group_signal(int owner_pid, int child_pid, const char *child_pkgid);
2214 * This API is only for Appfw internally.
2216 int aul_invoke_status_local_cb(int status);
2219 * This type is only for Appfw internally.
2221 typedef int (*data_control_provider_handler_fn) (bundle *b, int request_id, void *data);
2224 * This API is only for Appfw internally.
2226 int aul_set_data_control_provider_cb(data_control_provider_handler_fn handler);
2229 * This API is only for Appfw internally.
2231 int aul_unset_data_control_provider_cb(void);
2234 * This API is only for Appfw internally.
2236 int aul_pause_app(const char *appid);
2239 * This API is only for Appfw internally.
2241 int aul_pause_app_for_uid(const char *appid, uid_t uid);
2244 * This API is only for Appfw internally.
2246 int aul_pause_pid(int pid);
2249 * This API is only for Appfw internally.
2251 int aul_pause_pid_for_uid(int pid, uid_t uid);
2254 * This API is only for Appfw internally.
2256 int aul_reload_appinfo(void);
2259 * This API is only for Appfw internally.
2261 int aul_status_update(int status);
2264 * This API is only for Appfw internally.
2266 int aul_running_list_update(char *appid, char *app_path, char *pid);
2269 * This API is only for Appfw internally.
2271 int aul_app_group_get_window(int pid);
2274 * This API is only for Appfw internally.
2276 int aul_app_group_set_window(int wid);
2279 * This API is only for Appfw internally.
2281 void aul_app_group_get_leader_pids(int *cnt, int **pids);
2284 * This API is only for Appfw internally.
2286 void aul_app_group_get_group_pids(int leader_pid, int *cnt, int **pids);
2289 * This API is only for Appfw internally.
2291 int aul_app_group_get_leader_pid(int pid);
2294 * This API is only for Appfw internally.
2296 int aul_app_group_clear_top(void);
2299 * This API is only for Appfw internally.
2301 int aul_app_group_is_top(void);
2304 * This API is only for Appfw internally.
2306 int aul_app_group_get_fg_flag(int pid);
2309 * This API is only for Appfw internally.
2311 void aul_app_group_lower(int *exit);
2314 * This API is only for Appfw internally.
2316 void aul_app_group_get_idle_pids(int *cnt, int **pids);
2320 * This API puts some app below the caller app
2322 * This API's purpose is to reorder window stack limitedly.
2324 * @param[in] below_appid The appid to be reordered below the caller app
2325 * @return Loader ID if success, negative value(<0) if fail
2328 * The caller app should be resumed before calling this API.
2329 * below_appid should be main app which have been launched before.
2330 * This API is only available in User Session.
2332 int aul_app_group_activate_below(const char *below_appid);
2335 * This API is only for Appfw internally.
2337 int aul_request_data_control_socket_pair(bundle *b, int *fd);
2339 * This API is only for Appfw internally.
2341 int aul_request_message_port_socket_pair(int *fd);
2343 * This API is only for Appfw internally.
2345 int aul_listen_booting_done_signal(int (*func) (int, void *), void *data);
2348 * This API is only for Appfw internally.
2350 int aul_listen_cooldown_signal(int (*func) (const char *, void *), void *data);
2354 * This API registers a callback function that will be called when the
2355 * status of the application is changed.
2357 * This API is for monitoring the status of all applications.
2359 * @param[in] func callback function
2360 * @param[in] data user data
2361 * @return 0 if success, negative value if fail
2362 * @retval AUL_R_OK - success
2363 * @retval AUL_R_ERROR - general error
2368 * int app_status_handler(int pid, int status, void *data)
2370 * const char *app_status;
2374 * app_status = "STATUS_LAUNCHING";
2377 * app_status = "STATUS_VISIBLE";
2380 * app_status = "STATUS_BACKGROUND";
2383 * app_status = "STATUS_FOCUS";
2386 * app_status = "STATUS_UNKNOWN";
2389 * printf("pid: %d, status: %s", pid, status);
2393 * int main(int argc, char **argv)
2397 * ret = aul_listen_app_status_signal(app_status_handler, NULL);
2398 * if (ret != AUL_R_OK) {
2399 * printf("Failed to add status handler");
2409 int aul_listen_app_status_signal(int (*func)(int, int, void *), void *data);
2412 * This API is only for Appfw internally.
2414 int aul_check_tep_mount(const char *tep_path);
2417 * This API is only for Appfw internally.
2419 int aul_is_tep_mount_dbus_done(const char *tep_string);
2422 * This API is only for Appfw internally.
2424 int aul_forward_app(const char *appid, bundle *kb);
2428 * This API create custom launchpad-loader
2430 * This API's purpose is to make a slot for custom loader.
2431 * Once it is made, added loader will make a candidate process to use.
2433 * @param[in] loader_path The file name of the custom loader binary including full path
2434 * @param[in] extra A bundle to be passed to the custom loader
2435 * @return Loader ID if success, negative value(<0) if fail
2438 * This API is only for Appfw internally.
2439 * This API is only available in User Session.
2441 int aul_add_loader(const char *loader_path, bundle *extra);
2445 * This API create custom launchpad-loader
2447 * This API's purpose is to make a slot for custom loader.
2448 * Once it is made, added loader will make a candidate process to use.
2450 * @param[in] loader_path The file name of the custom loader binary including full path
2451 * @param[in] extra A bundle to be passed to the custom loader
2452 * @param[in] uid User ID
2453 * @return Loader ID if success, negative value(<0) if fail
2456 * This API is only for Appfw internally.
2457 * This API is only available to System user.
2459 int aul_add_loader_for_uid(const char *loader_path, bundle *extra, uid_t uid);
2464 * This API destroy custom launchpad-loader
2466 * This API's purpose is to remove a slot for custom loader.
2467 * Once it is removed, the prepared process will be removed as well.
2469 * @param[in] loader_id Loader ID
2470 * @return 0 if success, negative value(<0) if fail
2473 * This API is only for Appfw internally.
2474 * This API is only available in User Session.
2476 int aul_remove_loader(int loader_id);
2480 * This API destroy custom launchpad-loader
2482 * This API's purpose is to remove a slot for custom loader.
2483 * Once it is removed, the prepared process will be removed as well.
2485 * @param[in] loader_id Loader ID
2486 * @param[in] uid User ID
2487 * @return 0 if success, negative value(<0) if fail
2490 * This API is only for Appfw internally.
2491 * This API is only available to System user.
2493 int aul_remove_loader_for_uid(int loader_id, uid_t uid);
2497 * This API gets specified application process id.
2499 * The purpose of this API is to get the pid of specified application.
2501 * @param[in] appid application name
2502 * @return callee's pid if success, negative value(<0) if fail
2505 * This API is only available in User Session.
2507 int aul_app_get_pid(const char *appid);
2511 * This API gets specified application process id.
2513 * The purpose of this API is to get the pid of specified application.
2515 * @param[in] appid application name
2516 * @param[in] uid User ID
2517 * @return callee's pid if success, negative value(<0) if fail
2520 * This API is only available to System user.
2522 int aul_app_get_pid_for_uid(const char *appid, uid_t uid);
2526 * This function delete rua history.
2528 * @param[in] b Bundle object Target Package name or app path. If NULL or has no value, delete all rua history.
2530 * @return 0 if success, negative value(<0) if fail
2532 * @remarks This API is only for Appfw internally.
2541 bundle *b = bundle_create();
2543 bundle_add_str(b, AUL_K_RUA_PKGNAME, pkg_name);
2545 bundle_add_str(b, AUL_K_RUA_APPPATH, app_path);
2547 r = aul_delete_rua_history(b);
2552 int aul_delete_rua_history(bundle *b);
2557 * This function sets the default application(application id) associated with operatioin, uri and mime-type.
2559 * @param[in] b Bundle object Target application id and operation, uri and mime-type.
2561 * @return 0 if success, negative value(<0) if fail
2563 * @remarks This API is only for Appfw internally.
2568 #include <aul_svc.h>
2573 bundle *b = bundle_create();
2575 const char *appid = "org.tizen.test";
2576 const char *operation = "test_operation";
2577 const char *mime_type = "test_mime";
2578 const char *uri = "test_uri";
2580 aul_svc_set_operation(b, operation);
2581 aul_svc_set_mime(b, mime_type);
2582 aul_svc_set_uri(b, uri);
2584 aul_svc_set_appid(b, appid)
2586 r = aul_set_default_app_by_operation(b);
2591 int aul_set_default_app_by_operation(bundle *b);
2595 * This API unset the default application(application id) associated with operation, uri and mime-type.
2597 * @param[in] app_id The ID of the application
2599 * @return 0 if success, negative value(<0) if fail
2612 aul_unset_default_app_by_operation("org.tizen.test");
2617 int aul_unset_default_app_by_operation(const char *app_id);
2621 * This API launches application with the given bundle asynchronously.
2622 * If the application is not running or a multiple-instance one, this API launches with the given bundle.
2623 * If the application is running, this API sends a RESET event to the App.
2624 * While the application is running, if the application cannot receive the RESET event,
2625 * this API returns a general error(AUL_R_ERROR).\n
2627 * This API is for caller.
2628 * This API's purpose is to launch/reset application with given bundle.
2629 * @par Typical use case:
2630 * If you know the target application's pkgname and bundle types,
2631 * you can use this API to launch/reset the application.
2633 * @param[in] pkgname package name to be run as callee
2634 * @param[in] kb bundle to be passed to callee
2635 * @return 0 if success, negative value(<0) if fail
2636 * @retval AUL_R_OK - success
2637 * @retval AUL_R_EINVAL - invaild package name
2638 * @retval AUL_R_ECOM - internal AUL IPC error
2639 * @retval AUL_R_ERROR - general error
2642 * This API is only available in User Session.
2643 * This API doesn't check whether the callee application is executed successfully.
2645 int aul_launch_app_async(const char *appid, bundle *kb);
2649 * This API launches application with the given bundle asynchronously.
2650 * If the application is not running or a multiple-instance one, this API launches with the given bundle.
2651 * If the application is running, this API sends a RESET event to the App.
2652 * While the application is running, if the application cannot receive the RESET event,
2653 * this API returns a general error(AUL_R_ERROR).\n
2655 * This API is for caller.
2656 * This API's purpose is to launch/reset application with given bundle.
2657 * @par Typical use case:
2658 * If you know the target application's pkgname and bundle types,
2659 * you can use this API to launch/reset the application.
2661 * @param[in] pkgname package name to be run as callee
2662 * @param[in] kb bundle to be passed to callee
2663 * @param[in] uid User ID
2664 * @return 0 if success, negative value(<0) if fail
2665 * @retval AUL_R_OK - success
2666 * @retval AUL_R_EINVAL - invaild package name
2667 * @retval AUL_R_ECOM - internal AUL IPC error
2668 * @retval AUL_R_ERROR - general error
2671 * This API is only available to System user.
2672 * This API doesn't check whether the callee application is executed successfully.
2674 int aul_launch_app_async_for_uid(const char *appid, bundle *kb, uid_t uid);
2678 * This API request launchpad to make candidate processes.
2680 * @return 0 if success, negative value(<0) if fail
2683 * This API is only available in User Session.
2685 int aul_prepare_candidate_process(void);