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>
33 * @brief Return values in AUL.
35 typedef enum _aul_return_val {
36 AUL_R_ENOENT = -15, /**< App directory entry error */
37 AUL_R_EREJECTED = -14, /**< App disable for mode */
38 AUL_R_ENOAPP = -13, /**< Failed to find app ID or pkg ID */
39 AUL_R_EHIDDENFORGUEST = -11, /**< App hidden for guest mode */
40 AUL_R_ENOLAUNCHPAD = -10, /**< no launchpad */
41 AUL_R_ETERMINATING = -9, /**< application terminating */
42 AUL_R_EILLACC = -8, /**< Illegal Access */
43 AUL_R_LOCAL = -7, /**< Launch by himself */
44 AUL_R_ETIMEOUT = -6, /**< Timeout */
45 AUL_R_ECANCELED = -5, /**< Operation canceled */
46 AUL_R_EINVAL = -4, /**< Invalid argument */
47 AUL_R_ECOMM = -3, /**< Comunication Error */
48 AUL_R_ENOINIT = -2, /**< AUL handler NOT initialized */
49 AUL_R_ERROR = -1, /**< General error */
50 AUL_R_OK = 0 /**< General success */
66 typedef enum _aul_type {
77 AUL_TERMINATE_BG_INST,
80 typedef enum aul_widget_lifecycle_event {
81 AUL_WIDGET_LIFE_CYCLE_EVENT_APP_DEAD = 0,
82 AUL_WIDGET_LIFE_CYCLE_EVENT_CREATE = 1, /**< The widget is created */
83 AUL_WIDGET_LIFE_CYCLE_EVENT_DESTROY = 2, /**< The widget is destroyed */
84 AUL_WIDGET_LIFE_CYCLE_EVENT_PAUSE = 3, /**< The widget is paused */
85 AUL_WIDGET_LIFE_CYCLE_EVENT_RESUME = 4 /**< The widget is resumed */
86 } aul_widget_lifecycle_event_e;
88 typedef enum aul_widget_instance_event {
89 AUL_WIDGET_INSTANCE_EVENT_CREATE = 0,
90 AUL_WIDGET_INSTANCE_EVENT_DESTROY = 1,
91 AUL_WIDGET_INSTANCE_EVENT_TERMINATE = 2,
92 AUL_WIDGET_INSTANCE_EVENT_PAUSE = 3,
93 AUL_WIDGET_INSTANCE_EVENT_RESUME = 4,
94 AUL_WIDGET_INSTANCE_EVENT_UPDATE = 5,
95 AUL_WIDGET_INSTANCE_EVENT_PERIOD_CHANGED = 6,
96 AUL_WIDGET_INSTANCE_EVENT_SIZE_CHANGED = 7,
97 AUL_WIDGET_INSTANCE_EVENT_EXTRA_UPDATED = 8,
98 AUL_WIDGET_INSTANCE_EVENT_FAULT = 9,
99 AUL_WIDGET_INSTANCE_EVENT_APP_RESTART_REQUEST = 10,
100 AUL_WIDGET_INSTANCE_EVENT_CREATE_ABORTED = 11
101 } aul_widget_instance_event_e;
103 typedef enum _aul_process_status {
104 AUL_PROC_STATUS_LAUNCH = 0,
105 AUL_PROC_STATUS_FG = 3,
106 AUL_PROC_STATUS_BG = 4,
107 AUL_PROC_STATUS_FOCUS = 5,
108 AUL_PROC_STATUS_HIDE = 7
109 } aul_process_status_e;
112 * @brief This is callback function for aul_launch_init
113 * @param[in] type event's type received from system
114 * @param[in] b In case of RESET events, bundle which is received from peer
115 * @param[in] data user-supplied data
117 typedef int (*aul_handler_fn)(aul_type type, bundle *b, void *data);
121 * This API install your AUL handler and setup AUL internal connection.
123 * AUL receive START(RESET), RESUME, TERMINATE events from system.\n
124 * This API use to handle the events. \n
125 * @par Typical use case:
126 * In general, you need not use this API.
127 * If you use AppCore, you should NOT use this API.
128 * AppCore will set default aul_handler.
130 * @param[in] handler aul main callback handler function
131 * @param[in] data user-supplied data for start_handler
132 * @return 0 if success, negative value(<0) if fail\n
133 * @retval AUL_R_OK - success
134 * @retval AUL_R_ECANCELD - aul handler was installed already by others
135 * @retval AUL_R_ECOMM - error to create internal ipc
136 * @retval AUL_R_ERROR - error to attach glib main loop
138 * @warning If you use AppCore, you should NOT use this API.\n
139 * You need glib main loop.\n
141 * you must have aul handler to use this API.
142 * aul_luanch_init register aul handler.
145 * #include <bundle.h>
147 * static int aul_handler(aul_type type, bundle *kb,void *data)
152 * // process RESET event
155 * // process RESUME event
157 * case AUL_TERMINATE:
158 * // preocess TERMINATE event
164 * static GMainLoop *mainloop = NULL;
166 * int main(int argc, char **argv)
168 * aul_launch_init(aul_handler,NULL);
169 * aul_launch_argv_handler(argc, argv);
171 * mainloop = g_main_loop_new(NULL, FALSE);
172 * g_main_loop_run(mainloop);
177 * This API is only available in User Session.
179 int aul_launch_init(aul_handler_fn handler, void *data);
183 * This API create internal RESET events with given argc, argv \n
185 * This API's purpose is to generate reset event.
186 * If you want to generate local RESET events with argument vector format, use this API
187 * @par Typical use case:
188 * In general, you need not use this API.
189 * AppCore use this API to create internal reset event.
191 * @param[in] argc # of args
192 * @param[in] argv list of arg strings
193 * @return 0 if success, negative value(<0) if fail
194 * @retval AUL_R_OK - success
195 * @retval AUL_R_ENOINIT - aul handler was NOT yet installed
196 * @retval AUL_R_ECANCLED - error to create internal bundle with given argc,argv.
197 * @retval AUL_R_ERROR - general error
200 * you must have aul handler to use this API.
201 * aul_luanch_init register aul handler.
206 * #include <bundle.h>
208 * int send_local_reset_event()
212 * argv[0] = "local.app";
213 * argv[1] = "event_type";
214 * argv[2] = "my_reset";
216 * aul_launch_argv_handler(argc,argv);
221 * If you use AppCore, you NEED NOT use this API.
222 * This API is only available in User Session.
224 int aul_launch_argv_handler(int argc, char **argv);
228 * This API creates internal RESET events with given bundle \n
230 * This API's purpose is to generate reset event.
231 * If you want to generate local RESET events with argument vector format, first use
232 * bundle_import_from_argv to create a bundle from the argument vector and then use this API
233 * Eventually, this API will replace aul_launch_argv_handler().
234 * @par Typical use case:
235 * In general, you need not use this API.
236 * AppCore use this API to create internal reset event.
238 * @param[in] b bundle
239 * @return 0 if success, negative value(<0) if fail
240 * @retval AUL_R_OK - success
241 * @retval AUL_R_ENOINIT - aul handler was NOT yet installed
242 * @retval AUL_R_ERROR - general error
245 * you must have aul handler to use this API.
246 * aul_luanch_init register aul handler.
250 * aul_launch_init, bundle_import_from_argv
253 * #include <bundle.h>
255 * int send_local_reset_event()
260 * argv[0] = "local.app";
261 * argv[1] = "event_type";
262 * argv[2] = "my_reset";
265 * b = bundle_import_from_argv(argc,argv);
266 * aul_launch_local(b);
271 * If you use AppCore, you NEED NOT to use this API.
272 * This API is only available in User Session.
274 int aul_launch_local(bundle *b);
278 * This API launches application with the given bundle.
279 * If the application is not running or a multiple-instance one, this API launches with the given bundle.
280 * If the application is running, this API sends a RESET event to the App.
281 * While the application is running, if the application cannot receive the RESET event,
282 * this API returns a general error(AUL_R_ERROR).\n
284 * This API is for caller.
285 * This API's purpose is to launch/reset application with given bundle.
286 * @par Typical use case:
287 * If you know the target application's pkgname and bundle types,
288 * you can use this API to launch/reset the application.
290 * @param[in] pkgname package name to be run as callee
291 * @param[in] kb bundle to be passed to callee
292 * @return callee's pid if success, negative value(<0) if fail
293 * @retval AUL_R_OK - success
294 * @retval AUL_R_EINVAL - invaild package name
295 * @retval AUL_R_ECOM - internal AUL IPC error
296 * @retval AUL_R_ERROR - general error
302 * #include <bundle.h>
304 * int launch_inhouse_contact_app()
307 * b = bundle_create();
308 * bundle_add(b,"type","SIM");
309 * aul_launch_app("org.tizen.contact",b);
314 * This API is only available in User Session.
316 int aul_launch_app(const char *appid, bundle *kb);
320 * This API launches application with the given bundle.
321 * If the application is not running or a multiple-instance one, this API launches with the given bundle.
322 * If the application is running, this API sends a RESET event to the App.
323 * While the application is running, if the application cannot receive the RESET event,
324 * this API returns a general error(AUL_R_ERROR).\n
326 * This API is for caller.
327 * This API's purpose is to launch/reset application with given bundle.
328 * @par Typical use case:
329 * If you know the target application's pkgname and bundle types,
330 * you can use this API to launch/reset the application.
332 * @param[in] pkgname package name to be run as callee
333 * @param[in] kb bundle to be passed to callee
334 * @param[in] uid User ID to launch
335 * @return callee's pid if success, negative value(<0) if fail
336 * @retval AUL_R_OK - success
337 * @retval AUL_R_EINVAL - invaild package name
338 * @retval AUL_R_ECOM - internal AUL IPC error
339 * @retval AUL_R_ERROR - general error
344 * This API is also available in System Session.
346 int aul_launch_app_for_uid(const char *appid, bundle *kb, uid_t uid);
350 * This API launches application, as menu screen launches the app.
351 * Thus, if the application is running, this API sends a RESUME event to the app.
352 * If the application is not running, this API launches the app.
353 * While the application is running, if the application cannot receive the RESUME event,
354 * AUL tries to raise the application's default window.
357 * This API is for caller.
358 * This API's purpose is to resume/launch application
359 * @par Typical use case:
360 * If you only want to show application with previous state or default state, Use this API.
362 * @param[in] pkgname package name to be resume as callee
363 * @return callee's pid if success, negative value(<0) if fail
364 * @retval AUL_R_OK - success
365 * @retval AUL_R_EINVAL - invaild package name
366 * @retval AUL_R_ECOM - internal AUL IPC error
367 * @retval AUL_R_ERROR - general error
370 * aul_launch_app, aul_app_is_running, aul_resume_pid
373 * #include <bundle.h>
375 * int open_inhouse_contact_app()
377 * if(aul_app_is_running("org.tizen.contact"))
378 * aul_open_app("org.tizen.contact");
383 * If you don't want to launch the app,
384 * you should check app's running state with aul_app_is_running.
385 * This API will launch the application if the application is not running.
386 * This API is only available in User Session.
388 int aul_open_app(const char *appid);
392 * This API launches application, as menu screen launches the app.
393 * Thus, if the application is running, this API sends a RESUME event to the app.
394 * If the application is not running, this API launches the app.
395 * While the application is running, if the application cannot receive the RESUME event,
396 * AUL tries to raise the application's default window.
399 * This API is for caller.
400 * This API's purpose is to resume/launch application
401 * @par Typical use case:
402 * If you only want to show application with previous state or default state, Use this API.
404 * @param[in] pkgname package name to be resume as callee
405 * @param[in] uid User ID
406 * @return callee's pid if success, negative value(<0) if fail
407 * @retval AUL_R_OK - success
408 * @retval AUL_R_EINVAL - invaild package name
409 * @retval AUL_R_ECOM - internal AUL IPC error
410 * @retval AUL_R_ERROR - general error
413 * If you don't want to launch the app,
414 * you should check app's running state with aul_app_is_running.
415 * This API will launch the application if the application is not running.
416 * This API is only available to System user.
418 int aul_open_app_for_uid(const char *appid, uid_t uid);
422 * This API trigger to resume application
423 * If the application is running, this API send a resume event to the App.
424 * If the application is not running, this API launches the app.
425 * Although the application is running, if the application cannot receive resume event,
426 * AUL try to raise the application's default windows.
428 * This API is for caller.
429 * This API's purpose is to send resume event.
430 * @par Typical use case:
431 * If you only want to show application with previous state or default state, Use this API.
433 * @param[in] pkgname package name to be resume as callee
434 * @return callee's pid if success, negative value(<0) if fail
435 * @retval AUL_R_OK - success
436 * @retval AUL_R_EINVAL - invaild package name
437 * @retval AUL_R_ECOM - internal AUL IPC error
438 * @retval AUL_R_ERROR - general error
441 * aul_launch_app(), aul_app_is_running(), aul_resume_pid()
444 * This function will be deprecated. Use aul_open_app() instead of this function.
448 * #include <bundle.h>
450 * int resume_inhouse_contact_app()
452 * if(aul_app_is_running("org.tizen.contact"))
453 * aul_resume_app("org.tizen.contact");
458 * If you don't want to launch the app,
459 * you should check app's running state with aul_app_is_running.
460 * This API will launch the application if the application is not running.
461 * If you want to only resume without launching in multiple instance application model,
462 * you should use aul_resume_pid.
463 * This API is only available in User Session.
465 int aul_resume_app(const char *appid);
469 * This API trigger to resume application
470 * If the application is running, this API send a resume event to the App.
471 * If the application is not running, this API launches the app.
472 * Although the application is running, if the application cannot receive resume event,
473 * AUL try to raise the application's default windows.
475 * This API is for caller.
476 * This API's purpose is to send resume event.
477 * @par Typical use case:
478 * If you only want to show application with previous state or default state, Use this API.
480 * @param[in] pkgname package name to be resume as callee
481 * @param[in] uid User ID
482 * @return callee's pid if success, negative value(<0) if fail
483 * @retval AUL_R_OK - success
484 * @retval AUL_R_EINVAL - invaild package name
485 * @retval AUL_R_ECOM - internal AUL IPC error
486 * @retval AUL_R_ERROR - general error
489 * If you don't want to launch the app,
490 * you should check app's running state with aul_app_is_running.
491 * This API will launch the application if the application is not running.
492 * If you want to only resume without launching in multiple instance application model,
493 * you should use aul_resume_pid.
494 * This API is only available to System user.
496 int aul_resume_app_for_uid(const char *appid, uid_t uid);
500 * This API trigger to resume application
501 * If the application is running, this API send a resume event to the App.
502 * If the application is not running, this API return AUL_R_ERROR.
503 * Although the application is running, if the application cannot receive resume event,
504 * AUL try to raise the application's default windows.
506 * This API is for caller.
507 * This API's purpose is to send resume event.
508 * @par Typical use case:
509 * In multiple application model, If you want to only resume specific application, Use this API
511 * @param[in] pid application's pid to be resumed
512 * @return 0 if success, negative value(<0) if fail
513 * @retval AUL_R_OK - success
514 * @retval AUL_R_EINVAL - invaild pid
515 * @retval AUL_R_ECOM - internal AUL IPC error
516 * @retval AUL_R_ERROR - general error (include application is not running)
517 * @warning This API need to require root or inhouse permisssion \n
518 * If you have not the permission, this API return AUL_R_ERROR. \n
523 * #include <bundle.h>
525 * int iterfunc(const aul_app_info *info, void *data)
527 * if(strcmp(info->pkg_name,"org.tizen.contact")==0)
528 * aul_resume_pid(info->pid);
531 * int iterate_running_apps()
533 * return aul_app_get_running_app_info(iterfunc,NULL);
538 * This API is only available in User Session.
540 int aul_resume_pid(int pid);
544 * This API trigger to resume application
545 * If the application is running, this API send a resume event to the App.
546 * If the application is not running, this API return AUL_R_ERROR.
547 * Although the application is running, if the application cannot receive resume event,
548 * AUL try to raise the application's default windows.
550 * This API is for caller.
551 * This API's purpose is to send resume event.
552 * @par Typical use case:
553 * In multiple application model, If you want to only resume specific application, Use this API
555 * @param[in] pid application's pid to be resumed
556 * @param[in] uid User ID
557 * @return 0 if success, negative value(<0) if fail
558 * @retval AUL_R_OK - success
559 * @retval AUL_R_EINVAL - invaild pid
560 * @retval AUL_R_ECOM - internal AUL IPC error
561 * @retval AUL_R_ERROR - general error (include application is not running)
562 * @warning This API need to require root or inhouse permisssion \n
563 * If you have not the permission, this API return AUL_R_ERROR. \n
565 * This API is only available to System user.
567 int aul_resume_pid_for_uid(int pid, uid_t uid);
571 * This API trigger to terminate application
573 * If the application is running, this API send a terminate event to the App. \n
574 * If the app cannot receive the event, AUL kill forcely the application.\n
576 * This API's purpose is to kill application
577 * @par Typical use case:
578 * In general, Application like Task Manager use this API.
580 * This API need to require root or inhouse permisssion. \n
582 * @param[in] pid application's pid to be terminated
583 * @return 0 if success, negative value(<0) if fail
584 * @retval AUL_R_OK - success
585 * @retval AUL_R_EINVAL - invaild pid
586 * @retval AUL_R_ECOM - internal AUL IPC error
587 * @retval AUL_R_ERROR - general error
588 * @warning This API need to require root or inhouse permisssion. \n
592 * #include <bundle.h>
594 * int iterfunc(const aul_app_info *info, void *data)
596 * if(strcmp(info->pkg_name,"org.tizen.contact")==0)
597 * aul_terminate_pid(info->pid);
600 * int iterate_running_apps()
602 * return aul_app_get_running_app_info(iterfunc,NULL);
607 * If you have not the permission, this API return AUL_R_ERROR. \n
608 * This API is only available in User Session.
610 int aul_terminate_pid(int pid);
614 * This API trigger to terminate application
616 * If the application is running, this API send a terminate event to the App. \n
617 * If the app cannot receive the event, AUL kill forcely the application.\n
619 * This API's purpose is to kill application
620 * @par Typical use case:
621 * In general, Application like Task Manager use this API.
623 * This API need to require root or inhouse permisssion. \n
625 * @param[in] pid application's pid to be terminated
626 * @param[in] uid User ID
627 * @return 0 if success, negative value(<0) if fail
628 * @retval AUL_R_OK - success
629 * @retval AUL_R_EINVAL - invaild pid
630 * @retval AUL_R_ECOM - internal AUL IPC error
631 * @retval AUL_R_ERROR - general error
632 * @warning This API need to require root or inhouse permisssion. \n
635 * If you have not the permission, this API return AUL_R_ERROR. \n
636 * This API is only available to System user.
638 int aul_terminate_pid_for_uid(int pid, uid_t uid);
642 * This API trigger to terminate application asynchronously
644 * If the application is running, this API send a terminate event to the App. \n
645 * If the app cannot receive the event, AUL kill forcely the application.\n
647 * This API's purpose is to kill application
648 * @par Typical use case:
649 * In general, Application like Task Manager use this API.
651 * This API need to require root or inhouse permisssion. \n
653 * @param[in] pid application's pid to be terminated
654 * @return 0 if success, negative value(<0) if fail
655 * @retval AUL_R_OK - success
656 * @retval AUL_R_EINVAL - invaild pid
657 * @retval AUL_R_ECOM - internal AUL IPC error
658 * @retval AUL_R_ERROR - general error
659 * @warning This API need to require root or inhouse permisssion. \n
661 * If you have not the permission, this API return AUL_R_ERROR. \n
662 * This API is only available in User Session.
664 int aul_terminate_pid_async(int pid);
668 * This API trigger to terminate application asynchronously
670 * If the application is running, this API send a terminate event to the App. \n
671 * If the app cannot receive the event, AUL kill forcely the application.\n
673 * This API's purpose is to kill application
674 * @par Typical use case:
675 * In general, Application like Task Manager use this API.
677 * This API need to require root or inhouse permisssion. \n
679 * @param[in] pid application's pid to be terminated
680 * @param[in] uid User ID
681 * @return 0 if success, negative value(<0) if fail
682 * @retval AUL_R_OK - success
683 * @retval AUL_R_EINVAL - invaild pid
684 * @retval AUL_R_ECOM - internal AUL IPC error
685 * @retval AUL_R_ERROR - general error
686 * @warning This API need to require root or inhouse permisssion. \n
688 * If you have not the permission, this API return AUL_R_ERROR. \n
689 * This API is only available to System user.
691 int aul_terminate_pid_async_for_uid(int pid, uid_t uid);
695 * This API trigger to terminate application synchronously
697 * If the application is running, this API sends a terminate event to the application. \n
698 * And then, this API waits until the application is terminated successfully. \n
699 * If the app cannot receive the event, AUL kill forcely the application. \n
701 * This API's purpose is to kill application
702 * @par Typical use case:
703 * In general, Application like Task Manager use this API.
705 * This API need to require root or platform level permisssion. \n
707 * @param[in] pid application's pid to be terminated
708 * @return 0 if success, negative value(<0) if fail
709 * @retval AUL_R_OK - success
710 * @retval AUL_R_EINVAL - invaild pid
711 * @retval AUL_R_ECOM - internal AUL IPC error
712 * @retval AUL_R_ERROR - general error
713 * @warning This API need to require root or platform level permisssion. \n
715 * If you have not the permission, this API return AUL_R_ERROR. \n
716 * This API is only available in User Session.
718 int aul_terminate_pid_sync(int pid);
722 * This API trigger to terminate application synchronously
724 * If the application is running, this API send a terminate event to the application. \n
725 * And then, this API waits until the application is terminated successfully. \n
726 * If the app cannot receive the event, AUL kill forcely the application. \n
728 * This API's purpose is to kill application
729 * @par Typical use case:
730 * In general, Application like Task Manager use this API.
732 * This API need to require root or platform level permisssion. \n
734 * @param[in] pid application's pid to be terminated
735 * @param[in] uid User ID
736 * @return 0 if success, negative value(<0) if fail
737 * @retval AUL_R_OK - success
738 * @retval AUL_R_EINVAL - invaild pid
739 * @retval AUL_R_ECOM - internal AUL IPC error
740 * @retval AUL_R_ERROR - general error
741 * @warning This API need to require root or platform level permisssion. \n
743 * If you have not the permission, this API return AUL_R_ERROR. \n
744 * This API is only available to System user.
746 int aul_terminate_pid_sync_for_uid(int pid, uid_t uid);
749 *@brief Running application's information structure retrieved by AUL
751 typedef struct _aul_app_info {
752 int pid; /**< app's pid if running*/
753 char *pkg_name; /**< application id */
754 char *app_path; /**< application excutable path */
756 char *pkgid; /**< package id */
757 int status; /**< app's status */
758 int is_sub_app; /**< state whether sub app of app group */
763 * @brief iterator function running with aul_app_get_running_app_info
764 * @param[out] ainfo aul_app_info retreived by aul_app_get_running_app_info
765 * @param[out] data user-supplied data
767 typedef int (*aul_app_info_iter_fn)(const aul_app_info *ainfo, void *data);
771 * This API ask a application is running by application package name.
773 * To know whether some application is running or not, use this API
774 * @par Typical use case:
775 * For example, If you want to know browser application running,
776 * you can check it by using this API.
778 * @param[in] pkgname application package name
779 * @return true / false
780 * @retval 1 app_name is running now.
781 * @retval 0 app_name is NOT running now.
786 * int is_running_browser_app()
788 * return aul_app_is_running("org.tizen.browser");
793 * This API is only available in User Session.
796 int aul_app_is_running(const char *appid);
800 * This API ask a application is running by application package name.
802 * To know whether some application is running or not, use this API
803 * @par Typical use case:
804 * For example, If you want to know browser application running,
805 * you can check it by using this API.
807 * @param[in] pkgname application package name
808 * @param[in] uid User ID
809 * @return true / false
810 * @retval 1 app_name is running now.
811 * @retval 0 app_name is NOT running now.
815 * This API is only available to System User.
817 int aul_app_is_running_for_uid(const char *appid, uid_t uid);
821 * This API use to get running application list.
822 * This API call iter_fn with each aul_app_info of running apps when running application is found.
824 * If you want to get running application list, use this API
825 * @par Typical use case:
826 * In general, this API is used by task manager appllication. (running application list viewer)
828 * @param[in] iter_fn iterator function
829 * @param[in] user_data user-supplied data for iter_fn
830 * @return 0 if success, negative value(<0) if fail
831 * @retval AUL_R_OK - success
832 * @retval AUL_R_ERROR - internal error
837 * int iterfunc(const aul_app_info* info, void* data)
839 * printf("\t==========================\n");
840 * printf("\t pkg_name: %s\n", info->appid);
841 * printf("\t app_path: %s\n", info->app_path);
842 * printf("\t running pid: %d\n", info->pid);
843 * printf("\t==========================\n");
847 * int iterate_running_apps()
849 * return aul_app_get_running_app_info(iterfunc,NULL);
854 * This API should use if you want to know running application which has desktop files.
855 * If you want to get all process list, you must iterate process information by using proc filesystem
856 * Or, If you want to get all window list, you must iterate XWindows by using XWindow APIs
857 * This API is only available in User Session.
859 int aul_app_get_running_app_info(aul_app_info_iter_fn iter_fn, void *user_data);
863 * This API use to get running application list.
864 * This API call iter_fn with each aul_app_info of running apps when running application is found.
866 * If you want to get running application list, use this API
867 * @par Typical use case:
868 * In general, this API is used by task manager appllication. (running application list viewer)
870 * @param[in] iter_fn iterator function
871 * @param[in] user_data user-supplied data for iter_fn
872 * @param[in] uid User ID
873 * @return 0 if success, negative value(<0) if fail
874 * @retval AUL_R_OK - success
875 * @retval AUL_R_ERROR - internal error
878 * This API should use if you want to know running application which has desktop files.
879 * If you want to get all process list, you must iterate process information by using proc filesystem
880 * Or, If you want to get all window list, you must iterate XWindows by using XWindow APIs
881 * This API is only available to System user.
883 int aul_app_get_running_app_info_for_uid(aul_app_info_iter_fn iter_fn, void *user_data, uid_t uid);
887 * This API use to get all running application list, including sub app.
888 * This API call iter_fn with each aul_app_info of running apps when running application is found.
890 * If you want to get all running application list, use this API
891 * @par Typical use case:
892 * In general, this API is used by task manager application. (running application list viewer)
894 * @param[in] iter_fn iterator function
895 * @param[in] user_data user-supplied data for iter_fn
896 * @return 0 if success, negative value(<0) if fail
897 * @retval AUL_R_OK - success
898 * @retval AUL_R_ERROR - internal error
903 * int iterfunc_status(const aul_app_info *info, void *data)
905 * printf("\t==========================\n");
906 * printf("\t pid: %d\n", info->pid);
907 * printf("\t appid: %s\n", info->appid);
908 * printf("\t app_path: %s\n", info->app_path);
909 * printf("\t pkgid: %s\n", info->pkgid);
910 * printf("\t status: %d\n", info->status);
911 * printf("\t is_sub_app : %d\n", info->is_sub_app);
912 * printf("\t==========================\n");
916 * int iterate_running_apps()
918 * return aul_app_get_all_running_app_info(iterfunc_status,NULL);
923 * This API should use if you want to know running application which has desktop files.
924 * If you want to get all process list, you must iterate process information by using proc filesystem
925 * Or, If you want to get all window list, you must iterate XWindows by using XWindow APIs
926 * This API is only available in User Session.
928 int aul_app_get_all_running_app_info(aul_app_info_iter_fn iter_fn, void *user_data);
932 * This API use to get all running application list, including sub app.
933 * This API call iter_fn with each aul_app_info of running apps when running application is found.
935 * If you want to get all running application list, use this API
936 * @par Typical use case:
937 * In general, this API is used by task manager application. (running application list viewer)
939 * @param[in] iter_fn iterator function
940 * @param[in] user_data user-supplied data for iter_fn
941 * @param[in] uid User ID
942 * @return 0 if success, negative value(<0) if fail
943 * @retval AUL_R_OK - success
944 * @retval AUL_R_ERROR - internal error
947 * This API should use if you want to know running application which has desktop files.
948 * If you want to get all process list, you must iterate process information by using proc filesystem
949 * Or, If you want to get all window list, you must iterate XWindows by using XWindow APIs
950 * This API is only available to System user.
952 int aul_app_get_all_running_app_info_for_uid(aul_app_info_iter_fn iter_fn, void *user_data, uid_t uid);
956 * This API get application package name by pid
958 * If you want to get package name of running application, use this API
959 * @par Typical use case:
960 * In general, You can use this API when you want to know caller's information.
962 * @param[in] pid given pid
963 * @param[out] pkgname pkgname to be get
964 * @param[in] len length of pkgname
965 * @return 0 if success, negative value(<0) if fail
966 * @retval AUL_R_OK - success
967 * @retval AUL_R_ERROR - no such a package name
970 * #include <bundle.h>
972 * static int app_reset(bundle *b, void *data)
977 * pid = atoi(bundle_get_val(b,AUL_K_CALLER_PID));
978 * aul_app_get_pkgname_bypid(pid, appname, sizeof(appname));
983 * This API is only available in User Session.
985 int aul_app_get_pkgname_bypid(int pid, char *pkgname, int len);
989 * This API get application pkgid by pid
991 * If you want to get pkgid of running application, use this API
992 * @par Typical use case:
993 * In general, You can use this API when you want to know caller's information.
995 * @param[in] pid given pid
996 * @param[out] pkgid package id
997 * @param[in] len length of pkgid
998 * @return 0 if success, negative value(<0) if fail
999 * @retval AUL_R_OK - success
1000 * @retval AUL_R_ERROR - no such a appid
1004 * #include <bundle.h>
1006 * static int app_reset(bundle *b, void *data)
1011 * pid = atoi(bundle_get_val(b, AUL_K_CALLER_PID));
1012 * aul_app_get_pkgid_bypid(pid, pkgid, sizeof(pkgid));
1017 * This API is only available in User Session.
1019 int aul_app_get_pkgid_bypid(int pid, char *pkgid, int len);
1023 * This API get application pkgid by pid
1025 * If you want to get pkgid of running application, use this API
1026 * @par Typical use case:
1027 * In general, You can use this API when you want to know caller's information.
1029 * @param[in] pid given pid
1030 * @param[out] pkgid package id
1031 * @param[in] len length of pkgid
1032 * @param[in] uid User ID
1033 * @return 0 if success, negative value(<0) if fail
1034 * @retval AUL_R_OK - success
1035 * @retval AUL_R_ERROR - no such a appid
1038 * This API is also available to System user.
1040 int aul_app_get_pkgid_bypid_for_uid(int pid, char *pkgid, int len, uid_t uid);
1044 * This API get application appid by pid
1046 * If you want to get appid of running application, use this API
1047 * @par Typical use case:
1048 * In general, You can use this API when you want to know caller's information.
1050 * @param[in] pid given pid
1051 * @param[out] appid application id
1052 * @param[in] len length of pkgname
1053 * @return 0 if success, negative value(<0) if fail
1054 * @retval AUL_R_OK - success
1055 * @retval AUL_R_ERROR - no such a appid
1058 * #include <bundle.h>
1060 * static int app_reset(bundle *b, void *data)
1065 * pid = atoi(bundle_get_val(b,AUL_K_CALLER_PID));
1066 * aul_app_get_appid_bypid(pid, appid, sizeof(appid));
1071 * This API is only available in User Session.
1073 int aul_app_get_appid_bypid(int pid, char *appid, int len);
1077 * This API get application appid by pid
1079 * If you want to get appid of running application, use this API
1080 * @par Typical use case:
1081 * In general, You can use this API when you want to know caller's information.
1083 * @param[in] pid given pid
1084 * @param[out] appid application id
1085 * @param[in] len length of pkgname
1086 * @param[in] uid User ID
1087 * @return 0 if success, negative value(<0) if fail
1088 * @retval AUL_R_OK - success
1089 * @retval AUL_R_ERROR - no such a appid
1091 * This API is also available to System user.
1093 int aul_app_get_appid_bypid_for_uid(int pid, char *appid, int len, uid_t uid);
1097 * This API launch application associated with given filename
1099 * This API is for caller.
1100 * This API launch application based on mime type.
1101 * This API find mime_type associated with file name,
1102 * and then find default app associated with found mime_type
1103 * and then launch the app with filename argument.
1104 * @par Typical use case:
1105 * You can launch application to process given filename.
1106 * That is, Even if you don't know the specific application's pkgname,
1107 * you can launch the applicaiton processing given filename .
1108 * For example, If you want to process image file, you can simply launch image viewer.
1109 * At that time, you can use this APIs like aul_open_file("myimage.jpg");
1111 * @param[in] filename filename
1112 * @return callee's pid or 0 if success, negative value if fail\n
1113 * (when no found default app, return 0)
1114 * @retval AUL_R_OK - success
1115 * @retval AUL_R_EINVAL - invalid argument(filename)
1116 * @retval AUL_R_ECOM - internal AUL IPC error
1117 * @retval AUL_R_ERROR - general error
1122 * int view_image_file(char *filename)
1124 * aul_open_file(filename);
1129 * This API is only available in User Session.
1132 int aul_open_file(const char* filename);
1136 * This API launch application associated with given specific mimetype
1138 * This API is for caller.
1139 * This API launch application based on mime type like aul_open_file API.
1140 * But, This API don't find mime_type associated with file name.
1141 * This API use mimetype given by user. By using given mimetype, find default application.
1142 * and then launch the app with filename argument.
1143 * @par Typical use case:
1144 * Some files cannot extract exact mimetype automatically.
1145 * For example, To know mime type of files with DRM lock, first we should unlock DRM file.
1146 * In this case, You can use this API.
1147 * First, unlock DRM file, and extract mimetype from unlock file by using aul_get_mime_from_file,
1148 * and then, use this API with DRM file and extracted mime type.
1150 * @param[in] filename filename
1151 * @param[in] mimetype specific mimetype
1152 * @return callee's pid or 0 if success, negative value if fail\n
1153 * (when no found default app, return 0)
1154 * @retval AUL_R_OK - success
1155 * @retval AUL_R_EINVAL - invalid argument(filename,mimetype)
1156 * @retval AUL_R_ECOM - internal AUL IPC error
1157 * @retval AUL_R_ERROR - general error
1160 * aul_open_file, aul_get_mime_from_file
1164 * int view_drm_image_file(char *drm_filename)
1167 * // you must implement this function
1168 * mimetype = get_mimetype_from_drmfile(drm_filename);
1170 * aul_open_file_with_mimetype(drm_filename,mimetype);
1175 * This API is only available in User Session.
1177 int aul_open_file_with_mimetype(const char *filename, const char *mimetype);
1181 * This API launch application associated with content like "http://www.samsung.com"
1183 * This API is for caller.
1184 * This API launch application based on mime type.
1185 * This API find mime_type associated with content,
1186 * and then find default app associated with found mime_type,
1187 * and then launch the app with content argument.
1188 * @par Typical use case:
1189 * You can launch application to process given content.
1190 * That is, Even if you don't know the specific application's pkgname,
1191 * you can launch the applicaiton processing given content.
1192 * For example, If you want to process URL "http://www.samsung.com",
1193 * you can simply launch browser.
1194 * At that time, you can use this APIs like aul_open_content("http://www.samsung.com");
1196 * @param[in] content content
1197 * @return callee's pid or 0 if success, negative value if fail\n
1198 * (when no found default app, return 0)
1199 * @retval AUL_R_OK - success
1200 * @retval AUL_R_EINVAL - invalid argument(content)
1201 * @retval AUL_R_ECOM - internal AUL IPC error
1202 * @retval AUL_R_ERROR - general error or no found mimetype
1207 * int view_url(char *url)
1209 * aul_open_content(url);
1214 * This API is only available in User Session.
1217 int aul_open_content(const char* content);
1221 * This API get the default application(appid) associated with MIME type
1223 * This API use to get default application associteted with mimetype
1224 * In general, Setting Application need this API.
1225 * @par Typical use case:
1226 * Setting Application show mapping of default application / mimetype
1228 * @param[in] mimetype a mime type
1229 * @param[out] defapp a application appid of the app
1230 * @param[in] len length of defapp
1231 * @return 0 if success, negative value if fail
1232 * @retval AUL_R_OK - success
1233 * @retval AUL_R_EINVAL - invalid argument(mimetype)
1234 * @retval AUL_R_ERROR - general error or no found mimetype
1237 * aul_set_defapp_with_mime
1241 * void get_text_html_defapp()
1243 * char appname[255];
1244 * aul_get_defapp_from_mime("text/html",appname,sizeof(appname));
1249 * This API is only available in User Session.
1252 int aul_get_defapp_from_mime(const char *mimetype, char *defapp, int len);
1256 * This API set the default application(appid) associated with MIME type
1258 * This API use to change default application associteted with mimetype
1259 * In general, Setting Application or Installer need this API.
1260 * @par Typical use case:
1261 * Default Application associated with mimetype can be changed by Setting Application or installer
1262 * So, application to process specific mimetype can be substituted.
1264 * @param[in] mimetype a mime type
1265 * @param[in] defapp a application appid of the app to be set
1266 * @return 0 if success, negative value if fail
1267 * @retval AUL_R_OK - success
1268 * @retval AUL_R_EINVAL - invalid argument(mimetype)
1269 * @retval AUL_R_ERROR - general error
1272 * aul_get_defapp_from_mime
1276 * void set_text_html_defapp()
1278 * aul_set_defapp_with_mime("text/html","org.tizen.browser");
1283 * This API is only available in User Session.
1285 int aul_set_defapp_with_mime(const char *mimetype, const char *defapp);
1289 * This API get the mimetype associated with filename
1291 * This API use to get mimetype associteted with given filename
1292 * In general, This API use when you want to know only mimetype given filename.
1293 * @par Typical use case:
1294 * For example, In trasfering data through bluetooth,
1295 * additional information like mimetype should be added.
1296 * In such situation, You can get mimetype by using this API.
1298 * @param[in] filename file name
1299 * @param[out] mimetype a mime type
1300 * @param[in] len length of mimetype
1301 * @return 0 if success, negative value if fail
1302 * @retval AUL_R_OK - success
1303 * @retval AUL_R_EINVAL - invalid argument(filename)
1304 * @retval AUL_R_ERROR - general error
1309 * void get_mimetype()
1311 * char mimetype[255];
1312 * aul_get_mime_from_file("image.jpg",mimetype,sizeof(mimetype));
1317 * This API is only available in User Session.
1319 int aul_get_mime_from_file(const char *filename, char *mimetype, int len);
1323 * This API get the mimetype associated with given content
1325 * This API use to get mimetype associteted with given content
1326 * In general, This API use when you want to know only mimetype given content
1327 * @par Typical use case:
1328 * For example, In trasfering data through bluetooth,
1329 * additional information like mimetype should be added.
1330 * In such situation, You can get mimetype by using this API.
1332 * @param[in] content content string like "011-0000-0000"
1333 * @param[out] mimetype a mime type
1334 * @param[in] len length of mimetype
1335 * @return 0 if success, negative value if fail
1336 * @retval AUL_R_OK - success
1337 * @retval AUL_R_EINVAL - invalid argument(content)
1338 * @retval AUL_R_ERROR - general error
1343 * void get_mimetype()
1345 * char mimetype[255];
1346 * aul_get_mime_from_content("http://www.samsung.com",mimetype,sizeof(mimetype));
1351 * This API is only available in User Session.
1353 int aul_get_mime_from_content(const char *content, char *mimetype, int len);
1357 * This API get the icon's name associated with given mimetype
1359 * This API use to get icon's name associteted with given mimetype
1360 * @par Typical use case:
1361 * If you want to show mimetype's icon, use this API.
1363 * @param[in] mimetype a mime type
1364 * @param[out] iconname icon's name
1365 * @param[in] len length of iconname
1366 * @return 0 if success, negative value if fail
1367 * @retval AUL_R_OK - success
1368 * @retval AUL_R_EINVAL - invalid argument(content)
1369 * @retval AUL_R_ERROR - general error (no such mime type)
1374 * void get_mime_icon()
1377 * aul_get_mime_icon("text/html",icon,sizeof(icon));
1382 * This API is only available in User Session.
1384 int aul_get_mime_icon(const char *mimetype, char *iconname, int len);
1388 * This API get the extensions associated with given mimetype
1390 * This API use to get extensions associteted with given mimetype
1391 * @par Typical use case:
1392 * In general, user is not familiar with mimetype(text/html),
1393 * user is familiar with extenstions(*.html, *.htm)
1394 * So, To show mimetype information to user, use this API
1396 * @param[in] mimetype a mime type
1397 * @param[out] extlist extentions (ex> mpeg,mpg,mpe)
1398 * @param[in] len length of extlist
1399 * @return 0 if success, negative value if fail
1400 * @retval AUL_R_OK - success
1401 * @retval AUL_R_EINVAL - invalid argument(mimetype)
1402 * @retval AUL_R_ERROR - general error (no mimetype or no extenstion)
1405 * aul_get_mime_description
1409 * void get_extension()
1411 * char extlist[255];
1412 * aul_get_mime_extension("text/html",extlist,sizeof(extlist));
1417 * Some mimetype don't have extension.
1418 * In that case, You can use aul_get_mime_description.
1419 * This API is only available in User Session.
1421 int aul_get_mime_extension(const char *mimetype, char *extlist, int len);
1425 * This API get the description associated with given mimetype
1427 * This API use to get description associteted with given mimetype
1428 * @par Typical use case:
1429 * In general, user is not familiar with mimetype(text/html),
1430 * user is familiar with well-knowing information like extenstions(*.html, *.htm)
1431 * But, some mimetype don't have extenstion.
1432 * At that time,to show mimetype information to user, use this API
1434 * @param[in] mimetype a mime type
1435 * @param[out] desc description (ex> Call client)
1436 * @param[in] len length of desc
1437 * @return 0 if success, negative value if fail
1438 * @retval AUL_R_OK - success
1439 * @retval AUL_R_EINVAL - invalid argument(mimetype)
1440 * @retval AUL_R_ERROR - general error (no mimetype or no descrition)
1443 * aul_get_mime_extension
1447 * void get_information_from_mime()
1450 * if(aul_get_mime_extension("text/html",info,sizeof(info))<0){
1451 * aul_get_mime_description("text/html",info,sizeof(info));
1457 * This API is only available in User Session.
1459 int aul_get_mime_description(const char *mimetype, char *desc, int len);
1463 * This API create service result bundle based on bundle received in reset event.
1465 * This API use to create result bundle to send it to caller.
1466 * @par Typical use case:
1467 * This API is for callee which provide application service.\n
1468 * To send result to caller, You must create result bundle. \n
1469 * Callee(application providing the service) can send result by using this API and aul_send_service_result.
1471 * @param[in] inb bundle received in reset event
1472 * @param[out] outb bundle to use for returning result
1473 * @return 0 if success, negative value(<0) if fail
1474 * @retval AUL_R_OK - success
1475 * @retval AUL_R_EINVAL - inb is not bundle created by aul_open_service
1476 * @retval AUL_R_ERROR - general error
1479 * To create result bundle, You need received original bundle.
1480 * The original bundle can get from app_reset handler.
1484 * aul_send_service_result
1487 * #include <bundle.h>
1489 * int app_reset(bundle *b, void *data)
1491 * ad->recved_bundle = bundle_dup(b);
1496 * bundle* res_bundle;
1497 * aul_create_result_bundle(ad->recved_bundle,&res_bundle);
1498 * bundle_add(res_bundle, "result", "1");
1499 * aul_send_service_result(res_bundle);
1503 * This API is only available in User Session.
1506 int aul_create_result_bundle(bundle *inb, bundle **outb);
1510 * This API send service result to caller with bundle
1512 * This API is used to send result bundle to caller.
1513 * @par Typical use case:
1514 * This API is for callee which provide application service.\n
1515 * To send result to caller, You can use this API after creating result bundle. \n
1516 * Callee(application to provide service) can send result by using this API and aul_create_result_bundle.
1518 * @param[in] b Result data in bundle format
1519 * @return 0 if success, negative value(<0) if fail
1520 * @retval AUL_R_OK - success
1521 * @retval AUL_R_EINVAL - invalid result bundle
1522 * @retval AUL_R_ECOMM - internal AUL IPC error
1523 * @retval AUL_R_ERROR - general error
1526 * To send result bundle, You must create result bundle.
1527 * see aul_create_result_bundle
1531 * aul_create_result_bundle
1534 * #include <bundle.h>
1536 * int app_reset(bundle *b, void *data)
1538 * ad->recved_bundle = bundle_dup(b);
1543 * bundle* res_bundle;
1544 * aul_create_result_bundle(ad->recved_bundle,&res_bundle);
1545 * bundle_add(res_bundle, "result", "1");
1546 * aul_send_service_result(res_bundle);
1550 * This API is only available in User Session.
1553 int aul_send_service_result(bundle *b);
1557 * This API sets callback fuction that will be called when applications die.
1559 * This API's purpose is to listen the application dead event.
1560 * In general, task manager Application need this API.
1562 * @param[in] func callback function
1563 * @param[in] data user data
1564 * @return 0 if success, negative value if fail
1565 * @retval AUL_R_OK - success
1566 * @retval AUL_R_ERROR - general error
1569 * aul_listen_app_launch_signal
1573 * int app_dead_handler(int pid, void *data)
1575 * printf("===> %s : %d\n", __FUNCTION__, pid);
1579 * void dead_listen()
1581 * aul_listen_app_dead_signal(app_dead_handler, NULL);
1586 * This API is only available in User Session.
1589 int aul_listen_app_dead_signal(int (*func) (int, void *), void *data);
1593 * This API sets callback fuction that will be called when applications are launched.
1595 * This API's purpose is to listen the application launching event.
1596 * In general, task manager Application need this API.
1598 * @param[in] func callback function
1599 * @param[in] data user data
1600 * @return 0 if success, negative value if fail
1601 * @retval AUL_R_OK - success
1602 * @retval AUL_R_ERROR - general error
1605 * aul_listen_app_dead_signal
1609 * int app_launch_handler(int pid, void *data)
1611 * printf("===> %s : %d\n", __FUNCTION__, pid);
1615 * void dead_listen()
1617 * aul_listen_app_launch_signal(app_launch_handler, NULL);
1622 * This API is only available in User Session.
1625 int aul_listen_app_launch_signal(int (*func) (int, void *), void *data);
1629 * This API sets callback fuction that will be called when applications are launched.
1631 * This API's purpose is to listen the application launching event.
1632 * In general, task manager Application need this API.
1634 * @param[in] func callback function
1635 * @param[in] data user data
1636 * @return 0 if success, negative value if fail
1637 * @retval AUL_R_OK - success
1638 * @retval AUL_R_ERROR - general error
1641 * aul_listen_app_dead_signal
1645 * int app_launch_handler(int pid, const char *app_id, void *data)
1647 * printf("===> %s : %d, %s\n", __FUNCTION__, pid, app_id);
1651 * void dead_listen()
1653 * aul_listen_app_launch_signal(app_launch_handler, NULL);
1658 * This API is only available in User Session.
1661 int aul_listen_app_launch_signal_v2(int (*func) (int, const char *, void *), void *data);
1665 * This API gets status of specified application process id.
1667 * This API's purpose is to get the application's status.
1669 * @param[in] pid pid of application
1670 * @return 0 or greater if success, nagative value if fail
1671 * @retval STATUS_LAUNCHING
1672 * @retval STATUS_VISIBLE
1674 * @retval STATUS_DYING
1675 * @retval STATUS_NORESTART
1681 * int iterfunc(const aul_app_info *info, void *data)
1684 * status = aul_app_get_status_bypid(info->pid);
1685 * if (status == STATUS_VISIBLE) {
1686 * printf("%s has focus", info->app_id);
1687 * (int *)data = info->pid;
1693 * int find_focus_app_pid()
1696 * aul_app_get_running_app_info(iterfunc, &pid);
1701 * This API is only available in User Session.
1703 int aul_app_get_status_bypid(int pid);
1707 * This API gets status of specified application process id.
1709 * This API's purpose is to get the application's status.
1711 * @param[in] pid pid of application
1712 * @param[in] uid User ID
1713 * @return 0 or greater if success, nagative value if fail
1714 * @retval STATUS_LAUNCHING
1715 * @retval STATUS_VISIBLE
1717 * @retval STATUS_DYING
1718 * @retval STATUS_NORESTART
1721 * This API is only available to System user.
1723 int aul_app_get_status_bypid_for_uid(int pid, uid_t uid);
1727 * This API gets the status of specified application id.
1729 * This API's purpose is to get the status of the application.
1731 * @param[in] appid application ID
1732 * @return 0 or greater if success, nagative value if fail
1733 * @retval STATUS_LAUNCHING
1734 * @retval STATUS_FOCUS
1735 * @retval STATUS_VISIBLE
1737 * @retval STATUS_DYING
1738 * @retval STATUS_NORESTART
1748 * status = aul_app_get_status("org.tizen.helloworld");
1749 * if (status == STATUS_FOCUS)
1750 * printf("org.tizen.helloworld has focus");
1757 * This API is only available in User Session.
1759 int aul_app_get_status(const char *appid);
1763 * This API gets the status of specified application id.
1765 * This API's purpose is to get the status of the application
1767 * @param[in] appid application ID
1768 * @param[in] uid User 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
1778 * This API is only available to System user.
1780 int aul_app_get_status_for_uid(const char *appid, uid_t uid);
1784 * This API sets callback function that on application status changed.
1786 * This API's purpose is to listen the application's status changed within
1787 * the caller process. In general, a library that required to release resource on
1788 * application's status may use this API.
1790 * @param[in] func callback function
1791 * @param[in] data user data
1792 * @return 0 if success, negative value if fail
1793 * @retval AUL_R_OK - success
1794 * @retval AUL_R_ERROR - general error
1796 * aul_remove_status_local_cb
1800 * int status_changed(int status, void *data)
1802 * if (status == STATUS_VISIBLE)
1803 * printf("%d resume\n", getpid());
1805 * if (status == STATUS_BG)
1806 * printf("%d pause\n", getpid());
1809 * void listen_app_status()
1811 * aul_add_status_local_cb(status_changed, NULL);
1815 * This API is only available in User Session.
1818 int aul_add_status_local_cb(int (*func) (int, void *), void *data);
1822 * This API unsets callback function that on application status changed.
1824 * This API's purpose is to remove callback that added by
1825 * aul_add_status_local_cb.
1827 * @param[in] func callback function
1828 * @param[in] data user data
1829 * @return 0 if success, negative value if fail
1830 * @retval AUL_R_OK - success
1831 * @retval AUL_R_ERROR - general error
1834 * aul_add_status_local_cb
1838 * int status_changed(int status, void *data)
1840 * if (status == STATUS_VISIBLE)
1841 * printf("%d resume\n", getpid());
1843 * if (status == STATUS_BG)
1844 * printf("%d pause\n", getpid());
1847 * void listen_app_status()
1849 * aul_add_status_local_cb(status_changed, NULL);
1852 * void ignore_app_status()
1854 * aul_remove_status_local_cb(status_changed, NULL);
1859 * This API is only available in User Session.
1862 int aul_remove_status_local_cb(int (*func) (int, void *), void *data);
1865 * This API is only for appfw internally.
1867 int aul_set_process_group(int parent_pid, int child_pid);
1870 * This API is only for Appfw internally.
1872 int aul_terminate_bgapp_pid(int pid);
1875 * This API is only for Appfw internally.
1877 int aul_terminate_pid_without_restart(int pid);
1880 * This API is only for Appfw internally.
1882 int aul_terminate_pid_sync_without_restart(int pid);
1885 * This API is only for Appfw internally.
1887 int aul_terminate_pid_sync_without_restart_for_uid(int pid, uid_t uid);
1890 * This API is only for Appfw internally.
1892 const char *aul_get_app_external_root_path(void);
1895 * This API is only for Appfw internally.
1897 const char *aul_get_app_root_path(void);
1900 * This API is only for Appfw internally.
1902 const char *aul_get_app_data_path(void);
1905 * This API is only for Appfw internally.
1907 const char *aul_get_app_cache_path(void);
1910 * This API is only for Appfw internally.
1912 const char *aul_get_app_resource_path(void);
1915 * This API is only for Appfw internally.
1917 const char *aul_get_app_tep_resource_path(void);
1920 * This API is only for Appfw internally.
1922 int aul_get_app_shared_data_path(char **path);
1925 * This API is only for Appfw internally.
1927 const char *aul_get_app_shared_resource_path(void);
1930 * This API is only for Appfw internally.
1932 const char *aul_get_app_shared_trusted_path(void);
1935 * This API is only for Appfw internally.
1937 const char *aul_get_app_external_data_path(void);
1940 * This API is only for Appfw internally.
1942 const char *aul_get_app_external_cache_path(void);
1945 * This API is only for Appfw internally.
1947 const char *aul_get_app_external_shared_data_path(void);
1950 * This API is only for Appfw internally.
1952 const char *aul_get_app_specific_path(void);
1955 * This API is only for Appfw internally.
1957 int aul_get_app_shared_data_path_by_appid(const char *app_id, char **path);
1960 * This API is only for Appfw internally.
1962 int aul_get_app_shared_resource_path_by_appid(const char *app_id, char **path);
1965 * This API is only for Appfw internally.
1967 int aul_get_app_shared_trusted_path_by_appid(const char *app_id, char **path);
1970 * This API is only for Appfw internally.
1972 int aul_get_app_external_shared_data_path_by_appid(const char *app_id, char **path);
1975 * This API is only for Appfw internally.
1977 int aul_get_usr_app_shared_data_path_by_appid(const char *app_id, char **path, uid_t uid);
1980 * This API is only for Appfw internally.
1982 int aul_get_usr_app_shared_resource_path_by_appid(const char *app_id, char **path, uid_t uid);
1985 * This API is only for Appfw internally.
1987 int aul_get_usr_app_shared_trusted_path_by_appid(const char *app_id, char **path, uid_t uid);
1990 * This API is only for Appfw internally.
1992 int aul_get_usr_app_external_shared_data_path_by_appid(const char *app_id, char **path, uid_t uid);
1995 * This type is only for Appfw internally.
1997 typedef int (*subapp_fn)(void *data);
2000 * This API is only for Appfw internally.
2002 int aul_set_subapp(subapp_fn cb, void *data);
2005 * This API is only for Appfw internally.
2007 int aul_subapp_terminate_request_pid(int pid);
2010 * This API is only for Appfw internally.
2012 int aul_is_subapp(void);
2015 * This API is only for Appfw internally.
2017 int aul_kill_pid(int pid);
2020 * This API is only for Appfw internally.
2022 int aul_add_caller_cb(int pid, void (*caller_cb) (int, void *), void *data);
2025 * This API is only for Appfw internally.
2027 int aul_remove_caller_cb(int pid, void *data);
2030 * This API is only for Appfw internally.
2032 int aul_invoke_caller_cb(void *data);
2035 * This API is only for Appfw internally.
2037 void aul_set_preinit_window(void *evas_object);
2040 * This API is only for Appfw internally.
2042 void* aul_get_preinit_window(const char *win_name);
2045 * This API is only for Appfw internally.
2047 void aul_set_preinit_background(void *evas_object);
2050 * This API is only for Appfw internally.
2052 void* aul_get_preinit_background(void);
2055 * This API is only for Appfw internally.
2057 void aul_set_preinit_conformant(void *evas_object);
2060 * This API is only for Appfw internally.
2062 void* aul_get_preinit_conformant(void);
2065 * This API is only for Appfw internally.
2067 void aul_set_preinit_appid(const char *appid);
2070 * This API is only for Appfw internally.
2072 void aul_set_preinit_pkgid(const char *pkgid);
2075 * This API is only for Appfw internally.
2077 void aul_set_preinit_root_path(const char *root_path);
2080 * This API is only for Appfw internally.
2082 const char *aul_get_preinit_root_path(void);
2085 * This API is only for Appfw internally.
2087 int aul_update_freezer_status(int pid, const char* type);
2090 * This API is only for Appfw internally.
2092 int aul_send_app_launch_request_signal(int pid, const char* appid, const char* pkgid, const char* type);
2095 * This API is only for Appfw internally.
2097 int aul_send_app_resume_request_signal(int pid, const char* appid, const char* pkgid, const char *type);
2100 * This API is only for Appfw internally.
2102 int aul_send_app_terminate_request_signal(int pid, const char* appid, const char* pkgid, const char *type);
2105 * This API is only for Appfw internally.
2107 int aul_send_app_status_change_signal(int pid, const char* appid, const char* pkgid, const char* status, const char *type);
2110 * This API is only for Appfw internally.
2112 int aul_send_app_terminated_signal(int pid);
2115 * This API is only for Appfw internally.
2117 int aul_send_app_group_signal(int owner_pid, int child_pid, const char *child_pkgid);
2120 * This API is only for Appfw internally.
2122 int aul_invoke_status_local_cb(int status);
2125 * This type is only for Appfw internally.
2127 typedef int (*data_control_provider_handler_fn) (bundle *b, int request_id, void *data);
2130 * This API is only for Appfw internally.
2132 int aul_set_data_control_provider_cb(data_control_provider_handler_fn handler);
2135 * This API is only for Appfw internally.
2137 int aul_unset_data_control_provider_cb(void);
2140 * This API is only for Appfw internally.
2142 int aul_pause_app(const char *appid);
2145 * This API is only for Appfw internally.
2147 int aul_pause_app_for_uid(const char *appid, uid_t uid);
2150 * This API is only for Appfw internally.
2152 int aul_pause_pid(int pid);
2155 * This API is only for Appfw internally.
2157 int aul_pause_pid_for_uid(int pid, uid_t uid);
2160 * This API is only for Appfw internally.
2162 int aul_reload_appinfo(void);
2165 * This API is only for Appfw internally.
2167 int aul_status_update(int status);
2170 * This API is only for Appfw internally.
2172 int aul_running_list_update(char *appid, char *app_path, char *pid);
2175 * This API is only for Appfw internally.
2177 int aul_app_group_get_window(int pid);
2180 * This API is only for Appfw internally.
2182 int aul_app_group_set_window(int wid);
2185 * This API is only for Appfw internally.
2187 void aul_app_group_get_leader_pids(int *cnt, int **pids);
2190 * This API is only for Appfw internally.
2192 void aul_app_group_get_group_pids(int leader_pid, int *cnt, int **pids);
2195 * This API is only for Appfw internally.
2197 int aul_app_group_get_leader_pid(int pid);
2200 * This API is only for Appfw internally.
2202 int aul_app_group_clear_top(void);
2205 * This API is only for Appfw internally.
2207 int aul_app_group_is_top(void);
2210 * This API is only for Appfw internally.
2212 int aul_app_group_get_fg_flag(int pid);
2215 * This API is only for Appfw internally.
2217 void aul_app_group_lower(int *exit);
2220 * This API is only for Appfw internally.
2222 void aul_app_group_get_idle_pids(int *cnt, int **pids);
2226 * This API puts some app below the caller app
2228 * This API's purpose is to reorder window stack limitedly.
2230 * @param[in] below_appid The appid to be reordered below the caller app
2231 * @return 0 success, negative value(<0) if fail
2234 * below_appid should be main app which have been launched before.
2235 * This API is only available in User Session.
2237 int aul_app_group_activate_below(const char *below_appid);
2241 * This API puts some app above the caller app
2243 * This API's purpose is to reorder window stack limitedly.
2245 * @param[in] above_appid The appid to be reordered above the caller app
2246 * @return 0 if success, negative value(<0) if fail
2249 * above_appid should be main app which have been launched before.
2250 * This API is only available in User Session.
2252 int aul_app_group_activate_above(const char *above_appid);
2255 * This API is only for Appfw internally.
2257 int aul_request_data_control_socket_pair(bundle *b, int *fd);
2259 * This API is only for Appfw internally.
2261 int aul_request_message_port_socket_pair(int *fd);
2263 * This API is only for Appfw internally.
2265 int aul_listen_booting_done_signal(int (*func) (int, void *), void *data);
2268 * This API is only for Appfw internally.
2270 int aul_listen_cooldown_signal(int (*func) (const char *, void *), void *data);
2274 * This API registers a callback function that will be called when the
2275 * status of the application is changed.
2277 * This API is for monitoring the status of all applications.
2279 * @param[in] func callback function. Please refer to 'app_status_handler' below.
2280 * @param[in] data user data
2281 * @return 0 if success, negative value if fail
2282 * @retval AUL_R_OK - success
2283 * @retval AUL_R_ERROR - general error
2285 * The callback will be invoked asynchronously.
2286 * It can't guarantee that the real status would not be changed during the callback is called.
2291 * int app_status_handler(int pid, int status, void *data)
2293 * const char *app_status;
2296 * case AUL_PROC_STATUS_LAUNCH:
2297 * app_status = "LAUNCHING";
2299 * case AUL_PROC_STATUS_FG:
2300 * app_status = "VISIBLE";
2302 * case AUL_PROC_STATUS_BG:
2303 * app_status = "BACKGROUND";
2305 * case AUL_PROC_STATUS_FOCUS:
2306 * app_status = "FOCUS";
2308 * case AUL_PROC_STATUS_HIDE:
2309 * app_status = "HIDE";
2312 * app_status = "UNKNOWN";
2315 * printf("pid: %d, status: %s", pid, status);
2319 * int main(int argc, char **argv)
2323 * ret = aul_listen_app_status_signal(app_status_handler, NULL);
2324 * if (ret != AUL_R_OK) {
2325 * printf("Failed to add status handler");
2335 int aul_listen_app_status_signal(int (*func)(int, int, void *), void *data);
2338 * This API is only for Appfw internally.
2340 int aul_check_tep_mount(const char *tep_path);
2343 * This API is only for Appfw internally.
2345 int aul_is_tep_mount_dbus_done(const char *tep_string);
2348 * This API is only for Appfw internally.
2350 int aul_forward_app(const char *appid, bundle *kb);
2354 * This API create custom launchpad-loader
2356 * This API's purpose is to make a slot for custom loader.
2357 * Once it is made, added loader will make a candidate process to use.
2359 * @param[in] loader_path The file name of the custom loader binary including full path
2360 * @param[in] extra A bundle to be passed to the custom loader
2361 * @return Loader ID if success, negative value(<0) if fail
2364 * This API is only for Appfw internally.
2365 * This API is only available in User Session.
2367 int aul_add_loader(const char *loader_path, bundle *extra);
2371 * This API create custom launchpad-loader
2373 * This API's purpose is to make a slot for custom loader.
2374 * Once it is made, added loader will make a candidate process to use.
2376 * @param[in] loader_path The file name of the custom loader binary including full path
2377 * @param[in] extra A bundle to be passed to the custom loader
2378 * @param[in] uid User ID
2379 * @return Loader ID if success, negative value(<0) if fail
2382 * This API is only for Appfw internally.
2383 * This API is only available to System user.
2385 int aul_add_loader_for_uid(const char *loader_path, bundle *extra, uid_t uid);
2390 * This API destroy custom launchpad-loader
2392 * This API's purpose is to remove a slot for custom loader.
2393 * Once it is removed, the prepared process will be removed as well.
2395 * @param[in] loader_id Loader ID
2396 * @return 0 if success, negative value(<0) if fail
2399 * This API is only for Appfw internally.
2400 * This API is only available in User Session.
2402 int aul_remove_loader(int loader_id);
2406 * This API destroy custom launchpad-loader
2408 * This API's purpose is to remove a slot for custom loader.
2409 * Once it is removed, the prepared process will be removed as well.
2411 * @param[in] loader_id Loader ID
2412 * @param[in] uid User ID
2413 * @return 0 if success, negative value(<0) if fail
2416 * This API is only for Appfw internally.
2417 * This API is only available to System user.
2419 int aul_remove_loader_for_uid(int loader_id, uid_t uid);
2423 * This API gets specified application process id.
2425 * The purpose of this API is to get the pid of specified application.
2427 * @param[in] appid application name
2428 * @return callee's pid if success, negative value(<0) if fail
2431 * This API is only available in User Session.
2433 int aul_app_get_pid(const char *appid);
2437 * This API gets specified application process id.
2439 * The purpose of this API is to get the pid of specified application.
2441 * @param[in] appid application name
2442 * @param[in] uid User ID
2443 * @return callee's pid if success, negative value(<0) if fail
2446 * This API is only available to System user.
2448 int aul_app_get_pid_for_uid(const char *appid, uid_t uid);
2452 * This function update rua stat.
2454 * @param[in] b Bundle object contains caller and tag information.
2455 * @param[in] uid Target uid
2457 * @return 0 if success, negative value(<0) if fail
2459 * @remarks This API is only for Appfw internally.
2468 bundle *b = bundle_create();
2469 bundle_add_str(b, AUL_SVC_K_RUA_STAT_CALLER, caller);
2470 bundle_add_str(b, AUL_SVC_K_RUA_STAT_TAG, tag);
2472 r = aul_update_rua_stat_for_uid(b);
2477 int aul_update_rua_stat_for_uid(bundle *b, uid_t uid);
2481 * This function add rua history.
2483 * @param[in] b Bundle object Target Package name or app path.
2484 * @param[in] uid Target uid
2486 * @return 0 if success, negative value(<0) if fail
2488 * @remarks This API is only for Appfw internally.
2497 bundle *b = bundle_create();
2499 bundle_add_str(b, AUL_K_RUA_PKGNAME, pkg_name);
2501 bundle_add_str(b, AUL_K_RUA_APPPATH, app_path);
2503 r = aul_add_rua_history_for_uid(b);
2508 int aul_add_rua_history_for_uid(bundle *b, uid_t uid);
2512 * This function delete rua history.
2514 * @param[in] b Bundle object Target Package name. If NULL or has no value, delete all rua history.
2515 * @param[in] uid Target uid
2517 * @return 0 if success, negative value(<0) if fail
2519 * @remarks This API is only for Appfw internally.
2530 b = bundle_create();
2531 bundle_add_str(b, AUL_K_RUA_PKGNAME, pkg_name);
2533 r = aul_delete_rua_history_for_uid(b, getuid());
2538 int aul_delete_rua_history_for_uid(bundle *b, uid_t uid);
2543 * This function sets the default application(application id) associated with operatioin, uri and mime-type.
2545 * @param[in] b Bundle object Target application id and operation, uri and mime-type.
2547 * @return 0 if success, negative value(<0) if fail
2549 * @remarks This API is only for Appfw internally.
2554 #include <aul_svc.h>
2559 bundle *b = bundle_create();
2561 const char *appid = "org.tizen.test";
2562 const char *operation = "test_operation";
2563 const char *mime_type = "test_mime";
2564 const char *uri = "test_uri";
2566 aul_svc_set_operation(b, operation);
2567 aul_svc_set_mime(b, mime_type);
2568 aul_svc_set_uri(b, uri);
2570 aul_svc_set_appid(b, appid)
2572 r = aul_set_default_app_by_operation(b);
2577 int aul_set_default_app_by_operation(bundle *b);
2581 * This API unset the default application(application id) associated with operation, uri and mime-type.
2583 * @param[in] app_id The ID of the application
2585 * @return 0 if success, negative value(<0) if fail
2598 aul_unset_default_app_by_operation("org.tizen.test");
2603 int aul_unset_default_app_by_operation(const char *app_id);
2607 * Sends the launch request asynchronously.
2609 * @param[in] appid The application ID
2610 * @param[in] kb The Bundle data
2611 * @return a pid of the callee on success,
2612 * otherwise a negative error value
2613 * @retval AUL_R_OK - Successful
2614 * @retval AUL_R_EINVAL - Invalid parameter
2615 * @retval AUL_R_ECOM - Internal AUL IPC error
2616 * @retval AUL_R_ERROR - General error
2619 * This API is only available in User Session.
2620 * This API doesn't check whether the callee application is executed successfully.
2621 * If the caller application is equal to the callee application, this API can return AUL_R_OK.
2623 int aul_launch_app_async(const char *appid, bundle *kb);
2627 * Sends the launch request asynchronously.
2629 * @param[in] appid The application ID
2630 * @param[in] kb The Bundle data
2631 * @param[in] uid User ID
2632 * @return a pid of the callee on success,
2633 * otherwise a negative error value
2634 * @retval AUL_R_OK - Successful
2635 * @retval AUL_R_EINVAL - Invalid parameter
2636 * @retval AUL_R_ECOM - Internal AUL IPC error
2637 * @retval AUL_R_ERROR - General error
2640 * This API is only available to System user.
2641 * This API doesn't check whether the callee application is executed successfully.
2642 * If the caller application is equal to the callee application, this API can return AUL_R_OK.
2644 int aul_launch_app_async_for_uid(const char *appid, bundle *kb, uid_t uid);
2648 * This API request launchpad to make candidate processes.
2650 * @return 0 if success, negative value(<0) if fail
2653 * This API is only available in User Session.
2655 int aul_prepare_candidate_process(void);
2658 * This API is only for Appfw internally.
2660 int aul_widget_instance_add(const char *widget_id, const char *instance_id);
2663 * This API is only for Appfw internally.
2665 int aul_widget_instance_del(const char *widget_id, const char *instance_id);
2668 * This API is only for Appfw internally.
2670 typedef void (*aul_widget_instance_foreach_cb)(const char *instance_id, void *data);
2673 * This API is only for Appfw internally.
2675 int aul_widget_instance_foreach(const char *widget_id, aul_widget_instance_foreach_cb cb, void *data);
2678 * This API is only for Appfw internally.
2680 int aul_widget_instance_update(const char *widget_id, const char *instance_id, bundle *b);
2683 * This API is only for Appfw internally.
2685 int aul_widget_instance_count(const char *widget_id);
2689 * This API gets the last caller process id of specified application process id.
2691 * This API's purpose is to get the application's last caller process id.
2693 * @param[in] pid pid of application
2694 * @return caller pid if success, nagative value if fail
2697 * This API is only available in User Session.
2699 int aul_app_get_last_caller_pid(int pid);
2703 * This API gets the last caller process id of specified application process id.
2705 * This API's purpose is to get the last caller process id of the application.
2707 * @param[in] pid pid of application
2708 * @param[in] uid User ID
2709 * @return caller pid if success, nagative value if fail
2712 * This API is only available in System users.
2714 int aul_app_get_last_caller_pid_for_uid(int pid, uid_t uid);
2718 * This API trigger to resume application asynchronously.
2719 * If the application is running, this API send a resume event to the App.
2720 * If the application is not running, this API return AUL_R_ERROR.
2721 * Although the application is running, if the application cannot receive resume event,
2722 * AUL try to raise the application's default windows.
2724 * This API is for caller.
2725 * This API's purpose is to send resume event.
2726 * @par Typical use case:
2727 * In multiple application model, If you want to only resume specific application, Use this API
2729 * @param[in] pid application's pid to be resumed
2730 * @return 0 if success, negative value(<0) if fail
2731 * @retval AUL_R_OK - success
2732 * @retval AUL_R_EINVAL - invaild pid
2733 * @retval AUL_R_ECOM - internal AUL IPC error
2734 * @retval AUL_R_ERROR - general error (include application is not running)
2735 * @warning This API need to require root or inhouse permisssion \n
2736 * If you have not the permission, this API return AUL_R_ERROR. \n
2738 * This API is only available to User Session.
2740 int aul_resume_pid_async(int pid);
2744 * This API trigger to resume application asynchronously.
2745 * If the application is running, this API send a resume event to the App.
2746 * If the application is not running, this API return AUL_R_ERROR.
2747 * Although the application is running, if the application cannot receive resume event,
2748 * AUL try to raise the application's default windows.
2750 * This API is for caller.
2751 * This API's purpose is to send resume event.
2752 * @par Typical use case:
2753 * In multiple application model, If you want to only resume specific application, Use this API
2755 * @param[in] pid application's pid to be resumed
2756 * @param[in] uid User ID
2757 * @return 0 if success, negative value(<0) if fail
2758 * @retval AUL_R_OK - success
2759 * @retval AUL_R_EINVAL - invaild pid
2760 * @retval AUL_R_ECOM - internal AUL IPC error
2761 * @retval AUL_R_ERROR - general error (include application is not running)
2762 * @warning This API need to require root or inhouse permisssion \n
2763 * If you have not the permission, this API return AUL_R_ERROR. \n
2765 * This API is only available to System user.
2767 int aul_resume_pid_async_for_uid(int pid, uid_t uid);
2771 * This API set the alias appid.
2772 * The alias appid is only available for the aul_svc_set_appid() API.
2773 * If the appid is not available, this API returns an error.
2775 * @privlevel platform
2776 * @privilege %http://tizen.org/privilege/systemsettings.admin
2777 * @param[in] alias_appid an alias application ID
2778 * @param[in] appid an application ID
2779 * @return 0 if success, negative value(<0) if fail
2782 * This API is only available to User Session.
2784 int aul_set_alias_appid(const char *alias_appid, const char *appid);
2788 * This API unset the alias appid.
2790 * @privlevel platform
2791 * @privilege %http://tizen.org/privilege/systemsettings.admin
2792 * @param[in] alias_appid an alias application ID
2793 * @return 0 if success, negative value(<0) if fail
2796 * This API is only available to User Session.
2798 int aul_unset_alias_appid(const char *alias_appid);
2802 * This API activates the alias information based on the given appid.
2804 * @privlevel platform
2805 * @privilege %http://tizen.org/privilege/systemsettings.admin
2806 * @param[in] appid an application ID
2807 * @return 0 if success, negative value(<0) if fail
2810 * This API is only available to User Session.
2812 int aul_enable_alias_info(const char *appid);
2816 * This API deactivates the alias information based on the given appid.
2818 * @privlebel platform
2819 * @privilege %http://tizen.org/privilege/systemsettings.admin
2820 * @param[in] appid an application ID
2821 * @return 0 if success, negative value(<0) if fail
2824 * This API is only available to User Session.
2826 int aul_disable_alias_info(const char *appid);
2829 * This API is only for Appfw internally.
2831 typedef int (*app_status_cb)(aul_app_info *info, int ctx_status, void *data);
2834 * This API is only for Appfw internally.
2836 typedef struct status_listen_s *status_listen_h;
2840 * Registers a callback function to be invoked when the application change status.
2842 * @param[in] appid The application ID to get status
2843 * @param[in] callback The callback function to register
2844 * @param[in] data The user data to be passed to the callback function
2845 * @param[out] handle The status listen handle
2846 * @return @c 0 on success,
2847 * otherwise a negative error value
2849 int aul_listen_app_status(const char *appid, app_status_cb callback,
2850 void *data, status_listen_h *handle);
2851 int aul_listen_app_status_for_uid(const char *appid, app_status_cb callback,
2852 void *data, status_listen_h *handle, uid_t uid);
2855 * This API is only for Appfw internally.
2857 int aul_widget_instance_get_content(const char *widget_id, const char *instance_id, char **content);
2861 * Gets running application instance info
2862 * This API calls the iter_fn with the aul_app_info when running app instance info is found.
2864 * @param[in] iter_fn iterative function
2865 * @param[in] user_data User data
2866 * @return 0 if success, negative value(<0) if fail
2867 * @retval AUL_R_OK Successful
2868 * @retval AUL_R_ERROR General error
2869 * @retval AUL_R_EINVAL Invalid parameter
2871 int aul_app_get_running_app_instance_info(aul_app_info_iter_fn iter_fn,
2873 int aul_app_get_running_app_instance_info_for_uid(aul_app_info_iter_fn iter_fn,
2874 void *user_data, uid_t uid);
2877 * This API is only for Appfw internally.
2879 int aul_app_get_instance_id_bypid(int pid, char *instance_id, int len);
2880 int aul_app_get_instance_id_bypid_for_uid(int pid, char *instance_id,
2881 int len, uid_t uid);
2884 * This API is only for Appfw internally.
2886 int aul_resume_app_by_instance_id(const char *appid, const char *instance_id);
2887 int aul_resume_app_by_instance_id_for_uid(const char *appid,
2888 const char *instance_id, uid_t uid);
2891 * This API is only for Appfw internally.
2893 int aul_ignore_app_status(status_listen_h handle);
2896 * This API is only for Appfw internally.
2898 int aul_notify_exit(void);
2899 int aul_notify_start(void);
2902 * This API is only for App Framework internally.
2904 const char *aul_app_status_convert_to_string(int status);