4 * Copyright (c) 2015 Samsung Electronics Co., Ltd. All rights reserved.
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
24 #include <sys/types.h>
31 * @brief Return values in AUL.
33 typedef enum _aul_return_val {
34 AUL_R_EREJECTED = -14, /**< App disable for mode */
35 AUL_R_ENOAPP = -13, /**< Failed to find app ID or pkg ID */
36 AUL_R_EHIDDENFORGUEST = -11, /**< App hidden for guest mode */
37 AUL_R_ENOLAUNCHPAD = -10, /**< no launchpad */
38 AUL_R_ETERMINATING = -9, /**< application terminating */
39 AUL_R_EILLACC = -8, /**< Illegal Access */
40 AUL_R_LOCAL = -7, /**< Launch by himself */
41 AUL_R_ETIMEOUT = -6, /**< Timeout */
42 AUL_R_ECANCELED = -5, /**< Operation canceled */
43 AUL_R_EINVAL = -4, /**< Invalid argument */
44 AUL_R_ECOMM = -3, /**< Comunication Error */
45 AUL_R_ENOINIT = -2, /**< AUL handler NOT initialized */
46 AUL_R_ERROR = -1, /**< General error */
47 AUL_R_OK = 0 /**< General success */
62 typedef enum _aul_type {
72 typedef enum aul_widget_lifecycle_event {
73 AUL_WIDGET_LIFE_CYCLE_EVENT_APP_DEAD = 0,
74 AUL_WIDGET_LIFE_CYCLE_EVENT_CREATE = 1, /**< The widget is created */
75 AUL_WIDGET_LIFE_CYCLE_EVENT_DESTROY = 2, /**< The widget is destroyed */
76 AUL_WIDGET_LIFE_CYCLE_EVENT_PAUSE = 3, /**< The widget is paused */
77 AUL_WIDGET_LIFE_CYCLE_EVENT_RESUME = 4 /**< The widget is resumed */
78 } aul_widget_lifecycle_event_e;
80 typedef enum aul_widget_instance_event {
81 AUL_WIDGET_INSTANCE_EVENT_CREATE = 0,
82 AUL_WIDGET_INSTANCE_EVENT_DESTROY = 1,
83 AUL_WIDGET_INSTANCE_EVENT_TERMINATE = 2,
84 AUL_WIDGET_INSTANCE_EVENT_PAUSE = 3,
85 AUL_WIDGET_INSTANCE_EVENT_RESUME = 4,
86 AUL_WIDGET_INSTANCE_EVENT_UPDATE = 5,
87 AUL_WIDGET_INSTANCE_EVENT_PERIOD_CHANGED = 6,
88 AUL_WIDGET_INSTANCE_EVENT_SIZE_CHANGED = 7,
89 AUL_WIDGET_INSTANCE_EVENT_EXTRA_UPDATED = 8,
90 AUL_WIDGET_INSTANCE_EVENT_FAULT = 9,
91 AUL_WIDGET_INSTANCE_EVENT_APP_RESTART_REQUEST = 10
92 } aul_widget_instance_event_e;
94 /** AUL public key - To check caller's secuirty */
95 #define AUL_K_CALLER_PID "__AUL_CALLER_PID__"
96 /** AUL public key - To check callee's secuirty */
97 #define AUL_K_CALLEE_PID "__AUL_CALLEE_PID__"
98 /** AUL public key - added for multiuser mode */
99 #define AUL_K_CALLER_UID "__AUL_CALLER_UID__"
100 /** AUL public key - added for multiuser mode */
101 #define AUL_K_CALLEE_UID "__AUL_CALLEE_UID__"
102 /** AUL public key - added for multiuser mode */
103 #define AUL_K_TARGET_UID "__AUL_TARGET_UID__"
104 /** AUL public key - To check caller's secuirty */
105 #define AUL_K_CALLER_APPID "__AUL_CALLER_APPID__"
106 /** AUL public key - To check caller's secuirty */
107 #define AUL_K_CALLEE_APPID "__AUL_CALLEE_APPID__"
108 /** AUL public key - To find argv0 */
109 #define AUL_K_ARGV0 "__AUL_ARGV0__"
110 /** AUL public key - To measure launching time */
111 #define AUL_K_STARTTIME "__AUL_STARTTIME__"
112 /** AUL public key - To support launching based on mime type */
113 #define AUL_K_MIME_TYPE "__AUL_MIME_TYPE__"
114 /** AUL public key - To support launching based on mime type */
115 #define AUL_K_UNALIASED_MIME_TYPE "__AUL_UNALIASED_MIME_TYPE__"
116 /** AUL public key - To support launching based on mime type */
117 #define AUL_K_MIME_CONTENT "__AUL_MIME_CONTENT__"
118 /** AUL public key - To support launching based on service */
119 #define AUL_K_SERVICE_NAME "__AUL_SERVICE_NAME__"
120 /** AUL public key - To force launch app selector instead of lauchingn default app */
121 #define AUL_K_FORCE_LAUNCH_APP_SELECTOR "__AUL_FORCE_LAUNCH_APP_SELECTOR__"
122 /** AUL public key - To support debug argument */
123 #define AUL_K_DEBUG "__AUL_DEBUG__"
124 /** AUL public key - To support SDK */
125 #define AUL_K_SDK "__AUL_SDK__"
126 /** AUL public key - To support Media key */
127 #define AUL_K_MULTI_KEY "__AUL_MULTI_KEY__"
128 /** AUL public key - To support Media key */
129 #define AUL_K_MULTI_KEY_EVENT "__AUL_MULTI_KEY_EVENT__"
130 /** AUL public bundle value */
131 #define AUL_K_PRIVACY_APPID "__AUL_PRIVACY_APPID__"
132 /** AUL public bundle value - To support Media key*/
133 #define AUL_V_KEY_PRESSED "__AUL_KEY_PRESSED__"
134 /** AUL public bundle value - To support Media key*/
135 #define AUL_V_KEY_RELEASED "__AUL_KEY_RELEASED__"
136 /** AUL public key - To support rua stat */
137 #define AUL_SVC_K_RUA_STAT_CALLER "__K_RUA_STAT_CALLER__"
138 #define AUL_SVC_K_RUA_STAT_TAG "__K_RUA_STAT_TAG__"
139 /** AUL public key - To support rua delete */
140 #define AUL_K_RUA_PKGNAME "__K_RUA_PKGNAME"
141 /** AUL public key - To support rua delete */
142 #define AUL_K_RUA_APPPATH "__K_RUA_APPPATH"
143 /** AUL public key - To support rua add */
144 #define AUL_K_RUA_ARG "__K_RUA_ARG"
145 /** AUL public key - To support rua add */
146 #define AUL_K_RUA_TIME "__K_RUA_TIME"
149 /** AUL internal private key */
150 #define AUL_K_PKG_NAME "__AUL_PKG_NAME__"
151 /** AUL internal private key */
152 #define AUL_K_WAIT_RESULT "__AUL_WAIT_RESULT__"
153 /** AUL internal private key */
154 #define AUL_K_SEND_RESULT "__AUL_SEND_RESULT__"
155 /** AUL internal private key */
156 #define AUL_K_TASK_MANAGE "__AUL_TASK_MANAGE__"
157 /** AUL internal private key */
158 #define AUL_K_APP_TYPE "__AUL_APP_TYPE__"
159 /** AUL internal private key - To check original caller's identity */
160 #define AUL_K_ORG_CALLER_PID "__AUL_ORG_CALLER_PID__"
161 /** AUL internal private key - To check forwarded callee app's pid */
162 #define AUL_K_FWD_CALLEE_PID "__AUL_FWD_CALLEE_PID__"
163 /** AUL internal private key */
164 #define AUL_K_NO_CANCEL "__AUL_NO_CANCEL__"
165 /** AUL internal private key */
166 #define AUL_K_EXEC "__AUL_EXEC__"
167 /** AUL internal private key */
168 #define AUL_K_MULTIPLE "__AUL_MULTIPLE__"
169 /** AUL internal private key */
170 #define AUL_K_PACKAGETYPE "__AUL_PACKAGETYPE__"
171 /** AUL internal private key */
172 #define AUL_K_HWACC "__AUL_HWACC__"
173 /** AUL internal private key */
174 #define AUL_K_APPID "__AUL_APPID__"
175 /** AUL internal private key */
176 #define AUL_K_PID "__AUL_PID__"
177 /** AUL internal private key */
178 #define AUL_K_WID "__AUL_WID__"
179 /** AUL internal private key */
180 #define AUL_K_LEADER_PID "__AUL_LEADER_PID__"
181 /** AUL internal private key - To support data control */
182 #define AUL_K_DATA_CONTROL_TYPE "__AUL_DATA_CONTROL_TYPE__"
183 /** AUL internal private key */
184 #define AUL_K_PKGID "__AUL_PKGID_"
185 /** AUL internal private key */
186 #define AUL_K_INTERNAL_POOL "__AUL_INTERNAL_POOL__"
187 /** AUL internal private key */
188 #define AUL_TEP_PATH "_AUL_TEP_PATH_"
189 /** AUL internal private key */
190 #define AUL_K_COMP_TYPE "__AUL_COMP_TYPE__"
191 /** AUL internal private key */
192 #define AUL_K_LOADER_ID "__AUL_LOADER_ID__"
193 /** AUL internal private key */
194 #define AUL_K_LOADER_PATH "__AUL_LOADER_PATH__"
195 /** AUL internal private key */
196 #define AUL_K_LOADER_EXTRA "__AUL_LOADER_EXTRA__"
197 /** AUL internal private key */
198 #define AUL_K_LOADER_NAME "__AUL_LOADER_NAME__"
199 /** AUL internal private key */
200 #define AUL_K_WAYLAND_DISPLAY "__AUL_WAYLAND_DISPLAY__"
201 /** AUL internal private key */
202 #define AUL_K_WAYLAND_WORKING_DIR "__AUL_WAYLAND_WORKING_DIR__"
203 /** AUL internal private key */
204 #define AUL_K_COM_SENDER_PID "__AUL_COM_SENDER_PID__"
205 /** AUL internal private key */
206 #define AUL_K_COM_ENDPOINT "__AUL_COM_ENDPOINT__"
207 /** AUL internal private key */
208 #define AUL_K_COM_PRIVILEGE "__AUL_COM_PRIVILEGE__"
209 /** AUL internal private key */
210 #define AUL_K_COM_PROPAGATE "__AUL_COM_PROPAGATE__"
211 /** AUL internal private key */
212 #define AUL_K_COM_FILTER "__AUL_COM_FILTER__"
213 /** AUL internal private key */
214 #define AUL_K_COM_RESULT "__AUL_COM_RESULT__"
215 /** AUL internal private key */
216 #define AUL_K_ROOT_PATH "__AUL_ROOT_PATH__"
217 /** AUL internal private key */
218 #define AUL_K_SEQ_NUM "__AUL_SEQ_NUM__"
219 /** AUL internal private key */
220 #define AUL_K_API_VERSION "__AUL_API_VERSION__"
221 /** AUL internal private key */
222 #define AUL_K_ALLOWED_BG "__AUL_ALLOWED_BG__"
223 /** AUL internal private key */
224 #define AUL_K_OWNER_PID "__AUL_OWNER_PID__"
225 /** AUL internal private key */
226 #define AUL_K_CHILD_PID "__AUL_CHILD_PID__"
227 /** AUL internal private key */
228 #define AUL_K_WIDGET_VIEWER "__AUL_WIDGET_VIEWER__"
229 /** AUL internal private key */
230 #define AUL_K_WIDGET_ID "__AUL_WIDGET_ID__"
231 /** AUL internal private key */
232 #define AUL_K_WIDGET_INSTANCE_ID "__AUL_WIDGET_INSTANCE_ID__"
233 /** AUL internal private key */
234 #define AUL_K_WIDGET_STATUS "__AUL_WIDGET_STATUS__"
235 /** AUL internal private key */
236 #define AUL_K_APP_DATA_KEY "__AUL_APP_DATA_KEY__"
237 /** AUL internal private key */
238 #define AUL_K_TARGET_PID "__AUL_TARGET_PID__"
241 * @brief This is callback function for aul_launch_init
242 * @param[in] type event's type received from system
243 * @param[in] b In case of RESET events, bundle which is received from peer
244 * @param[in] data user-supplied data
246 typedef int (*aul_handler_fn)(aul_type type, bundle *b, void *data);
250 * This API install your AUL handler and setup AUL internal connection.
252 * AUL receive START(RESET), RESUME, TERMINATE events from system.\n
253 * This API use to handle the events. \n
254 * @par Typical use case:
255 * In general, you need not use this API.
256 * If you use AppCore, you should NOT use this API.
257 * AppCore will set default aul_handler.
259 * @param[in] handler aul main callback handler function
260 * @param[in] data user-supplied data for start_handler
261 * @return 0 if success, negative value(<0) if fail\n
262 * @retval AUL_R_OK - success
263 * @retval AUL_R_ECANCELD - aul handler was installed already by others
264 * @retval AUL_R_ECOMM - error to create internal ipc
265 * @retval AUL_R_ERROR - error to attach glib main loop
267 * @warning If you use AppCore, you should NOT use this API.\n
268 * You need glib main loop.\n
270 * you must have aul handler to use this API.
271 * aul_luanch_init register aul handler.
274 * #include <bundle.h>
276 * static int aul_handler(aul_type type, bundle *kb,void *data)
281 * // process RESET event
284 * // process RESUME event
286 * case AUL_TERMINATE:
287 * // preocess TERMINATE event
293 * static GMainLoop *mainloop = NULL;
295 * int main(int argc, char **argv)
297 * aul_launch_init(aul_handler,NULL);
298 * aul_launch_argv_handler(argc, argv);
300 * mainloop = g_main_loop_new(NULL, FALSE);
301 * g_main_loop_run(mainloop);
306 * This API is only available in User Session.
308 int aul_launch_init(aul_handler_fn handler, void *data);
312 * This API create internal RESET events with given argc, argv \n
314 * This API's purpose is to generate reset event.
315 * If you want to generate local RESET events with argument vector format, use this API
316 * @par Typical use case:
317 * In general, you need not use this API.
318 * AppCore use this API to create internal reset event.
320 * @param[in] argc # of args
321 * @param[in] argv list of arg strings
322 * @return 0 if success, negative value(<0) if fail
323 * @retval AUL_R_OK - success
324 * @retval AUL_R_ENOINIT - aul handler was NOT yet installed
325 * @retval AUL_R_ECANCLED - error to create internal bundle with given argc,argv.
326 * @retval AUL_R_ERROR - general error
329 * you must have aul handler to use this API.
330 * aul_luanch_init register aul handler.
335 * #include <bundle.h>
337 * int send_local_reset_event()
341 * argv[0] = "local.app";
342 * argv[1] = "event_type";
343 * argv[2] = "my_reset";
345 * aul_launch_argv_handler(argc,argv);
350 * If you use AppCore, you NEED NOT use this API.
351 * This API is only available in User Session.
353 int aul_launch_argv_handler(int argc, char **argv);
357 * This API creates internal RESET events with given bundle \n
359 * This API's purpose is to generate reset event.
360 * If you want to generate local RESET events with argument vector format, first use
361 * bundle_import_from_argv to create a bundle from the argument vector and then use this API
362 * Eventually, this API will replace aul_launch_argv_handler().
363 * @par Typical use case:
364 * In general, you need not use this API.
365 * AppCore use this API to create internal reset event.
367 * @param[in] b bundle
368 * @return 0 if success, negative value(<0) if fail
369 * @retval AUL_R_OK - success
370 * @retval AUL_R_ENOINIT - aul handler was NOT yet installed
371 * @retval AUL_R_ERROR - general error
374 * you must have aul handler to use this API.
375 * aul_luanch_init register aul handler.
379 * aul_launch_init, bundle_import_from_argv
382 * #include <bundle.h>
384 * int send_local_reset_event()
389 * argv[0] = "local.app";
390 * argv[1] = "event_type";
391 * argv[2] = "my_reset";
394 * b = bundle_import_from_argv(argc,argv);
395 * aul_launch_local(b);
400 * If you use AppCore, you NEED NOT to use this API.
401 * This API is only available in User Session.
403 int aul_launch_local(bundle *b);
407 * This API launches application with the given bundle.
408 * If the application is not running or a multiple-instance one, this API launches with the given bundle.
409 * If the application is running, this API sends a RESET event to the App.
410 * While the application is running, if the application cannot receive the RESET event,
411 * this API returns a general error(AUL_R_ERROR).\n
413 * This API is for caller.
414 * This API's purpose is to launch/reset application with given bundle.
415 * @par Typical use case:
416 * If you know the target application's pkgname and bundle types,
417 * you can use this API to launch/reset the application.
419 * @param[in] pkgname package name to be run as callee
420 * @param[in] kb bundle to be passed to callee
421 * @return callee's pid if success, negative value(<0) if fail
422 * @retval AUL_R_OK - success
423 * @retval AUL_R_EINVAL - invaild package name
424 * @retval AUL_R_ECOM - internal AUL IPC error
425 * @retval AUL_R_ERROR - general error
431 * #include <bundle.h>
433 * int launch_inhouse_contact_app()
436 * b = bundle_create();
437 * bundle_add(b,"type","SIM");
438 * aul_launch_app("org.tizen.contact",b);
443 * This API is only available in User Session.
445 int aul_launch_app(const char *appid, bundle *kb);
449 * This API launches application with the given bundle.
450 * If the application is not running or a multiple-instance one, this API launches with the given bundle.
451 * If the application is running, this API sends a RESET event to the App.
452 * While the application is running, if the application cannot receive the RESET event,
453 * this API returns a general error(AUL_R_ERROR).\n
455 * This API is for caller.
456 * This API's purpose is to launch/reset application with given bundle.
457 * @par Typical use case:
458 * If you know the target application's pkgname and bundle types,
459 * you can use this API to launch/reset the application.
461 * @param[in] pkgname package name to be run as callee
462 * @param[in] kb bundle to be passed to callee
463 * @param[in] uid User ID to launch
464 * @return callee's pid if success, negative value(<0) if fail
465 * @retval AUL_R_OK - success
466 * @retval AUL_R_EINVAL - invaild package name
467 * @retval AUL_R_ECOM - internal AUL IPC error
468 * @retval AUL_R_ERROR - general error
473 * This API is also available in System Session.
475 int aul_launch_app_for_uid(const char *appid, bundle *kb, uid_t uid);
479 * This API launches application, as menu screen launches the app.
480 * Thus, if the applocation is running, this API sends a RESUME event to the app.
481 * If the application is not running, this API launches the app.
482 * While the application is running, if the application cannot receive the RESUME event,
483 * AUL tries to raise the application's default window.
486 * This API is for caller.
487 * This API's purpose is to resume/launch application
488 * @par Typical use case:
489 * If you only want to show application with previous state or default state, Use this API.
491 * @param[in] pkgname package name to be resume as callee
492 * @return callee's pid if success, negative value(<0) if fail
493 * @retval AUL_R_OK - success
494 * @retval AUL_R_EINVAL - invaild package name
495 * @retval AUL_R_ECOM - internal AUL IPC error
496 * @retval AUL_R_ERROR - general error
499 * aul_launch_app, aul_app_is_running, aul_resume_pid
502 * #include <bundle.h>
504 * int open_inhouse_contact_app()
506 * if(aul_app_is_running("org.tizen.contact"))
507 * aul_open_app("org.tizen.contact");
512 * If you don't want to launch the app,
513 * you should check app's running state with aul_app_is_running.
514 * This API will launch the application if the application is not running.
515 * This API is only available in User Session.
517 int aul_open_app(const char *appid);
521 * This API launches application, as menu screen launches the app.
522 * Thus, if the applocation is running, this API sends a RESUME event to the app.
523 * If the application is not running, this API launches the app.
524 * While the application is running, if the application cannot receive the RESUME event,
525 * AUL tries to raise the application's default window.
528 * This API is for caller.
529 * This API's purpose is to resume/launch application
530 * @par Typical use case:
531 * If you only want to show application with previous state or default state, Use this API.
533 * @param[in] pkgname package name to be resume as callee
534 * @param[in] uid User ID
535 * @return callee's pid if success, negative value(<0) if fail
536 * @retval AUL_R_OK - success
537 * @retval AUL_R_EINVAL - invaild package name
538 * @retval AUL_R_ECOM - internal AUL IPC error
539 * @retval AUL_R_ERROR - general error
542 * If you don't want to launch the app,
543 * you should check app's running state with aul_app_is_running.
544 * This API will launch the application if the application is not running.
545 * This API is only available to System user.
547 int aul_open_app_for_uid(const char *appid, uid_t uid);
551 * This API trigger to resume application
552 * If the application is running, this API send a resume event to the App.
553 * If the application is not running, this API returns fail.
554 * Although the application is running, if the application cannot receive resume event,
555 * AUL try to raise the application's default windows.
557 * This API is for caller.
558 * This API's purpose is to send resume event.
559 * @par Typical use case:
560 * If you only want to show application with previous state or default state, Use this API.
562 * @param[in] pkgname package name to be resume as callee
563 * @return callee's pid if success, negative value(<0) if fail
564 * @retval AUL_R_OK - success
565 * @retval AUL_R_EINVAL - invaild package name
566 * @retval AUL_R_ECOM - internal AUL IPC error
567 * @retval AUL_R_ERROR - general error
570 * aul_launch_app, aul_app_is_running, aul_resume_pid
572 * This function will be deprecated. Use aul_open_add() instead.
575 * #include <bundle.h>
577 * int resume_inhouse_contact_app()
579 * if(aul_app_is_running("org.tizen.contact"))
580 * aul_resume_app("org.tizen.contact");
585 * If you don't want to launch the app,
586 * you should check app's running state with aul_app_is_running.
587 * This API will launch the application if the application is not running.
588 * If you want to only resume without launching in multiple instance application model,
589 * you should use aul_resume_pid.
590 * This API is only available in User Session.
592 int aul_resume_app(const char *appid);
596 * This API trigger to resume application
597 * If the application is running, this API send a resume event to the App.
598 * If the application is not running, this API returns fail.
599 * Although the application is running, if the application cannot receive resume event,
600 * AUL try to raise the application's default windows.
602 * This API is for caller.
603 * This API's purpose is to send resume event.
604 * @par Typical use case:
605 * If you only want to show application with previous state or default state, Use this API.
607 * @param[in] pkgname package name to be resume as callee
608 * @param[in] uid User ID
609 * @return callee's pid if success, negative value(<0) if fail
610 * @retval AUL_R_OK - success
611 * @retval AUL_R_EINVAL - invaild package name
612 * @retval AUL_R_ECOM - internal AUL IPC error
613 * @retval AUL_R_ERROR - general error
616 * If you don't want to launch the app,
617 * you should check app's running state with aul_app_is_running.
618 * This API will launch the application if the application is not running.
619 * If you want to only resume without launching in multiple instance application model,
620 * you should use aul_resume_pid.
621 * This API is only available to System user.
623 int aul_resume_app_for_uid(const char *appid, uid_t uid);
627 * This API trigger to resume application
628 * If the application is running, this API send a resume event to the App.
629 * If the application is not running, this API return AUL_R_ERROR.
630 * Although the application is running, if the application cannot receive resume event,
631 * AUL try to raise the application's default windows.
633 * This API is for caller.
634 * This API's purpose is to send resume event.
635 * @par Typical use case:
636 * In multiple application model, If you want to only resume specific application, Use this API
638 * @param[in] pid application's pid to be resumed
639 * @return 0 if success, negative value(<0) if fail
640 * @retval AUL_R_OK - success
641 * @retval AUL_R_EINVAL - invaild pid
642 * @retval AUL_R_ECOM - internal AUL IPC error
643 * @retval AUL_R_ERROR - general error (include application is not running)
644 * @warning This API need to require root or inhouse permisssion \n
645 * If you have not the permission, this API return AUL_R_ERROR. \n
650 * #include <bundle.h>
652 * int iterfunc(const aul_app_info *info, void *data)
654 * if(strcmp(info->pkg_name,"org.tizen.contact")==0)
655 * aul_resume_pid(info->pid);
658 * int iterate_running_apps()
660 * return aul_app_get_running_app_info(iterfunc,NULL);
665 * This API is only available in User Session.
667 int aul_resume_pid(int pid);
671 * This API trigger to resume application
672 * If the application is running, this API send a resume event to the App.
673 * If the application is not running, this API return AUL_R_ERROR.
674 * Although the application is running, if the application cannot receive resume event,
675 * AUL try to raise the application's default windows.
677 * This API is for caller.
678 * This API's purpose is to send resume event.
679 * @par Typical use case:
680 * In multiple application model, If you want to only resume specific application, Use this API
682 * @param[in] pid application's pid to be resumed
683 * @param[in] uid User ID
684 * @return 0 if success, negative value(<0) if fail
685 * @retval AUL_R_OK - success
686 * @retval AUL_R_EINVAL - invaild pid
687 * @retval AUL_R_ECOM - internal AUL IPC error
688 * @retval AUL_R_ERROR - general error (include application is not running)
689 * @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
692 * This API is only available to System user.
694 int aul_resume_pid_for_uid(int pid, uid_t uid);
698 * This API trigger to terminate application
700 * If the application is running, this API send a terminate event to the App. \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 inhouse 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 inhouse permisssion. \n
719 * #include <bundle.h>
721 * int iterfunc(const aul_app_info *info, void *data)
723 * if(strcmp(info->pkg_name,"org.tizen.contact")==0)
724 * aul_terminate_pid(info->pid);
727 * int iterate_running_apps()
729 * return aul_app_get_running_app_info(iterfunc,NULL);
734 * If you have not the permission, this API return AUL_R_ERROR. \n
735 * This API is only available in User Session.
737 int aul_terminate_pid(int pid);
741 * This API trigger to terminate application
743 * If the application is running, this API send a terminate event to the App. \n
744 * If the app cannot receive the event, AUL kill forcely the application.\n
746 * This API's purpose is to kill application
747 * @par Typical use case:
748 * In general, Application like Task Manager use this API.
750 * This API need to require root or inhouse permisssion. \n
752 * @param[in] pid application's pid to be terminated
753 * @param[in] uid User ID
754 * @return 0 if success, negative value(<0) if fail
755 * @retval AUL_R_OK - success
756 * @retval AUL_R_EINVAL - invaild pid
757 * @retval AUL_R_ECOM - internal AUL IPC error
758 * @retval AUL_R_ERROR - general error
759 * @warning This API need to require root or inhouse permisssion. \n
762 * If you have not the permission, this API return AUL_R_ERROR. \n
763 * This API is only available to System user.
765 int aul_terminate_pid_for_uid(int pid, uid_t uid);
769 * This API trigger to terminate application asynchronously
771 * If the application is running, this API send a terminate event to the App. \n
772 * If the app cannot receive the event, AUL kill forcely the application.\n
774 * This API's purpose is to kill application
775 * @par Typical use case:
776 * In general, Application like Task Manager use this API.
778 * This API need to require root or inhouse permisssion. \n
780 * @param[in] pid application's pid to be terminated
781 * @return 0 if success, negative value(<0) if fail
782 * @retval AUL_R_OK - success
783 * @retval AUL_R_EINVAL - invaild pid
784 * @retval AUL_R_ECOM - internal AUL IPC error
785 * @retval AUL_R_ERROR - general error
786 * @warning This API need to require root or inhouse permisssion. \n
788 * If you have not the permission, this API return AUL_R_ERROR. \n
789 * This API is only available in User Session.
791 int aul_terminate_pid_async(int pid);
795 * This API trigger to terminate application asynchronously
797 * If the application is running, this API send a terminate event to the App. \n
798 * If the app cannot receive the event, AUL kill forcely the application.\n
800 * This API's purpose is to kill application
801 * @par Typical use case:
802 * In general, Application like Task Manager use this API.
804 * This API need to require root or inhouse permisssion. \n
806 * @param[in] pid application's pid to be terminated
807 * @param[in] uid User ID
808 * @return 0 if success, negative value(<0) if fail
809 * @retval AUL_R_OK - success
810 * @retval AUL_R_EINVAL - invaild pid
811 * @retval AUL_R_ECOM - internal AUL IPC error
812 * @retval AUL_R_ERROR - general error
813 * @warning This API need to require root or inhouse permisssion. \n
815 * If you have not the permission, this API return AUL_R_ERROR. \n
816 * This API is only available to System user.
818 int aul_terminate_pid_async_for_uid(int pid, uid_t uid);
822 * This API trigger to terminate application synchronously
824 * If the application is running, this API sends a terminate event to the application. \n
825 * And then, this API waits until the application is terminated successfully. \n
826 * If the app cannot receive the event, AUL kill forcely the application. \n
828 * This API's purpose is to kill application
829 * @par Typical use case:
830 * In general, Application like Task Manager use this API.
832 * This API need to require root or platform level permisssion. \n
834 * @param[in] pid application's pid to be terminated
835 * @return 0 if success, negative value(<0) if fail
836 * @retval AUL_R_OK - success
837 * @retval AUL_R_EINVAL - invaild pid
838 * @retval AUL_R_ECOM - internal AUL IPC error
839 * @retval AUL_R_ERROR - general error
840 * @warning This API need to require root or platform level permisssion. \n
842 * If you have not the permission, this API return AUL_R_ERROR. \n
843 * This API is only available in User Session.
845 int aul_terminate_pid_sync(int pid);
849 * This API trigger to terminate application synchronously
851 * If the application is running, this API send a terminate event to the application. \n
852 * And then, this API waits until the application is terminated successfully. \n
853 * If the app cannot receive the event, AUL kill forcely the application. \n
855 * This API's purpose is to kill application
856 * @par Typical use case:
857 * In general, Application like Task Manager use this API.
859 * This API need to require root or platform level permisssion. \n
861 * @param[in] pid application's pid to be terminated
862 * @param[in] uid User ID
863 * @return 0 if success, negative value(<0) if fail
864 * @retval AUL_R_OK - success
865 * @retval AUL_R_EINVAL - invaild pid
866 * @retval AUL_R_ECOM - internal AUL IPC error
867 * @retval AUL_R_ERROR - general error
868 * @warning This API need to require root or platform level permisssion. \n
870 * If you have not the permission, this API return AUL_R_ERROR. \n
871 * This API is only available to System user.
873 int aul_terminate_pid_sync_for_uid(int pid, uid_t uid);
876 *@brief Running application's information structure retrieved by AUL
878 typedef struct _aul_app_info {
879 int pid; /**< app's pid if running*/
880 char *pkg_name; /**< application id */
881 char *app_path; /**< application excutable path */
883 char *pkgid; /**< package id */
884 int status; /**< app's status */
885 int is_sub_app; /**< state whether sub app of app group */
889 * @brief iterator function running with aul_app_get_running_app_info
890 * @param[out] ainfo aul_app_info retreived by aul_app_get_running_app_info
891 * @param[out] data user-supplied data
893 typedef int (*aul_app_info_iter_fn)(const aul_app_info *ainfo, void *data);
897 * This API ask a application is running by application package name.
899 * To know whether some application is running or not, use this API
900 * @par Typical use case:
901 * For example, If you want to know browser application running,
902 * you can check it by using this API.
904 * @param[in] pkgname application package name
905 * @return true / false
906 * @retval 1 app_name is running now.
907 * @retval 0 app_name is NOT running now.
912 * int is_running_browser_app()
914 * return aul_app_is_running("org.tizen.browser");
919 * This API is only available in User Session.
922 int aul_app_is_running(const char *appid);
926 * This API ask a application is running by application package name.
928 * To know whether some application is running or not, use this API
929 * @par Typical use case:
930 * For example, If you want to know browser application running,
931 * you can check it by using this API.
933 * @param[in] pkgname application package name
934 * @param[in] uid User ID
935 * @return true / false
936 * @retval 1 app_name is running now.
937 * @retval 0 app_name is NOT running now.
941 * This API is only available to System User.
943 int aul_app_is_running_for_uid(const char *appid, uid_t uid);
947 * This API use to get running application list.
948 * This API call iter_fn with each aul_app_info of running apps when running application is found.
950 * If you want to get running application list, use this API
951 * @par Typical use case:
952 * In general, this API is used by task manager appllication. (running application list viewer)
954 * @param[in] iter_fn iterator function
955 * @param[in] data user-supplied data for iter_fn
956 * @return 0 if success, negative value(<0) if fail
957 * @retval AUL_R_OK - success
958 * @retval AUL_R_ERROR - internal error
963 * int iterfunc(const aul_app_info* info, void* data)
965 * printf("\t==========================\n");
966 * printf("\t pkg_name: %s\n", info->appid);
967 * printf("\t app_path: %s\n", info->app_path);
968 * printf("\t running pid: %d\n", info->pid);
969 * printf("\t==========================\n");
973 * int iterate_running_apps()
975 * return aul_app_get_running_app_info(iterfunc,NULL);
980 * This API should use if you want to know running application which has desktop files.
981 * If you want to get all process list, you must iterate process information by using proc filesystem
982 * Or, If you want to get all window list, you must iterate XWindows by using XWindow APIs
983 * This API is only available in User Session.
985 int aul_app_get_running_app_info(aul_app_info_iter_fn iter_fn, void *data);
989 * This API use to get running application list.
990 * This API call iter_fn with each aul_app_info of running apps when running application is found.
992 * If you want to get running application list, use this API
993 * @par Typical use case:
994 * In general, this API is used by task manager appllication. (running application list viewer)
996 * @param[in] iter_fn iterator function
997 * @param[in] data user-supplied data for iter_fn
998 * @param[in] uid User ID
999 * @return 0 if success, negative value(<0) if fail
1000 * @retval AUL_R_OK - success
1001 * @retval AUL_R_ERROR - internal error
1004 * This API should use if you want to know running application which has desktop files.
1005 * If you want to get all process list, you must iterate process information by using proc filesystem
1006 * Or, If you want to get all window list, you must iterate XWindows by using XWindow APIs
1007 * This API is only available to System user.
1009 int aul_app_get_running_app_info_for_uid(aul_app_info_iter_fn iter_fn, void *data, uid_t uid);
1013 * This API use to get all running application list, including sub app.
1014 * This API call iter_fn with each aul_app_info of running apps when running application is found.
1016 * If you want to get all running application list, use this API
1017 * @par Typical use case:
1018 * In general, this API is used by task manager application. (running application list viewer)
1020 * @param[in] iter_fn iterator function
1021 * @param[in] data user-supplied data for iter_fn
1022 * @return 0 if success, negative value(<0) if fail
1023 * @retval AUL_R_OK - success
1024 * @retval AUL_R_ERROR - internal error
1029 * int iterfunc_status(const aul_app_info *info, void *data)
1031 * printf("\t==========================\n");
1032 * printf("\t pid: %d\n", info->pid);
1033 * printf("\t appid: %s\n", info->appid);
1034 * printf("\t app_path: %s\n", info->app_path);
1035 * printf("\t pkgid: %s\n", info->pkgid);
1036 * printf("\t status: %d\n", info->status);
1037 * printf("\t is_sub_app : %d\n", info->is_sub_app);
1038 * printf("\t==========================\n");
1042 * int iterate_running_apps()
1044 * return aul_app_get_all_running_app_info(iterfunc_status,NULL);
1049 * This API should use if you want to know running application which has desktop files.
1050 * If you want to get all process list, you must iterate process information by using proc filesystem
1051 * Or, If you want to get all window list, you must iterate XWindows by using XWindow APIs
1052 * This API is only available in User Session.
1054 int aul_app_get_all_running_app_info(aul_app_info_iter_fn iter_fn, void *data);
1058 * This API use to get all running application list, including sub app.
1059 * This API call iter_fn with each aul_app_info of running apps when running application is found.
1061 * If you want to get all running application list, use this API
1062 * @par Typical use case:
1063 * In general, this API is used by task manager application. (running application list viewer)
1065 * @param[in] iter_fn iterator function
1066 * @param[in] data user-supplied data for iter_fn
1067 * @param[in] uid User ID
1068 * @return 0 if success, negative value(<0) if fail
1069 * @retval AUL_R_OK - success
1070 * @retval AUL_R_ERROR - internal error
1073 * This API should use if you want to know running application which has desktop files.
1074 * If you want to get all process list, you must iterate process information by using proc filesystem
1075 * Or, If you want to get all window list, you must iterate XWindows by using XWindow APIs
1076 * This API is only available to System user.
1078 int aul_app_get_all_running_app_info_for_uid(aul_app_info_iter_fn iter_fn, void *data, uid_t uid);
1082 * This API get application package name by pid
1084 * If you want to get package name of running application, use this API
1085 * @par Typical use case:
1086 * In general, You can use this API when you want to know caller's information.
1088 * @param[in] pid given pid
1089 * @param[out] pkgname pkgname to be get
1090 * @param[in] len length of pkgname
1091 * @return 0 if success, negative value(<0) if fail
1092 * @retval AUL_R_OK - success
1093 * @retval AUL_R_ERROR - no such a package name
1096 * #include <bundle.h>
1098 * static int app_reset(bundle *b, void *data)
1101 * char appname[255];
1103 * pid = atoi(bundle_get_val(b,AUL_K_CALLER_PID));
1104 * aul_app_get_pkgname_bypid(pid, appname, sizeof(appname));
1109 * This API is only available in User Session.
1111 int aul_app_get_pkgname_bypid(int pid, char *pkgname, int len);
1115 * This API get application pkgid by pid
1117 * If you want to get pkgid of running application, use this API
1118 * @par Typical use case:
1119 * In general, You can use this API when you want to know caller's information.
1121 * @param[in] pid given pid
1122 * @param[out] pkgid package id
1123 * @param[in] len length of pkgid
1124 * @return 0 if success, negative value(<0) if fail
1125 * @retval AUL_R_OK - success
1126 * @retval AUL_R_ERROR - no such a appid
1130 * #include <bundle.h>
1132 * static int app_reset(bundle *b, void *data)
1137 * pid = atoi(bundle_get_val(b, AUL_K_CALLER_PID));
1138 * aul_app_get_pkgid_bypid(pid, pkgid, sizeof(pkgid));
1143 * This API is only available in User Session.
1145 int aul_app_get_pkgid_bypid(int pid, char *pkgid, int len);
1149 * This API get application pkgid by pid
1151 * If you want to get pkgid of running application, use this API
1152 * @par Typical use case:
1153 * In general, You can use this API when you want to know caller's information.
1155 * @param[in] pid given pid
1156 * @param[out] pkgid package id
1157 * @param[in] len length of pkgid
1158 * @param[in] uid User ID
1159 * @return 0 if success, negative value(<0) if fail
1160 * @retval AUL_R_OK - success
1161 * @retval AUL_R_ERROR - no such a appid
1164 * This API is also available to System user.
1166 int aul_app_get_pkgid_bypid_for_uid(int pid, char *pkgid, int len, uid_t uid);
1170 * This API get application appid by pid
1172 * If you want to get appid of running application, use this API
1173 * @par Typical use case:
1174 * In general, You can use this API when you want to know caller's information.
1176 * @param[in] pid given pid
1177 * @param[out] appid application id
1178 * @param[in] len length of pkgname
1179 * @return 0 if success, negative value(<0) if fail
1180 * @retval AUL_R_OK - success
1181 * @retval AUL_R_ERROR - no such a appid
1184 * #include <bundle.h>
1186 * static int app_reset(bundle *b, void *data)
1191 * pid = atoi(bundle_get_val(b,AUL_K_CALLER_PID));
1192 * aul_app_get_appid_bypid(pid, appid, sizeof(appid));
1197 * This API is only available in User Session.
1199 int aul_app_get_appid_bypid(int pid, char *appid, int len);
1203 * This API get application appid by pid
1205 * If you want to get appid of running application, use this API
1206 * @par Typical use case:
1207 * In general, You can use this API when you want to know caller's information.
1209 * @param[in] pid given pid
1210 * @param[out] appid application id
1211 * @param[in] len length of pkgname
1212 * @param[in] uid User ID
1213 * @return 0 if success, negative value(<0) if fail
1214 * @retval AUL_R_OK - success
1215 * @retval AUL_R_ERROR - no such a appid
1217 * This API is also available to System user.
1219 int aul_app_get_appid_bypid_for_uid(int pid, char *appid, int len, uid_t uid);
1223 * This API launch application associated with given filename
1225 * This API is for caller.
1226 * This API launch application based on mime type.
1227 * This API find mime_type associated with file name,
1228 * and then find default app associated with found mime_type
1229 * and then launch the app with filename argument.
1230 * @par Typical use case:
1231 * You can launch application to process given filename.
1232 * That is, Even if you don't know the specific application's pkgname,
1233 * you can launch the applicaiton processing given filename .
1234 * For example, If you want to process image file, you can simply launch image viewer.
1235 * At that time, you can use this APIs like aul_open_file("myimage.jpg");
1237 * @param[in] filename filename
1238 * @return callee's pid or 0 if success, negative value if fail\n
1239 * (when no found default app, return 0)
1240 * @retval AUL_R_OK - success
1241 * @retval AUL_R_EINVAL - invalid argument(filename)
1242 * @retval AUL_R_ECOM - internal AUL IPC error
1243 * @retval AUL_R_ERROR - general error
1248 * int view_image_file(char *filename)
1250 * aul_open_file(filename);
1255 * This API is only available in User Session.
1258 int aul_open_file(const char* filename);
1262 * This API launch application associated with given specific mimetype
1264 * This API is for caller.
1265 * This API launch application based on mime type like aul_open_file API.
1266 * But, This API don't find mime_type associated with file name.
1267 * This API use mimetype given by user. By using given mimetype, find default application.
1268 * and then launch the app with filename argument.
1269 * @par Typical use case:
1270 * Some files cannot extract exact mimetype automatically.
1271 * For example, To know mime type of files with DRM lock, first we should unlock DRM file.
1272 * In this case, You can use this API.
1273 * First, unlock DRM file, and extract mimetype from unlock file by using aul_get_mime_from_file,
1274 * and then, use this API with DRM file and extracted mime type.
1276 * @param[in] filename filename
1277 * @param[in] mimetype specific mimetype
1278 * @return callee's pid or 0 if success, negative value if fail\n
1279 * (when no found default app, return 0)
1280 * @retval AUL_R_OK - success
1281 * @retval AUL_R_EINVAL - invalid argument(filename,mimetype)
1282 * @retval AUL_R_ECOM - internal AUL IPC error
1283 * @retval AUL_R_ERROR - general error
1286 * aul_open_file, aul_get_mime_from_file
1290 * int view_drm_image_file(char *drm_filename)
1293 * // you must implement this function
1294 * mimetype = get_mimetype_from_drmfile(drm_filename);
1296 * aul_open_file_with_mimetype(drm_filename,mimetype);
1301 * This API is only available in User Session.
1303 int aul_open_file_with_mimetype(const char *filename, const char *mimetype);
1307 * This API launch application associated with content like "http://www.samsung.com"
1309 * This API is for caller.
1310 * This API launch application based on mime type.
1311 * This API find mime_type associated with content,
1312 * and then find default app associated with found mime_type,
1313 * and then launch the app with content argument.
1314 * @par Typical use case:
1315 * You can launch application to process given content.
1316 * That is, Even if you don't know the specific application's pkgname,
1317 * you can launch the applicaiton processing given content.
1318 * For example, If you want to process URL "http://www.samsung.com",
1319 * you can simply launch browser.
1320 * At that time, you can use this APIs like aul_open_content("http://www.samsung.com");
1322 * @param[in] content content
1323 * @return callee's pid or 0 if success, negative value if fail\n
1324 * (when no found default app, return 0)
1325 * @retval AUL_R_OK - success
1326 * @retval AUL_R_EINVAL - invalid argument(content)
1327 * @retval AUL_R_ECOM - internal AUL IPC error
1328 * @retval AUL_R_ERROR - general error or no found mimetype
1333 * int view_url(char *url)
1335 * aul_open_content(url);
1340 * This API is only available in User Session.
1343 int aul_open_content(const char* content);
1347 * This API get the default application(appid) associated with MIME type
1349 * This API use to get default application associteted with mimetype
1350 * In general, Setting Application need this API.
1351 * @par Typical use case:
1352 * Setting Application show mapping of default application / mimetype
1354 * @param[in] mimetype a mime type
1355 * @param[out] defapp a application appid of the app
1356 * @param[in] len length of defapp
1357 * @return 0 if success, negative value if fail
1358 * @retval AUL_R_OK - success
1359 * @retval AUL_R_EINVAL - invalid argument(mimetype)
1360 * @retval AUL_R_ERROR - general error or no found mimetype
1363 * aul_set_defapp_with_mime
1367 * void get_text_html_defapp()
1369 * char appname[255];
1370 * aul_get_defapp_from_mime("text/html",appname,sizeof(appname));
1375 * This API is only available in User Session.
1378 int aul_get_defapp_from_mime(const char *mimetype, char *defapp, int len);
1382 * This API set the default application(appid) associated with MIME type
1384 * This API use to change default application associteted with mimetype
1385 * In general, Setting Application or Installer need this API.
1386 * @par Typical use case:
1387 * Default Application associated with mimetype can be changed by Setting Application or installer
1388 * So, application to process specific mimetype can be substituted.
1390 * @param[in] mimetype a mime type
1391 * @param[in] defapp a application appid of the app to be set
1392 * @return 0 if success, negative value if fail
1393 * @retval AUL_R_OK - success
1394 * @retval AUL_R_EINVAL - invalid argument(mimetype)
1395 * @retval AUL_R_ERROR - general error
1398 * aul_get_defapp_from_mime
1402 * void set_text_html_defapp()
1404 * aul_set_defapp_with_mime("text/html","org.tizen.browser");
1409 * This API is only available in User Session.
1411 int aul_set_defapp_with_mime(const char *mimetype, const char *defapp);
1415 * This API get the mimetype associated with filename
1417 * This API use to get mimetype associteted with given filename
1418 * In general, This API use when you want to know only mimetype given filename.
1419 * @par Typical use case:
1420 * For example, In trasfering data through bluetooth,
1421 * additional information like mimetype should be added.
1422 * In such situation, You can get mimetype by using this API.
1424 * @param[in] filename file name
1425 * @param[out] mimetype a mime type
1426 * @param[in] len length of mimetype
1427 * @return 0 if success, negative value if fail
1428 * @retval AUL_R_OK - success
1429 * @retval AUL_R_EINVAL - invalid argument(filename)
1430 * @retval AUL_R_ERROR - general error
1435 * void get_mimetype()
1437 * char mimetype[255];
1438 * aul_get_mime_from_file("image.jpg",mimetype,sizeof(mimetype));
1443 * This API is only available in User Session.
1445 int aul_get_mime_from_file(const char *filename, char *mimetype, int len);
1449 * This API get the mimetype associated with given content
1451 * This API use to get mimetype associteted with given content
1452 * In general, This API use when you want to know only mimetype given content
1453 * @par Typical use case:
1454 * For example, In trasfering data through bluetooth,
1455 * additional information like mimetype should be added.
1456 * In such situation, You can get mimetype by using this API.
1458 * @param[in] content content string like "011-0000-0000"
1459 * @param[out] mimetype a mime type
1460 * @param[in] len length of mimetype
1461 * @return 0 if success, negative value if fail
1462 * @retval AUL_R_OK - success
1463 * @retval AUL_R_EINVAL - invalid argument(content)
1464 * @retval AUL_R_ERROR - general error
1469 * void get_mimetype()
1471 * char mimetype[255];
1472 * aul_get_mime_from_content("http://www.samsung.com",mimetype,sizeof(mimetype));
1477 * This API is only available in User Session.
1479 int aul_get_mime_from_content(const char *content, char *mimetype, int len);
1483 * This API get the icon's name associated with given mimetype
1485 * This API use to get icon's name associteted with given mimetype
1486 * @par Typical use case:
1487 * If you want to show mimetype's icon, use this API.
1489 * @param[in] mimetype a mime type
1490 * @param[out] iconname icon's name
1491 * @param[in] len length of iconname
1492 * @return 0 if success, negative value if fail
1493 * @retval AUL_R_OK - success
1494 * @retval AUL_R_EINVAL - invalid argument(content)
1495 * @retval AUL_R_ERROR - general error (no such mime type)
1500 * void get_mime_icon()
1503 * aul_get_mime_icon("text/html",icon,sizeof(icon));
1508 * This API is only available in User Session.
1510 int aul_get_mime_icon(const char *mimetype, char *iconname, int len);
1514 * This API get the extensions associated with given mimetype
1516 * This API use to get extensions associteted with given mimetype
1517 * @par Typical use case:
1518 * In general, user is not familiar with mimetype(text/html),
1519 * user is familiar with extenstions(*.html, *.htm)
1520 * So, To show mimetype information to user, use this API
1522 * @param[in] mimetype a mime type
1523 * @param[out] extlist extentions (ex> mpeg,mpg,mpe)
1524 * @param[in] len length of extlist
1525 * @return 0 if success, negative value if fail
1526 * @retval AUL_R_OK - success
1527 * @retval AUL_R_EINVAL - invalid argument(mimetype)
1528 * @retval AUL_R_ERROR - general error (no mimetype or no extenstion)
1531 * aul_get_mime_description
1535 * void get_extension()
1537 * char extlist[255];
1538 * aul_get_mime_extension("text/html",extlist,sizeof(extlist));
1543 * Some mimetype don't have extension.
1544 * In that case, You can use aul_get_mime_description.
1545 * This API is only available in User Session.
1547 int aul_get_mime_extension(const char *mimetype, char *extlist, int len);
1551 * This API get the description associated with given mimetype
1553 * This API use to get description associteted with given mimetype
1554 * @par Typical use case:
1555 * In general, user is not familiar with mimetype(text/html),
1556 * user is familiar with well-knowing information like extenstions(*.html, *.htm)
1557 * But, some mimetype don't have extenstion.
1558 * At that time,to show mimetype information to user, use this API
1560 * @param[in] mimetype a mime type
1561 * @param[out] desc description (ex> Call client)
1562 * @param[in] len length of desc
1563 * @return 0 if success, negative value if fail
1564 * @retval AUL_R_OK - success
1565 * @retval AUL_R_EINVAL - invalid argument(mimetype)
1566 * @retval AUL_R_ERROR - general error (no mimetype or no descrition)
1569 * aul_get_mime_extension
1573 * void get_information_from_mime()
1576 * if(aul_get_mime_extension("text/html",info,sizeof(info))<0){
1577 * aul_get_mime_description("text/html",info,sizeof(info));
1583 * This API is only available in User Session.
1585 int aul_get_mime_description(const char *mimetype, char *desc, int len);
1589 * This API create service result bundle based on bundle received in reset event.
1591 * This API use to create result bundle to send it to caller.
1592 * @par Typical use case:
1593 * This API is for callee which provide application service.\n
1594 * To send result to caller, You must create result bundle. \n
1595 * Callee(application providing the service) can send result by using this API and aul_send_service_result.
1597 * @param[in] inb bundle received in reset event
1598 * @param[out] outb bundle to use for returning result
1599 * @return 0 if success, negative value(<0) if fail
1600 * @retval AUL_R_OK - success
1601 * @retval AUL_R_EINVAL - inb is not bundle created by aul_open_service
1602 * @retval AUL_R_ERROR - general error
1605 * To create result bundle, You need received original bundle.
1606 * The original bundle can get from app_reset handler.
1610 * aul_send_service_result
1613 * #include <bundle.h>
1615 * int app_reset(bundle *b, void *data)
1617 * ad->recved_bundle = bundle_dup(b);
1622 * bundle* res_bundle;
1623 * aul_create_result_bundle(ad->recved_bundle,&res_bundle);
1624 * bundle_add(res_bundle, "result", "1");
1625 * aul_send_service_result(res_bundle);
1629 * This API is only available in User Session.
1632 int aul_create_result_bundle(bundle *inb, bundle **outb);
1636 * This API send service result to caller with bundle
1638 * This API is used to send result bundle to caller.
1639 * @par Typical use case:
1640 * This API is for callee which provide application service.\n
1641 * To send result to caller, You can use this API after creating result bundle. \n
1642 * Callee(application to provide service) can send result by using this API and aul_create_result_bundle.
1644 * @param[in] b Result data in bundle format
1645 * @return 0 if success, negative value(<0) if fail
1646 * @retval AUL_R_OK - success
1647 * @retval AUL_R_EINVAL - invalid result bundle
1648 * @retval AUL_R_ECOMM - internal AUL IPC error
1649 * @retval AUL_R_ERROR - general error
1652 * To send result bundle, You must create result bundle.
1653 * see aul_create_result_bundle
1657 * aul_create_result_bundle
1660 * #include <bundle.h>
1662 * int app_reset(bundle *b, void *data)
1664 * ad->recved_bundle = bundle_dup(b);
1669 * bundle* res_bundle;
1670 * aul_create_result_bundle(ad->recved_bundle,&res_bundle);
1671 * bundle_add(res_bundle, "result", "1");
1672 * aul_send_service_result(res_bundle);
1676 * This API is only available in User Session.
1679 int aul_send_service_result(bundle *b);
1683 * This API sets callback fuction that will be called when applications die.
1685 * This API's purpose is to listen the application dead event.
1686 * In general, task manager Application need this API.
1688 * @param[in] func callback function
1689 * @param[in] data user data
1690 * @return 0 if success, negative value if fail
1691 * @retval AUL_R_OK - success
1692 * @retval AUL_R_ERROR - general error
1695 * aul_listen_app_launch_signal
1699 * int app_dead_handler(int pid, void *data)
1701 * printf("===> %s : %d\n", __FUNCTION__, pid);
1705 * void dead_listen()
1707 * aul_listen_app_dead_signal(app_dead_handler, NULL);
1712 * This API is only available in User Session.
1715 int aul_listen_app_dead_signal(int (*func) (int, void *), void *data);
1719 * This API sets callback fuction that will be called when applications are launched.
1721 * This API's purpose is to listen the application launching event.
1722 * In general, task manager Application need this API.
1724 * @param[in] func callback function
1725 * @param[in] data user data
1726 * @return 0 if success, negative value if fail
1727 * @retval AUL_R_OK - success
1728 * @retval AUL_R_ERROR - general error
1731 * aul_listen_app_dead_signal
1735 * int app_launch_handler(int pid, void *data)
1737 * printf("===> %s : %d\n", __FUNCTION__, pid);
1741 * void dead_listen()
1743 * aul_listen_app_launch_signal(app_launch_handler, NULL);
1748 * This API is only available in User Session.
1751 int aul_listen_app_launch_signal(int (*func) (int, void *), void *data);
1755 * This API sets callback fuction that will be called when applications are launched.
1757 * This API's purpose is to listen the application launching event.
1758 * In general, task manager Application need this API.
1760 * @param[in] func callback function
1761 * @param[in] data user data
1762 * @return 0 if success, negative value if fail
1763 * @retval AUL_R_OK - success
1764 * @retval AUL_R_ERROR - general error
1767 * aul_listen_app_dead_signal
1771 * int app_launch_handler(int pid, const char *app_id, void *data)
1773 * printf("===> %s : %d, %s\n", __FUNCTION__, pid, app_id);
1777 * void dead_listen()
1779 * aul_listen_app_launch_signal(app_launch_handler, NULL);
1784 * This API is only available in User Session.
1787 int aul_listen_app_launch_signal_v2(int (*func) (int, const char *, void *), void *data);
1791 * This API gets status of specified application process id.
1793 * This API's purpose is to get the application's status.
1795 * @param[in] pid pid of application
1796 * @return 0 or greater if success, nagative value if fail
1797 * @retval STATUS_LAUNCHING
1798 * @retval STATUS_CREATED
1799 * @retval STATUS_FOCUS
1800 * @retval STATUS_VISIBLE
1802 * @retval STATUS_DYING
1803 * @retval STATUS_HOME
1804 * @retval STATUS_NORESTART
1810 * int iterfunc(const aul_app_info *info, void *data)
1813 * status = aul_app_get_status_bypid(info->pid);
1814 * if (status == STATUS_FOCUS) {
1815 * printf("%s has focus", info->app_id);
1816 * (int *)data = info->pid;
1822 * int find_focus_app_pid()
1825 * aul_app_get_running_app_info(iterfunc, &pid);
1830 * This API is only available in User Session.
1832 int aul_app_get_status_bypid(int pid);
1836 * This API gets status of specified application process id.
1838 * This API's purpose is to get the application's status.
1840 * @param[in] pid pid of application
1841 * @param[in] uid User ID
1842 * @return 0 or greater if success, nagative value if fail
1843 * @retval STATUS_LAUNCHING
1844 * @retval STATUS_CREATED
1845 * @retval STATUS_FOCUS
1846 * @retval STATUS_VISIBLE
1848 * @retval STATUS_DYING
1849 * @retval STATUS_HOME
1850 * @retval STATUS_NORESTART
1853 * This API is only available to System user.
1855 int aul_app_get_status_bypid_for_uid(int pid, uid_t uid);
1859 * This API gets the status of specified application id.
1861 * This API's purpose is to get the status of the application.
1863 * @param[in] appid application ID
1864 * @return 0 or greater if success, nagative value if fail
1865 * @retval STATUS_LAUNCHING
1866 * @retval STATUS_FOCUS
1867 * @retval STATUS_VISIBLE
1869 * @retval STATUS_DYING
1870 * @retval STATUS_NORESTART
1880 * status = aul_app_get_status("org.tizen.helloworld");
1881 * if (status == STATUS_FOCUS)
1882 * printf("org.tizen.helloworld has focus");
1889 * This API is only available in User Session.
1891 int aul_app_get_status(const char *appid);
1895 * This API gets the status of specified application id.
1897 * This API's purpose is to get the status of the application
1899 * @param[in] appid application ID
1900 * @param[in] uid User ID
1901 * @return 0 or greater if success, nagative value if fail
1902 * @retval STATUS_LAUNCHING
1903 * @retval STATUS_FOCUS
1904 * @retval STATUS_VISIBLE
1906 * @retval STATUS_DYING
1907 * @retval STATUS_NORESTART
1910 * This API is only available to System user.
1912 int aul_app_get_status_for_uid(const char *appid, uid_t uid);
1916 * This API sets callback function that on application status changed.
1918 * This API's purpose is to listen the application's status changed within
1919 * the caller process. In general, a library that required to release resource on
1920 * application's status may use this API.
1922 * @param[in] func callback function
1923 * @param[in] data user data
1924 * @return 0 if success, negative value if fail
1925 * @retval AUL_R_OK - success
1926 * @retval AUL_R_ERROR - general error
1928 * aul_remove_status_local_cb
1932 * int status_changed(int status, void *data)
1934 * if (status == STATUS_FOCUS)
1935 * printf("%d has focus\n", getpid());
1937 * if (status == STATUS_VISIBLE)
1938 * printf("%d resume\n", getpid());
1940 * if (status == STATUS_BG0
1941 * printf("%d pause\n", getpid());
1944 * void listen_app_status()
1946 * aul_add_status_local_cb(status_changed, NULL);
1950 * This API is only available in User Session.
1953 int aul_add_status_local_cb(int (*func) (int, void *), void *data);
1957 * This API unsets callback function that on application status changed.
1959 * This API's purpose is to remove callback that added by
1960 * aul_add_status_local_cb.
1962 * @param[in] func callback function
1963 * @param[in] data user data
1964 * @return 0 if success, negative value if fail
1965 * @retval AUL_R_OK - success
1966 * @retval AUL_R_ERROR - general error
1969 * aul_add_status_local_cb
1973 * int status_changed(int status, void *data)
1975 * if (status == STATUS_FOCUS)
1976 * printf("%d has focus\n", getpid());
1978 * if (status == STATUS_VISIBLE)
1979 * printf("%d resume\n", getpid());
1981 * if (status == STATUS_BG0
1982 * printf("%d pause\n", getpid());
1985 * void listen_app_status()
1987 * aul_add_status_local_cb(status_changed, NULL);
1990 * void ignore_app_status()
1992 * aul_remove_status_local_cb(status_changed, NULL);
1997 * This API is only available in User Session.
2000 int aul_remove_status_local_cb(int (*func) (int, void *), void *data);
2003 * This API is only for appfw internally.
2005 int aul_set_process_group(int parent_pid, int child_pid);
2008 * This API is only for Appfw internally.
2010 int aul_terminate_bgapp_pid(int pid);
2013 * This API is only for Appfw internally.
2015 int aul_terminate_pid_without_restart(int pid);
2018 * This API is only for Appfw internally.
2020 const char *aul_get_app_external_root_path(void);
2023 * This API is only for Appfw internally.
2025 const char *aul_get_app_root_path(void);
2028 * This API is only for Appfw internally.
2030 const char *aul_get_app_data_path(void);
2033 * This API is only for Appfw internally.
2035 const char *aul_get_app_cache_path(void);
2038 * This API is only for Appfw internally.
2040 const char *aul_get_app_resource_path(void);
2043 * This API is only for Appfw internally.
2045 const char *aul_get_app_tep_resource_path(void);
2048 * This API is only for Appfw internally.
2050 int aul_get_app_shared_data_path(char **path);
2053 * This API is only for Appfw internally.
2055 const char *aul_get_app_shared_resource_path(void);
2058 * This API is only for Appfw internally.
2060 const char *aul_get_app_shared_trusted_path(void);
2063 * This API is only for Appfw internally.
2065 const char *aul_get_app_external_data_path(void);
2068 * This API is only for Appfw internally.
2070 const char *aul_get_app_external_cache_path(void);
2073 * This API is only for Appfw internally.
2075 const char *aul_get_app_external_shared_data_path(void);
2078 * This API is only for Appfw internally.
2080 const char *aul_get_app_specific_path(void);
2083 * This API is only for Appfw internally.
2085 const char *aul_get_app_external_specific_path(void);
2088 * This API is only for Appfw internally.
2090 int aul_get_app_shared_data_path_by_appid(const char *app_id, char **path);
2093 * This API is only for Appfw internally.
2095 int aul_get_app_shared_resource_path_by_appid(const char *app_id, char **path);
2098 * This API is only for Appfw internally.
2100 int aul_get_app_shared_trusted_path_by_appid(const char *app_id, char **path);
2103 * This API is only for Appfw internally.
2105 int aul_get_app_external_shared_data_path_by_appid(const char *app_id, char **path);
2108 * This API is only for Appfw internally.
2110 int aul_get_usr_app_shared_data_path_by_appid(const char *app_id, char **path, uid_t uid);
2113 * This API is only for Appfw internally.
2115 int aul_get_usr_app_shared_resource_path_by_appid(const char *app_id, char **path, uid_t uid);
2118 * This API is only for Appfw internally.
2120 int aul_get_usr_app_shared_trusted_path_by_appid(const char *app_id, char **path, uid_t uid);
2123 * This API is only for Appfw internally.
2125 int aul_get_usr_app_external_shared_data_path_by_appid(const char *app_id, char **path, uid_t uid);
2128 * This type is only for Appfw internally.
2130 typedef int (*subapp_fn)(void *data);
2133 * This API is only for Appfw internally.
2135 int aul_set_subapp(subapp_fn cb, void *data);
2138 * This API is only for Appfw internally.
2140 int aul_subapp_terminate_request_pid(int pid);
2143 * This API is only for Appfw internally.
2145 int aul_is_subapp(void);
2148 * This API is only for Appfw internally.
2150 int aul_kill_pid(int pid);
2153 * This API is only for Appfw internally.
2155 int aul_add_caller_cb(int pid, void (*caller_cb) (int, void *), void *data);
2158 * This API is only for Appfw internally.
2160 int aul_remove_caller_cb(int pid, void *data);
2163 * This API is only for Appfw internally.
2165 int aul_invoke_caller_cb(void *data);
2168 * This API is only for Appfw internally.
2170 void aul_set_preinit_window(void *evas_object);
2173 * This API is only for Appfw internally.
2175 void* aul_get_preinit_window(const char *win_name);
2178 * This API is only for Appfw internally.
2180 void aul_set_preinit_background(void *evas_object);
2183 * This API is only for Appfw internally.
2185 void* aul_get_preinit_background(void);
2188 * This API is only for Appfw internally.
2190 void aul_set_preinit_conformant(void *evas_object);
2193 * This API is only for Appfw internally.
2195 void* aul_get_preinit_conformant(void);
2198 * This API is only for Appfw internally.
2200 void aul_set_preinit_appid(const char *appid);
2203 * This API is only for Appfw internally.
2205 void aul_set_preinit_pkgid(const char *pkgid);
2208 * This API is only for Appfw internally.
2210 void aul_set_preinit_root_path(const char *root_path);
2213 * This API is only for Appfw internally.
2215 const char *aul_get_preinit_root_path(void);
2218 * This API is only for Appfw internally.
2220 int aul_update_freezer_status(int pid, const char* type);
2223 * This API is only for Appfw internally.
2225 int aul_send_app_launch_request_signal(int pid, const char* appid, const char* pkgid, const char* type);
2228 * This API is only for Appfw internally.
2230 int aul_send_app_resume_request_signal(int pid, const char* appid, const char* pkgid, const char *type);
2233 * This API is only for Appfw internally.
2235 int aul_send_app_terminate_request_signal(int pid, const char* appid, const char* pkgid, const char *type);
2238 * This API is only for Appfw internally.
2240 int aul_send_app_status_change_signal(int pid, const char* appid, const char* pkgid, const char* status, const char *type);
2243 * This API is only for Appfw internally.
2245 int aul_send_app_terminated_signal(int pid);
2248 * This API is only for Appfw internally.
2250 int aul_send_app_group_signal(int owner_pid, int child_pid, const char *child_pkgid);
2253 * This API is only for Appfw internally.
2255 int aul_invoke_status_local_cb(int status);
2258 * This type is only for Appfw internally.
2260 typedef int (*data_control_provider_handler_fn) (bundle *b, int request_id, void *data);
2263 * This API is only for Appfw internally.
2265 int aul_set_data_control_provider_cb(data_control_provider_handler_fn handler);
2268 * This API is only for Appfw internally.
2270 int aul_unset_data_control_provider_cb(void);
2273 * This API is only for Appfw internally.
2275 int aul_pause_app(const char *appid);
2278 * This API is only for Appfw internally.
2280 int aul_pause_app_for_uid(const char *appid, uid_t uid);
2283 * This API is only for Appfw internally.
2285 int aul_pause_pid(int pid);
2288 * This API is only for Appfw internally.
2290 int aul_pause_pid_for_uid(int pid, uid_t uid);
2293 * This API is only for Appfw internally.
2295 int aul_reload_appinfo(void);
2298 * This API is only for Appfw internally.
2300 int aul_status_update(int status);
2303 * This API is only for Appfw internally.
2305 int aul_running_list_update(char *appid, char *app_path, char *pid);
2308 * This API is only for Appfw internally.
2310 int aul_app_group_get_window(int pid);
2313 * This API is only for Appfw internally.
2315 int aul_app_group_set_window(int wid);
2318 * This API is only for Appfw internally.
2320 void aul_app_group_get_leader_pids(int *cnt, int **pids);
2323 * This API is only for Appfw internally.
2325 void aul_app_group_get_group_pids(int leader_pid, int *cnt, int **pids);
2328 * This API is only for Appfw internally.
2330 int aul_app_group_get_leader_pid(int pid);
2333 * This API is only for Appfw internally.
2335 int aul_app_group_clear_top(void);
2338 * This API is only for Appfw internally.
2340 int aul_app_group_is_top(void);
2343 * This API is only for Appfw internally.
2345 int aul_app_group_get_fg_flag(int pid);
2348 * This API is only for Appfw internally.
2350 void aul_app_group_lower(int *exit);
2353 * This API is only for Appfw internally.
2355 void aul_app_group_get_idle_pids(int *cnt, int **pids);
2359 * This API puts some app below the caller app
2361 * This API's purpose is to reorder window stack limitedly.
2363 * @param[in] below_appid The appid to be reordered below the caller app
2364 * @return Loader ID if success, negative value(<0) if fail
2367 * The caller app should be resumed before calling this API.
2368 * below_appid should be main app which have been launched before.
2369 * This API is only available in User Session.
2371 int aul_app_group_activate_below(const char *below_appid);
2374 * This API is only for Appfw internally.
2376 int aul_request_data_control_socket_pair(bundle *b, int *fd);
2378 * This API is only for Appfw internally.
2380 int aul_request_message_port_socket_pair(int *fd);
2382 * This API is only for Appfw internally.
2384 int aul_listen_booting_done_signal(int (*func) (int, void *), void *data);
2387 * This API is only for Appfw internally.
2389 int aul_listen_cooldown_signal(int (*func) (const char *, void *), void *data);
2393 * This API registers a callback function that will be called when the
2394 * status of the application is changed.
2396 * This API is for monitoring the status of all applications.
2398 * @param[in] func callback function
2399 * @param[in] data user data
2400 * @return 0 if success, negative value if fail
2401 * @retval AUL_R_OK - success
2402 * @retval AUL_R_ERROR - general error
2407 * int app_status_handler(int pid, int status, void *data)
2409 * const char *app_status;
2413 * app_status = "STATUS_LAUNCHING";
2416 * app_status = "STATUS_VISIBLE";
2419 * app_status = "STATUS_BACKGROUND";
2422 * app_status = "STATUS_FOCUS";
2425 * app_status = "STATUS_UNKNOWN";
2428 * printf("pid: %d, status: %s", pid, status);
2432 * int main(int argc, char **argv)
2436 * ret = aul_listen_app_status_signal(app_status_handler, NULL);
2437 * if (ret != AUL_R_OK) {
2438 * printf("Failed to add status handler");
2448 int aul_listen_app_status_signal(int (*func)(int, int, void *), void *data);
2451 * This API is only for Appfw internally.
2453 int aul_check_tep_mount(const char *tep_path);
2456 * This API is only for Appfw internally.
2458 int aul_is_tep_mount_dbus_done(const char *tep_string);
2461 * This API is only for Appfw internally.
2463 int aul_forward_app(const char *appid, bundle *kb);
2467 * This API create custom launchpad-loader
2469 * This API's purpose is to make a slot for custom loader.
2470 * Once it is made, added loader will make a candidate process to use.
2472 * @param[in] loader_path The file name of the custom loader binary including full path
2473 * @param[in] extra A bundle to be passed to the custom loader
2474 * @return Loader ID if success, negative value(<0) if fail
2477 * This API is only for Appfw internally.
2478 * This API is only available in User Session.
2480 int aul_add_loader(const char *loader_path, bundle *extra);
2484 * This API create custom launchpad-loader
2486 * This API's purpose is to make a slot for custom loader.
2487 * Once it is made, added loader will make a candidate process to use.
2489 * @param[in] loader_path The file name of the custom loader binary including full path
2490 * @param[in] extra A bundle to be passed to the custom loader
2491 * @param[in] uid User ID
2492 * @return Loader ID if success, negative value(<0) if fail
2495 * This API is only for Appfw internally.
2496 * This API is only available to System user.
2498 int aul_add_loader_for_uid(const char *loader_path, bundle *extra, uid_t uid);
2503 * This API destroy custom launchpad-loader
2505 * This API's purpose is to remove a slot for custom loader.
2506 * Once it is removed, the prepared process will be removed as well.
2508 * @param[in] loader_id Loader ID
2509 * @return 0 if success, negative value(<0) if fail
2512 * This API is only for Appfw internally.
2513 * This API is only available in User Session.
2515 int aul_remove_loader(int loader_id);
2519 * This API destroy custom launchpad-loader
2521 * This API's purpose is to remove a slot for custom loader.
2522 * Once it is removed, the prepared process will be removed as well.
2524 * @param[in] loader_id Loader ID
2525 * @param[in] uid User ID
2526 * @return 0 if success, negative value(<0) if fail
2529 * This API is only for Appfw internally.
2530 * This API is only available to System user.
2532 int aul_remove_loader_for_uid(int loader_id, uid_t uid);
2536 * This API gets specified application process id.
2538 * The purpose of this API is to get the pid of specified application.
2540 * @param[in] appid application name
2541 * @return callee's pid if success, negative value(<0) if fail
2544 * This API is only available in User Session.
2546 int aul_app_get_pid(const char *appid);
2550 * This API gets specified application process id.
2552 * The purpose of this API is to get the pid of specified application.
2554 * @param[in] appid application name
2555 * @param[in] uid User ID
2556 * @return callee's pid if success, negative value(<0) if fail
2559 * This API is only available to System user.
2561 int aul_app_get_pid_for_uid(const char *appid, uid_t uid);
2565 * This function update rua stat.
2567 * @param[in] b Bundle object contains caller and tag information.
2568 * @param[in] uid Target uid
2570 * @return 0 if success, negative value(<0) if fail
2572 * @remarks This API is only for Appfw internally.
2581 bundle *b = bundle_create();
2582 bundle_add_str(b, AUL_SVC_K_RUA_STAT_CALLER, caller);
2583 bundle_add_str(b, AUL_SVC_K_RUA_STAT_TAG, tag);
2585 r = aul_update_rua_stat_for_uid(b);
2590 int aul_update_rua_stat_for_uid(bundle *b, uid_t uid);
2594 * This function add rua history.
2596 * @param[in] b Bundle object Target Package name or app path.
2597 * @param[in] uid Target uid
2599 * @return 0 if success, negative value(<0) if fail
2601 * @remarks This API is only for Appfw internally.
2610 bundle *b = bundle_create();
2612 bundle_add_str(b, AUL_K_RUA_PKGNAME, pkg_name);
2614 bundle_add_str(b, AUL_K_RUA_APPPATH, app_path);
2616 r = aul_add_rua_history_for_uid(b);
2621 int aul_add_rua_history_for_uid(bundle *b, uid_t uid);
2625 * This function delete rua history.
2627 * @param[in] b Bundle object Target Package name. If NULL or has no value, delete all rua history.
2628 * @param[in] uid Target uid
2630 * @return 0 if success, negative value(<0) if fail
2632 * @remarks This API is only for Appfw internally.
2643 b = bundle_create();
2644 bundle_add_str(b, AUL_K_RUA_PKGNAME, pkg_name);
2646 r = aul_delete_rua_history_for_uid(b, getuid());
2651 int aul_delete_rua_history_for_uid(bundle *b, uid_t uid);
2656 * This function sets the default application(application id) associated with operatioin, uri and mime-type.
2658 * @param[in] b Bundle object Target application id and operation, uri and mime-type.
2660 * @return 0 if success, negative value(<0) if fail
2662 * @remarks This API is only for Appfw internally.
2667 #include <aul_svc.h>
2672 bundle *b = bundle_create();
2674 const char *appid = "org.tizen.test";
2675 const char *operation = "test_operation";
2676 const char *mime_type = "test_mime";
2677 const char *uri = "test_uri";
2679 aul_svc_set_operation(b, operation);
2680 aul_svc_set_mime(b, mime_type);
2681 aul_svc_set_uri(b, uri);
2683 aul_svc_set_appid(b, appid)
2685 r = aul_set_default_app_by_operation(b);
2690 int aul_set_default_app_by_operation(bundle *b);
2694 * This API unset the default application(application id) associated with operation, uri and mime-type.
2696 * @param[in] app_id The ID of the application
2698 * @return 0 if success, negative value(<0) if fail
2711 aul_unset_default_app_by_operation("org.tizen.test");
2716 int aul_unset_default_app_by_operation(const char *app_id);
2720 * This API launches application with the given bundle asynchronously.
2721 * If the application is not running or a multiple-instance one, this API launches with the given bundle.
2722 * If the application is running, this API sends a RESET event to the App.
2723 * While the application is running, if the application cannot receive the RESET event,
2724 * this API returns a general error(AUL_R_ERROR).\n
2726 * This API is for caller.
2727 * This API's purpose is to launch/reset application with given bundle.
2728 * @par Typical use case:
2729 * If you know the target application's pkgname and bundle types,
2730 * you can use this API to launch/reset the application.
2732 * @param[in] pkgname package name to be run as callee
2733 * @param[in] kb bundle to be passed to callee
2734 * @return 0 if success, negative value(<0) if fail
2735 * @retval AUL_R_OK - success
2736 * @retval AUL_R_EINVAL - invaild package name
2737 * @retval AUL_R_ECOM - internal AUL IPC error
2738 * @retval AUL_R_ERROR - general error
2741 * This API is only available in User Session.
2742 * This API doesn't check whether the callee application is executed successfully.
2744 int aul_launch_app_async(const char *appid, bundle *kb);
2748 * This API launches application with the given bundle asynchronously.
2749 * If the application is not running or a multiple-instance one, this API launches with the given bundle.
2750 * If the application is running, this API sends a RESET event to the App.
2751 * While the application is running, if the application cannot receive the RESET event,
2752 * this API returns a general error(AUL_R_ERROR).\n
2754 * This API is for caller.
2755 * This API's purpose is to launch/reset application with given bundle.
2756 * @par Typical use case:
2757 * If you know the target application's pkgname and bundle types,
2758 * you can use this API to launch/reset the application.
2760 * @param[in] pkgname package name to be run as callee
2761 * @param[in] kb bundle to be passed to callee
2762 * @param[in] uid User ID
2763 * @return 0 if success, negative value(<0) if fail
2764 * @retval AUL_R_OK - success
2765 * @retval AUL_R_EINVAL - invaild package name
2766 * @retval AUL_R_ECOM - internal AUL IPC error
2767 * @retval AUL_R_ERROR - general error
2770 * This API is only available to System user.
2771 * This API doesn't check whether the callee application is executed successfully.
2773 int aul_launch_app_async_for_uid(const char *appid, bundle *kb, uid_t uid);
2777 * This API request launchpad to make candidate processes.
2779 * @return 0 if success, negative value(<0) if fail
2782 * This API is only available in User Session.
2784 int aul_prepare_candidate_process(void);
2787 * This API is only for Appfw internally.
2789 int aul_widget_instance_add(const char *widget_id, const char *instance_id);
2792 * This API is only for Appfw internally.
2794 int aul_widget_instance_del(const char *widget_id, const char *instance_id);
2797 * This API is only for Appfw internally.
2799 typedef void (*aul_widget_instance_foreach_cb)(const char *instance_id, void *data);
2802 * This API is only for Appfw internally.
2804 int aul_widget_instance_foreach(const char *widget_id, aul_widget_instance_foreach_cb cb, void *data);
2807 * This API is only for Appfw internally.
2809 int aul_widget_instance_update(const char *widget_id, const char *instance_id, bundle *b);
2813 * This API gets the last caller process id of specified application process id.
2815 * This API's purpose is to get the application's last caller process id.
2817 * @param[in] pid pid of application
2818 * @return caller pid if success, nagative value if fail
2821 * This API is only available in User Session.
2823 int aul_app_get_last_caller_pid(int pid);
2827 * This API gets the last caller process id of specified application process id.
2829 * This API's purpose is to get the last caller process id of the application.
2831 * @param[in] pid pid of application
2832 * @param[in] uid User ID
2833 * @return caller pid if success, nagative value if fail
2836 * This API is only available in System users.
2838 int aul_app_get_last_caller_pid_for_uid(int pid, uid_t uid);