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_shared_data_path_by_appid(const char *app_id, char **path);
2010 * This API is only for Appfw internally.
2012 int aul_get_app_shared_resource_path_by_appid(const char *app_id, char **path);
2015 * This API is only for Appfw internally.
2017 int aul_get_app_shared_trusted_path_by_appid(const char *app_id, char **path);
2020 * This API is only for Appfw internally.
2022 int aul_get_app_external_shared_data_path_by_appid(const char *app_id, char **path);
2025 * This API is only for Appfw internally.
2027 int aul_get_usr_app_shared_data_path_by_appid(const char *app_id, char **path, uid_t uid);
2030 * This API is only for Appfw internally.
2032 int aul_get_usr_app_shared_resource_path_by_appid(const char *app_id, char **path, uid_t uid);
2035 * This API is only for Appfw internally.
2037 int aul_get_usr_app_shared_trusted_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_external_shared_data_path_by_appid(const char *app_id, char **path, uid_t uid);
2045 * This type is only for Appfw internally.
2047 typedef int (*subapp_fn)(void *data);
2050 * This API is only for Appfw internally.
2052 int aul_set_subapp(subapp_fn cb, void *data);
2055 * This API is only for Appfw internally.
2057 int aul_subapp_terminate_request_pid(int pid);
2060 * This API is only for Appfw internally.
2062 int aul_is_subapp(void);
2065 * This API is only for Appfw internally.
2067 int aul_kill_pid(int pid);
2070 * This API is only for Appfw internally.
2072 int aul_add_caller_cb(int pid, void (*caller_cb) (int, void *), void *data);
2075 * This API is only for Appfw internally.
2077 int aul_remove_caller_cb(int pid, void *data);
2080 * This API is only for Appfw internally.
2082 int aul_invoke_caller_cb(void *data);
2085 * This API is only for Appfw internally.
2087 void aul_set_preinit_window(void *evas_object);
2090 * This API is only for Appfw internally.
2092 void* aul_get_preinit_window(const char *win_name);
2095 * This API is only for Appfw internally.
2097 void aul_set_preinit_background(void *evas_object);
2100 * This API is only for Appfw internally.
2102 void* aul_get_preinit_background(void);
2105 * This API is only for Appfw internally.
2107 void aul_set_preinit_conformant(void *evas_object);
2110 * This API is only for Appfw internally.
2112 void* aul_get_preinit_conformant(void);
2115 * This API is only for Appfw internally.
2117 void aul_set_preinit_appid(const char *appid);
2120 * This API is only for Appfw internally.
2122 void aul_set_preinit_pkgid(const char *pkgid);
2125 * This API is only for Appfw internally.
2127 void aul_set_preinit_root_path(const char *root_path);
2130 * This API is only for Appfw internally.
2132 const char *aul_get_preinit_root_path(void);
2135 * This API is only for Appfw internally.
2137 int aul_update_freezer_status(int pid, const char* type);
2140 * This API is only for Appfw internally.
2142 int aul_send_app_launch_request_signal(int pid, const char* appid, const char* pkgid, const char* type);
2145 * This API is only for Appfw internally.
2147 int aul_send_app_resume_request_signal(int pid, const char* appid, const char* pkgid, const char *type);
2150 * This API is only for Appfw internally.
2152 int aul_send_app_terminate_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_status_change_signal(int pid, const char* appid, const char* pkgid, const char* status, const char *type);
2160 * This API is only for Appfw internally.
2162 int aul_send_app_terminated_signal(int pid);
2165 * This API is only for Appfw internally.
2167 int aul_send_app_group_signal(int owner_pid, int child_pid, const char *child_pkgid);
2170 * This API is only for Appfw internally.
2172 int aul_invoke_status_local_cb(int status);
2175 * This type is only for Appfw internally.
2177 typedef int (*data_control_provider_handler_fn) (bundle *b, int request_id, void *data);
2180 * This API is only for Appfw internally.
2182 int aul_set_data_control_provider_cb(data_control_provider_handler_fn handler);
2185 * This API is only for Appfw internally.
2187 int aul_unset_data_control_provider_cb(void);
2190 * This API is only for Appfw internally.
2192 int aul_pause_app(const char *appid);
2195 * This API is only for Appfw internally.
2197 int aul_pause_app_for_uid(const char *appid, uid_t uid);
2200 * This API is only for Appfw internally.
2202 int aul_pause_pid(int pid);
2205 * This API is only for Appfw internally.
2207 int aul_pause_pid_for_uid(int pid, uid_t uid);
2210 * This API is only for Appfw internally.
2212 int aul_reload_appinfo(void);
2215 * This API is only for Appfw internally.
2217 int aul_status_update(int status);
2220 * This API is only for Appfw internally.
2222 int aul_app_group_get_window(int pid);
2225 * This API is only for Appfw internally.
2227 int aul_app_group_set_window(int wid);
2230 * This API is only for Appfw internally.
2232 void aul_app_group_get_leader_pids(int *cnt, int **pids);
2235 * This API is only for Appfw internally.
2237 void aul_app_group_get_group_pids(int leader_pid, int *cnt, int **pids);
2240 * This API is only for Appfw internally.
2242 int aul_app_group_get_leader_pid(int pid);
2245 * This API is only for Appfw internally.
2247 int aul_app_group_clear_top(void);
2250 * This API is only for Appfw internally.
2252 int aul_app_group_is_top(void);
2255 * This API is only for Appfw internally.
2257 int aul_app_group_get_fg_flag(int pid);
2260 * This API is only for Appfw internally.
2262 void aul_app_group_lower(int *exit);
2265 * This API is only for Appfw internally.
2267 void aul_app_group_get_idle_pids(int *cnt, int **pids);
2271 * This API puts some app below the caller app
2273 * This API's purpose is to reorder window stack limitedly.
2275 * @param[in] below_appid The appid to be reordered below the caller app
2276 * @return 0 success, negative value(<0) if fail
2279 * below_appid should be main app which have been launched before.
2280 * This API is only available in User Session.
2282 int aul_app_group_activate_below(const char *below_appid);
2286 * This API puts some app above the caller app
2288 * This API's purpose is to reorder window stack limitedly.
2290 * @param[in] above_appid The appid to be reordered above the caller app
2291 * @return 0 if success, negative value(<0) if fail
2294 * above_appid should be main app which have been launched before.
2295 * This API is only available in User Session.
2297 int aul_app_group_activate_above(const char *above_appid);
2300 * This API is only for Appfw internally.
2302 int aul_request_data_control_socket_pair(bundle *b, int *fd);
2305 * This API is only for Appfw internally.
2307 int aul_request_message_port_socket_pair(int *fd);
2310 * @brief Called when the system booting is completed.
2311 * @param[in] unused The unused parameter
2312 * @param[in] user_data The use data passed from the registration function
2313 * @return The return value is not used.
2315 * @see aul_listen_booting_done_signal();
2317 typedef int (*aul_booting_done_event_cb)(int unused, void *user_data);
2320 * @brief Registers a callback function to be invoked when the system booting is completed.
2321 * @param[in] callback The callback function
2322 * @param[in] user_data The user data to be passed to the callback function
2323 * @return @c 0 on success,
2324 * otherwise a negative error value
2326 * @see aul_booting_done_event_cb()a
2327 * @remarks This function is only available for App Framework internally.
2329 int aul_listen_booting_done_signal(aul_booting_done_event_cb, void *user_data);
2332 * @brief Called when the coodlown event occurs.
2333 * @param[in] status The cooldown status
2334 * @param[in] user_data The user data passed from the registration function
2335 * @return The return value is not used.
2337 * @see aul_listen_cooldown_signal()
2339 typedef int (*aul_cooldown_event_cb)(const char *status, void *user_data);
2342 * @brief Registers a callback function to be invoked when the cooldown event occurs.
2343 * @param[in] callback The callback function
2344 * @param[in] user_data The user data to be passed to the callback function
2345 * @return @c 0 on success,
2346 * otherwise a negative error value
2348 * @see aul_coodlown_event_cb()
2350 * @remarks This function is only available for App Framework internally.
2352 int aul_listen_cooldown_signal(int (*func) (const char *, void *), void *data);
2355 * @brief Called when the status of the app process is changed.
2356 * @details This function is called when the app process status is changed, after you register this callback using aul_listen_app_status_signal().
2357 * @param[in] pid The process ID
2358 * @param[in] status The status of the process
2359 * @param[in] user_data The user data passed from the registeration function
2361 * @see @aul_listen_app_status_signal()
2362 * @see #aul_process_status_e
2364 typedef int (*aul_app_status_changed_cb)(int pid, int status, void *user_data);
2367 * @brief Registers a callback function to be invoked when the process status is changed.
2368 * @remarks If the callback function is nullptr, the registered event will be deregistered.
2369 * @param[in] callback The callback function
2370 * @param[in] user_data The user data to be passed to the callback function
2371 * @return @c 0 on success,
2372 * otherwise a negative error value
2373 * @retval #AUL_R_OK Successful
2374 * @retval #AUL_R_ERROR Internal I/O error
2376 * @see @aul_app_status_changed_cb()
2377 * @see #aul_process_status_e
2379 * @remarks This function is only available for App Framework internally.
2384 * static int app_status_changed_cb(int pid, int status, void *user_data)
2386 * cosnt char *app_status;
2389 * case AUL_PROC_STATUS_LAUNCH:
2390 * app_status = "LAUNCHING";
2392 * case AUL_PROC_STATUS_FG:
2393 * app_status = "VISIBLE";
2395 * case AUL_PROC_STATUS_BG:
2396 * app_status = "BACKGROUND";
2398 * case AUL_PROC_STATUS_FOCUS:
2399 * app_status = "FOCUS";
2401 * case AUL_PROC_STATUS_HIDE:
2402 * app_status = "HIDE";
2405 * app_status = "UNKNOWN";
2409 * dlog_print(DLOG_INFO, LOG_TAG, "pid: %d, status: %%s(%d)", pid, app_status, status);
2413 * int listen_app_status_signal(void)
2417 * ret = aul_listen_app_status_signal(app_status_changed_cb, NULL);
2418 * if (ret != AUL_R_OK) {
2419 * dlog_print(DLOG_ERROR, LOG_TAG, "aul_listen_app_status_signal() is failed. error(%d)", ret);
2426 int aul_listen_app_status_signal(aul_app_status_changed_cb callback, void *user_data);
2429 * This API is only for Appfw internally.
2431 int aul_check_tep_mount(const char *tep_path);
2434 * This API is only for Appfw internally.
2436 int aul_is_tep_mount_dbus_done(const char *tep_string);
2439 * This API is only for Appfw internally.
2441 int aul_forward_app(const char *appid, bundle *kb);
2445 * This API create custom launchpad-loader
2447 * This API's purpose is to make a slot for custom loader.
2448 * Once it is made, added loader will make a candidate process to use.
2450 * @param[in] loader_path The file name of the custom loader binary including full path
2451 * @param[in] extra A bundle to be passed to the custom loader
2452 * @return Loader ID if success, negative value(<0) if fail
2455 * This API is only for Appfw internally.
2456 * This API is only available in User Session.
2458 int aul_add_loader(const char *loader_path, bundle *extra);
2462 * This API create custom launchpad-loader
2464 * This API's purpose is to make a slot for custom loader.
2465 * Once it is made, added loader will make a candidate process to use.
2467 * @param[in] loader_path The file name of the custom loader binary including full path
2468 * @param[in] extra A bundle to be passed to the custom loader
2469 * @param[in] uid User ID
2470 * @return Loader ID if success, negative value(<0) if fail
2473 * This API is only for Appfw internally.
2474 * This API is only available to System user.
2476 int aul_add_loader_for_uid(const char *loader_path, bundle *extra, uid_t uid);
2481 * This API destroy custom launchpad-loader
2483 * This API's purpose is to remove a slot for custom loader.
2484 * Once it is removed, the prepared process will be removed as well.
2486 * @param[in] loader_id Loader ID
2487 * @return 0 if success, negative value(<0) if fail
2490 * This API is only for Appfw internally.
2491 * This API is only available in User Session.
2493 int aul_remove_loader(int loader_id);
2497 * This API destroy custom launchpad-loader
2499 * This API's purpose is to remove a slot for custom loader.
2500 * Once it is removed, the prepared process will be removed as well.
2502 * @param[in] loader_id Loader ID
2503 * @param[in] uid User ID
2504 * @return 0 if success, negative value(<0) if fail
2507 * This API is only for Appfw internally.
2508 * This API is only available to System user.
2510 int aul_remove_loader_for_uid(int loader_id, uid_t uid);
2514 * This API gets specified application process id.
2516 * The purpose of this API is to get the pid of specified application.
2518 * @param[in] appid application name
2519 * @return callee's pid if success, negative value(<0) if fail
2522 * This API is only available in User Session.
2524 int aul_app_get_pid(const char *appid);
2528 * This API gets specified application process id.
2530 * The purpose of this API is to get the pid of specified application.
2532 * @param[in] appid application name
2533 * @param[in] uid User ID
2534 * @return callee's pid if success, negative value(<0) if fail
2537 * This API is only available to System user.
2539 int aul_app_get_pid_for_uid(const char *appid, uid_t uid);
2543 * This function update rua stat.
2545 * @param[in] b Bundle object contains caller and tag information.
2546 * @param[in] uid Target uid
2548 * @return 0 if success, negative value(<0) if fail
2550 * @remarks This API is only for Appfw internally.
2559 bundle *b = bundle_create();
2560 bundle_add_str(b, AUL_SVC_K_RUA_STAT_CALLER, caller);
2561 bundle_add_str(b, AUL_SVC_K_RUA_STAT_TAG, tag);
2563 r = aul_update_rua_stat_for_uid(b);
2568 int aul_update_rua_stat_for_uid(bundle *b, uid_t uid);
2572 * This function add rua history.
2574 * @param[in] b Bundle object Target Package name or app path.
2575 * @param[in] uid Target uid
2577 * @return 0 if success, negative value(<0) if fail
2579 * @remarks This API is only for Appfw internally.
2588 bundle *b = bundle_create();
2590 bundle_add_str(b, AUL_K_RUA_PKGNAME, pkg_name);
2592 bundle_add_str(b, AUL_K_RUA_APPPATH, app_path);
2594 r = aul_add_rua_history_for_uid(b);
2599 int aul_add_rua_history_for_uid(bundle *b, uid_t uid);
2603 * This function delete rua history.
2605 * @param[in] b Bundle object Target Package name. If NULL or has no value, delete all rua history.
2606 * @param[in] uid Target uid
2608 * @return 0 if success, negative value(<0) if fail
2610 * @remarks This API is only for Appfw internally.
2621 b = bundle_create();
2622 bundle_add_str(b, AUL_K_RUA_PKGNAME, pkg_name);
2624 r = aul_delete_rua_history_for_uid(b, getuid());
2629 int aul_delete_rua_history_for_uid(bundle *b, uid_t uid);
2634 * This function sets the default application(application id) associated with operatioin, uri and mime-type.
2636 * @param[in] b Bundle object Target application id and operation, uri and mime-type.
2638 * @return 0 if success, negative value(<0) if fail
2640 * @remarks This API is only for Appfw internally.
2645 #include <aul_svc.h>
2650 bundle *b = bundle_create();
2652 const char *appid = "org.tizen.test";
2653 const char *operation = "test_operation";
2654 const char *mime_type = "test_mime";
2655 const char *uri = "test_uri";
2657 aul_svc_set_operation(b, operation);
2658 aul_svc_set_mime(b, mime_type);
2659 aul_svc_set_uri(b, uri);
2661 aul_svc_set_appid(b, appid)
2663 r = aul_set_default_app_by_operation(b);
2668 int aul_set_default_app_by_operation(bundle *b);
2672 * This API unset the default application(application id) associated with operation, uri and mime-type.
2674 * @param[in] app_id The ID of the application
2676 * @return 0 if success, negative value(<0) if fail
2689 aul_unset_default_app_by_operation("org.tizen.test");
2694 int aul_unset_default_app_by_operation(const char *app_id);
2698 * Sends the launch request asynchronously.
2700 * @param[in] appid The application ID
2701 * @param[in] kb The Bundle data
2702 * @return a pid of the callee on success,
2703 * otherwise a negative error value
2704 * @retval AUL_R_OK - Successful
2705 * @retval AUL_R_EINVAL - Invalid parameter
2706 * @retval AUL_R_ECOM - Internal AUL IPC error
2707 * @retval AUL_R_ERROR - General error
2710 * This API is only available in User Session.
2711 * This API doesn't check whether the callee application is executed successfully.
2712 * If the caller application is equal to the callee application, this API can return AUL_R_OK.
2714 int aul_launch_app_async(const char *appid, bundle *kb);
2718 * Sends the launch request asynchronously.
2720 * @param[in] appid The application ID
2721 * @param[in] kb The Bundle data
2722 * @param[in] uid User ID
2723 * @return a pid of the callee on success,
2724 * otherwise a negative error value
2725 * @retval AUL_R_OK - Successful
2726 * @retval AUL_R_EINVAL - Invalid parameter
2727 * @retval AUL_R_ECOM - Internal AUL IPC error
2728 * @retval AUL_R_ERROR - General error
2731 * This API is only available to System user.
2732 * This API doesn't check whether the callee application is executed successfully.
2733 * If the caller application is equal to the callee application, this API can return AUL_R_OK.
2735 int aul_launch_app_async_for_uid(const char *appid, bundle *kb, uid_t uid);
2739 * This API request launchpad to make candidate processes.
2741 * @return 0 if success, negative value(<0) if fail
2744 * This API is only available in User Session.
2746 int aul_prepare_candidate_process(void);
2749 * This API is only for Appfw internally.
2751 int aul_widget_instance_add(const char *widget_id, const char *instance_id);
2754 * This API is only for Appfw internally.
2756 int aul_widget_instance_del(const char *widget_id, const char *instance_id);
2759 * This API is only for Appfw internally.
2761 typedef void (*aul_widget_instance_foreach_cb)(const char *instance_id, void *data);
2764 * This API is only for Appfw internally.
2766 int aul_widget_instance_foreach(const char *widget_id, aul_widget_instance_foreach_cb cb, void *data);
2769 * This API is only for Appfw internally.
2771 int aul_widget_instance_update(const char *widget_id, const char *instance_id, bundle *b);
2774 * This API is only for Appfw internally.
2776 int aul_widget_instance_count(const char *widget_id);
2780 * This API gets the last caller process id of specified application process id.
2782 * This API's purpose is to get the application's last caller process id.
2784 * @param[in] pid pid of application
2785 * @return caller pid if success, nagative value if fail
2788 * This API is only available in User Session.
2790 int aul_app_get_last_caller_pid(int pid);
2794 * This API gets the last caller process id of specified application process id.
2796 * This API's purpose is to get the last caller process id of the application.
2798 * @param[in] pid pid of application
2799 * @param[in] uid User ID
2800 * @return caller pid if success, nagative value if fail
2803 * This API is only available in System users.
2805 int aul_app_get_last_caller_pid_for_uid(int pid, uid_t uid);
2809 * This API trigger to resume application asynchronously.
2810 * If the application is running, this API send a resume event to the App.
2811 * If the application is not running, this API return AUL_R_ERROR.
2812 * Although the application is running, if the application cannot receive resume event,
2813 * AUL try to raise the application's default windows.
2815 * This API is for caller.
2816 * This API's purpose is to send resume event.
2817 * @par Typical use case:
2818 * In multiple application model, If you want to only resume specific application, Use this API
2820 * @param[in] pid application's pid to be resumed
2821 * @return 0 if success, negative value(<0) if fail
2822 * @retval AUL_R_OK - success
2823 * @retval AUL_R_EINVAL - invaild pid
2824 * @retval AUL_R_ECOM - internal AUL IPC error
2825 * @retval AUL_R_ERROR - general error (include application is not running)
2826 * @warning This API need to require root or inhouse permisssion \n
2827 * If you have not the permission, this API return AUL_R_ERROR. \n
2829 * This API is only available to User Session.
2831 int aul_resume_pid_async(int pid);
2835 * This API trigger to resume application asynchronously.
2836 * If the application is running, this API send a resume event to the App.
2837 * If the application is not running, this API return AUL_R_ERROR.
2838 * Although the application is running, if the application cannot receive resume event,
2839 * AUL try to raise the application's default windows.
2841 * This API is for caller.
2842 * This API's purpose is to send resume event.
2843 * @par Typical use case:
2844 * In multiple application model, If you want to only resume specific application, Use this API
2846 * @param[in] pid application's pid to be resumed
2847 * @param[in] uid User ID
2848 * @return 0 if success, negative value(<0) if fail
2849 * @retval AUL_R_OK - success
2850 * @retval AUL_R_EINVAL - invaild pid
2851 * @retval AUL_R_ECOM - internal AUL IPC error
2852 * @retval AUL_R_ERROR - general error (include application is not running)
2853 * @warning This API need to require root or inhouse permisssion \n
2854 * If you have not the permission, this API return AUL_R_ERROR. \n
2856 * This API is only available to System user.
2858 int aul_resume_pid_async_for_uid(int pid, uid_t uid);
2862 * This API set the alias appid.
2863 * The alias appid is only available for the aul_svc_set_appid() API.
2864 * If the appid is not available, this API returns an error.
2866 * @privlevel platform
2867 * @privilege %http://tizen.org/privilege/systemsettings.admin
2868 * @param[in] alias_appid an alias application ID
2869 * @param[in] appid an application ID
2870 * @return 0 if success, negative value(<0) if fail
2873 * This API is only available to User Session.
2875 int aul_set_alias_appid(const char *alias_appid, const char *appid);
2879 * This API unset the alias appid.
2881 * @privlevel platform
2882 * @privilege %http://tizen.org/privilege/systemsettings.admin
2883 * @param[in] alias_appid an alias application ID
2884 * @return 0 if success, negative value(<0) if fail
2887 * This API is only available to User Session.
2889 int aul_unset_alias_appid(const char *alias_appid);
2893 * This API activates the alias information based on the given appid.
2895 * @privlevel platform
2896 * @privilege %http://tizen.org/privilege/systemsettings.admin
2897 * @param[in] appid an application ID
2898 * @return 0 if success, negative value(<0) if fail
2901 * This API is only available to User Session.
2903 int aul_enable_alias_info(const char *appid);
2907 * This API deactivates the alias information based on the given appid.
2909 * @privlebel platform
2910 * @privilege %http://tizen.org/privilege/systemsettings.admin
2911 * @param[in] appid an application ID
2912 * @return 0 if success, negative value(<0) if fail
2915 * This API is only available to User Session.
2917 int aul_disable_alias_info(const char *appid);
2920 * This API is only for Appfw internally.
2922 typedef int (*app_status_cb)(aul_app_info *info, int ctx_status, void *data);
2925 * This API is only for Appfw internally.
2927 typedef struct status_listen_s *status_listen_h;
2931 * Registers a callback function to be invoked when the application change status.
2933 * @param[in] appid The application ID to get status
2934 * @param[in] callback The callback function to register
2935 * @param[in] data The user data to be passed to the callback function
2936 * @param[out] handle The status listen handle
2937 * @return @c 0 on success,
2938 * otherwise a negative error value
2940 int aul_listen_app_status(const char *appid, app_status_cb callback,
2941 void *data, status_listen_h *handle);
2942 int aul_listen_app_status_for_uid(const char *appid, app_status_cb callback,
2943 void *data, status_listen_h *handle, uid_t uid);
2946 * This API is only for Appfw internally.
2948 int aul_widget_instance_get_content(const char *widget_id, const char *instance_id, char **content);
2952 * Gets running application instance info
2953 * This API calls the iter_fn with the aul_app_info when running app instance info is found.
2955 * @param[in] iter_fn iterative function
2956 * @param[in] user_data User data
2957 * @return 0 if success, negative value(<0) if fail
2958 * @retval AUL_R_OK Successful
2959 * @retval AUL_R_ERROR General error
2960 * @retval AUL_R_EINVAL Invalid parameter
2962 int aul_app_get_running_app_instance_info(aul_app_info_iter_fn iter_fn,
2964 int aul_app_get_running_app_instance_info_for_uid(aul_app_info_iter_fn iter_fn,
2965 void *user_data, uid_t uid);
2968 * This API is only for Appfw internally.
2970 int aul_app_get_instance_id_bypid(int pid, char *instance_id, int len);
2971 int aul_app_get_instance_id_bypid_for_uid(int pid, char *instance_id,
2972 int len, uid_t uid);
2975 * This API is only for Appfw internally.
2977 int aul_resume_app_by_instance_id(const char *appid, const char *instance_id);
2978 int aul_resume_app_by_instance_id_for_uid(const char *appid,
2979 const char *instance_id, uid_t uid);
2982 * This API is only for Appfw internally.
2984 int aul_ignore_app_status(status_listen_h handle);
2987 * This API is only for Appfw internally.
2989 int aul_notify_exit(void);
2990 int aul_notify_start(void);
2993 * This API is only for App Framework internally.
2995 const char *aul_app_status_convert_to_string(int status);
2998 * This API is only for App Framework internally.
3000 int aul_terminate_instance_async(const char *instance_id, int pid);
3001 int aul_terminate_instance_async_for_uid(const char *instance_id, int pid,
3005 * @brief Sends the terminate request.
3007 * @privlevel platform
3008 * @privilege %http://tizen.org/privilege/appmanager.kill
3010 * @param[in] appid The application ID
3011 * @param[in] instance_id The instance ID
3012 * @return @c 0 on success,
3013 * otherwise a negative error value
3015 * @remarks This function is only for App Framework internally.
3017 int aul_terminate_app_with_instance_id(const char *appid,
3018 const char *instance_id);
3021 * @brief Sends the terminate request.
3023 * @privlevel platform
3024 * @privilege %http://tizen.org/privilege/appmanager.kill
3026 * @param[in] appid The application ID
3027 * @param[in] instance_id The instance ID
3028 * @param[in] uid The user ID
3029 * @return @c 0 on success,
3030 * otherwise a negative error value
3032 * @remarks This function is only for App Framework internally.
3034 int aul_terminate_app_with_instance_id_for_uid(const char *appid,
3035 const char *instance_id, uid_t uid);
3038 * @brief Sends the terminate request.
3040 * @privlevel platform
3041 * @privilege %http://tizen.org/privilege/appmanager.kill
3043 * @param[in] appid The application ID
3044 * @return @c 0 on success,
3045 * otherwise a negative error value
3047 * @remarks This function is only for App Framework internally.
3049 int aul_terminate_app(const char *appid);
3052 * @brief Sends the terminate request.
3054 * @privlevel platform
3055 * @privilege %http://tizen.org/privilege/appmanager.kill
3057 * @param[in] appid The application ID
3058 * @param[in] uid The user ID
3059 * @return @c 0 on success,
3060 * otherwise a negative error value
3062 * @remarks This function is only for App Framework internally.
3064 int aul_terminate_app_for_uid(const char *appid, uid_t uid);
3067 * @brief Checks whether the application is running or not.
3070 * @param[in] appid The application ID
3071 * @param[in] instance_id The instance ID
3072 * @param[out] running @c true if the instance is running, \n
3073 * otherwise @c false if not running
3074 * @return @c 0 on success,
3075 * otherwise a negative error value
3077 * @remarks This function is only for App Framework internally.
3079 int aul_app_is_running_with_instance_id(const char *appid,
3080 const char *instance_id, bool *running);
3083 * @brief Sends a preparation request for an app-defined loader.
3086 * @param[in] loader_name The loader name
3087 * @return @c the loader ID on success,
3088 * otherwise a negative error value
3090 * @remarks This function is only for App Framework internally.
3092 int aul_prepare_app_defined_loader(const char *loader_name);
3093 int aul_prepare_app_defined_loader_for_uid(const char *loader_name, uid_t uid);
3096 * @remarks This function is only for App Framework internally.
3098 int aul_status_update_v2(int status);
3101 * @remarks This function is only for App Framework internally.
3103 int aul_get_default_app(bundle *b, char **appid);
3106 * @remarks This function is only for App Framework internally.
3108 int aul_set_auto_restart(bundle *b);
3111 * @remarks This function is only for App Framework internally.
3113 int aul_unset_auto_restart(void);
3116 * @remarks This function is only for App Framework internally.
3118 int aul_package_pre_event_send(uid_t uid, bundle *b);
3121 * @remarks This function is only for App Framework internally.
3123 int aul_launch_worker_init(void);
3126 * @remarks This function is only for App Framework internally.
3128 void aul_launch_worker_fini(void);