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>
34 * @brief Return values in AUL.
36 typedef enum _aul_return_val {
37 AUL_R_ENOMEM = -16, /**< Out of memory (Since 5.5) */
38 AUL_R_ENOENT = -15, /**< App directory entry error */
39 AUL_R_EREJECTED = -14, /**< App disable for mode */
40 AUL_R_ENOAPP = -13, /**< Failed to find app ID or pkg ID */
41 AUL_R_EHIDDENFORGUEST = -11, /**< App hidden for guest mode */
42 AUL_R_ENOLAUNCHPAD = -10, /**< no launchpad */
43 AUL_R_ETERMINATING = -9, /**< application terminating */
44 AUL_R_EILLACC = -8, /**< Illegal Access */
45 AUL_R_LOCAL = -7, /**< Launch by himself */
46 AUL_R_ETIMEOUT = -6, /**< Timeout */
47 AUL_R_ECANCELED = -5, /**< Operation canceled */
48 AUL_R_EINVAL = -4, /**< Invalid argument */
49 AUL_R_ECOMM = -3, /**< Comunication Error */
50 AUL_R_ENOINIT = -2, /**< AUL handler NOT initialized */
51 AUL_R_ERROR = -1, /**< General error */
52 AUL_R_OK = 0 /**< General success */
68 typedef enum _aul_type {
79 AUL_TERMINATE_BG_INST,
82 typedef enum aul_widget_lifecycle_event {
83 AUL_WIDGET_LIFE_CYCLE_EVENT_APP_DEAD = 0,
84 AUL_WIDGET_LIFE_CYCLE_EVENT_CREATE = 1, /**< The widget is created */
85 AUL_WIDGET_LIFE_CYCLE_EVENT_DESTROY = 2, /**< The widget is destroyed */
86 AUL_WIDGET_LIFE_CYCLE_EVENT_PAUSE = 3, /**< The widget is paused */
87 AUL_WIDGET_LIFE_CYCLE_EVENT_RESUME = 4 /**< The widget is resumed */
88 } aul_widget_lifecycle_event_e;
90 typedef enum aul_widget_instance_event {
91 AUL_WIDGET_INSTANCE_EVENT_CREATE = 0,
92 AUL_WIDGET_INSTANCE_EVENT_DESTROY = 1,
93 AUL_WIDGET_INSTANCE_EVENT_TERMINATE = 2,
94 AUL_WIDGET_INSTANCE_EVENT_PAUSE = 3,
95 AUL_WIDGET_INSTANCE_EVENT_RESUME = 4,
96 AUL_WIDGET_INSTANCE_EVENT_UPDATE = 5,
97 AUL_WIDGET_INSTANCE_EVENT_PERIOD_CHANGED = 6,
98 AUL_WIDGET_INSTANCE_EVENT_SIZE_CHANGED = 7,
99 AUL_WIDGET_INSTANCE_EVENT_EXTRA_UPDATED = 8,
100 AUL_WIDGET_INSTANCE_EVENT_FAULT = 9,
101 AUL_WIDGET_INSTANCE_EVENT_APP_RESTART_REQUEST = 10,
102 AUL_WIDGET_INSTANCE_EVENT_CREATE_ABORTED = 11
103 } aul_widget_instance_event_e;
105 typedef enum _aul_process_status {
106 AUL_PROC_STATUS_LAUNCH = 0,
107 AUL_PROC_STATUS_FG = 3,
108 AUL_PROC_STATUS_BG = 4,
109 AUL_PROC_STATUS_FOCUS = 5,
110 AUL_PROC_STATUS_HIDE = 7
111 } aul_process_status_e;
114 * @brief This is callback function for aul_launch_init
115 * @param[in] type event's type received from system
116 * @param[in] b In case of RESET events, bundle which is received from peer
117 * @param[in] data user-supplied data
119 typedef int (*aul_handler_fn)(aul_type type, bundle *b, void *data);
123 * This API install your AUL handler and setup AUL internal connection.
125 * AUL receive START(RESET), RESUME, TERMINATE events from system.\n
126 * This API use to handle the events. \n
127 * @par Typical use case:
128 * In general, you need not use this API.
129 * If you use AppCore, you should NOT use this API.
130 * AppCore will set default aul_handler.
132 * @param[in] handler aul main callback handler function
133 * @param[in] data user-supplied data for start_handler
134 * @return 0 if success, negative value(<0) if fail\n
135 * @retval AUL_R_OK - success
136 * @retval AUL_R_ECANCELD - aul handler was installed already by others
137 * @retval AUL_R_ECOMM - error to create internal ipc
138 * @retval AUL_R_ERROR - error to attach glib main loop
140 * @warning If you use AppCore, you should NOT use this API.\n
141 * You need glib main loop.\n
143 * you must have aul handler to use this API.
144 * aul_luanch_init register aul handler.
147 * #include <bundle.h>
149 * static int aul_handler(aul_type type, bundle *kb,void *data)
154 * // process RESET event
157 * // process RESUME event
159 * case AUL_TERMINATE:
160 * // preocess TERMINATE event
166 * static GMainLoop *mainloop = NULL;
168 * int main(int argc, char **argv)
170 * aul_launch_init(aul_handler,NULL);
171 * aul_launch_argv_handler(argc, argv);
173 * mainloop = g_main_loop_new(NULL, FALSE);
174 * g_main_loop_run(mainloop);
179 * This API is only available in User Session.
181 int aul_launch_init(aul_handler_fn handler, void *data);
185 * This API create internal RESET events with given argc, argv \n
187 * This API's purpose is to generate reset event.
188 * If you want to generate local RESET events with argument vector format, use this API
189 * @par Typical use case:
190 * In general, you need not use this API.
191 * AppCore use this API to create internal reset event.
193 * @param[in] argc # of args
194 * @param[in] argv list of arg strings
195 * @return 0 if success, negative value(<0) if fail
196 * @retval AUL_R_OK - success
197 * @retval AUL_R_ENOINIT - aul handler was NOT yet installed
198 * @retval AUL_R_ECANCLED - error to create internal bundle with given argc,argv.
199 * @retval AUL_R_ERROR - general error
202 * you must have aul handler to use this API.
203 * aul_luanch_init register aul handler.
208 * #include <bundle.h>
210 * int send_local_reset_event()
214 * argv[0] = "local.app";
215 * argv[1] = "event_type";
216 * argv[2] = "my_reset";
218 * aul_launch_argv_handler(argc,argv);
223 * If you use AppCore, you NEED NOT use this API.
224 * This API is only available in User Session.
226 int aul_launch_argv_handler(int argc, char **argv);
230 * This API creates internal RESET events with given bundle \n
232 * This API's purpose is to generate reset event.
233 * If you want to generate local RESET events with argument vector format, first use
234 * bundle_import_from_argv to create a bundle from the argument vector and then use this API
235 * Eventually, this API will replace aul_launch_argv_handler().
236 * @par Typical use case:
237 * In general, you need not use this API.
238 * AppCore use this API to create internal reset event.
240 * @param[in] b bundle
241 * @return 0 if success, negative value(<0) if fail
242 * @retval AUL_R_OK - success
243 * @retval AUL_R_ENOINIT - aul handler was NOT yet installed
244 * @retval AUL_R_ERROR - general error
247 * you must have aul handler to use this API.
248 * aul_luanch_init register aul handler.
252 * aul_launch_init, bundle_import_from_argv
255 * #include <bundle.h>
257 * int send_local_reset_event()
262 * argv[0] = "local.app";
263 * argv[1] = "event_type";
264 * argv[2] = "my_reset";
267 * b = bundle_import_from_argv(argc,argv);
268 * aul_launch_local(b);
273 * If you use AppCore, you NEED NOT to use this API.
274 * This API is only available in User Session.
276 int aul_launch_local(bundle *b);
280 * This API launches application with the given bundle.
281 * If the application is not running or a multiple-instance one, this API launches with the given bundle.
282 * If the application is running, this API sends a RESET event to the App.
283 * While the application is running, if the application cannot receive the RESET event,
284 * this API returns a general error(AUL_R_ERROR).\n
286 * This API is for caller.
287 * This API's purpose is to launch/reset application with given bundle.
288 * @par Typical use case:
289 * If you know the target application's pkgname and bundle types,
290 * you can use this API to launch/reset the application.
292 * @param[in] pkgname package name to be run as callee
293 * @param[in] kb bundle to be passed to callee
294 * @return callee's pid if success, negative value(<0) if fail
295 * @retval AUL_R_OK - success
296 * @retval AUL_R_EINVAL - invaild package name
297 * @retval AUL_R_ECOM - internal AUL IPC error
298 * @retval AUL_R_ERROR - general error
304 * #include <bundle.h>
306 * int launch_inhouse_contact_app()
309 * b = bundle_create();
310 * bundle_add(b,"type","SIM");
311 * aul_launch_app("org.tizen.contact",b);
316 * This API is only available in User Session.
318 int aul_launch_app(const char *appid, bundle *kb);
322 * This API launches application with the given bundle.
323 * If the application is not running or a multiple-instance one, this API launches with the given bundle.
324 * If the application is running, this API sends a RESET event to the App.
325 * While the application is running, if the application cannot receive the RESET event,
326 * this API returns a general error(AUL_R_ERROR).\n
328 * This API is for caller.
329 * This API's purpose is to launch/reset application with given bundle.
330 * @par Typical use case:
331 * If you know the target application's pkgname and bundle types,
332 * you can use this API to launch/reset the application.
334 * @param[in] pkgname package name to be run as callee
335 * @param[in] kb bundle to be passed to callee
336 * @param[in] uid User ID to launch
337 * @return callee's pid if success, negative value(<0) if fail
338 * @retval AUL_R_OK - success
339 * @retval AUL_R_EINVAL - invaild package name
340 * @retval AUL_R_ECOM - internal AUL IPC error
341 * @retval AUL_R_ERROR - general error
346 * This API is also available in System Session.
348 int aul_launch_app_for_uid(const char *appid, bundle *kb, uid_t uid);
352 * This API launches application, as menu screen launches the app.
353 * Thus, if the application is running, this API sends a RESUME event to the app.
354 * If the application is not running, this API launches the app.
355 * While the application is running, if the application cannot receive the RESUME event,
356 * AUL tries to raise the application's default window.
359 * This API is for caller.
360 * This API's purpose is to resume/launch application
361 * @par Typical use case:
362 * If you only want to show application with previous state or default state, Use this API.
364 * @param[in] pkgname package name to be resume as callee
365 * @return callee's pid if success, negative value(<0) if fail
366 * @retval AUL_R_OK - success
367 * @retval AUL_R_EINVAL - invaild package name
368 * @retval AUL_R_ECOM - internal AUL IPC error
369 * @retval AUL_R_ERROR - general error
372 * aul_launch_app, aul_app_is_running, aul_resume_pid
375 * #include <bundle.h>
377 * int open_inhouse_contact_app()
379 * if(aul_app_is_running("org.tizen.contact"))
380 * aul_open_app("org.tizen.contact");
385 * If you don't want to launch the app,
386 * you should check app's running state with aul_app_is_running.
387 * This API will launch the application if the application is not running.
388 * This API is only available in User Session.
390 int aul_open_app(const char *appid);
394 * This API launches application, as menu screen launches the app.
395 * Thus, if the application is running, this API sends a RESUME event to the app.
396 * If the application is not running, this API launches the app.
397 * While the application is running, if the application cannot receive the RESUME event,
398 * AUL tries to raise the application's default window.
401 * This API is for caller.
402 * This API's purpose is to resume/launch application
403 * @par Typical use case:
404 * If you only want to show application with previous state or default state, Use this API.
406 * @param[in] pkgname package name to be resume as callee
407 * @param[in] uid User ID
408 * @return callee's pid if success, negative value(<0) if fail
409 * @retval AUL_R_OK - success
410 * @retval AUL_R_EINVAL - invaild package name
411 * @retval AUL_R_ECOM - internal AUL IPC error
412 * @retval AUL_R_ERROR - general error
415 * If you don't want to launch the app,
416 * you should check app's running state with aul_app_is_running.
417 * This API will launch the application if the application is not running.
418 * This API is only available to System user.
420 int aul_open_app_for_uid(const char *appid, uid_t uid);
424 * This API trigger to resume application
425 * If the application is running, this API send a resume event to the App.
426 * If the application is not running, this API launches the app.
427 * Although the application is running, if the application cannot receive resume event,
428 * AUL try to raise the application's default windows.
430 * This API is for caller.
431 * This API's purpose is to send resume event.
432 * @par Typical use case:
433 * If you only want to show application with previous state or default state, Use this API.
435 * @param[in] pkgname package name to be resume as callee
436 * @return callee's pid if success, negative value(<0) if fail
437 * @retval AUL_R_OK - success
438 * @retval AUL_R_EINVAL - invaild package name
439 * @retval AUL_R_ECOM - internal AUL IPC error
440 * @retval AUL_R_ERROR - general error
443 * aul_launch_app(), aul_app_is_running(), aul_resume_pid()
446 * This function will be deprecated. Use aul_open_app() instead of this function.
450 * #include <bundle.h>
452 * int resume_inhouse_contact_app()
454 * if(aul_app_is_running("org.tizen.contact"))
455 * aul_resume_app("org.tizen.contact");
460 * If you don't want to launch the app,
461 * you should check app's running state with aul_app_is_running.
462 * This API will launch the application if the application is not running.
463 * If you want to only resume without launching in multiple instance application model,
464 * you should use aul_resume_pid.
465 * This API is only available in User Session.
467 int aul_resume_app(const char *appid);
471 * This API trigger to resume application
472 * If the application is running, this API send a resume event to the App.
473 * If the application is not running, this API launches the app.
474 * Although the application is running, if the application cannot receive resume event,
475 * AUL try to raise the application's default windows.
477 * This API is for caller.
478 * This API's purpose is to send resume event.
479 * @par Typical use case:
480 * If you only want to show application with previous state or default state, Use this API.
482 * @param[in] pkgname package name to be resume as callee
483 * @param[in] uid User ID
484 * @return callee's pid if success, negative value(<0) if fail
485 * @retval AUL_R_OK - success
486 * @retval AUL_R_EINVAL - invaild package name
487 * @retval AUL_R_ECOM - internal AUL IPC error
488 * @retval AUL_R_ERROR - general error
491 * If you don't want to launch the app,
492 * you should check app's running state with aul_app_is_running.
493 * This API will launch the application if the application is not running.
494 * If you want to only resume without launching in multiple instance application model,
495 * you should use aul_resume_pid.
496 * This API is only available to System user.
498 int aul_resume_app_for_uid(const char *appid, uid_t uid);
502 * This API trigger to resume application
503 * If the application is running, this API send a resume event to the App.
504 * If the application is not running, this API return AUL_R_ERROR.
505 * Although the application is running, if the application cannot receive resume event,
506 * AUL try to raise the application's default windows.
508 * This API is for caller.
509 * This API's purpose is to send resume event.
510 * @par Typical use case:
511 * In multiple application model, If you want to only resume specific application, Use this API
513 * @param[in] pid application's pid to be resumed
514 * @return 0 if success, negative value(<0) if fail
515 * @retval AUL_R_OK - success
516 * @retval AUL_R_EINVAL - invaild pid
517 * @retval AUL_R_ECOM - internal AUL IPC error
518 * @retval AUL_R_ERROR - general error (include application is not running)
519 * @warning This API need to require root or inhouse permisssion \n
520 * If you have not the permission, this API return AUL_R_ERROR. \n
525 * #include <bundle.h>
527 * int iterfunc(const aul_app_info *info, void *data)
529 * if(strcmp(info->pkg_name,"org.tizen.contact")==0)
530 * aul_resume_pid(info->pid);
533 * int iterate_running_apps()
535 * return aul_app_get_running_app_info(iterfunc,NULL);
540 * This API is only available in User Session.
542 int aul_resume_pid(int pid);
546 * This API trigger to resume application
547 * If the application is running, this API send a resume event to the App.
548 * If the application is not running, this API return AUL_R_ERROR.
549 * Although the application is running, if the application cannot receive resume event,
550 * AUL try to raise the application's default windows.
552 * This API is for caller.
553 * This API's purpose is to send resume event.
554 * @par Typical use case:
555 * In multiple application model, If you want to only resume specific application, Use this API
557 * @param[in] pid application's pid to be resumed
558 * @param[in] uid User ID
559 * @return 0 if success, negative value(<0) if fail
560 * @retval AUL_R_OK - success
561 * @retval AUL_R_EINVAL - invaild pid
562 * @retval AUL_R_ECOM - internal AUL IPC error
563 * @retval AUL_R_ERROR - general error (include application is not running)
564 * @warning This API need to require root or inhouse permisssion \n
565 * If you have not the permission, this API return AUL_R_ERROR. \n
567 * This API is only available to System user.
569 int aul_resume_pid_for_uid(int pid, uid_t uid);
573 * This API trigger to terminate application
575 * If the application is running, this API send a terminate event to the App. \n
576 * If the app cannot receive the event, AUL kill forcely the application.\n
578 * This API's purpose is to kill application
579 * @par Typical use case:
580 * In general, Application like Task Manager use this API.
582 * This API need to require root or inhouse permisssion. \n
584 * @param[in] pid application's pid to be terminated
585 * @return 0 if success, negative value(<0) if fail
586 * @retval AUL_R_OK - success
587 * @retval AUL_R_EINVAL - invaild pid
588 * @retval AUL_R_ECOM - internal AUL IPC error
589 * @retval AUL_R_ERROR - general error
590 * @warning This API need to require root or inhouse permisssion. \n
594 * #include <bundle.h>
596 * int iterfunc(const aul_app_info *info, void *data)
598 * if(strcmp(info->pkg_name,"org.tizen.contact")==0)
599 * aul_terminate_pid(info->pid);
602 * int iterate_running_apps()
604 * return aul_app_get_running_app_info(iterfunc,NULL);
609 * If you have not the permission, this API return AUL_R_ERROR. \n
610 * This API is only available in User Session.
612 int aul_terminate_pid(int pid);
616 * This API trigger to terminate application
618 * If the application is running, this API send a terminate event to the App. \n
619 * If the app cannot receive the event, AUL kill forcely the application.\n
621 * This API's purpose is to kill application
622 * @par Typical use case:
623 * In general, Application like Task Manager use this API.
625 * This API need to require root or inhouse permisssion. \n
627 * @param[in] pid application's pid to be terminated
628 * @param[in] uid User ID
629 * @return 0 if success, negative value(<0) if fail
630 * @retval AUL_R_OK - success
631 * @retval AUL_R_EINVAL - invaild pid
632 * @retval AUL_R_ECOM - internal AUL IPC error
633 * @retval AUL_R_ERROR - general error
634 * @warning This API need to require root or inhouse permisssion. \n
637 * If you have not the permission, this API return AUL_R_ERROR. \n
638 * This API is only available to System user.
640 int aul_terminate_pid_for_uid(int pid, uid_t uid);
644 * This API trigger to terminate application asynchronously
646 * If the application is running, this API send a terminate event to the App. \n
647 * If the app cannot receive the event, AUL kill forcely the application.\n
649 * This API's purpose is to kill application
650 * @par Typical use case:
651 * In general, Application like Task Manager use this API.
653 * This API need to require root or inhouse permisssion. \n
655 * @param[in] pid application's pid to be terminated
656 * @return 0 if success, negative value(<0) if fail
657 * @retval AUL_R_OK - success
658 * @retval AUL_R_EINVAL - invaild pid
659 * @retval AUL_R_ECOM - internal AUL IPC error
660 * @retval AUL_R_ERROR - general error
661 * @warning This API need to require root or inhouse permisssion. \n
663 * If you have not the permission, this API return AUL_R_ERROR. \n
664 * This API is only available in User Session.
666 int aul_terminate_pid_async(int pid);
670 * This API trigger to terminate application asynchronously
672 * If the application is running, this API send a terminate event to the App. \n
673 * If the app cannot receive the event, AUL kill forcely the application.\n
675 * This API's purpose is to kill application
676 * @par Typical use case:
677 * In general, Application like Task Manager use this API.
679 * This API need to require root or inhouse permisssion. \n
681 * @param[in] pid application's pid to be terminated
682 * @param[in] uid User ID
683 * @return 0 if success, negative value(<0) if fail
684 * @retval AUL_R_OK - success
685 * @retval AUL_R_EINVAL - invaild pid
686 * @retval AUL_R_ECOM - internal AUL IPC error
687 * @retval AUL_R_ERROR - general error
688 * @warning This API need to require root or inhouse permisssion. \n
690 * If you have not the permission, this API return AUL_R_ERROR. \n
691 * This API is only available to System user.
693 int aul_terminate_pid_async_for_uid(int pid, uid_t uid);
697 * This API trigger to terminate application synchronously
699 * If the application is running, this API sends a terminate event to the application. \n
700 * And then, this API waits until the application is terminated successfully. \n
701 * If the app cannot receive the event, AUL kill forcely the application. \n
703 * This API's purpose is to kill application
704 * @par Typical use case:
705 * In general, Application like Task Manager use this API.
707 * This API need to require root or platform level permisssion. \n
709 * @param[in] pid application's pid to be terminated
710 * @return 0 if success, negative value(<0) if fail
711 * @retval AUL_R_OK - success
712 * @retval AUL_R_EINVAL - invaild pid
713 * @retval AUL_R_ECOM - internal AUL IPC error
714 * @retval AUL_R_ERROR - general error
715 * @warning This API need to require root or platform level permisssion. \n
717 * If you have not the permission, this API return AUL_R_ERROR. \n
718 * This API is only available in User Session.
720 int aul_terminate_pid_sync(int pid);
724 * This API trigger to terminate application synchronously
726 * If the application is running, this API send a terminate event to the application. \n
727 * And then, this API waits until the application is terminated successfully. \n
728 * If the app cannot receive the event, AUL kill forcely the application. \n
730 * This API's purpose is to kill application
731 * @par Typical use case:
732 * In general, Application like Task Manager use this API.
734 * This API need to require root or platform level permisssion. \n
736 * @param[in] pid application's pid to be terminated
737 * @param[in] uid User ID
738 * @return 0 if success, negative value(<0) if fail
739 * @retval AUL_R_OK - success
740 * @retval AUL_R_EINVAL - invaild pid
741 * @retval AUL_R_ECOM - internal AUL IPC error
742 * @retval AUL_R_ERROR - general error
743 * @warning This API need to require root or platform level permisssion. \n
745 * If you have not the permission, this API return AUL_R_ERROR. \n
746 * This API is only available to System user.
748 int aul_terminate_pid_sync_for_uid(int pid, uid_t uid);
751 *@brief Running application's information structure retrieved by AUL
753 typedef struct _aul_app_info {
754 int pid; /**< app's pid if running*/
755 char *pkg_name; /**< application id */
756 char *app_path; /**< application excutable path */
758 char *pkgid; /**< package id */
759 int status; /**< app's status */
760 int is_sub_app; /**< state whether sub app of app group */
765 * @brief iterator function running with aul_app_get_running_app_info
766 * @param[out] ainfo aul_app_info retreived by aul_app_get_running_app_info
767 * @param[out] data user-supplied data
769 typedef int (*aul_app_info_iter_fn)(const aul_app_info *ainfo, void *data);
773 * This API ask a application is running by application package name.
775 * To know whether some application is running or not, use this API
776 * @par Typical use case:
777 * For example, If you want to know browser application running,
778 * you can check it by using this API.
780 * @param[in] pkgname application package name
781 * @return true / false
782 * @retval 1 app_name is running now.
783 * @retval 0 app_name is NOT running now.
788 * int is_running_browser_app()
790 * return aul_app_is_running("org.tizen.browser");
795 * This API is only available in User Session.
798 int aul_app_is_running(const char *appid);
802 * This API ask a application is running by application package name.
804 * To know whether some application is running or not, use this API
805 * @par Typical use case:
806 * For example, If you want to know browser application running,
807 * you can check it by using this API.
809 * @param[in] pkgname application package name
810 * @param[in] uid User ID
811 * @return true / false
812 * @retval 1 app_name is running now.
813 * @retval 0 app_name is NOT running now.
817 * This API is only available to System User.
819 int aul_app_is_running_for_uid(const char *appid, uid_t uid);
823 * This API use to get running application list.
824 * This API call iter_fn with each aul_app_info of running apps when running application is found.
826 * If you want to get running application list, use this API
827 * @par Typical use case:
828 * In general, this API is used by task manager appllication. (running application list viewer)
830 * @param[in] iter_fn iterator function
831 * @param[in] user_data user-supplied data for iter_fn
832 * @return 0 if success, negative value(<0) if fail
833 * @retval AUL_R_OK - success
834 * @retval AUL_R_ERROR - internal error
839 * int iterfunc(const aul_app_info* info, void* data)
841 * printf("\t==========================\n");
842 * printf("\t pkg_name: %s\n", info->appid);
843 * printf("\t app_path: %s\n", info->app_path);
844 * printf("\t running pid: %d\n", info->pid);
845 * printf("\t==========================\n");
849 * int iterate_running_apps()
851 * return aul_app_get_running_app_info(iterfunc,NULL);
856 * This API should use if you want to know running application which has desktop files.
857 * If you want to get all process list, you must iterate process information by using proc filesystem
858 * Or, If you want to get all window list, you must iterate XWindows by using XWindow APIs
859 * This API is only available in User Session.
861 int aul_app_get_running_app_info(aul_app_info_iter_fn iter_fn, void *user_data);
865 * This API use to get running application list.
866 * This API call iter_fn with each aul_app_info of running apps when running application is found.
868 * If you want to get running application list, use this API
869 * @par Typical use case:
870 * In general, this API is used by task manager appllication. (running application list viewer)
872 * @param[in] iter_fn iterator function
873 * @param[in] user_data user-supplied data for iter_fn
874 * @param[in] uid User ID
875 * @return 0 if success, negative value(<0) if fail
876 * @retval AUL_R_OK - success
877 * @retval AUL_R_ERROR - internal error
880 * This API should use if you want to know running application which has desktop files.
881 * If you want to get all process list, you must iterate process information by using proc filesystem
882 * Or, If you want to get all window list, you must iterate XWindows by using XWindow APIs
883 * This API is only available to System user.
885 int aul_app_get_running_app_info_for_uid(aul_app_info_iter_fn iter_fn, void *user_data, uid_t uid);
889 * This API use to get all running application list, including sub app.
890 * This API call iter_fn with each aul_app_info of running apps when running application is found.
892 * If you want to get all running application list, use this API
893 * @par Typical use case:
894 * In general, this API is used by task manager application. (running application list viewer)
896 * @param[in] iter_fn iterator function
897 * @param[in] user_data user-supplied data for iter_fn
898 * @return 0 if success, negative value(<0) if fail
899 * @retval AUL_R_OK - success
900 * @retval AUL_R_ERROR - internal error
905 * int iterfunc_status(const aul_app_info *info, void *data)
907 * printf("\t==========================\n");
908 * printf("\t pid: %d\n", info->pid);
909 * printf("\t appid: %s\n", info->appid);
910 * printf("\t app_path: %s\n", info->app_path);
911 * printf("\t pkgid: %s\n", info->pkgid);
912 * printf("\t status: %d\n", info->status);
913 * printf("\t is_sub_app : %d\n", info->is_sub_app);
914 * printf("\t==========================\n");
918 * int iterate_running_apps()
920 * return aul_app_get_all_running_app_info(iterfunc_status,NULL);
925 * This API should use if you want to know running application which has desktop files.
926 * If you want to get all process list, you must iterate process information by using proc filesystem
927 * Or, If you want to get all window list, you must iterate XWindows by using XWindow APIs
928 * This API is only available in User Session.
930 int aul_app_get_all_running_app_info(aul_app_info_iter_fn iter_fn, void *user_data);
934 * This API use to get all running application list, including sub app.
935 * This API call iter_fn with each aul_app_info of running apps when running application is found.
937 * If you want to get all running application list, use this API
938 * @par Typical use case:
939 * In general, this API is used by task manager application. (running application list viewer)
941 * @param[in] iter_fn iterator function
942 * @param[in] user_data user-supplied data for iter_fn
943 * @param[in] uid User ID
944 * @return 0 if success, negative value(<0) if fail
945 * @retval AUL_R_OK - success
946 * @retval AUL_R_ERROR - internal error
949 * This API should use if you want to know running application which has desktop files.
950 * If you want to get all process list, you must iterate process information by using proc filesystem
951 * Or, If you want to get all window list, you must iterate XWindows by using XWindow APIs
952 * This API is only available to System user.
954 int aul_app_get_all_running_app_info_for_uid(aul_app_info_iter_fn iter_fn, void *user_data, uid_t uid);
958 * This API get application package name by pid
960 * If you want to get package name of running application, use this API
961 * @par Typical use case:
962 * In general, You can use this API when you want to know caller's information.
964 * @param[in] pid given pid
965 * @param[out] pkgname pkgname to be get
966 * @param[in] len length of pkgname
967 * @return 0 if success, negative value(<0) if fail
968 * @retval AUL_R_OK - success
969 * @retval AUL_R_ERROR - no such a package name
972 * #include <bundle.h>
974 * static int app_reset(bundle *b, void *data)
979 * pid = atoi(bundle_get_val(b,AUL_K_CALLER_PID));
980 * aul_app_get_pkgname_bypid(pid, appname, sizeof(appname));
985 * This API is only available in User Session.
987 int aul_app_get_pkgname_bypid(int pid, char *pkgname, int len);
991 * This API get application pkgid by pid
993 * If you want to get pkgid of running application, use this API
994 * @par Typical use case:
995 * In general, You can use this API when you want to know caller's information.
997 * @param[in] pid given pid
998 * @param[out] pkgid package id
999 * @param[in] len length of pkgid
1000 * @return 0 if success, negative value(<0) if fail
1001 * @retval AUL_R_OK - success
1002 * @retval AUL_R_ERROR - no such a appid
1006 * #include <bundle.h>
1008 * static int app_reset(bundle *b, void *data)
1013 * pid = atoi(bundle_get_val(b, AUL_K_CALLER_PID));
1014 * aul_app_get_pkgid_bypid(pid, pkgid, sizeof(pkgid));
1019 * This API is only available in User Session.
1021 int aul_app_get_pkgid_bypid(int pid, char *pkgid, int len);
1025 * This API get application pkgid by pid
1027 * If you want to get pkgid of running application, use this API
1028 * @par Typical use case:
1029 * In general, You can use this API when you want to know caller's information.
1031 * @param[in] pid given pid
1032 * @param[out] pkgid package id
1033 * @param[in] len length of pkgid
1034 * @param[in] uid User ID
1035 * @return 0 if success, negative value(<0) if fail
1036 * @retval AUL_R_OK - success
1037 * @retval AUL_R_ERROR - no such a appid
1040 * This API is also available to System user.
1042 int aul_app_get_pkgid_bypid_for_uid(int pid, char *pkgid, int len, uid_t uid);
1046 * This API get application appid by pid
1048 * If you want to get appid of running application, use this API
1049 * @par Typical use case:
1050 * In general, You can use this API when you want to know caller's information.
1052 * @param[in] pid given pid
1053 * @param[out] appid application id
1054 * @param[in] len length of pkgname
1055 * @return 0 if success, negative value(<0) if fail
1056 * @retval AUL_R_OK - success
1057 * @retval AUL_R_ERROR - no such a appid
1060 * #include <bundle.h>
1062 * static int app_reset(bundle *b, void *data)
1067 * pid = atoi(bundle_get_val(b,AUL_K_CALLER_PID));
1068 * aul_app_get_appid_bypid(pid, appid, sizeof(appid));
1073 * This API is only available in User Session.
1075 int aul_app_get_appid_bypid(int pid, char *appid, int len);
1079 * This API get application appid by pid
1081 * If you want to get appid of running application, use this API
1082 * @par Typical use case:
1083 * In general, You can use this API when you want to know caller's information.
1085 * @param[in] pid given pid
1086 * @param[out] appid application id
1087 * @param[in] len length of pkgname
1088 * @param[in] uid User ID
1089 * @return 0 if success, negative value(<0) if fail
1090 * @retval AUL_R_OK - success
1091 * @retval AUL_R_ERROR - no such a appid
1093 * This API is also available to System user.
1095 int aul_app_get_appid_bypid_for_uid(int pid, char *appid, int len, uid_t uid);
1099 * This API launch application associated with given filename
1101 * This API is for caller.
1102 * This API launch application based on mime type.
1103 * This API find mime_type associated with file name,
1104 * and then find default app associated with found mime_type
1105 * and then launch the app with filename argument.
1106 * @par Typical use case:
1107 * You can launch application to process given filename.
1108 * That is, Even if you don't know the specific application's pkgname,
1109 * you can launch the applicaiton processing given filename .
1110 * For example, If you want to process image file, you can simply launch image viewer.
1111 * At that time, you can use this APIs like aul_open_file("myimage.jpg");
1113 * @param[in] filename filename
1114 * @return callee's pid or 0 if success, negative value if fail\n
1115 * (when no found default app, return 0)
1116 * @retval AUL_R_OK - success
1117 * @retval AUL_R_EINVAL - invalid argument(filename)
1118 * @retval AUL_R_ECOM - internal AUL IPC error
1119 * @retval AUL_R_ERROR - general error
1124 * int view_image_file(char *filename)
1126 * aul_open_file(filename);
1131 * This API is only available in User Session.
1134 int aul_open_file(const char* filename);
1138 * This API launch application associated with given specific mimetype
1140 * This API is for caller.
1141 * This API launch application based on mime type like aul_open_file API.
1142 * But, This API don't find mime_type associated with file name.
1143 * This API use mimetype given by user. By using given mimetype, find default application.
1144 * and then launch the app with filename argument.
1145 * @par Typical use case:
1146 * Some files cannot extract exact mimetype automatically.
1147 * For example, To know mime type of files with DRM lock, first we should unlock DRM file.
1148 * In this case, You can use this API.
1149 * First, unlock DRM file, and extract mimetype from unlock file by using aul_get_mime_from_file,
1150 * and then, use this API with DRM file and extracted mime type.
1152 * @param[in] filename filename
1153 * @param[in] mimetype specific mimetype
1154 * @return callee's pid or 0 if success, negative value if fail\n
1155 * (when no found default app, return 0)
1156 * @retval AUL_R_OK - success
1157 * @retval AUL_R_EINVAL - invalid argument(filename,mimetype)
1158 * @retval AUL_R_ECOM - internal AUL IPC error
1159 * @retval AUL_R_ERROR - general error
1162 * aul_open_file, aul_get_mime_from_file
1166 * int view_drm_image_file(char *drm_filename)
1169 * // you must implement this function
1170 * mimetype = get_mimetype_from_drmfile(drm_filename);
1172 * aul_open_file_with_mimetype(drm_filename,mimetype);
1177 * This API is only available in User Session.
1179 int aul_open_file_with_mimetype(const char *filename, const char *mimetype);
1183 * This API launch application associated with content like "http://www.samsung.com"
1185 * This API is for caller.
1186 * This API launch application based on mime type.
1187 * This API find mime_type associated with content,
1188 * and then find default app associated with found mime_type,
1189 * and then launch the app with content argument.
1190 * @par Typical use case:
1191 * You can launch application to process given content.
1192 * That is, Even if you don't know the specific application's pkgname,
1193 * you can launch the applicaiton processing given content.
1194 * For example, If you want to process URL "http://www.samsung.com",
1195 * you can simply launch browser.
1196 * At that time, you can use this APIs like aul_open_content("http://www.samsung.com");
1198 * @param[in] content content
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(content)
1203 * @retval AUL_R_ECOM - internal AUL IPC error
1204 * @retval AUL_R_ERROR - general error or no found mimetype
1209 * int view_url(char *url)
1211 * aul_open_content(url);
1216 * This API is only available in User Session.
1219 int aul_open_content(const char* content);
1223 * This API get the default application(appid) associated with MIME type
1225 * This API use to get default application associteted with mimetype
1226 * In general, Setting Application need this API.
1227 * @par Typical use case:
1228 * Setting Application show mapping of default application / mimetype
1230 * @param[in] mimetype a mime type
1231 * @param[out] defapp a application appid of the app
1232 * @param[in] len length of defapp
1233 * @return 0 if success, negative value if fail
1234 * @retval AUL_R_OK - success
1235 * @retval AUL_R_EINVAL - invalid argument(mimetype)
1236 * @retval AUL_R_ERROR - general error or no found mimetype
1239 * aul_set_defapp_with_mime
1243 * void get_text_html_defapp()
1245 * char appname[255];
1246 * aul_get_defapp_from_mime("text/html",appname,sizeof(appname));
1251 * This API is only available in User Session.
1254 int aul_get_defapp_from_mime(const char *mimetype, char *defapp, int len);
1258 * This API set the default application(appid) associated with MIME type
1260 * This API use to change default application associteted with mimetype
1261 * In general, Setting Application or Installer need this API.
1262 * @par Typical use case:
1263 * Default Application associated with mimetype can be changed by Setting Application or installer
1264 * So, application to process specific mimetype can be substituted.
1266 * @param[in] mimetype a mime type
1267 * @param[in] defapp a application appid of the app to be set
1268 * @return 0 if success, negative value if fail
1269 * @retval AUL_R_OK - success
1270 * @retval AUL_R_EINVAL - invalid argument(mimetype)
1271 * @retval AUL_R_ERROR - general error
1274 * aul_get_defapp_from_mime
1278 * void set_text_html_defapp()
1280 * aul_set_defapp_with_mime("text/html","org.tizen.browser");
1285 * This API is only available in User Session.
1287 int aul_set_defapp_with_mime(const char *mimetype, const char *defapp);
1291 * This API get the mimetype associated with filename
1293 * This API use to get mimetype associteted with given filename
1294 * In general, This API use when you want to know only mimetype given filename.
1295 * @par Typical use case:
1296 * For example, In trasfering data through bluetooth,
1297 * additional information like mimetype should be added.
1298 * In such situation, You can get mimetype by using this API.
1300 * @param[in] filename file name
1301 * @param[out] mimetype a mime type
1302 * @param[in] len length of mimetype
1303 * @return 0 if success, negative value if fail
1304 * @retval AUL_R_OK - success
1305 * @retval AUL_R_EINVAL - invalid argument(filename)
1306 * @retval AUL_R_ERROR - general error
1311 * void get_mimetype()
1313 * char mimetype[255];
1314 * aul_get_mime_from_file("image.jpg",mimetype,sizeof(mimetype));
1319 * This API is only available in User Session.
1321 int aul_get_mime_from_file(const char *filename, char *mimetype, int len);
1325 * This API get the mimetype associated with given content
1327 * This API use to get mimetype associteted with given content
1328 * In general, This API use when you want to know only mimetype given content
1329 * @par Typical use case:
1330 * For example, In trasfering data through bluetooth,
1331 * additional information like mimetype should be added.
1332 * In such situation, You can get mimetype by using this API.
1334 * @param[in] content content string like "011-0000-0000"
1335 * @param[out] mimetype a mime type
1336 * @param[in] len length of mimetype
1337 * @return 0 if success, negative value if fail
1338 * @retval AUL_R_OK - success
1339 * @retval AUL_R_EINVAL - invalid argument(content)
1340 * @retval AUL_R_ERROR - general error
1345 * void get_mimetype()
1347 * char mimetype[255];
1348 * aul_get_mime_from_content("http://www.samsung.com",mimetype,sizeof(mimetype));
1353 * This API is only available in User Session.
1355 int aul_get_mime_from_content(const char *content, char *mimetype, int len);
1359 * This API get the icon's name associated with given mimetype
1361 * This API use to get icon's name associteted with given mimetype
1362 * @par Typical use case:
1363 * If you want to show mimetype's icon, use this API.
1365 * @param[in] mimetype a mime type
1366 * @param[out] iconname icon's name
1367 * @param[in] len length of iconname
1368 * @return 0 if success, negative value if fail
1369 * @retval AUL_R_OK - success
1370 * @retval AUL_R_EINVAL - invalid argument(content)
1371 * @retval AUL_R_ERROR - general error (no such mime type)
1376 * void get_mime_icon()
1379 * aul_get_mime_icon("text/html",icon,sizeof(icon));
1384 * This API is only available in User Session.
1386 int aul_get_mime_icon(const char *mimetype, char *iconname, int len);
1390 * This API get the extensions associated with given mimetype
1392 * This API use to get extensions associteted with given mimetype
1393 * @par Typical use case:
1394 * In general, user is not familiar with mimetype(text/html),
1395 * user is familiar with extenstions(*.html, *.htm)
1396 * So, To show mimetype information to user, use this API
1398 * @param[in] mimetype a mime type
1399 * @param[out] extlist extentions (ex> mpeg,mpg,mpe)
1400 * @param[in] len length of extlist
1401 * @return 0 if success, negative value if fail
1402 * @retval AUL_R_OK - success
1403 * @retval AUL_R_EINVAL - invalid argument(mimetype)
1404 * @retval AUL_R_ERROR - general error (no mimetype or no extenstion)
1407 * aul_get_mime_description
1411 * void get_extension()
1413 * char extlist[255];
1414 * aul_get_mime_extension("text/html",extlist,sizeof(extlist));
1419 * Some mimetype don't have extension.
1420 * In that case, You can use aul_get_mime_description.
1421 * This API is only available in User Session.
1423 int aul_get_mime_extension(const char *mimetype, char *extlist, int len);
1427 * This API get the description associated with given mimetype
1429 * This API use to get description associteted with given mimetype
1430 * @par Typical use case:
1431 * In general, user is not familiar with mimetype(text/html),
1432 * user is familiar with well-knowing information like extenstions(*.html, *.htm)
1433 * But, some mimetype don't have extenstion.
1434 * At that time,to show mimetype information to user, use this API
1436 * @param[in] mimetype a mime type
1437 * @param[out] desc description (ex> Call client)
1438 * @param[in] len length of desc
1439 * @return 0 if success, negative value if fail
1440 * @retval AUL_R_OK - success
1441 * @retval AUL_R_EINVAL - invalid argument(mimetype)
1442 * @retval AUL_R_ERROR - general error (no mimetype or no descrition)
1445 * aul_get_mime_extension
1449 * void get_information_from_mime()
1452 * if(aul_get_mime_extension("text/html",info,sizeof(info))<0){
1453 * aul_get_mime_description("text/html",info,sizeof(info));
1459 * This API is only available in User Session.
1461 int aul_get_mime_description(const char *mimetype, char *desc, int len);
1465 * This API create service result bundle based on bundle received in reset event.
1467 * This API use to create result bundle to send it to caller.
1468 * @par Typical use case:
1469 * This API is for callee which provide application service.\n
1470 * To send result to caller, You must create result bundle. \n
1471 * Callee(application providing the service) can send result by using this API and aul_send_service_result.
1473 * @param[in] inb bundle received in reset event
1474 * @param[out] outb bundle to use for returning result
1475 * @return 0 if success, negative value(<0) if fail
1476 * @retval AUL_R_OK - success
1477 * @retval AUL_R_EINVAL - inb is not bundle created by aul_open_service
1478 * @retval AUL_R_ERROR - general error
1481 * To create result bundle, You need received original bundle.
1482 * The original bundle can get from app_reset handler.
1486 * aul_send_service_result
1489 * #include <bundle.h>
1491 * int app_reset(bundle *b, void *data)
1493 * ad->recved_bundle = bundle_dup(b);
1498 * bundle* res_bundle;
1499 * aul_create_result_bundle(ad->recved_bundle,&res_bundle);
1500 * bundle_add(res_bundle, "result", "1");
1501 * aul_send_service_result(res_bundle);
1505 * This API is only available in User Session.
1508 int aul_create_result_bundle(bundle *inb, bundle **outb);
1512 * This API send service result to caller with bundle
1514 * This API is used to send result bundle to caller.
1515 * @par Typical use case:
1516 * This API is for callee which provide application service.\n
1517 * To send result to caller, You can use this API after creating result bundle. \n
1518 * Callee(application to provide service) can send result by using this API and aul_create_result_bundle.
1520 * @param[in] b Result data in bundle format
1521 * @return 0 if success, negative value(<0) if fail
1522 * @retval AUL_R_OK - success
1523 * @retval AUL_R_EINVAL - invalid result bundle
1524 * @retval AUL_R_ECOMM - internal AUL IPC error
1525 * @retval AUL_R_ERROR - general error
1528 * To send result bundle, You must create result bundle.
1529 * see aul_create_result_bundle
1533 * aul_create_result_bundle
1536 * #include <bundle.h>
1538 * int app_reset(bundle *b, void *data)
1540 * ad->recved_bundle = bundle_dup(b);
1545 * bundle* res_bundle;
1546 * aul_create_result_bundle(ad->recved_bundle,&res_bundle);
1547 * bundle_add(res_bundle, "result", "1");
1548 * aul_send_service_result(res_bundle);
1552 * This API is only available in User Session.
1555 int aul_send_service_result(bundle *b);
1558 * @brief Called when an application is terminated.
1559 * @details This function is called when an application is terminated, after you register this callback using aul_listen_app_dead_signal().
1560 * @param[in] pid The process ID
1561 * @param[in] user_data The user data passed from the registeration function
1563 * @see aul_listen_app_dead_signal()
1565 typedef int (*aul_app_dead_event_cb)(int pid, void *user_data);
1568 * @breif Registers a callback function to be invoked when the application is terminated.
1569 * @remarks If the callback function is nullptr, the registered event will be deregistered.
1570 * @param[in] callback The callback function
1571 * @param[in] user_data The user data to be passed to the callback function
1572 * @return @c 0 on success,
1573 * otherwise a negative error value
1574 * @retval #AUL_R_OK Successful
1575 * @retval #AUL_R_ERROR Internal I/O error
1576 * @see aul_app_dead_event_cb()
1578 * @remarks This function is only available for App Framework internally.
1583 * static int app_dead_event_cb(int pid, void *user_data)
1585 * dlog_print(DLOG_INFO, LOG_TAG, "application(%s) is terminated", pid);
1589 * int listen_app_dead_signal(void)
1593 * ret = aul_listen_app_dead_signal(app_dead_event_cb, NULL);
1594 * if (ret != AUL_R_OK) {
1595 * dlog_print(DLOG_ERROR, LOG_TAG, "aul_listen_app_dead_signal() is failed. error(%d)", ret);
1602 int aul_listen_app_dead_signal(aul_app_dead_event_cb callback, void *user_data);
1605 * @brief Called when an application is launched.
1606 * @details This function is called when an application is launched, after you register this callback using aul_listen_app_launch_signal().
1607 * @param[in] pid The process ID
1608 * @param[in] user_data The user data passed from the registeration function
1610 * @see aul_listen_app_launch_signal()
1612 typedef int (*aul_app_launch_event_cb)(int pid, void *user_data);
1615 * @brief Registers a callback function to be invoked when the application is launched.
1616 * @remarks If the callback function is nullptr, the registered event will be deregistered.
1617 * @param[in] callback The callback function
1618 * @param[in] user_data The user data to be passed to the callback function
1619 * @return @c 0 on success,
1620 * otherwise a negative error value
1621 * @retval #AUL_R_OK Successful
1622 * @retval #AUL_R_ERROR Internal I/O error
1623 * @see aul_app_launch_event_cb()
1625 * @remarks This function is only available for App Framework internally.
1630 * static int app_launch_event_cb(int pid, void *user_data)
1632 * dlog_print(DLOG_INFO, LOG_TAG, "application(%d) is launched", pid);
1636 * int listen_app_launch_signal(void)
1640 * ret = aul_listen_app_launch_signal(app_launch_event_cb, NULL);
1641 * if (ret != AUL_R_OK) {
1642 * dlog_print(DLOG_ERROR, LOG_TAG, "aul_listen_app_launch_signal() is failed. error(%d)", ret);
1649 int aul_listen_app_launch_signal(aul_app_launch_event_cb callback, void *user_data);
1652 * @brief Called when an application is launched.
1653 * @details This function is called when an application is launched, after you register this callback using aul_listen_app_launch_signal_v2().
1654 * @param[in] pid The process ID
1655 * @param[in] appid The application ID
1656 * @param[in] user_data The user data passed from the registeration function
1658 * @see aul_listen_app_launch_signal_v2()
1660 typedef int (*aul_app_launch_event_cb_v2)(int pid, const char *appid, void *user_data);
1663 * @brief Registers a callback function to be invoked when the application is launched.
1664 * @remarks If the callback function is nullptr, the registered event will be deregistered.
1665 * @param[in] callback The callback function
1666 * @param[in] user_data The user data to be passed to the callback function
1667 * @return @c 0 on success,
1668 * otherwise a negative error value
1669 * @retval #AUL_R_OK Successful
1670 * @retval #AUL_R_ERROR Internal I/O error
1672 * @see aul_app_launch_event_cb_v2()
1674 * @remarks This function is only available for App Framework internally.
1679 * static int app_launch_event_cb(int pid, const char *appid, void *user_data)
1681 * dlog_print(DLOG_INFO, LOG_TAG, "application(%s:%d) is launched", appid, pid);
1685 * int listen_app_launch_signal(void)
1689 * ret = aul_listen_app_launch_signal_v2(app_launch_event_cb, NULL);
1690 * if (ret != AUL_R_OK) {
1691 * dlog_print(DLOG_ERROR, LOG_TAG, "aul_listen_app_launch_signal_v2() is failed. error(%d)", ret);
1698 int aul_listen_app_launch_signal_v2(aul_app_launch_event_cb_v2 callback, void *user_data);
1702 * This API gets status of specified application process id.
1704 * This API's purpose is to get the application's status.
1706 * @param[in] pid pid of application
1707 * @return 0 or greater if success, nagative value if fail
1708 * @retval STATUS_LAUNCHING
1709 * @retval STATUS_VISIBLE
1711 * @retval STATUS_DYING
1712 * @retval STATUS_NORESTART
1718 * int iterfunc(const aul_app_info *info, void *data)
1721 * status = aul_app_get_status_bypid(info->pid);
1722 * if (status == STATUS_VISIBLE) {
1723 * printf("%s has focus", info->app_id);
1724 * (int *)data = info->pid;
1730 * int find_focus_app_pid()
1733 * aul_app_get_running_app_info(iterfunc, &pid);
1738 * This API is only available in User Session.
1740 int aul_app_get_status_bypid(int pid);
1744 * This API gets status of specified application process id.
1746 * This API's purpose is to get the application's status.
1748 * @param[in] pid pid of application
1749 * @param[in] uid User ID
1750 * @return 0 or greater if success, nagative value if fail
1751 * @retval STATUS_LAUNCHING
1752 * @retval STATUS_VISIBLE
1754 * @retval STATUS_DYING
1755 * @retval STATUS_NORESTART
1758 * This API is only available to System user.
1760 int aul_app_get_status_bypid_for_uid(int pid, uid_t uid);
1764 * This API gets the status of specified application id.
1766 * This API's purpose is to get the status of the application.
1768 * @param[in] appid application ID
1769 * @return 0 or greater if success, nagative value if fail
1770 * @retval STATUS_LAUNCHING
1771 * @retval STATUS_FOCUS
1772 * @retval STATUS_VISIBLE
1774 * @retval STATUS_DYING
1775 * @retval STATUS_NORESTART
1785 * status = aul_app_get_status("org.tizen.helloworld");
1786 * if (status == STATUS_FOCUS)
1787 * printf("org.tizen.helloworld has focus");
1794 * This API is only available in User Session.
1796 int aul_app_get_status(const char *appid);
1800 * This API gets the status of specified application id.
1802 * This API's purpose is to get the status of the application
1804 * @param[in] appid application ID
1805 * @param[in] uid User ID
1806 * @return 0 or greater if success, nagative value if fail
1807 * @retval STATUS_LAUNCHING
1808 * @retval STATUS_FOCUS
1809 * @retval STATUS_VISIBLE
1811 * @retval STATUS_DYING
1812 * @retval STATUS_NORESTART
1815 * This API is only available to System user.
1817 int aul_app_get_status_for_uid(const char *appid, uid_t uid);
1820 * @brief Called when the status is changed.
1821 * @remarks If @c is a negative error value,
1822 * the registered callback function will be deregistered.
1823 * @param[in] status The status
1824 * @param[in] user_data The user data passed from the registration function
1825 * @return @c 0 to continue with the next iteration of the loop,
1826 * otherwise a negative error value to break out of the loop
1827 * @see aul_add_status_local_cb()
1828 * @see aul_remove_status_local_cb();
1830 typedef int (*aul_status_local_cb)(int status, void *user_data);
1834 * This API sets callback function that on application status changed.
1836 * This API's purpose is to listen the application's status changed within
1837 * the caller process. In general, a library that required to release resource on
1838 * application's status may use this API.
1840 * @param[in] callback callback function
1841 * @param[in] data user data
1842 * @return 0 if success, negative value if fail
1843 * @retval AUL_R_OK - success
1844 * @retval AUL_R_ERROR - general error
1846 * aul_remove_status_local_cb
1850 * int status_changed(int status, void *data)
1852 * if (status == STATUS_VISIBLE)
1853 * printf("%d resume\n", getpid());
1855 * if (status == STATUS_BG)
1856 * printf("%d pause\n", getpid());
1859 * void listen_app_status()
1861 * aul_add_status_local_cb(status_changed, NULL);
1865 * This API is only available in User Session.
1868 int aul_add_status_local_cb(aul_status_local_cb callback, void *data);
1872 * This API unsets callback function that on application status changed.
1874 * This API's purpose is to remove callback that added by
1875 * aul_add_status_local_cb.
1877 * @param[in] callback callback function
1878 * @param[in] data user data
1879 * @return 0 if success, negative value if fail
1880 * @retval AUL_R_OK - success
1881 * @retval AUL_R_ERROR - general error
1884 * aul_add_status_local_cb
1888 * int status_changed(int status, void *data)
1890 * if (status == STATUS_VISIBLE)
1891 * printf("%d resume\n", getpid());
1893 * if (status == STATUS_BG)
1894 * printf("%d pause\n", getpid());
1897 * void listen_app_status()
1899 * aul_add_status_local_cb(status_changed, NULL);
1902 * void ignore_app_status()
1904 * aul_remove_status_local_cb(status_changed, NULL);
1909 * This API is only available in User Session.
1912 int aul_remove_status_local_cb(aul_status_local_cb callback, void *data);
1915 * This API is only for appfw internally.
1917 int aul_set_process_group(int parent_pid, int child_pid);
1920 * This API is only for Appfw internally.
1922 int aul_terminate_bgapp_pid(int pid);
1925 * This API is only for Appfw internally.
1927 int aul_terminate_pid_without_restart(int pid);
1930 * This API is only for Appfw internally.
1932 int aul_terminate_pid_sync_without_restart(int pid);
1935 * This API is only for Appfw internally.
1937 int aul_terminate_pid_sync_without_restart_for_uid(int pid, uid_t uid);
1940 * This API is only for Appfw internally.
1942 const char *aul_get_app_external_root_path(void);
1945 * This API is only for Appfw internally.
1947 const char *aul_get_app_root_path(void);
1950 * This API is only for Appfw internally.
1952 const char *aul_get_app_data_path(void);
1955 * This API is only for Appfw internally.
1957 const char *aul_get_app_cache_path(void);
1960 * This API is only for Appfw internally.
1962 const char *aul_get_app_resource_path(void);
1965 * This API is only for Appfw internally.
1967 const char *aul_get_app_tep_resource_path(void);
1970 * This API is only for Appfw internally.
1972 int aul_get_app_shared_data_path(char **path);
1975 * This API is only for Appfw internally.
1977 const char *aul_get_app_shared_resource_path(void);
1980 * This API is only for Appfw internally.
1982 const char *aul_get_app_shared_trusted_path(void);
1985 * This API is only for Appfw internally.
1987 const char *aul_get_app_external_data_path(void);
1990 * This API is only for Appfw internally.
1992 const char *aul_get_app_external_cache_path(void);
1995 * This API is only for Appfw internally.
1997 const char *aul_get_app_external_shared_data_path(void);
2000 * This API is only for Appfw internally.
2002 const char *aul_get_app_specific_path(void);
2005 * This API is only for Appfw internally.
2007 int aul_get_app_res_control_allowed_resource_path(const char *res_type, char **path);
2010 * This API is only for Appfw internally.
2012 int aul_get_app_res_control_global_resource_path(const char *res_type, char **path);
2015 * This API is only for Appfw internally.
2017 int aul_get_app_shared_data_path_by_appid(const char *app_id, char **path);
2020 * This API is only for Appfw internally.
2022 int aul_get_app_shared_resource_path_by_appid(const char *app_id, char **path);
2025 * This API is only for Appfw internally.
2027 int aul_get_app_shared_trusted_path_by_appid(const char *app_id, char **path);
2030 * This API is only for Appfw internally.
2032 int aul_get_app_external_shared_data_path_by_appid(const char *app_id, char **path);
2035 * This API is only for Appfw internally.
2037 int aul_get_usr_app_shared_data_path_by_appid(const char *app_id, char **path, uid_t uid);
2040 * This API is only for Appfw internally.
2042 int aul_get_usr_app_shared_resource_path_by_appid(const char *app_id, char **path, uid_t uid);
2045 * This API is only for Appfw internally.
2047 int aul_get_usr_app_shared_trusted_path_by_appid(const char *app_id, char **path, uid_t uid);
2050 * This API is only for Appfw internally.
2052 int aul_get_usr_app_external_shared_data_path_by_appid(const char *app_id, char **path, uid_t uid);
2055 * This type is only for Appfw internally.
2057 typedef int (*subapp_fn)(void *data);
2060 * This API is only for Appfw internally.
2062 int aul_set_subapp(subapp_fn cb, void *data);
2065 * This API is only for Appfw internally.
2067 int aul_subapp_terminate_request_pid(int pid);
2070 * This API is only for Appfw internally.
2072 int aul_is_subapp(void);
2075 * This API is only for Appfw internally.
2077 int aul_kill_pid(int pid);
2080 * This API is only for Appfw internally.
2082 int aul_add_caller_cb(int pid, void (*caller_cb) (int, void *), void *data);
2085 * This API is only for Appfw internally.
2087 int aul_remove_caller_cb(int pid, void *data);
2090 * This API is only for Appfw internally.
2092 int aul_invoke_caller_cb(void *data);
2095 * This API is only for Appfw internally.
2097 void aul_set_preinit_window(void *evas_object);
2100 * This API is only for Appfw internally.
2102 void* aul_get_preinit_window(const char *win_name);
2105 * This API is only for Appfw internally.
2107 void aul_set_preinit_background(void *evas_object);
2110 * This API is only for Appfw internally.
2112 void* aul_get_preinit_background(void);
2115 * This API is only for Appfw internally.
2117 void aul_set_preinit_conformant(void *evas_object);
2120 * This API is only for Appfw internally.
2122 void* aul_get_preinit_conformant(void);
2125 * This API is only for Appfw internally.
2127 void aul_set_preinit_appid(const char *appid);
2130 * This API is only for Appfw internally.
2132 void aul_set_preinit_pkgid(const char *pkgid);
2135 * This API is only for Appfw internally.
2137 void aul_set_preinit_root_path(const char *root_path);
2140 * This API is only for Appfw internally.
2142 const char *aul_get_preinit_root_path(void);
2145 * This API is only for Appfw internally.
2147 int aul_update_freezer_status(int pid, const char* type);
2150 * This API is only for Appfw internally.
2152 int aul_send_app_launch_request_signal(int pid, const char* appid, const char* pkgid, const char* type);
2155 * This API is only for Appfw internally.
2157 int aul_send_app_resume_request_signal(int pid, const char* appid, const char* pkgid, const char *type);
2160 * This API is only for Appfw internally.
2162 int aul_send_app_terminate_request_signal(int pid, const char* appid, const char* pkgid, const char *type);
2165 * This API is only for Appfw internally.
2167 int aul_send_app_status_change_signal(int pid, const char* appid, const char* pkgid, const char* status, const char *type);
2170 * This API is only for Appfw internally.
2172 int aul_send_app_terminated_signal(int pid);
2175 * This API is only for Appfw internally.
2177 int aul_send_app_group_signal(int owner_pid, int child_pid, const char *child_pkgid);
2180 * This API is only for Appfw internally.
2182 int aul_invoke_status_local_cb(int status);
2185 * This type is only for Appfw internally.
2187 typedef int (*data_control_provider_handler_fn) (bundle *b, int request_id, void *data);
2190 * This API is only for Appfw internally.
2192 int aul_set_data_control_provider_cb(data_control_provider_handler_fn handler);
2195 * This API is only for Appfw internally.
2197 int aul_unset_data_control_provider_cb(void);
2200 * This API is only for Appfw internally.
2202 int aul_pause_app(const char *appid);
2205 * This API is only for Appfw internally.
2207 int aul_pause_app_for_uid(const char *appid, uid_t uid);
2210 * This API is only for Appfw internally.
2212 int aul_pause_pid(int pid);
2215 * This API is only for Appfw internally.
2217 int aul_pause_pid_for_uid(int pid, uid_t uid);
2220 * This API is only for Appfw internally.
2222 int aul_reload_appinfo(void);
2225 * This API is only for Appfw internally.
2227 int aul_status_update(int status);
2230 * This API is only for Appfw internally.
2232 int aul_app_group_get_window(int pid);
2235 * This API is only for Appfw internally.
2237 int aul_app_group_set_window(int wid);
2240 * This API is only for Appfw internally.
2242 void aul_app_group_get_leader_pids(int *cnt, int **pids);
2245 * This API is only for Appfw internally.
2247 void aul_app_group_get_group_pids(int leader_pid, int *cnt, int **pids);
2250 * This API is only for Appfw internally.
2252 int aul_app_group_get_leader_pid(int pid);
2255 * This API is only for Appfw internally.
2257 int aul_app_group_clear_top(void);
2260 * This API is only for Appfw internally.
2262 int aul_app_group_is_top(void);
2265 * This API is only for Appfw internally.
2267 int aul_app_group_get_fg_flag(int pid);
2270 * This API is only for Appfw internally.
2272 void aul_app_group_lower(int *exit);
2275 * This API is only for Appfw internally.
2277 void aul_app_group_get_idle_pids(int *cnt, int **pids);
2281 * This API puts some app below the caller app
2283 * This API's purpose is to reorder window stack limitedly.
2285 * @param[in] below_appid The appid to be reordered below the caller app
2286 * @return 0 success, negative value(<0) if fail
2289 * below_appid should be main app which have been launched before.
2290 * This API is only available in User Session.
2292 int aul_app_group_activate_below(const char *below_appid);
2296 * This API puts some app above the caller app
2298 * This API's purpose is to reorder window stack limitedly.
2300 * @param[in] above_appid The appid to be reordered above the caller app
2301 * @return 0 if success, negative value(<0) if fail
2304 * above_appid should be main app which have been launched before.
2305 * This API is only available in User Session.
2307 int aul_app_group_activate_above(const char *above_appid);
2310 * This API is only for Appfw internally.
2312 int aul_request_data_control_socket_pair(bundle *b, int *fd);
2315 * This API is only for Appfw internally.
2317 int aul_request_message_port_socket_pair(int *fd);
2320 * @brief Called when the system booting is completed.
2321 * @param[in] unused The unused parameter
2322 * @param[in] user_data The use data passed from the registration function
2323 * @return The return value is not used.
2325 * @see aul_listen_booting_done_signal();
2327 typedef int (*aul_booting_done_event_cb)(int unused, void *user_data);
2330 * @brief Registers a callback function to be invoked when the system booting is completed.
2331 * @param[in] callback The callback function
2332 * @param[in] user_data The user data to be passed to the callback function
2333 * @return @c 0 on success,
2334 * otherwise a negative error value
2336 * @see aul_booting_done_event_cb()a
2337 * @remarks This function is only available for App Framework internally.
2339 int aul_listen_booting_done_signal(aul_booting_done_event_cb, void *user_data);
2342 * @brief Called when the coodlown event occurs.
2343 * @param[in] status The cooldown status
2344 * @param[in] user_data The user data passed from the registration function
2345 * @return The return value is not used.
2347 * @see aul_listen_cooldown_signal()
2349 typedef int (*aul_cooldown_event_cb)(const char *status, void *user_data);
2352 * @brief Registers a callback function to be invoked when the cooldown event occurs.
2353 * @param[in] callback The callback function
2354 * @param[in] user_data The user data to be passed to the callback function
2355 * @return @c 0 on success,
2356 * otherwise a negative error value
2358 * @see aul_coodlown_event_cb()
2360 * @remarks This function is only available for App Framework internally.
2362 int aul_listen_cooldown_signal(int (*func) (const char *, void *), void *data);
2365 * @brief Called when the status of the app process is changed.
2366 * @details This function is called when the app process status is changed, after you register this callback using aul_listen_app_status_signal().
2367 * @param[in] pid The process ID
2368 * @param[in] status The status of the process
2369 * @param[in] user_data The user data passed from the registeration function
2371 * @see @aul_listen_app_status_signal()
2372 * @see #aul_process_status_e
2374 typedef int (*aul_app_status_changed_cb)(int pid, int status, void *user_data);
2377 * @brief Registers a callback function to be invoked when the process status is changed.
2378 * @remarks If the callback function is nullptr, the registered event will be deregistered.
2379 * @param[in] callback The callback function
2380 * @param[in] user_data The user data to be passed to the callback function
2381 * @return @c 0 on success,
2382 * otherwise a negative error value
2383 * @retval #AUL_R_OK Successful
2384 * @retval #AUL_R_ERROR Internal I/O error
2386 * @see @aul_app_status_changed_cb()
2387 * @see #aul_process_status_e
2389 * @remarks This function is only available for App Framework internally.
2394 * static int app_status_changed_cb(int pid, int status, void *user_data)
2396 * cosnt char *app_status;
2399 * case AUL_PROC_STATUS_LAUNCH:
2400 * app_status = "LAUNCHING";
2402 * case AUL_PROC_STATUS_FG:
2403 * app_status = "VISIBLE";
2405 * case AUL_PROC_STATUS_BG:
2406 * app_status = "BACKGROUND";
2408 * case AUL_PROC_STATUS_FOCUS:
2409 * app_status = "FOCUS";
2411 * case AUL_PROC_STATUS_HIDE:
2412 * app_status = "HIDE";
2415 * app_status = "UNKNOWN";
2419 * dlog_print(DLOG_INFO, LOG_TAG, "pid: %d, status: %%s(%d)", pid, app_status, status);
2423 * int listen_app_status_signal(void)
2427 * ret = aul_listen_app_status_signal(app_status_changed_cb, NULL);
2428 * if (ret != AUL_R_OK) {
2429 * dlog_print(DLOG_ERROR, LOG_TAG, "aul_listen_app_status_signal() is failed. error(%d)", ret);
2436 int aul_listen_app_status_signal(aul_app_status_changed_cb callback, void *user_data);
2439 * This API is only for Appfw internally.
2441 int aul_check_tep_mount(const char *tep_path);
2444 * This API is only for Appfw internally.
2446 int aul_is_tep_mount_dbus_done(const char *tep_string);
2449 * This API is only for Appfw internally.
2451 int aul_forward_app(const char *appid, bundle *kb);
2455 * This API create custom launchpad-loader
2457 * This API's purpose is to make a slot for custom loader.
2458 * Once it is made, added loader will make a candidate process to use.
2460 * @param[in] loader_path The file name of the custom loader binary including full path
2461 * @param[in] extra A bundle to be passed to the custom loader
2462 * @return Loader ID if success, negative value(<0) if fail
2465 * This API is only for Appfw internally.
2466 * This API is only available in User Session.
2468 int aul_add_loader(const char *loader_path, bundle *extra);
2472 * This API create custom launchpad-loader
2474 * This API's purpose is to make a slot for custom loader.
2475 * Once it is made, added loader will make a candidate process to use.
2477 * @param[in] loader_path The file name of the custom loader binary including full path
2478 * @param[in] extra A bundle to be passed to the custom loader
2479 * @param[in] uid User ID
2480 * @return Loader ID if success, negative value(<0) if fail
2483 * This API is only for Appfw internally.
2484 * This API is only available to System user.
2486 int aul_add_loader_for_uid(const char *loader_path, bundle *extra, uid_t uid);
2491 * This API destroy custom launchpad-loader
2493 * This API's purpose is to remove a slot for custom loader.
2494 * Once it is removed, the prepared process will be removed as well.
2496 * @param[in] loader_id Loader ID
2497 * @return 0 if success, negative value(<0) if fail
2500 * This API is only for Appfw internally.
2501 * This API is only available in User Session.
2503 int aul_remove_loader(int loader_id);
2507 * This API destroy custom launchpad-loader
2509 * This API's purpose is to remove a slot for custom loader.
2510 * Once it is removed, the prepared process will be removed as well.
2512 * @param[in] loader_id Loader ID
2513 * @param[in] uid User ID
2514 * @return 0 if success, negative value(<0) if fail
2517 * This API is only for Appfw internally.
2518 * This API is only available to System user.
2520 int aul_remove_loader_for_uid(int loader_id, uid_t uid);
2524 * This API gets specified application process id.
2526 * The purpose of this API is to get the pid of specified application.
2528 * @param[in] appid application name
2529 * @return callee's pid if success, negative value(<0) if fail
2532 * This API is only available in User Session.
2534 int aul_app_get_pid(const char *appid);
2538 * This API gets specified application process id.
2540 * The purpose of this API is to get the pid of specified application.
2542 * @param[in] appid application name
2543 * @param[in] uid User ID
2544 * @return callee's pid if success, negative value(<0) if fail
2547 * This API is only available to System user.
2549 int aul_app_get_pid_for_uid(const char *appid, uid_t uid);
2553 * This function update rua stat.
2555 * @param[in] b Bundle object contains caller and tag information.
2556 * @param[in] uid Target uid
2558 * @return 0 if success, negative value(<0) if fail
2560 * @remarks This API is only for Appfw internally.
2569 bundle *b = bundle_create();
2570 bundle_add_str(b, AUL_SVC_K_RUA_STAT_CALLER, caller);
2571 bundle_add_str(b, AUL_SVC_K_RUA_STAT_TAG, tag);
2573 r = aul_update_rua_stat_for_uid(b);
2578 int aul_update_rua_stat_for_uid(bundle *b, uid_t uid);
2582 * This function add rua history.
2584 * @param[in] b Bundle object Target Package name or app path.
2585 * @param[in] uid Target uid
2587 * @return 0 if success, negative value(<0) if fail
2589 * @remarks This API is only for Appfw internally.
2598 bundle *b = bundle_create();
2600 bundle_add_str(b, AUL_K_RUA_PKGNAME, pkg_name);
2602 bundle_add_str(b, AUL_K_RUA_APPPATH, app_path);
2604 r = aul_add_rua_history_for_uid(b);
2609 int aul_add_rua_history_for_uid(bundle *b, uid_t uid);
2613 * This function delete rua history.
2615 * @param[in] b Bundle object Target Package name. If NULL or has no value, delete all rua history.
2616 * @param[in] uid Target uid
2618 * @return 0 if success, negative value(<0) if fail
2620 * @remarks This API is only for Appfw internally.
2631 b = bundle_create();
2632 bundle_add_str(b, AUL_K_RUA_PKGNAME, pkg_name);
2634 r = aul_delete_rua_history_for_uid(b, getuid());
2639 int aul_delete_rua_history_for_uid(bundle *b, uid_t uid);
2644 * This function sets the default application(application id) associated with operatioin, uri and mime-type.
2646 * @param[in] b Bundle object Target application id and operation, uri and mime-type.
2648 * @return 0 if success, negative value(<0) if fail
2650 * @remarks This API is only for Appfw internally.
2655 #include <aul_svc.h>
2660 bundle *b = bundle_create();
2662 const char *appid = "org.tizen.test";
2663 const char *operation = "test_operation";
2664 const char *mime_type = "test_mime";
2665 const char *uri = "test_uri";
2667 aul_svc_set_operation(b, operation);
2668 aul_svc_set_mime(b, mime_type);
2669 aul_svc_set_uri(b, uri);
2671 aul_svc_set_appid(b, appid)
2673 r = aul_set_default_app_by_operation(b);
2678 int aul_set_default_app_by_operation(bundle *b);
2682 * This API unset the default application(application id) associated with operation, uri and mime-type.
2684 * @param[in] app_id The ID of the application
2686 * @return 0 if success, negative value(<0) if fail
2699 aul_unset_default_app_by_operation("org.tizen.test");
2704 int aul_unset_default_app_by_operation(const char *app_id);
2708 * Sends the launch request asynchronously.
2710 * @param[in] appid The application ID
2711 * @param[in] kb The Bundle data
2712 * @return a pid of the callee on success,
2713 * otherwise a negative error value
2714 * @retval AUL_R_OK - Successful
2715 * @retval AUL_R_EINVAL - Invalid parameter
2716 * @retval AUL_R_ECOM - Internal AUL IPC error
2717 * @retval AUL_R_ERROR - General error
2720 * This API is only available in User Session.
2721 * This API doesn't check whether the callee application is executed successfully.
2722 * If the caller application is equal to the callee application, this API can return AUL_R_OK.
2724 int aul_launch_app_async(const char *appid, bundle *kb);
2728 * Sends the launch request asynchronously.
2730 * @param[in] appid The application ID
2731 * @param[in] kb The Bundle data
2732 * @param[in] uid User ID
2733 * @return a pid of the callee on success,
2734 * otherwise a negative error value
2735 * @retval AUL_R_OK - Successful
2736 * @retval AUL_R_EINVAL - Invalid parameter
2737 * @retval AUL_R_ECOM - Internal AUL IPC error
2738 * @retval AUL_R_ERROR - General error
2741 * This API is only available to System user.
2742 * This API doesn't check whether the callee application is executed successfully.
2743 * If the caller application is equal to the callee application, this API can return AUL_R_OK.
2745 int aul_launch_app_async_for_uid(const char *appid, bundle *kb, uid_t uid);
2749 * This API request launchpad to make candidate processes.
2751 * @return 0 if success, negative value(<0) if fail
2754 * This API is only available in User Session.
2756 int aul_prepare_candidate_process(void);
2759 * This API is only for Appfw internally.
2761 int aul_widget_instance_add(const char *widget_id, const char *instance_id);
2764 * This API is only for Appfw internally.
2766 int aul_widget_instance_del(const char *widget_id, const char *instance_id);
2769 * This API is only for Appfw internally.
2771 typedef void (*aul_widget_instance_foreach_cb)(const char *instance_id, void *data);
2774 * This API is only for Appfw internally.
2776 int aul_widget_instance_foreach(const char *widget_id, aul_widget_instance_foreach_cb cb, void *data);
2779 * This API is only for Appfw internally.
2781 int aul_widget_instance_update(const char *widget_id, const char *instance_id, bundle *b);
2784 * This API is only for Appfw internally.
2786 int aul_widget_instance_count(const char *widget_id);
2790 * This API gets the last caller process id of specified application process id.
2792 * This API's purpose is to get the application's last caller process id.
2794 * @param[in] pid pid of application
2795 * @return caller pid if success, nagative value if fail
2798 * This API is only available in User Session.
2800 int aul_app_get_last_caller_pid(int pid);
2804 * This API gets the last caller process id of specified application process id.
2806 * This API's purpose is to get the last caller process id of the application.
2808 * @param[in] pid pid of application
2809 * @param[in] uid User ID
2810 * @return caller pid if success, nagative value if fail
2813 * This API is only available in System users.
2815 int aul_app_get_last_caller_pid_for_uid(int pid, uid_t uid);
2819 * This API trigger to resume application asynchronously.
2820 * If the application is running, this API send a resume event to the App.
2821 * If the application is not running, this API return AUL_R_ERROR.
2822 * Although the application is running, if the application cannot receive resume event,
2823 * AUL try to raise the application's default windows.
2825 * This API is for caller.
2826 * This API's purpose is to send resume event.
2827 * @par Typical use case:
2828 * In multiple application model, If you want to only resume specific application, Use this API
2830 * @param[in] pid application's pid to be resumed
2831 * @return 0 if success, negative value(<0) if fail
2832 * @retval AUL_R_OK - success
2833 * @retval AUL_R_EINVAL - invaild pid
2834 * @retval AUL_R_ECOM - internal AUL IPC error
2835 * @retval AUL_R_ERROR - general error (include application is not running)
2836 * @warning This API need to require root or inhouse permisssion \n
2837 * If you have not the permission, this API return AUL_R_ERROR. \n
2839 * This API is only available to User Session.
2841 int aul_resume_pid_async(int pid);
2845 * This API trigger to resume application asynchronously.
2846 * If the application is running, this API send a resume event to the App.
2847 * If the application is not running, this API return AUL_R_ERROR.
2848 * Although the application is running, if the application cannot receive resume event,
2849 * AUL try to raise the application's default windows.
2851 * This API is for caller.
2852 * This API's purpose is to send resume event.
2853 * @par Typical use case:
2854 * In multiple application model, If you want to only resume specific application, Use this API
2856 * @param[in] pid application's pid to be resumed
2857 * @param[in] uid User ID
2858 * @return 0 if success, negative value(<0) if fail
2859 * @retval AUL_R_OK - success
2860 * @retval AUL_R_EINVAL - invaild pid
2861 * @retval AUL_R_ECOM - internal AUL IPC error
2862 * @retval AUL_R_ERROR - general error (include application is not running)
2863 * @warning This API need to require root or inhouse permisssion \n
2864 * If you have not the permission, this API return AUL_R_ERROR. \n
2866 * This API is only available to System user.
2868 int aul_resume_pid_async_for_uid(int pid, uid_t uid);
2872 * This API set the alias appid.
2873 * The alias appid is only available for the aul_svc_set_appid() API.
2874 * If the appid is not available, this API returns an error.
2876 * @privlevel platform
2877 * @privilege %http://tizen.org/privilege/systemsettings.admin
2878 * @param[in] alias_appid an alias application ID
2879 * @param[in] appid an application ID
2880 * @return 0 if success, negative value(<0) if fail
2883 * This API is only available to User Session.
2885 int aul_set_alias_appid(const char *alias_appid, const char *appid);
2889 * This API unset the alias appid.
2891 * @privlevel platform
2892 * @privilege %http://tizen.org/privilege/systemsettings.admin
2893 * @param[in] alias_appid an alias application ID
2894 * @return 0 if success, negative value(<0) if fail
2897 * This API is only available to User Session.
2899 int aul_unset_alias_appid(const char *alias_appid);
2903 * This API activates the alias information based on the given appid.
2905 * @privlevel platform
2906 * @privilege %http://tizen.org/privilege/systemsettings.admin
2907 * @param[in] appid an application ID
2908 * @return 0 if success, negative value(<0) if fail
2911 * This API is only available to User Session.
2913 int aul_enable_alias_info(const char *appid);
2917 * This API deactivates the alias information based on the given appid.
2919 * @privlebel platform
2920 * @privilege %http://tizen.org/privilege/systemsettings.admin
2921 * @param[in] appid an application ID
2922 * @return 0 if success, negative value(<0) if fail
2925 * This API is only available to User Session.
2927 int aul_disable_alias_info(const char *appid);
2930 * This API is only for Appfw internally.
2932 typedef int (*app_status_cb)(aul_app_info *info, int ctx_status, void *data);
2935 * This API is only for Appfw internally.
2937 typedef struct status_listen_s *status_listen_h;
2941 * Registers a callback function to be invoked when the application change status.
2943 * @param[in] appid The application ID to get status
2944 * @param[in] callback The callback function to register
2945 * @param[in] data The user data to be passed to the callback function
2946 * @param[out] handle The status listen handle
2947 * @return @c 0 on success,
2948 * otherwise a negative error value
2950 int aul_listen_app_status(const char *appid, app_status_cb callback,
2951 void *data, status_listen_h *handle);
2952 int aul_listen_app_status_for_uid(const char *appid, app_status_cb callback,
2953 void *data, status_listen_h *handle, uid_t uid);
2956 * This API is only for Appfw internally.
2958 int aul_widget_instance_get_content(const char *widget_id, const char *instance_id, char **content);
2962 * Gets running application instance info
2963 * This API calls the iter_fn with the aul_app_info when running app instance info is found.
2965 * @param[in] iter_fn iterative function
2966 * @param[in] user_data User data
2967 * @return 0 if success, negative value(<0) if fail
2968 * @retval AUL_R_OK Successful
2969 * @retval AUL_R_ERROR General error
2970 * @retval AUL_R_EINVAL Invalid parameter
2972 int aul_app_get_running_app_instance_info(aul_app_info_iter_fn iter_fn,
2974 int aul_app_get_running_app_instance_info_for_uid(aul_app_info_iter_fn iter_fn,
2975 void *user_data, uid_t uid);
2978 * This API is only for Appfw internally.
2980 int aul_app_get_instance_id_bypid(int pid, char *instance_id, int len);
2981 int aul_app_get_instance_id_bypid_for_uid(int pid, char *instance_id,
2982 int len, uid_t uid);
2985 * This API is only for Appfw internally.
2987 int aul_resume_app_by_instance_id(const char *appid, const char *instance_id);
2988 int aul_resume_app_by_instance_id_for_uid(const char *appid,
2989 const char *instance_id, uid_t uid);
2992 * This API is only for Appfw internally.
2994 int aul_ignore_app_status(status_listen_h handle);
2997 * This API is only for Appfw internally.
2999 int aul_notify_exit(void);
3000 int aul_notify_start(void);
3003 * This API is only for App Framework internally.
3005 const char *aul_app_status_convert_to_string(int status);
3008 * This API is only for App Framework internally.
3010 int aul_terminate_instance_async(const char *instance_id, int pid);
3011 int aul_terminate_instance_async_for_uid(const char *instance_id, int pid,
3015 * @brief Sends the terminate request.
3017 * @privlevel platform
3018 * @privilege %http://tizen.org/privilege/appmanager.kill
3020 * @param[in] appid The application ID
3021 * @param[in] instance_id The instance ID
3022 * @return @c 0 on success,
3023 * otherwise a negative error value
3025 * @remarks This function is only for App Framework internally.
3027 int aul_terminate_app_with_instance_id(const char *appid,
3028 const char *instance_id);
3031 * @brief Sends the terminate request.
3033 * @privlevel platform
3034 * @privilege %http://tizen.org/privilege/appmanager.kill
3036 * @param[in] appid The application ID
3037 * @param[in] instance_id The instance ID
3038 * @param[in] uid The user ID
3039 * @return @c 0 on success,
3040 * otherwise a negative error value
3042 * @remarks This function is only for App Framework internally.
3044 int aul_terminate_app_with_instance_id_for_uid(const char *appid,
3045 const char *instance_id, uid_t uid);
3048 * @brief Sends the terminate request.
3050 * @privlevel platform
3051 * @privilege %http://tizen.org/privilege/appmanager.kill
3053 * @param[in] appid The application ID
3054 * @return @c 0 on success,
3055 * otherwise a negative error value
3057 * @remarks This function is only for App Framework internally.
3059 int aul_terminate_app(const char *appid);
3062 * @brief Sends the terminate request.
3064 * @privlevel platform
3065 * @privilege %http://tizen.org/privilege/appmanager.kill
3067 * @param[in] appid The application ID
3068 * @param[in] uid The user ID
3069 * @return @c 0 on success,
3070 * otherwise a negative error value
3072 * @remarks This function is only for App Framework internally.
3074 int aul_terminate_app_for_uid(const char *appid, uid_t uid);
3077 * @brief Checks whether the application is running or not.
3080 * @param[in] appid The application ID
3081 * @param[in] instance_id The instance ID
3082 * @param[out] running @c true if the instance is running, \n
3083 * otherwise @c false if not running
3084 * @return @c 0 on success,
3085 * otherwise a negative error value
3087 * @remarks This function is only for App Framework internally.
3089 int aul_app_is_running_with_instance_id(const char *appid,
3090 const char *instance_id, bool *running);
3093 * @brief Sends a preparation request for an app-defined loader.
3096 * @param[in] loader_name The loader name
3097 * @return @c the loader ID on success,
3098 * otherwise a negative error value
3100 * @remarks This function is only for App Framework internally.
3102 int aul_prepare_app_defined_loader(const char *loader_name);
3103 int aul_prepare_app_defined_loader_for_uid(const char *loader_name, uid_t uid);
3106 * @remarks This function is only for App Framework internally.
3108 int aul_status_update_v2(int status);
3111 * @remarks This function is only for App Framework internally.
3113 int aul_get_default_app(bundle *b, char **appid);
3116 * @remarks This function is only for App Framework internally.
3118 int aul_set_auto_restart(bundle *b);
3121 * @remarks This function is only for App Framework internally.
3123 int aul_unset_auto_restart(void);
3126 * @remarks This function is only for App Framework internally.
3128 int aul_package_pre_event_send(uid_t uid, bundle *b);
3131 * @remarks This function is only for App Framework internally.
3133 int aul_launch_worker_init(void);
3136 * @remarks This function is only for App Framework internally.
3138 void aul_launch_worker_fini(void);
3141 * @brief Called when the application ID is delivered.
3143 * @param[in] result The result
3144 * @param[in] pid The process ID
3145 * @param[in] appid The application ID
3146 * @param[in] user_data The user data passed from the regitration function
3147 * @remarks This function is only for App Framework internally.
3148 * @see aul_app_get_appid_bypid_async()
3150 typedef void (*aul_appid_cb)(int result, pid_t pid, const char *appid, void *user_data);
3153 * @brief Gets the application ID from the process ID.
3155 * @param[in] pid The process ID
3156 * @param[in] callback The callback function
3157 * @param[in] user_data The user data to be passed to the callaback function
3158 * @return @c 0 on success,
3159 * otherwise a negative error value
3160 * @retval #AUL_R_OK Successful
3161 * @retval #AUL_R_EINVAL Invalid parameter
3162 * @retval #AUL_R_ENOMEM Out of memory
3163 * @retval #AUL_R_ERROR Internal I/O error
3164 * @remarks This function is only for App Framework internally.
3165 * @see aul_appid_cb()
3167 int aul_app_get_appid_bypid_async(pid_t pid, aul_appid_cb callback, void *user_data);
3170 * @brief Called when the result is delivered.
3172 * @param[in] result The result
3173 * @param[in] user_data The user data passed from the regitration function
3174 * @remarks This function is only for App Framework internally.
3176 typedef void (*aul_result_cb)(int result, void *user_data);
3179 * @brief Sends the termination request with the process ID.
3181 * @privilege %http://tizen.org/privilege/appmanager.kill
3182 * @privlevel platform
3183 * @param[in] pid The process ID
3184 * @param[in] callback The callback function
3185 * @param[in] user_data The user data to be passed to the callback function
3186 * @return @c 0 on success,
3187 * otherwise a negative error value
3188 * @retval #AUL_R_OK Successful
3189 * @retval #AUL_R_EINVAL Invalid parameter
3190 * @retval #AUL_R_ENOMEM Out of memory
3191 * @retval #AUL_R_ERROR Internal I/O error
3192 * @remarks This function is only for App Framework internally.
3193 * @see aul_result_cb()
3195 int aul_terminate_pid_async_v2(pid_t pid, aul_result_cb callback, void *user_data);
3198 * @brief Sends the termination request.
3200 * @privilege %http://tizen.org/privilege/appmanager.kill
3201 * @privlevel platform
3202 * @param[in] appid The application ID
3203 * @param[in] callback The callback function
3204 * @param[in] user_data The user data to be passed to the callback function
3205 * @return @c 0 on success,
3206 * otherwise a negative error value
3207 * @retval #AUL_R_OK Successful
3208 * @retval #AUL_R_EINVAL Invalid parameter
3209 * @retval #AUL_R_ENOMEM Out of memory
3210 * @retval #AUL_R_ERROR Internal I/O error
3211 * @remarks This function is only for App Framework internally.
3212 * @see aul_result_cb()
3214 int aul_terminate_app_async(const char *appid, aul_result_cb callback, void *user_data);
3217 * @brief Sends the request to kill the process ID.
3219 * @privilege %http://tizen.org/privilege/appmanager.kill
3220 * @privlevel platform
3221 * @param[in] pid The process ID
3222 * @param[in] callback The callback function
3223 * @param[in] user_data The user data to be passed to the callback function
3224 * @return @c 0 on success,
3225 * otherwise a negative error value
3226 * @retval #AUL_R_OK Successful
3227 * @retval #AUL_R_EINVAL Invalid parameter
3228 * @retval #AUL_R_ENOMEM Out of memory
3229 * @retval #AUL_R_ERROR Internal I/O error
3230 * @remarks This function is only for App Framework internally.
3231 * @see aul_result_cb()
3233 int aul_kill_pid_async(pid_t pid, aul_result_cb callback, void *user_data);
3236 * @Brief Called when the reply is delivered from the callee application.
3238 * @param[in] b The bundle object
3239 * @param[in] is_cancel If true, the request was cancelled
3240 * @param[in] user_data The user data passed from the registration function
3241 * @remarks This function is only for App Framework internally.
3242 * @see aul_send_launch_request_for_uid()
3244 typedef void (*aul_reply_cb)(bundle *b, int is_cancel, void *user_data);
3247 * @brief Sends the launch request asynchronously.
3249 * @privilege %http://tizen.org/privilege/appmanager.launch
3251 * @param[in] appid The application ID
3252 * @param[in] b The bundle object
3253 * @param[in] uid The target user ID
3254 * @param[in] reply_cb The reply callback function
3255 * @param[in] result_cb The result callback function
3256 * @param[in] user_data The user data to be passed to the callback function
3257 * @retrun @c 0 on success,
3258 * otherwise a negative error value
3259 * @retval #AUL_R_OK Successful
3260 * @retval #AUL_R_EINVAL Invalid parameter
3261 * @retval #AUL_R_ENOMEM Out of memory
3262 * @retval #AUL_R_ERROR Internal I/O error
3263 * @retval #AUL_R_ECOMM Communication error on send
3264 * @retval #AUL_R_EILLACC Permission denied
3265 * @remarks This function is only for App Framework internally.
3266 * @see aul_reply_cb()
3268 int aul_send_launch_request_for_uid(const char *appid, bundle *b, uid_t uid,
3269 aul_reply_cb reply_cb, aul_result_cb result_cb, void *user_data);