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_ENOENT = -15, /**< App directory entry error */
35 AUL_R_EREJECTED = -14, /**< App disable for mode */
36 AUL_R_ENOAPP = -13, /**< Failed to find app ID or pkg ID */
37 AUL_R_EHIDDENFORGUEST = -11, /**< App hidden for guest mode */
38 AUL_R_ENOLAUNCHPAD = -10, /**< no launchpad */
39 AUL_R_ETERMINATING = -9, /**< application terminating */
40 AUL_R_EILLACC = -8, /**< Illegal Access */
41 AUL_R_LOCAL = -7, /**< Launch by himself */
42 AUL_R_ETIMEOUT = -6, /**< Timeout */
43 AUL_R_ECANCELED = -5, /**< Operation canceled */
44 AUL_R_EINVAL = -4, /**< Invalid argument */
45 AUL_R_ECOMM = -3, /**< Comunication Error */
46 AUL_R_ENOINIT = -2, /**< AUL handler NOT initialized */
47 AUL_R_ERROR = -1, /**< General error */
48 AUL_R_OK = 0 /**< General success */
64 typedef enum _aul_type {
76 typedef enum aul_widget_lifecycle_event {
77 AUL_WIDGET_LIFE_CYCLE_EVENT_APP_DEAD = 0,
78 AUL_WIDGET_LIFE_CYCLE_EVENT_CREATE = 1, /**< The widget is created */
79 AUL_WIDGET_LIFE_CYCLE_EVENT_DESTROY = 2, /**< The widget is destroyed */
80 AUL_WIDGET_LIFE_CYCLE_EVENT_PAUSE = 3, /**< The widget is paused */
81 AUL_WIDGET_LIFE_CYCLE_EVENT_RESUME = 4 /**< The widget is resumed */
82 } aul_widget_lifecycle_event_e;
84 typedef enum aul_widget_instance_event {
85 AUL_WIDGET_INSTANCE_EVENT_CREATE = 0,
86 AUL_WIDGET_INSTANCE_EVENT_DESTROY = 1,
87 AUL_WIDGET_INSTANCE_EVENT_TERMINATE = 2,
88 AUL_WIDGET_INSTANCE_EVENT_PAUSE = 3,
89 AUL_WIDGET_INSTANCE_EVENT_RESUME = 4,
90 AUL_WIDGET_INSTANCE_EVENT_UPDATE = 5,
91 AUL_WIDGET_INSTANCE_EVENT_PERIOD_CHANGED = 6,
92 AUL_WIDGET_INSTANCE_EVENT_SIZE_CHANGED = 7,
93 AUL_WIDGET_INSTANCE_EVENT_EXTRA_UPDATED = 8,
94 AUL_WIDGET_INSTANCE_EVENT_FAULT = 9,
95 AUL_WIDGET_INSTANCE_EVENT_APP_RESTART_REQUEST = 10
96 } aul_widget_instance_event_e;
98 /** AUL public key - To check caller's secuirty */
99 #define AUL_K_CALLER_PID "__AUL_CALLER_PID__"
100 /** AUL public key - To check callee's secuirty */
101 #define AUL_K_CALLEE_PID "__AUL_CALLEE_PID__"
102 /** AUL public key - added for multiuser mode */
103 #define AUL_K_CALLER_UID "__AUL_CALLER_UID__"
104 /** AUL public key - added for multiuser mode */
105 #define AUL_K_CALLEE_UID "__AUL_CALLEE_UID__"
106 /** AUL public key - added for multiuser mode */
107 #define AUL_K_TARGET_UID "__AUL_TARGET_UID__"
108 /** AUL public key - To check caller's secuirty */
109 #define AUL_K_CALLER_APPID "__AUL_CALLER_APPID__"
110 /** AUL public key - To check caller's secuirty */
111 #define AUL_K_CALLEE_APPID "__AUL_CALLEE_APPID__"
112 /** AUL public key - To find argv0 */
113 #define AUL_K_ARGV0 "__AUL_ARGV0__"
114 /** AUL public key - To measure launching time */
115 #define AUL_K_STARTTIME "__AUL_STARTTIME__"
116 /** AUL public key - To support launching based on mime type */
117 #define AUL_K_MIME_TYPE "__AUL_MIME_TYPE__"
118 /** AUL public key - To support launching based on mime type */
119 #define AUL_K_UNALIASED_MIME_TYPE "__AUL_UNALIASED_MIME_TYPE__"
120 /** AUL public key - To support launching based on mime type */
121 #define AUL_K_MIME_CONTENT "__AUL_MIME_CONTENT__"
122 /** AUL public key - To support launching based on service */
123 #define AUL_K_SERVICE_NAME "__AUL_SERVICE_NAME__"
124 /** AUL public key - To force launch app selector instead of lauchingn default app */
125 #define AUL_K_FORCE_LAUNCH_APP_SELECTOR "__AUL_FORCE_LAUNCH_APP_SELECTOR__"
126 /** AUL public key - To support debug argument */
127 #define AUL_K_DEBUG "__AUL_DEBUG__"
128 /** AUL public key - To support SDK */
129 #define AUL_K_SDK "__AUL_SDK__"
130 /** AUL public key - To support Media key */
131 #define AUL_K_MULTI_KEY "__AUL_MULTI_KEY__"
132 /** AUL public key - To support Media key */
133 #define AUL_K_MULTI_KEY_EVENT "__AUL_MULTI_KEY_EVENT__"
134 /** AUL public bundle value */
135 #define AUL_K_PRIVACY_APPID "__AUL_PRIVACY_APPID__"
136 /** AUL public bundle value - To support Media key*/
137 #define AUL_V_KEY_PRESSED "__AUL_KEY_PRESSED__"
138 /** AUL public bundle value - To support Media key*/
139 #define AUL_V_KEY_RELEASED "__AUL_KEY_RELEASED__"
140 /** AUL public key - To support rua stat */
141 #define AUL_SVC_K_RUA_STAT_CALLER "__K_RUA_STAT_CALLER__"
142 #define AUL_SVC_K_RUA_STAT_TAG "__K_RUA_STAT_TAG__"
143 /** AUL public key - To support rua delete */
144 #define AUL_K_RUA_PKGNAME "__K_RUA_PKGNAME"
145 /** AUL public key - To support rua delete */
146 #define AUL_K_RUA_APPPATH "__K_RUA_APPPATH"
147 /** AUL public key - To support rua add */
148 #define AUL_K_RUA_ARG "__K_RUA_ARG"
149 /** AUL public key - To support rua add */
150 #define AUL_K_RUA_TIME "__K_RUA_TIME"
151 /** AUL public bundle value */
152 #define AUL_K_RUA_INSTANCE_ID "__K_RUA_INSTANCE_ID"
153 /** AUL public bundle value */
154 #define AUL_K_RUA_INSTANCE_NAME "__K_RUA_INSTANCE_NAME"
155 /** AUL public bundle value */
156 #define AUL_K_RUA_ICON "__K_RUA_ICON"
157 /** AUL public bundle value */
158 #define AUL_K_RUA_URI "__K_RUA_URI"
160 /** AUL internal private key */
161 #define AUL_K_PKG_NAME "__AUL_PKG_NAME__"
162 /** AUL internal private key */
163 #define AUL_K_WAIT_RESULT "__AUL_WAIT_RESULT__"
164 /** AUL internal private key */
165 #define AUL_K_SEND_RESULT "__AUL_SEND_RESULT__"
166 /** AUL internal private key */
167 #define AUL_K_TASK_MANAGE "__AUL_TASK_MANAGE__"
168 /** AUL internal private key */
169 #define AUL_K_APP_TYPE "__AUL_APP_TYPE__"
170 /** AUL internal private key - To check original caller's identity */
171 #define AUL_K_ORG_CALLER_PID "__AUL_ORG_CALLER_PID__"
172 /** AUL internal private key - To check forwarded callee app's pid */
173 #define AUL_K_FWD_CALLEE_PID "__AUL_FWD_CALLEE_PID__"
174 /** AUL internal private key */
175 #define AUL_K_NO_CANCEL "__AUL_NO_CANCEL__"
176 /** AUL internal private key */
177 #define AUL_K_EXEC "__AUL_EXEC__"
178 /** AUL internal private key */
179 #define AUL_K_MULTIPLE "__AUL_MULTIPLE__"
180 /** AUL internal private key */
181 #define AUL_K_PACKAGETYPE "__AUL_PACKAGETYPE__"
182 /** AUL internal private key */
183 #define AUL_K_HWACC "__AUL_HWACC__"
184 /** AUL internal private key */
185 #define AUL_K_APPID "__AUL_APPID__"
186 /** AUL internal private key */
187 #define AUL_K_PID "__AUL_PID__"
188 /** AUL internal private key */
189 #define AUL_K_WID "__AUL_WID__"
190 /** AUL internal private key */
191 #define AUL_K_LEADER_PID "__AUL_LEADER_PID__"
192 /** AUL internal private key - To support data control */
193 #define AUL_K_DATA_CONTROL_TYPE "__AUL_DATA_CONTROL_TYPE__"
194 /** AUL internal private key */
195 #define AUL_K_PKGID "__AUL_PKGID_"
196 /** AUL internal private key */
197 #define AUL_K_INTERNAL_POOL "__AUL_INTERNAL_POOL__"
198 /** AUL internal private key */
199 #define AUL_TEP_PATH "_AUL_TEP_PATH_"
200 /** AUL internal private key */
201 #define AUL_K_COMP_TYPE "__AUL_COMP_TYPE__"
202 /** AUL internal private key */
203 #define AUL_K_LOADER_ID "__AUL_LOADER_ID__"
204 /** AUL internal private key */
205 #define AUL_K_LOADER_PATH "__AUL_LOADER_PATH__"
206 /** AUL internal private key */
207 #define AUL_K_LOADER_EXTRA "__AUL_LOADER_EXTRA__"
208 /** AUL internal private key */
209 #define AUL_K_LOADER_NAME "__AUL_LOADER_NAME__"
210 /** AUL internal private key */
211 #define AUL_K_WAYLAND_DISPLAY "__AUL_WAYLAND_DISPLAY__"
212 /** AUL internal private key */
213 #define AUL_K_WAYLAND_WORKING_DIR "__AUL_WAYLAND_WORKING_DIR__"
214 /** AUL internal private key */
215 #define AUL_K_COM_SENDER_PID "__AUL_COM_SENDER_PID__"
216 /** AUL internal private key */
217 #define AUL_K_COM_ENDPOINT "__AUL_COM_ENDPOINT__"
218 /** AUL internal private key */
219 #define AUL_K_COM_PRIVILEGE "__AUL_COM_PRIVILEGE__"
220 /** AUL internal private key */
221 #define AUL_K_COM_PROPAGATE "__AUL_COM_PROPAGATE__"
222 /** AUL internal private key */
223 #define AUL_K_COM_FILTER "__AUL_COM_FILTER__"
224 /** AUL internal private key */
225 #define AUL_K_COM_RESULT "__AUL_COM_RESULT__"
226 /** AUL internal private key */
227 #define AUL_K_ROOT_PATH "__AUL_ROOT_PATH__"
228 /** AUL internal private key */
229 #define AUL_K_SEQ_NUM "__AUL_SEQ_NUM__"
230 /** AUL internal private key */
231 #define AUL_K_API_VERSION "__AUL_API_VERSION__"
232 /** AUL internal private key */
233 #define AUL_K_ALLOWED_BG "__AUL_ALLOWED_BG__"
234 /** AUL internal private key */
235 #define AUL_K_OWNER_PID "__AUL_OWNER_PID__"
236 /** AUL internal private key */
237 #define AUL_K_CHILD_PID "__AUL_CHILD_PID__"
238 /** AUL internal private key */
239 #define AUL_K_WIDGET_VIEWER "__AUL_WIDGET_VIEWER__"
240 /** AUL internal private key */
241 #define AUL_K_WIDGET_ID "__AUL_WIDGET_ID__"
242 /** AUL internal private key */
243 #define AUL_K_WIDGET_INSTANCE_ID "__AUL_WIDGET_INSTANCE_ID__"
244 /** AUL internal private key */
245 #define AUL_K_WIDGET_STATUS "__AUL_WIDGET_STATUS__"
246 /** AUL internal private key */
247 #define AUL_K_WIDGET_CONTENT_INFO "__AUL_WIDGET_CONTENT_INFO__"
248 /** AUL internal private key */
249 #define AUL_K_TARGET_PID "__AUL_TARGET_PID__"
250 /** AUL internal private key */
251 #define AUL_K_ALIAS_APPID "__AUL_ALIAS_APPID__"
252 /** AUL internal private key */
253 #define AUL_K_ORG_APPID "__AUL_ORG_APPID__"
254 /** AUL internal private key */
255 #define AUL_K_STATUS "__AUL_STATUS__"
256 /** AUL internal private key */
257 #define AUL_K_IS_SUBAPP "__AUL_IS_SUBAPP__"
258 /** AUL internal private key */
259 #define AUL_K_INSTANCE_ID "__AUL_INSTANCE_ID__"
260 /** AUL internal private key */
261 #define AUL_K_ORG_CALLER_UID "__AUL_ORG_CALLER_UID__"
264 * @brief This is callback function for aul_launch_init
265 * @param[in] type event's type received from system
266 * @param[in] b In case of RESET events, bundle which is received from peer
267 * @param[in] data user-supplied data
269 typedef int (*aul_handler_fn)(aul_type type, bundle *b, void *data);
273 * This API install your AUL handler and setup AUL internal connection.
275 * AUL receive START(RESET), RESUME, TERMINATE events from system.\n
276 * This API use to handle the events. \n
277 * @par Typical use case:
278 * In general, you need not use this API.
279 * If you use AppCore, you should NOT use this API.
280 * AppCore will set default aul_handler.
282 * @param[in] handler aul main callback handler function
283 * @param[in] data user-supplied data for start_handler
284 * @return 0 if success, negative value(<0) if fail\n
285 * @retval AUL_R_OK - success
286 * @retval AUL_R_ECANCELD - aul handler was installed already by others
287 * @retval AUL_R_ECOMM - error to create internal ipc
288 * @retval AUL_R_ERROR - error to attach glib main loop
290 * @warning If you use AppCore, you should NOT use this API.\n
291 * You need glib main loop.\n
293 * you must have aul handler to use this API.
294 * aul_luanch_init register aul handler.
297 * #include <bundle.h>
299 * static int aul_handler(aul_type type, bundle *kb,void *data)
304 * // process RESET event
307 * // process RESUME event
309 * case AUL_TERMINATE:
310 * // preocess TERMINATE event
316 * static GMainLoop *mainloop = NULL;
318 * int main(int argc, char **argv)
320 * aul_launch_init(aul_handler,NULL);
321 * aul_launch_argv_handler(argc, argv);
323 * mainloop = g_main_loop_new(NULL, FALSE);
324 * g_main_loop_run(mainloop);
329 * This API is only available in User Session.
331 int aul_launch_init(aul_handler_fn handler, void *data);
335 * This API create internal RESET events with given argc, argv \n
337 * This API's purpose is to generate reset event.
338 * If you want to generate local RESET events with argument vector format, use this API
339 * @par Typical use case:
340 * In general, you need not use this API.
341 * AppCore use this API to create internal reset event.
343 * @param[in] argc # of args
344 * @param[in] argv list of arg strings
345 * @return 0 if success, negative value(<0) if fail
346 * @retval AUL_R_OK - success
347 * @retval AUL_R_ENOINIT - aul handler was NOT yet installed
348 * @retval AUL_R_ECANCLED - error to create internal bundle with given argc,argv.
349 * @retval AUL_R_ERROR - general error
352 * you must have aul handler to use this API.
353 * aul_luanch_init register aul handler.
358 * #include <bundle.h>
360 * int send_local_reset_event()
364 * argv[0] = "local.app";
365 * argv[1] = "event_type";
366 * argv[2] = "my_reset";
368 * aul_launch_argv_handler(argc,argv);
373 * If you use AppCore, you NEED NOT use this API.
374 * This API is only available in User Session.
376 int aul_launch_argv_handler(int argc, char **argv);
380 * This API creates internal RESET events with given bundle \n
382 * This API's purpose is to generate reset event.
383 * If you want to generate local RESET events with argument vector format, first use
384 * bundle_import_from_argv to create a bundle from the argument vector and then use this API
385 * Eventually, this API will replace aul_launch_argv_handler().
386 * @par Typical use case:
387 * In general, you need not use this API.
388 * AppCore use this API to create internal reset event.
390 * @param[in] b bundle
391 * @return 0 if success, negative value(<0) if fail
392 * @retval AUL_R_OK - success
393 * @retval AUL_R_ENOINIT - aul handler was NOT yet installed
394 * @retval AUL_R_ERROR - general error
397 * you must have aul handler to use this API.
398 * aul_luanch_init register aul handler.
402 * aul_launch_init, bundle_import_from_argv
405 * #include <bundle.h>
407 * int send_local_reset_event()
412 * argv[0] = "local.app";
413 * argv[1] = "event_type";
414 * argv[2] = "my_reset";
417 * b = bundle_import_from_argv(argc,argv);
418 * aul_launch_local(b);
423 * If you use AppCore, you NEED NOT to use this API.
424 * This API is only available in User Session.
426 int aul_launch_local(bundle *b);
430 * This API launches application with the given bundle.
431 * If the application is not running or a multiple-instance one, this API launches with the given bundle.
432 * If the application is running, this API sends a RESET event to the App.
433 * While the application is running, if the application cannot receive the RESET event,
434 * this API returns a general error(AUL_R_ERROR).\n
436 * This API is for caller.
437 * This API's purpose is to launch/reset application with given bundle.
438 * @par Typical use case:
439 * If you know the target application's pkgname and bundle types,
440 * you can use this API to launch/reset the application.
442 * @param[in] pkgname package name to be run as callee
443 * @param[in] kb bundle to be passed to callee
444 * @return callee's pid if success, negative value(<0) if fail
445 * @retval AUL_R_OK - success
446 * @retval AUL_R_EINVAL - invaild package name
447 * @retval AUL_R_ECOM - internal AUL IPC error
448 * @retval AUL_R_ERROR - general error
454 * #include <bundle.h>
456 * int launch_inhouse_contact_app()
459 * b = bundle_create();
460 * bundle_add(b,"type","SIM");
461 * aul_launch_app("org.tizen.contact",b);
466 * This API is only available in User Session.
468 int aul_launch_app(const char *appid, bundle *kb);
472 * This API launches application with the given bundle.
473 * If the application is not running or a multiple-instance one, this API launches with the given bundle.
474 * If the application is running, this API sends a RESET event to the App.
475 * While the application is running, if the application cannot receive the RESET event,
476 * this API returns a general error(AUL_R_ERROR).\n
478 * This API is for caller.
479 * This API's purpose is to launch/reset application with given bundle.
480 * @par Typical use case:
481 * If you know the target application's pkgname and bundle types,
482 * you can use this API to launch/reset the application.
484 * @param[in] pkgname package name to be run as callee
485 * @param[in] kb bundle to be passed to callee
486 * @param[in] uid User ID to launch
487 * @return callee's pid if success, negative value(<0) if fail
488 * @retval AUL_R_OK - success
489 * @retval AUL_R_EINVAL - invaild package name
490 * @retval AUL_R_ECOM - internal AUL IPC error
491 * @retval AUL_R_ERROR - general error
496 * This API is also available in System Session.
498 int aul_launch_app_for_uid(const char *appid, bundle *kb, uid_t uid);
502 * This API launches application, as menu screen launches the app.
503 * Thus, if the applocation is running, this API sends a RESUME event to the app.
504 * If the application is not running, this API launches the app.
505 * While the application is running, if the application cannot receive the RESUME event,
506 * AUL tries to raise the application's default window.
509 * This API is for caller.
510 * This API's purpose is to resume/launch application
511 * @par Typical use case:
512 * If you only want to show application with previous state or default state, Use this API.
514 * @param[in] pkgname package name to be resume as callee
515 * @return callee's pid if success, negative value(<0) if fail
516 * @retval AUL_R_OK - success
517 * @retval AUL_R_EINVAL - invaild package name
518 * @retval AUL_R_ECOM - internal AUL IPC error
519 * @retval AUL_R_ERROR - general error
522 * aul_launch_app, aul_app_is_running, aul_resume_pid
525 * #include <bundle.h>
527 * int open_inhouse_contact_app()
529 * if(aul_app_is_running("org.tizen.contact"))
530 * aul_open_app("org.tizen.contact");
535 * If you don't want to launch the app,
536 * you should check app's running state with aul_app_is_running.
537 * This API will launch the application if the application is not running.
538 * This API is only available in User Session.
540 int aul_open_app(const char *appid);
544 * This API launches application, as menu screen launches the app.
545 * Thus, if the applocation is running, this API sends a RESUME event to the app.
546 * If the application is not running, this API launches the app.
547 * While the application is running, if the application cannot receive the RESUME event,
548 * AUL tries to raise the application's default window.
551 * This API is for caller.
552 * This API's purpose is to resume/launch application
553 * @par Typical use case:
554 * If you only want to show application with previous state or default state, Use this API.
556 * @param[in] pkgname package name to be resume as callee
557 * @param[in] uid User ID
558 * @return callee's pid if success, negative value(<0) if fail
559 * @retval AUL_R_OK - success
560 * @retval AUL_R_EINVAL - invaild package name
561 * @retval AUL_R_ECOM - internal AUL IPC error
562 * @retval AUL_R_ERROR - general error
565 * If you don't want to launch the app,
566 * you should check app's running state with aul_app_is_running.
567 * This API will launch the application if the application is not running.
568 * This API is only available to System user.
570 int aul_open_app_for_uid(const char *appid, uid_t uid);
574 * This API trigger to resume application
575 * If the application is running, this API send a resume event to the App.
576 * If the application is not running, this API returns fail.
577 * Although the application is running, if the application cannot receive resume event,
578 * AUL try to raise the application's default windows.
580 * This API is for caller.
581 * This API's purpose is to send resume event.
582 * @par Typical use case:
583 * If you only want to show application with previous state or default state, Use this API.
585 * @param[in] pkgname package name to be resume as callee
586 * @return callee's pid if success, negative value(<0) if fail
587 * @retval AUL_R_OK - success
588 * @retval AUL_R_EINVAL - invaild package name
589 * @retval AUL_R_ECOM - internal AUL IPC error
590 * @retval AUL_R_ERROR - general error
593 * aul_launch_app, aul_app_is_running, aul_resume_pid
595 * This function will be deprecated. Use aul_open_add() instead.
598 * #include <bundle.h>
600 * int resume_inhouse_contact_app()
602 * if(aul_app_is_running("org.tizen.contact"))
603 * aul_resume_app("org.tizen.contact");
608 * If you don't want to launch the app,
609 * you should check app's running state with aul_app_is_running.
610 * This API will launch the application if the application is not running.
611 * If you want to only resume without launching in multiple instance application model,
612 * you should use aul_resume_pid.
613 * This API is only available in User Session.
615 int aul_resume_app(const char *appid);
619 * This API trigger to resume application
620 * If the application is running, this API send a resume event to the App.
621 * If the application is not running, this API returns fail.
622 * Although the application is running, if the application cannot receive resume event,
623 * AUL try to raise the application's default windows.
625 * This API is for caller.
626 * This API's purpose is to send resume event.
627 * @par Typical use case:
628 * If you only want to show application with previous state or default state, Use this API.
630 * @param[in] pkgname package name to be resume as callee
631 * @param[in] uid User ID
632 * @return callee's pid if success, negative value(<0) if fail
633 * @retval AUL_R_OK - success
634 * @retval AUL_R_EINVAL - invaild package name
635 * @retval AUL_R_ECOM - internal AUL IPC error
636 * @retval AUL_R_ERROR - general error
639 * If you don't want to launch the app,
640 * you should check app's running state with aul_app_is_running.
641 * This API will launch the application if the application is not running.
642 * If you want to only resume without launching in multiple instance application model,
643 * you should use aul_resume_pid.
644 * This API is only available to System user.
646 int aul_resume_app_for_uid(const char *appid, uid_t uid);
650 * This API trigger to resume application
651 * If the application is running, this API send a resume event to the App.
652 * If the application is not running, this API return AUL_R_ERROR.
653 * Although the application is running, if the application cannot receive resume event,
654 * AUL try to raise the application's default windows.
656 * This API is for caller.
657 * This API's purpose is to send resume event.
658 * @par Typical use case:
659 * In multiple application model, If you want to only resume specific application, Use this API
661 * @param[in] pid application's pid to be resumed
662 * @return 0 if success, negative value(<0) if fail
663 * @retval AUL_R_OK - success
664 * @retval AUL_R_EINVAL - invaild pid
665 * @retval AUL_R_ECOM - internal AUL IPC error
666 * @retval AUL_R_ERROR - general error (include application is not running)
667 * @warning This API need to require root or inhouse permisssion \n
668 * If you have not the permission, this API return AUL_R_ERROR. \n
673 * #include <bundle.h>
675 * int iterfunc(const aul_app_info *info, void *data)
677 * if(strcmp(info->pkg_name,"org.tizen.contact")==0)
678 * aul_resume_pid(info->pid);
681 * int iterate_running_apps()
683 * return aul_app_get_running_app_info(iterfunc,NULL);
688 * This API is only available in User Session.
690 int aul_resume_pid(int pid);
694 * This API trigger to resume application
695 * If the application is running, this API send a resume event to the App.
696 * If the application is not running, this API return AUL_R_ERROR.
697 * Although the application is running, if the application cannot receive resume event,
698 * AUL try to raise the application's default windows.
700 * This API is for caller.
701 * This API's purpose is to send resume event.
702 * @par Typical use case:
703 * In multiple application model, If you want to only resume specific application, Use this API
705 * @param[in] pid application's pid to be resumed
706 * @param[in] uid User ID
707 * @return 0 if success, negative value(<0) if fail
708 * @retval AUL_R_OK - success
709 * @retval AUL_R_EINVAL - invaild pid
710 * @retval AUL_R_ECOM - internal AUL IPC error
711 * @retval AUL_R_ERROR - general error (include application is not running)
712 * @warning This API need to require root or inhouse permisssion \n
713 * If you have not the permission, this API return AUL_R_ERROR. \n
715 * This API is only available to System user.
717 int aul_resume_pid_for_uid(int pid, uid_t uid);
721 * This API trigger to terminate application
723 * If the application is running, this API send a terminate event to the App. \n
724 * If the app cannot receive the event, AUL kill forcely the application.\n
726 * This API's purpose is to kill application
727 * @par Typical use case:
728 * In general, Application like Task Manager use this API.
730 * This API need to require root or inhouse permisssion. \n
732 * @param[in] pid application's pid to be terminated
733 * @return 0 if success, negative value(<0) if fail
734 * @retval AUL_R_OK - success
735 * @retval AUL_R_EINVAL - invaild pid
736 * @retval AUL_R_ECOM - internal AUL IPC error
737 * @retval AUL_R_ERROR - general error
738 * @warning This API need to require root or inhouse permisssion. \n
742 * #include <bundle.h>
744 * int iterfunc(const aul_app_info *info, void *data)
746 * if(strcmp(info->pkg_name,"org.tizen.contact")==0)
747 * aul_terminate_pid(info->pid);
750 * int iterate_running_apps()
752 * return aul_app_get_running_app_info(iterfunc,NULL);
757 * If you have not the permission, this API return AUL_R_ERROR. \n
758 * This API is only available in User Session.
760 int aul_terminate_pid(int pid);
764 * This API trigger to terminate application
766 * If the application is running, this API send a terminate event to the App. \n
767 * If the app cannot receive the event, AUL kill forcely the application.\n
769 * This API's purpose is to kill application
770 * @par Typical use case:
771 * In general, Application like Task Manager use this API.
773 * This API need to require root or inhouse permisssion. \n
775 * @param[in] pid application's pid to be terminated
776 * @param[in] uid User ID
777 * @return 0 if success, negative value(<0) if fail
778 * @retval AUL_R_OK - success
779 * @retval AUL_R_EINVAL - invaild pid
780 * @retval AUL_R_ECOM - internal AUL IPC error
781 * @retval AUL_R_ERROR - general error
782 * @warning This API need to require root or inhouse permisssion. \n
785 * If you have not the permission, this API return AUL_R_ERROR. \n
786 * This API is only available to System user.
788 int aul_terminate_pid_for_uid(int pid, uid_t uid);
792 * This API trigger to terminate application asynchronously
794 * If the application is running, this API send a terminate event to the App. \n
795 * If the app cannot receive the event, AUL kill forcely the application.\n
797 * This API's purpose is to kill application
798 * @par Typical use case:
799 * In general, Application like Task Manager use this API.
801 * This API need to require root or inhouse permisssion. \n
803 * @param[in] pid application's pid to be terminated
804 * @return 0 if success, negative value(<0) if fail
805 * @retval AUL_R_OK - success
806 * @retval AUL_R_EINVAL - invaild pid
807 * @retval AUL_R_ECOM - internal AUL IPC error
808 * @retval AUL_R_ERROR - general error
809 * @warning This API need to require root or inhouse permisssion. \n
811 * If you have not the permission, this API return AUL_R_ERROR. \n
812 * This API is only available in User Session.
814 int aul_terminate_pid_async(int pid);
818 * This API trigger to terminate application asynchronously
820 * If the application is running, this API send a terminate event to the App. \n
821 * If the app cannot receive the event, AUL kill forcely the application.\n
823 * This API's purpose is to kill application
824 * @par Typical use case:
825 * In general, Application like Task Manager use this API.
827 * This API need to require root or inhouse permisssion. \n
829 * @param[in] pid application's pid to be terminated
830 * @param[in] uid User ID
831 * @return 0 if success, negative value(<0) if fail
832 * @retval AUL_R_OK - success
833 * @retval AUL_R_EINVAL - invaild pid
834 * @retval AUL_R_ECOM - internal AUL IPC error
835 * @retval AUL_R_ERROR - general error
836 * @warning This API need to require root or inhouse permisssion. \n
838 * If you have not the permission, this API return AUL_R_ERROR. \n
839 * This API is only available to System user.
841 int aul_terminate_pid_async_for_uid(int pid, uid_t uid);
845 * This API trigger to terminate application synchronously
847 * If the application is running, this API sends a terminate event to the application. \n
848 * And then, this API waits until the application is terminated successfully. \n
849 * If the app cannot receive the event, AUL kill forcely the application. \n
851 * This API's purpose is to kill application
852 * @par Typical use case:
853 * In general, Application like Task Manager use this API.
855 * This API need to require root or platform level permisssion. \n
857 * @param[in] pid application's pid to be terminated
858 * @return 0 if success, negative value(<0) if fail
859 * @retval AUL_R_OK - success
860 * @retval AUL_R_EINVAL - invaild pid
861 * @retval AUL_R_ECOM - internal AUL IPC error
862 * @retval AUL_R_ERROR - general error
863 * @warning This API need to require root or platform level permisssion. \n
865 * If you have not the permission, this API return AUL_R_ERROR. \n
866 * This API is only available in User Session.
868 int aul_terminate_pid_sync(int pid);
872 * This API trigger to terminate application synchronously
874 * If the application is running, this API send a terminate event to the application. \n
875 * And then, this API waits until the application is terminated successfully. \n
876 * If the app cannot receive the event, AUL kill forcely the application. \n
878 * This API's purpose is to kill application
879 * @par Typical use case:
880 * In general, Application like Task Manager use this API.
882 * This API need to require root or platform level permisssion. \n
884 * @param[in] pid application's pid to be terminated
885 * @param[in] uid User ID
886 * @return 0 if success, negative value(<0) if fail
887 * @retval AUL_R_OK - success
888 * @retval AUL_R_EINVAL - invaild pid
889 * @retval AUL_R_ECOM - internal AUL IPC error
890 * @retval AUL_R_ERROR - general error
891 * @warning This API need to require root or platform level permisssion. \n
893 * If you have not the permission, this API return AUL_R_ERROR. \n
894 * This API is only available to System user.
896 int aul_terminate_pid_sync_for_uid(int pid, uid_t uid);
899 *@brief Running application's information structure retrieved by AUL
901 typedef struct _aul_app_info {
902 int pid; /**< app's pid if running*/
903 char *pkg_name; /**< application id */
904 char *app_path; /**< application excutable path */
906 char *pkgid; /**< package id */
907 int status; /**< app's status */
908 int is_sub_app; /**< state whether sub app of app group */
913 * @brief iterator function running with aul_app_get_running_app_info
914 * @param[out] ainfo aul_app_info retreived by aul_app_get_running_app_info
915 * @param[out] data user-supplied data
917 typedef int (*aul_app_info_iter_fn)(const aul_app_info *ainfo, void *data);
921 * This API ask a application is running by application package name.
923 * To know whether some application is running or not, use this API
924 * @par Typical use case:
925 * For example, If you want to know browser application running,
926 * you can check it by using this API.
928 * @param[in] pkgname application package name
929 * @return true / false
930 * @retval 1 app_name is running now.
931 * @retval 0 app_name is NOT running now.
936 * int is_running_browser_app()
938 * return aul_app_is_running("org.tizen.browser");
943 * This API is only available in User Session.
946 int aul_app_is_running(const char *appid);
950 * This API ask a application is running by application package name.
952 * To know whether some application is running or not, use this API
953 * @par Typical use case:
954 * For example, If you want to know browser application running,
955 * you can check it by using this API.
957 * @param[in] pkgname application package name
958 * @param[in] uid User ID
959 * @return true / false
960 * @retval 1 app_name is running now.
961 * @retval 0 app_name is NOT running now.
965 * This API is only available to System User.
967 int aul_app_is_running_for_uid(const char *appid, uid_t uid);
971 * This API use to get running application list.
972 * This API call iter_fn with each aul_app_info of running apps when running application is found.
974 * If you want to get running application list, use this API
975 * @par Typical use case:
976 * In general, this API is used by task manager appllication. (running application list viewer)
978 * @param[in] iter_fn iterator function
979 * @param[in] user_data user-supplied data for iter_fn
980 * @return 0 if success, negative value(<0) if fail
981 * @retval AUL_R_OK - success
982 * @retval AUL_R_ERROR - internal error
987 * int iterfunc(const aul_app_info* info, void* data)
989 * printf("\t==========================\n");
990 * printf("\t pkg_name: %s\n", info->appid);
991 * printf("\t app_path: %s\n", info->app_path);
992 * printf("\t running pid: %d\n", info->pid);
993 * printf("\t==========================\n");
997 * int iterate_running_apps()
999 * return aul_app_get_running_app_info(iterfunc,NULL);
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 in User Session.
1009 int aul_app_get_running_app_info(aul_app_info_iter_fn iter_fn, void *user_data);
1013 * This API use to get running application list.
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 running application list, use this API
1017 * @par Typical use case:
1018 * In general, this API is used by task manager appllication. (running application list viewer)
1020 * @param[in] iter_fn iterator function
1021 * @param[in] user_data user-supplied data for iter_fn
1022 * @param[in] uid User ID
1023 * @return 0 if success, negative value(<0) if fail
1024 * @retval AUL_R_OK - success
1025 * @retval AUL_R_ERROR - internal error
1028 * This API should use if you want to know running application which has desktop files.
1029 * If you want to get all process list, you must iterate process information by using proc filesystem
1030 * Or, If you want to get all window list, you must iterate XWindows by using XWindow APIs
1031 * This API is only available to System user.
1033 int aul_app_get_running_app_info_for_uid(aul_app_info_iter_fn iter_fn, void *user_data, uid_t uid);
1037 * This API use to get all running application list, including sub app.
1038 * This API call iter_fn with each aul_app_info of running apps when running application is found.
1040 * If you want to get all running application list, use this API
1041 * @par Typical use case:
1042 * In general, this API is used by task manager application. (running application list viewer)
1044 * @param[in] iter_fn iterator function
1045 * @param[in] user_data user-supplied data for iter_fn
1046 * @return 0 if success, negative value(<0) if fail
1047 * @retval AUL_R_OK - success
1048 * @retval AUL_R_ERROR - internal error
1053 * int iterfunc_status(const aul_app_info *info, void *data)
1055 * printf("\t==========================\n");
1056 * printf("\t pid: %d\n", info->pid);
1057 * printf("\t appid: %s\n", info->appid);
1058 * printf("\t app_path: %s\n", info->app_path);
1059 * printf("\t pkgid: %s\n", info->pkgid);
1060 * printf("\t status: %d\n", info->status);
1061 * printf("\t is_sub_app : %d\n", info->is_sub_app);
1062 * printf("\t==========================\n");
1066 * int iterate_running_apps()
1068 * return aul_app_get_all_running_app_info(iterfunc_status,NULL);
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 in User Session.
1078 int aul_app_get_all_running_app_info(aul_app_info_iter_fn iter_fn, void *user_data);
1082 * This API use to get all running application list, including sub app.
1083 * This API call iter_fn with each aul_app_info of running apps when running application is found.
1085 * If you want to get all running application list, use this API
1086 * @par Typical use case:
1087 * In general, this API is used by task manager application. (running application list viewer)
1089 * @param[in] iter_fn iterator function
1090 * @param[in] user_data user-supplied data for iter_fn
1091 * @param[in] uid User ID
1092 * @return 0 if success, negative value(<0) if fail
1093 * @retval AUL_R_OK - success
1094 * @retval AUL_R_ERROR - internal error
1097 * This API should use if you want to know running application which has desktop files.
1098 * If you want to get all process list, you must iterate process information by using proc filesystem
1099 * Or, If you want to get all window list, you must iterate XWindows by using XWindow APIs
1100 * This API is only available to System user.
1102 int aul_app_get_all_running_app_info_for_uid(aul_app_info_iter_fn iter_fn, void *user_data, uid_t uid);
1106 * This API get application package name by pid
1108 * If you want to get package name of running application, use this API
1109 * @par Typical use case:
1110 * In general, You can use this API when you want to know caller's information.
1112 * @param[in] pid given pid
1113 * @param[out] pkgname pkgname to be get
1114 * @param[in] len length of pkgname
1115 * @return 0 if success, negative value(<0) if fail
1116 * @retval AUL_R_OK - success
1117 * @retval AUL_R_ERROR - no such a package name
1120 * #include <bundle.h>
1122 * static int app_reset(bundle *b, void *data)
1125 * char appname[255];
1127 * pid = atoi(bundle_get_val(b,AUL_K_CALLER_PID));
1128 * aul_app_get_pkgname_bypid(pid, appname, sizeof(appname));
1133 * This API is only available in User Session.
1135 int aul_app_get_pkgname_bypid(int pid, char *pkgname, int len);
1139 * This API get application pkgid by pid
1141 * If you want to get pkgid of running application, use this API
1142 * @par Typical use case:
1143 * In general, You can use this API when you want to know caller's information.
1145 * @param[in] pid given pid
1146 * @param[out] pkgid package id
1147 * @param[in] len length of pkgid
1148 * @return 0 if success, negative value(<0) if fail
1149 * @retval AUL_R_OK - success
1150 * @retval AUL_R_ERROR - no such a appid
1154 * #include <bundle.h>
1156 * static int app_reset(bundle *b, void *data)
1161 * pid = atoi(bundle_get_val(b, AUL_K_CALLER_PID));
1162 * aul_app_get_pkgid_bypid(pid, pkgid, sizeof(pkgid));
1167 * This API is only available in User Session.
1169 int aul_app_get_pkgid_bypid(int pid, char *pkgid, int len);
1173 * This API get application pkgid by pid
1175 * If you want to get pkgid of running application, use this API
1176 * @par Typical use case:
1177 * In general, You can use this API when you want to know caller's information.
1179 * @param[in] pid given pid
1180 * @param[out] pkgid package id
1181 * @param[in] len length of pkgid
1182 * @param[in] uid User ID
1183 * @return 0 if success, negative value(<0) if fail
1184 * @retval AUL_R_OK - success
1185 * @retval AUL_R_ERROR - no such a appid
1188 * This API is also available to System user.
1190 int aul_app_get_pkgid_bypid_for_uid(int pid, char *pkgid, int len, uid_t uid);
1194 * This API get application appid by pid
1196 * If you want to get appid of running application, use this API
1197 * @par Typical use case:
1198 * In general, You can use this API when you want to know caller's information.
1200 * @param[in] pid given pid
1201 * @param[out] appid application id
1202 * @param[in] len length of pkgname
1203 * @return 0 if success, negative value(<0) if fail
1204 * @retval AUL_R_OK - success
1205 * @retval AUL_R_ERROR - no such a appid
1208 * #include <bundle.h>
1210 * static int app_reset(bundle *b, void *data)
1215 * pid = atoi(bundle_get_val(b,AUL_K_CALLER_PID));
1216 * aul_app_get_appid_bypid(pid, appid, sizeof(appid));
1221 * This API is only available in User Session.
1223 int aul_app_get_appid_bypid(int pid, char *appid, int len);
1227 * This API get application appid by pid
1229 * If you want to get appid of running application, use this API
1230 * @par Typical use case:
1231 * In general, You can use this API when you want to know caller's information.
1233 * @param[in] pid given pid
1234 * @param[out] appid application id
1235 * @param[in] len length of pkgname
1236 * @param[in] uid User ID
1237 * @return 0 if success, negative value(<0) if fail
1238 * @retval AUL_R_OK - success
1239 * @retval AUL_R_ERROR - no such a appid
1241 * This API is also available to System user.
1243 int aul_app_get_appid_bypid_for_uid(int pid, char *appid, int len, uid_t uid);
1247 * This API launch application associated with given filename
1249 * This API is for caller.
1250 * This API launch application based on mime type.
1251 * This API find mime_type associated with file name,
1252 * and then find default app associated with found mime_type
1253 * and then launch the app with filename argument.
1254 * @par Typical use case:
1255 * You can launch application to process given filename.
1256 * That is, Even if you don't know the specific application's pkgname,
1257 * you can launch the applicaiton processing given filename .
1258 * For example, If you want to process image file, you can simply launch image viewer.
1259 * At that time, you can use this APIs like aul_open_file("myimage.jpg");
1261 * @param[in] filename filename
1262 * @return callee's pid or 0 if success, negative value if fail\n
1263 * (when no found default app, return 0)
1264 * @retval AUL_R_OK - success
1265 * @retval AUL_R_EINVAL - invalid argument(filename)
1266 * @retval AUL_R_ECOM - internal AUL IPC error
1267 * @retval AUL_R_ERROR - general error
1272 * int view_image_file(char *filename)
1274 * aul_open_file(filename);
1279 * This API is only available in User Session.
1282 int aul_open_file(const char* filename);
1286 * This API launch application associated with given specific mimetype
1288 * This API is for caller.
1289 * This API launch application based on mime type like aul_open_file API.
1290 * But, This API don't find mime_type associated with file name.
1291 * This API use mimetype given by user. By using given mimetype, find default application.
1292 * and then launch the app with filename argument.
1293 * @par Typical use case:
1294 * Some files cannot extract exact mimetype automatically.
1295 * For example, To know mime type of files with DRM lock, first we should unlock DRM file.
1296 * In this case, You can use this API.
1297 * First, unlock DRM file, and extract mimetype from unlock file by using aul_get_mime_from_file,
1298 * and then, use this API with DRM file and extracted mime type.
1300 * @param[in] filename filename
1301 * @param[in] mimetype specific mimetype
1302 * @return callee's pid or 0 if success, negative value if fail\n
1303 * (when no found default app, return 0)
1304 * @retval AUL_R_OK - success
1305 * @retval AUL_R_EINVAL - invalid argument(filename,mimetype)
1306 * @retval AUL_R_ECOM - internal AUL IPC error
1307 * @retval AUL_R_ERROR - general error
1310 * aul_open_file, aul_get_mime_from_file
1314 * int view_drm_image_file(char *drm_filename)
1317 * // you must implement this function
1318 * mimetype = get_mimetype_from_drmfile(drm_filename);
1320 * aul_open_file_with_mimetype(drm_filename,mimetype);
1325 * This API is only available in User Session.
1327 int aul_open_file_with_mimetype(const char *filename, const char *mimetype);
1331 * This API launch application associated with content like "http://www.samsung.com"
1333 * This API is for caller.
1334 * This API launch application based on mime type.
1335 * This API find mime_type associated with content,
1336 * and then find default app associated with found mime_type,
1337 * and then launch the app with content argument.
1338 * @par Typical use case:
1339 * You can launch application to process given content.
1340 * That is, Even if you don't know the specific application's pkgname,
1341 * you can launch the applicaiton processing given content.
1342 * For example, If you want to process URL "http://www.samsung.com",
1343 * you can simply launch browser.
1344 * At that time, you can use this APIs like aul_open_content("http://www.samsung.com");
1346 * @param[in] content content
1347 * @return callee's pid or 0 if success, negative value if fail\n
1348 * (when no found default app, return 0)
1349 * @retval AUL_R_OK - success
1350 * @retval AUL_R_EINVAL - invalid argument(content)
1351 * @retval AUL_R_ECOM - internal AUL IPC error
1352 * @retval AUL_R_ERROR - general error or no found mimetype
1357 * int view_url(char *url)
1359 * aul_open_content(url);
1364 * This API is only available in User Session.
1367 int aul_open_content(const char* content);
1371 * This API get the default application(appid) associated with MIME type
1373 * This API use to get default application associteted with mimetype
1374 * In general, Setting Application need this API.
1375 * @par Typical use case:
1376 * Setting Application show mapping of default application / mimetype
1378 * @param[in] mimetype a mime type
1379 * @param[out] defapp a application appid of the app
1380 * @param[in] len length of defapp
1381 * @return 0 if success, negative value if fail
1382 * @retval AUL_R_OK - success
1383 * @retval AUL_R_EINVAL - invalid argument(mimetype)
1384 * @retval AUL_R_ERROR - general error or no found mimetype
1387 * aul_set_defapp_with_mime
1391 * void get_text_html_defapp()
1393 * char appname[255];
1394 * aul_get_defapp_from_mime("text/html",appname,sizeof(appname));
1399 * This API is only available in User Session.
1402 int aul_get_defapp_from_mime(const char *mimetype, char *defapp, int len);
1406 * This API set the default application(appid) associated with MIME type
1408 * This API use to change default application associteted with mimetype
1409 * In general, Setting Application or Installer need this API.
1410 * @par Typical use case:
1411 * Default Application associated with mimetype can be changed by Setting Application or installer
1412 * So, application to process specific mimetype can be substituted.
1414 * @param[in] mimetype a mime type
1415 * @param[in] defapp a application appid of the app to be set
1416 * @return 0 if success, negative value if fail
1417 * @retval AUL_R_OK - success
1418 * @retval AUL_R_EINVAL - invalid argument(mimetype)
1419 * @retval AUL_R_ERROR - general error
1422 * aul_get_defapp_from_mime
1426 * void set_text_html_defapp()
1428 * aul_set_defapp_with_mime("text/html","org.tizen.browser");
1433 * This API is only available in User Session.
1435 int aul_set_defapp_with_mime(const char *mimetype, const char *defapp);
1439 * This API get the mimetype associated with filename
1441 * This API use to get mimetype associteted with given filename
1442 * In general, This API use when you want to know only mimetype given filename.
1443 * @par Typical use case:
1444 * For example, In trasfering data through bluetooth,
1445 * additional information like mimetype should be added.
1446 * In such situation, You can get mimetype by using this API.
1448 * @param[in] filename file name
1449 * @param[out] mimetype a mime type
1450 * @param[in] len length of mimetype
1451 * @return 0 if success, negative value if fail
1452 * @retval AUL_R_OK - success
1453 * @retval AUL_R_EINVAL - invalid argument(filename)
1454 * @retval AUL_R_ERROR - general error
1459 * void get_mimetype()
1461 * char mimetype[255];
1462 * aul_get_mime_from_file("image.jpg",mimetype,sizeof(mimetype));
1467 * This API is only available in User Session.
1469 int aul_get_mime_from_file(const char *filename, char *mimetype, int len);
1473 * This API get the mimetype associated with given content
1475 * This API use to get mimetype associteted with given content
1476 * In general, This API use when you want to know only mimetype given content
1477 * @par Typical use case:
1478 * For example, In trasfering data through bluetooth,
1479 * additional information like mimetype should be added.
1480 * In such situation, You can get mimetype by using this API.
1482 * @param[in] content content string like "011-0000-0000"
1483 * @param[out] mimetype a mime type
1484 * @param[in] len length of mimetype
1485 * @return 0 if success, negative value if fail
1486 * @retval AUL_R_OK - success
1487 * @retval AUL_R_EINVAL - invalid argument(content)
1488 * @retval AUL_R_ERROR - general error
1493 * void get_mimetype()
1495 * char mimetype[255];
1496 * aul_get_mime_from_content("http://www.samsung.com",mimetype,sizeof(mimetype));
1501 * This API is only available in User Session.
1503 int aul_get_mime_from_content(const char *content, char *mimetype, int len);
1507 * This API get the icon's name associated with given mimetype
1509 * This API use to get icon's name associteted with given mimetype
1510 * @par Typical use case:
1511 * If you want to show mimetype's icon, use this API.
1513 * @param[in] mimetype a mime type
1514 * @param[out] iconname icon's name
1515 * @param[in] len length of iconname
1516 * @return 0 if success, negative value if fail
1517 * @retval AUL_R_OK - success
1518 * @retval AUL_R_EINVAL - invalid argument(content)
1519 * @retval AUL_R_ERROR - general error (no such mime type)
1524 * void get_mime_icon()
1527 * aul_get_mime_icon("text/html",icon,sizeof(icon));
1532 * This API is only available in User Session.
1534 int aul_get_mime_icon(const char *mimetype, char *iconname, int len);
1538 * This API get the extensions associated with given mimetype
1540 * This API use to get extensions associteted with given mimetype
1541 * @par Typical use case:
1542 * In general, user is not familiar with mimetype(text/html),
1543 * user is familiar with extenstions(*.html, *.htm)
1544 * So, To show mimetype information to user, use this API
1546 * @param[in] mimetype a mime type
1547 * @param[out] extlist extentions (ex> mpeg,mpg,mpe)
1548 * @param[in] len length of extlist
1549 * @return 0 if success, negative value if fail
1550 * @retval AUL_R_OK - success
1551 * @retval AUL_R_EINVAL - invalid argument(mimetype)
1552 * @retval AUL_R_ERROR - general error (no mimetype or no extenstion)
1555 * aul_get_mime_description
1559 * void get_extension()
1561 * char extlist[255];
1562 * aul_get_mime_extension("text/html",extlist,sizeof(extlist));
1567 * Some mimetype don't have extension.
1568 * In that case, You can use aul_get_mime_description.
1569 * This API is only available in User Session.
1571 int aul_get_mime_extension(const char *mimetype, char *extlist, int len);
1575 * This API get the description associated with given mimetype
1577 * This API use to get description associteted with given mimetype
1578 * @par Typical use case:
1579 * In general, user is not familiar with mimetype(text/html),
1580 * user is familiar with well-knowing information like extenstions(*.html, *.htm)
1581 * But, some mimetype don't have extenstion.
1582 * At that time,to show mimetype information to user, use this API
1584 * @param[in] mimetype a mime type
1585 * @param[out] desc description (ex> Call client)
1586 * @param[in] len length of desc
1587 * @return 0 if success, negative value if fail
1588 * @retval AUL_R_OK - success
1589 * @retval AUL_R_EINVAL - invalid argument(mimetype)
1590 * @retval AUL_R_ERROR - general error (no mimetype or no descrition)
1593 * aul_get_mime_extension
1597 * void get_information_from_mime()
1600 * if(aul_get_mime_extension("text/html",info,sizeof(info))<0){
1601 * aul_get_mime_description("text/html",info,sizeof(info));
1607 * This API is only available in User Session.
1609 int aul_get_mime_description(const char *mimetype, char *desc, int len);
1613 * This API create service result bundle based on bundle received in reset event.
1615 * This API use to create result bundle to send it to caller.
1616 * @par Typical use case:
1617 * This API is for callee which provide application service.\n
1618 * To send result to caller, You must create result bundle. \n
1619 * Callee(application providing the service) can send result by using this API and aul_send_service_result.
1621 * @param[in] inb bundle received in reset event
1622 * @param[out] outb bundle to use for returning result
1623 * @return 0 if success, negative value(<0) if fail
1624 * @retval AUL_R_OK - success
1625 * @retval AUL_R_EINVAL - inb is not bundle created by aul_open_service
1626 * @retval AUL_R_ERROR - general error
1629 * To create result bundle, You need received original bundle.
1630 * The original bundle can get from app_reset handler.
1634 * aul_send_service_result
1637 * #include <bundle.h>
1639 * int app_reset(bundle *b, void *data)
1641 * ad->recved_bundle = bundle_dup(b);
1646 * bundle* res_bundle;
1647 * aul_create_result_bundle(ad->recved_bundle,&res_bundle);
1648 * bundle_add(res_bundle, "result", "1");
1649 * aul_send_service_result(res_bundle);
1653 * This API is only available in User Session.
1656 int aul_create_result_bundle(bundle *inb, bundle **outb);
1660 * This API send service result to caller with bundle
1662 * This API is used to send result bundle to caller.
1663 * @par Typical use case:
1664 * This API is for callee which provide application service.\n
1665 * To send result to caller, You can use this API after creating result bundle. \n
1666 * Callee(application to provide service) can send result by using this API and aul_create_result_bundle.
1668 * @param[in] b Result data in bundle format
1669 * @return 0 if success, negative value(<0) if fail
1670 * @retval AUL_R_OK - success
1671 * @retval AUL_R_EINVAL - invalid result bundle
1672 * @retval AUL_R_ECOMM - internal AUL IPC error
1673 * @retval AUL_R_ERROR - general error
1676 * To send result bundle, You must create result bundle.
1677 * see aul_create_result_bundle
1681 * aul_create_result_bundle
1684 * #include <bundle.h>
1686 * int app_reset(bundle *b, void *data)
1688 * ad->recved_bundle = bundle_dup(b);
1693 * bundle* res_bundle;
1694 * aul_create_result_bundle(ad->recved_bundle,&res_bundle);
1695 * bundle_add(res_bundle, "result", "1");
1696 * aul_send_service_result(res_bundle);
1700 * This API is only available in User Session.
1703 int aul_send_service_result(bundle *b);
1707 * This API sets callback fuction that will be called when applications die.
1709 * This API's purpose is to listen the application dead event.
1710 * In general, task manager Application need this API.
1712 * @param[in] func callback function
1713 * @param[in] data user data
1714 * @return 0 if success, negative value if fail
1715 * @retval AUL_R_OK - success
1716 * @retval AUL_R_ERROR - general error
1719 * aul_listen_app_launch_signal
1723 * int app_dead_handler(int pid, void *data)
1725 * printf("===> %s : %d\n", __FUNCTION__, pid);
1729 * void dead_listen()
1731 * aul_listen_app_dead_signal(app_dead_handler, NULL);
1736 * This API is only available in User Session.
1739 int aul_listen_app_dead_signal(int (*func) (int, void *), void *data);
1743 * This API sets callback fuction that will be called when applications are launched.
1745 * This API's purpose is to listen the application launching event.
1746 * In general, task manager Application need this API.
1748 * @param[in] func callback function
1749 * @param[in] data user data
1750 * @return 0 if success, negative value if fail
1751 * @retval AUL_R_OK - success
1752 * @retval AUL_R_ERROR - general error
1755 * aul_listen_app_dead_signal
1759 * int app_launch_handler(int pid, void *data)
1761 * printf("===> %s : %d\n", __FUNCTION__, pid);
1765 * void dead_listen()
1767 * aul_listen_app_launch_signal(app_launch_handler, NULL);
1772 * This API is only available in User Session.
1775 int aul_listen_app_launch_signal(int (*func) (int, void *), void *data);
1779 * This API sets callback fuction that will be called when applications are launched.
1781 * This API's purpose is to listen the application launching event.
1782 * In general, task manager Application need this API.
1784 * @param[in] func callback function
1785 * @param[in] data user data
1786 * @return 0 if success, negative value if fail
1787 * @retval AUL_R_OK - success
1788 * @retval AUL_R_ERROR - general error
1791 * aul_listen_app_dead_signal
1795 * int app_launch_handler(int pid, const char *app_id, void *data)
1797 * printf("===> %s : %d, %s\n", __FUNCTION__, pid, app_id);
1801 * void dead_listen()
1803 * aul_listen_app_launch_signal(app_launch_handler, NULL);
1808 * This API is only available in User Session.
1811 int aul_listen_app_launch_signal_v2(int (*func) (int, const char *, void *), void *data);
1815 * This API gets status of specified application process id.
1817 * This API's purpose is to get the application's status.
1819 * @param[in] pid pid of application
1820 * @return 0 or greater if success, nagative value if fail
1821 * @retval STATUS_LAUNCHING
1822 * @retval STATUS_VISIBLE
1824 * @retval STATUS_DYING
1825 * @retval STATUS_NORESTART
1831 * int iterfunc(const aul_app_info *info, void *data)
1834 * status = aul_app_get_status_bypid(info->pid);
1835 * if (status == STATUS_VISIBLE) {
1836 * printf("%s has focus", info->app_id);
1837 * (int *)data = info->pid;
1843 * int find_focus_app_pid()
1846 * aul_app_get_running_app_info(iterfunc, &pid);
1851 * This API is only available in User Session.
1853 int aul_app_get_status_bypid(int pid);
1857 * This API gets status of specified application process id.
1859 * This API's purpose is to get the application's status.
1861 * @param[in] pid pid of application
1862 * @param[in] uid User ID
1863 * @return 0 or greater if success, nagative value if fail
1864 * @retval STATUS_LAUNCHING
1865 * @retval STATUS_VISIBLE
1867 * @retval STATUS_DYING
1868 * @retval STATUS_NORESTART
1871 * This API is only available to System user.
1873 int aul_app_get_status_bypid_for_uid(int pid, uid_t uid);
1877 * This API gets the status of specified application id.
1879 * This API's purpose is to get the status of the application.
1881 * @param[in] appid application ID
1882 * @return 0 or greater if success, nagative value if fail
1883 * @retval STATUS_LAUNCHING
1884 * @retval STATUS_FOCUS
1885 * @retval STATUS_VISIBLE
1887 * @retval STATUS_DYING
1888 * @retval STATUS_NORESTART
1898 * status = aul_app_get_status("org.tizen.helloworld");
1899 * if (status == STATUS_FOCUS)
1900 * printf("org.tizen.helloworld has focus");
1907 * This API is only available in User Session.
1909 int aul_app_get_status(const char *appid);
1913 * This API gets the status of specified application id.
1915 * This API's purpose is to get the status of the application
1917 * @param[in] appid application ID
1918 * @param[in] uid User ID
1919 * @return 0 or greater if success, nagative value if fail
1920 * @retval STATUS_LAUNCHING
1921 * @retval STATUS_FOCUS
1922 * @retval STATUS_VISIBLE
1924 * @retval STATUS_DYING
1925 * @retval STATUS_NORESTART
1928 * This API is only available to System user.
1930 int aul_app_get_status_for_uid(const char *appid, uid_t uid);
1934 * This API sets callback function that on application status changed.
1936 * This API's purpose is to listen the application's status changed within
1937 * the caller process. In general, a library that required to release resource on
1938 * application's status may use this API.
1940 * @param[in] func callback function
1941 * @param[in] data user data
1942 * @return 0 if success, negative value if fail
1943 * @retval AUL_R_OK - success
1944 * @retval AUL_R_ERROR - general error
1946 * aul_remove_status_local_cb
1950 * int status_changed(int status, void *data)
1952 * if (status == STATUS_VISIBLE)
1953 * printf("%d resume\n", getpid());
1955 * if (status == STATUS_BG)
1956 * printf("%d pause\n", getpid());
1959 * void listen_app_status()
1961 * aul_add_status_local_cb(status_changed, NULL);
1965 * This API is only available in User Session.
1968 int aul_add_status_local_cb(int (*func) (int, void *), void *data);
1972 * This API unsets callback function that on application status changed.
1974 * This API's purpose is to remove callback that added by
1975 * aul_add_status_local_cb.
1977 * @param[in] func callback function
1978 * @param[in] data user data
1979 * @return 0 if success, negative value if fail
1980 * @retval AUL_R_OK - success
1981 * @retval AUL_R_ERROR - general error
1984 * aul_add_status_local_cb
1988 * int status_changed(int status, void *data)
1990 * if (status == STATUS_VISIBLE)
1991 * printf("%d resume\n", getpid());
1993 * if (status == STATUS_BG)
1994 * printf("%d pause\n", getpid());
1997 * void listen_app_status()
1999 * aul_add_status_local_cb(status_changed, NULL);
2002 * void ignore_app_status()
2004 * aul_remove_status_local_cb(status_changed, NULL);
2009 * This API is only available in User Session.
2012 int aul_remove_status_local_cb(int (*func) (int, void *), void *data);
2015 * This API is only for appfw internally.
2017 int aul_set_process_group(int parent_pid, int child_pid);
2020 * This API is only for Appfw internally.
2022 int aul_terminate_bgapp_pid(int pid);
2025 * This API is only for Appfw internally.
2027 int aul_terminate_pid_without_restart(int pid);
2030 * This API is only for Appfw internally.
2032 int aul_terminate_pid_sync_without_restart(int pid);
2035 * This API is only for Appfw internally.
2037 int aul_terminate_pid_sync_without_restart_for_uid(int pid, uid_t uid);
2040 * This API is only for Appfw internally.
2042 const char *aul_get_app_external_root_path(void);
2045 * This API is only for Appfw internally.
2047 const char *aul_get_app_root_path(void);
2050 * This API is only for Appfw internally.
2052 const char *aul_get_app_data_path(void);
2055 * This API is only for Appfw internally.
2057 const char *aul_get_app_cache_path(void);
2060 * This API is only for Appfw internally.
2062 const char *aul_get_app_resource_path(void);
2065 * This API is only for Appfw internally.
2067 const char *aul_get_app_tep_resource_path(void);
2070 * This API is only for Appfw internally.
2072 int aul_get_app_shared_data_path(char **path);
2075 * This API is only for Appfw internally.
2077 const char *aul_get_app_shared_resource_path(void);
2080 * This API is only for Appfw internally.
2082 const char *aul_get_app_shared_trusted_path(void);
2085 * This API is only for Appfw internally.
2087 const char *aul_get_app_external_data_path(void);
2090 * This API is only for Appfw internally.
2092 const char *aul_get_app_external_cache_path(void);
2095 * This API is only for Appfw internally.
2097 const char *aul_get_app_external_shared_data_path(void);
2100 * This API is only for Appfw internally.
2102 const char *aul_get_app_specific_path(void);
2105 * This API is only for Appfw internally.
2107 const char *aul_get_app_external_specific_path(void);
2110 * This API is only for Appfw internally.
2112 int aul_get_app_shared_data_path_by_appid(const char *app_id, char **path);
2115 * This API is only for Appfw internally.
2117 int aul_get_app_shared_resource_path_by_appid(const char *app_id, char **path);
2120 * This API is only for Appfw internally.
2122 int aul_get_app_shared_trusted_path_by_appid(const char *app_id, char **path);
2125 * This API is only for Appfw internally.
2127 int aul_get_app_external_shared_data_path_by_appid(const char *app_id, char **path);
2130 * This API is only for Appfw internally.
2132 int aul_get_usr_app_shared_data_path_by_appid(const char *app_id, char **path, uid_t uid);
2135 * This API is only for Appfw internally.
2137 int aul_get_usr_app_shared_resource_path_by_appid(const char *app_id, char **path, uid_t uid);
2140 * This API is only for Appfw internally.
2142 int aul_get_usr_app_shared_trusted_path_by_appid(const char *app_id, char **path, uid_t uid);
2145 * This API is only for Appfw internally.
2147 int aul_get_usr_app_external_shared_data_path_by_appid(const char *app_id, char **path, uid_t uid);
2150 * This type is only for Appfw internally.
2152 typedef int (*subapp_fn)(void *data);
2155 * This API is only for Appfw internally.
2157 int aul_set_subapp(subapp_fn cb, void *data);
2160 * This API is only for Appfw internally.
2162 int aul_subapp_terminate_request_pid(int pid);
2165 * This API is only for Appfw internally.
2167 int aul_is_subapp(void);
2170 * This API is only for Appfw internally.
2172 int aul_kill_pid(int pid);
2175 * This API is only for Appfw internally.
2177 int aul_add_caller_cb(int pid, void (*caller_cb) (int, void *), void *data);
2180 * This API is only for Appfw internally.
2182 int aul_remove_caller_cb(int pid, void *data);
2185 * This API is only for Appfw internally.
2187 int aul_invoke_caller_cb(void *data);
2190 * This API is only for Appfw internally.
2192 void aul_set_preinit_window(void *evas_object);
2195 * This API is only for Appfw internally.
2197 void* aul_get_preinit_window(const char *win_name);
2200 * This API is only for Appfw internally.
2202 void aul_set_preinit_background(void *evas_object);
2205 * This API is only for Appfw internally.
2207 void* aul_get_preinit_background(void);
2210 * This API is only for Appfw internally.
2212 void aul_set_preinit_conformant(void *evas_object);
2215 * This API is only for Appfw internally.
2217 void* aul_get_preinit_conformant(void);
2220 * This API is only for Appfw internally.
2222 void aul_set_preinit_appid(const char *appid);
2225 * This API is only for Appfw internally.
2227 void aul_set_preinit_pkgid(const char *pkgid);
2230 * This API is only for Appfw internally.
2232 void aul_set_preinit_root_path(const char *root_path);
2235 * This API is only for Appfw internally.
2237 const char *aul_get_preinit_root_path(void);
2240 * This API is only for Appfw internally.
2242 int aul_update_freezer_status(int pid, const char* type);
2245 * This API is only for Appfw internally.
2247 int aul_send_app_launch_request_signal(int pid, const char* appid, const char* pkgid, const char* type);
2250 * This API is only for Appfw internally.
2252 int aul_send_app_resume_request_signal(int pid, const char* appid, const char* pkgid, const char *type);
2255 * This API is only for Appfw internally.
2257 int aul_send_app_terminate_request_signal(int pid, const char* appid, const char* pkgid, const char *type);
2260 * This API is only for Appfw internally.
2262 int aul_send_app_status_change_signal(int pid, const char* appid, const char* pkgid, const char* status, const char *type);
2265 * This API is only for Appfw internally.
2267 int aul_send_app_terminated_signal(int pid);
2270 * This API is only for Appfw internally.
2272 int aul_send_app_group_signal(int owner_pid, int child_pid, const char *child_pkgid);
2275 * This API is only for Appfw internally.
2277 int aul_invoke_status_local_cb(int status);
2280 * This type is only for Appfw internally.
2282 typedef int (*data_control_provider_handler_fn) (bundle *b, int request_id, void *data);
2285 * This API is only for Appfw internally.
2287 int aul_set_data_control_provider_cb(data_control_provider_handler_fn handler);
2290 * This API is only for Appfw internally.
2292 int aul_unset_data_control_provider_cb(void);
2295 * This API is only for Appfw internally.
2297 int aul_pause_app(const char *appid);
2300 * This API is only for Appfw internally.
2302 int aul_pause_app_for_uid(const char *appid, uid_t uid);
2305 * This API is only for Appfw internally.
2307 int aul_pause_pid(int pid);
2310 * This API is only for Appfw internally.
2312 int aul_pause_pid_for_uid(int pid, uid_t uid);
2315 * This API is only for Appfw internally.
2317 int aul_reload_appinfo(void);
2320 * This API is only for Appfw internally.
2322 int aul_status_update(int status);
2325 * This API is only for Appfw internally.
2327 int aul_running_list_update(char *appid, char *app_path, char *pid);
2330 * This API is only for Appfw internally.
2332 int aul_app_group_get_window(int pid);
2335 * This API is only for Appfw internally.
2337 int aul_app_group_set_window(int wid);
2340 * This API is only for Appfw internally.
2342 void aul_app_group_get_leader_pids(int *cnt, int **pids);
2345 * This API is only for Appfw internally.
2347 void aul_app_group_get_group_pids(int leader_pid, int *cnt, int **pids);
2350 * This API is only for Appfw internally.
2352 int aul_app_group_get_leader_pid(int pid);
2355 * This API is only for Appfw internally.
2357 int aul_app_group_clear_top(void);
2360 * This API is only for Appfw internally.
2362 int aul_app_group_is_top(void);
2365 * This API is only for Appfw internally.
2367 int aul_app_group_get_fg_flag(int pid);
2370 * This API is only for Appfw internally.
2372 void aul_app_group_lower(int *exit);
2375 * This API is only for Appfw internally.
2377 void aul_app_group_get_idle_pids(int *cnt, int **pids);
2381 * This API puts some app below the caller app
2383 * This API's purpose is to reorder window stack limitedly.
2385 * @param[in] below_appid The appid to be reordered below the caller app
2386 * @return 0 success, negative value(<0) if fail
2389 * below_appid should be main app which have been launched before.
2390 * This API is only available in User Session.
2392 int aul_app_group_activate_below(const char *below_appid);
2396 * This API puts some app above the caller app
2398 * This API's purpose is to reorder window stack limitedly.
2400 * @param[in] above_appid The appid to be reordered above the caller app
2401 * @return 0 if success, negative value(<0) if fail
2404 * above_appid should be main app which have been launched before.
2405 * This API is only available in User Session.
2407 int aul_app_group_activate_above(const char *above_appid);
2410 * This API is only for Appfw internally.
2412 int aul_request_data_control_socket_pair(bundle *b, int *fd);
2414 * This API is only for Appfw internally.
2416 int aul_request_message_port_socket_pair(int *fd);
2418 * This API is only for Appfw internally.
2420 int aul_listen_booting_done_signal(int (*func) (int, void *), void *data);
2423 * This API is only for Appfw internally.
2425 int aul_listen_cooldown_signal(int (*func) (const char *, void *), void *data);
2429 * This API registers a callback function that will be called when the
2430 * status of the application is changed.
2432 * This API is for monitoring the status of all applications.
2434 * @param[in] func callback function
2435 * @param[in] data user data
2436 * @return 0 if success, negative value if fail
2437 * @retval AUL_R_OK - success
2438 * @retval AUL_R_ERROR - general error
2443 * int app_status_handler(int pid, int status, void *data)
2445 * const char *app_status;
2449 * app_status = "STATUS_LAUNCHING";
2452 * app_status = "STATUS_VISIBLE";
2455 * app_status = "STATUS_BACKGROUND";
2458 * app_status = "STATUS_FOCUS";
2461 * app_status = "STATUS_UNKNOWN";
2464 * printf("pid: %d, status: %s", pid, status);
2468 * int main(int argc, char **argv)
2472 * ret = aul_listen_app_status_signal(app_status_handler, NULL);
2473 * if (ret != AUL_R_OK) {
2474 * printf("Failed to add status handler");
2484 int aul_listen_app_status_signal(int (*func)(int, int, void *), void *data);
2487 * This API is only for Appfw internally.
2489 int aul_check_tep_mount(const char *tep_path);
2492 * This API is only for Appfw internally.
2494 int aul_is_tep_mount_dbus_done(const char *tep_string);
2497 * This API is only for Appfw internally.
2499 int aul_forward_app(const char *appid, bundle *kb);
2503 * This API create custom launchpad-loader
2505 * This API's purpose is to make a slot for custom loader.
2506 * Once it is made, added loader will make a candidate process to use.
2508 * @param[in] loader_path The file name of the custom loader binary including full path
2509 * @param[in] extra A bundle to be passed to the custom loader
2510 * @return Loader ID if success, negative value(<0) if fail
2513 * This API is only for Appfw internally.
2514 * This API is only available in User Session.
2516 int aul_add_loader(const char *loader_path, bundle *extra);
2520 * This API create custom launchpad-loader
2522 * This API's purpose is to make a slot for custom loader.
2523 * Once it is made, added loader will make a candidate process to use.
2525 * @param[in] loader_path The file name of the custom loader binary including full path
2526 * @param[in] extra A bundle to be passed to the custom loader
2527 * @param[in] uid User ID
2528 * @return Loader ID if success, negative value(<0) if fail
2531 * This API is only for Appfw internally.
2532 * This API is only available to System user.
2534 int aul_add_loader_for_uid(const char *loader_path, bundle *extra, uid_t uid);
2539 * This API destroy custom launchpad-loader
2541 * This API's purpose is to remove a slot for custom loader.
2542 * Once it is removed, the prepared process will be removed as well.
2544 * @param[in] loader_id Loader ID
2545 * @return 0 if success, negative value(<0) if fail
2548 * This API is only for Appfw internally.
2549 * This API is only available in User Session.
2551 int aul_remove_loader(int loader_id);
2555 * This API destroy custom launchpad-loader
2557 * This API's purpose is to remove a slot for custom loader.
2558 * Once it is removed, the prepared process will be removed as well.
2560 * @param[in] loader_id Loader ID
2561 * @param[in] uid User ID
2562 * @return 0 if success, negative value(<0) if fail
2565 * This API is only for Appfw internally.
2566 * This API is only available to System user.
2568 int aul_remove_loader_for_uid(int loader_id, uid_t uid);
2572 * This API gets specified application process id.
2574 * The purpose of this API is to get the pid of specified application.
2576 * @param[in] appid application name
2577 * @return callee's pid if success, negative value(<0) if fail
2580 * This API is only available in User Session.
2582 int aul_app_get_pid(const char *appid);
2586 * This API gets specified application process id.
2588 * The purpose of this API is to get the pid of specified application.
2590 * @param[in] appid application name
2591 * @param[in] uid User ID
2592 * @return callee's pid if success, negative value(<0) if fail
2595 * This API is only available to System user.
2597 int aul_app_get_pid_for_uid(const char *appid, uid_t uid);
2601 * This function update rua stat.
2603 * @param[in] b Bundle object contains caller and tag information.
2604 * @param[in] uid Target uid
2606 * @return 0 if success, negative value(<0) if fail
2608 * @remarks This API is only for Appfw internally.
2617 bundle *b = bundle_create();
2618 bundle_add_str(b, AUL_SVC_K_RUA_STAT_CALLER, caller);
2619 bundle_add_str(b, AUL_SVC_K_RUA_STAT_TAG, tag);
2621 r = aul_update_rua_stat_for_uid(b);
2626 int aul_update_rua_stat_for_uid(bundle *b, uid_t uid);
2630 * This function add rua history.
2632 * @param[in] b Bundle object Target Package name or app path.
2633 * @param[in] uid Target uid
2635 * @return 0 if success, negative value(<0) if fail
2637 * @remarks This API is only for Appfw internally.
2646 bundle *b = bundle_create();
2648 bundle_add_str(b, AUL_K_RUA_PKGNAME, pkg_name);
2650 bundle_add_str(b, AUL_K_RUA_APPPATH, app_path);
2652 r = aul_add_rua_history_for_uid(b);
2657 int aul_add_rua_history_for_uid(bundle *b, uid_t uid);
2661 * This function delete rua history.
2663 * @param[in] b Bundle object Target Package name. If NULL or has no value, delete all rua history.
2664 * @param[in] uid Target uid
2666 * @return 0 if success, negative value(<0) if fail
2668 * @remarks This API is only for Appfw internally.
2679 b = bundle_create();
2680 bundle_add_str(b, AUL_K_RUA_PKGNAME, pkg_name);
2682 r = aul_delete_rua_history_for_uid(b, getuid());
2687 int aul_delete_rua_history_for_uid(bundle *b, uid_t uid);
2692 * This function sets the default application(application id) associated with operatioin, uri and mime-type.
2694 * @param[in] b Bundle object Target application id and operation, uri and mime-type.
2696 * @return 0 if success, negative value(<0) if fail
2698 * @remarks This API is only for Appfw internally.
2703 #include <aul_svc.h>
2708 bundle *b = bundle_create();
2710 const char *appid = "org.tizen.test";
2711 const char *operation = "test_operation";
2712 const char *mime_type = "test_mime";
2713 const char *uri = "test_uri";
2715 aul_svc_set_operation(b, operation);
2716 aul_svc_set_mime(b, mime_type);
2717 aul_svc_set_uri(b, uri);
2719 aul_svc_set_appid(b, appid)
2721 r = aul_set_default_app_by_operation(b);
2726 int aul_set_default_app_by_operation(bundle *b);
2730 * This API unset the default application(application id) associated with operation, uri and mime-type.
2732 * @param[in] app_id The ID of the application
2734 * @return 0 if success, negative value(<0) if fail
2747 aul_unset_default_app_by_operation("org.tizen.test");
2752 int aul_unset_default_app_by_operation(const char *app_id);
2756 * This API launches application with the given bundle asynchronously.
2757 * If the application is not running or a multiple-instance one, this API launches with the given bundle.
2758 * If the application is running, this API sends a RESET event to the App.
2759 * While the application is running, if the application cannot receive the RESET event,
2760 * this API returns a general error(AUL_R_ERROR).\n
2762 * This API is for caller.
2763 * This API's purpose is to launch/reset application with given bundle.
2764 * @par Typical use case:
2765 * If you know the target application's pkgname and bundle types,
2766 * you can use this API to launch/reset the application.
2768 * @param[in] pkgname package name to be run as callee
2769 * @param[in] kb bundle to be passed to callee
2770 * @return 0 if success, negative value(<0) if fail
2771 * @retval AUL_R_OK - success
2772 * @retval AUL_R_EINVAL - invaild package name
2773 * @retval AUL_R_ECOM - internal AUL IPC error
2774 * @retval AUL_R_ERROR - general error
2777 * This API is only available in User Session.
2778 * This API doesn't check whether the callee application is executed successfully.
2780 int aul_launch_app_async(const char *appid, bundle *kb);
2784 * This API launches application with the given bundle asynchronously.
2785 * If the application is not running or a multiple-instance one, this API launches with the given bundle.
2786 * If the application is running, this API sends a RESET event to the App.
2787 * While the application is running, if the application cannot receive the RESET event,
2788 * this API returns a general error(AUL_R_ERROR).\n
2790 * This API is for caller.
2791 * This API's purpose is to launch/reset application with given bundle.
2792 * @par Typical use case:
2793 * If you know the target application's pkgname and bundle types,
2794 * you can use this API to launch/reset the application.
2796 * @param[in] pkgname package name to be run as callee
2797 * @param[in] kb bundle to be passed to callee
2798 * @param[in] uid User ID
2799 * @return 0 if success, negative value(<0) if fail
2800 * @retval AUL_R_OK - success
2801 * @retval AUL_R_EINVAL - invaild package name
2802 * @retval AUL_R_ECOM - internal AUL IPC error
2803 * @retval AUL_R_ERROR - general error
2806 * This API is only available to System user.
2807 * This API doesn't check whether the callee application is executed successfully.
2809 int aul_launch_app_async_for_uid(const char *appid, bundle *kb, uid_t uid);
2813 * This API request launchpad to make candidate processes.
2815 * @return 0 if success, negative value(<0) if fail
2818 * This API is only available in User Session.
2820 int aul_prepare_candidate_process(void);
2823 * This API is only for Appfw internally.
2825 int aul_widget_instance_add(const char *widget_id, const char *instance_id);
2828 * This API is only for Appfw internally.
2830 int aul_widget_instance_del(const char *widget_id, const char *instance_id);
2833 * This API is only for Appfw internally.
2835 typedef void (*aul_widget_instance_foreach_cb)(const char *instance_id, void *data);
2838 * This API is only for Appfw internally.
2840 int aul_widget_instance_foreach(const char *widget_id, aul_widget_instance_foreach_cb cb, void *data);
2843 * This API is only for Appfw internally.
2845 int aul_widget_instance_update(const char *widget_id, const char *instance_id, bundle *b);
2848 * This API is only for Appfw internally.
2850 int aul_widget_instance_count(const char *widget_id);
2854 * This API gets the last caller process id of specified application process id.
2856 * This API's purpose is to get the application's last caller process id.
2858 * @param[in] pid pid of application
2859 * @return caller pid if success, nagative value if fail
2862 * This API is only available in User Session.
2864 int aul_app_get_last_caller_pid(int pid);
2868 * This API gets the last caller process id of specified application process id.
2870 * This API's purpose is to get the last caller process id of the application.
2872 * @param[in] pid pid of application
2873 * @param[in] uid User ID
2874 * @return caller pid if success, nagative value if fail
2877 * This API is only available in System users.
2879 int aul_app_get_last_caller_pid_for_uid(int pid, uid_t uid);
2883 * This API trigger to resume application asynchronously.
2884 * If the application is running, this API send a resume event to the App.
2885 * If the application is not running, this API return AUL_R_ERROR.
2886 * Although the application is running, if the application cannot receive resume event,
2887 * AUL try to raise the application's default windows.
2889 * This API is for caller.
2890 * This API's purpose is to send resume event.
2891 * @par Typical use case:
2892 * In multiple application model, If you want to only resume specific application, Use this API
2894 * @param[in] pid application's pid to be resumed
2895 * @return 0 if success, negative value(<0) if fail
2896 * @retval AUL_R_OK - success
2897 * @retval AUL_R_EINVAL - invaild pid
2898 * @retval AUL_R_ECOM - internal AUL IPC error
2899 * @retval AUL_R_ERROR - general error (include application is not running)
2900 * @warning This API need to require root or inhouse permisssion \n
2901 * If you have not the permission, this API return AUL_R_ERROR. \n
2903 * This API is only available to User Session.
2905 int aul_resume_pid_async(int pid);
2909 * This API trigger to resume application asynchronously.
2910 * If the application is running, this API send a resume event to the App.
2911 * If the application is not running, this API return AUL_R_ERROR.
2912 * Although the application is running, if the application cannot receive resume event,
2913 * AUL try to raise the application's default windows.
2915 * This API is for caller.
2916 * This API's purpose is to send resume event.
2917 * @par Typical use case:
2918 * In multiple application model, If you want to only resume specific application, Use this API
2920 * @param[in] pid application's pid to be resumed
2921 * @param[in] uid User ID
2922 * @return 0 if success, negative value(<0) if fail
2923 * @retval AUL_R_OK - success
2924 * @retval AUL_R_EINVAL - invaild pid
2925 * @retval AUL_R_ECOM - internal AUL IPC error
2926 * @retval AUL_R_ERROR - general error (include application is not running)
2927 * @warning This API need to require root or inhouse permisssion \n
2928 * If you have not the permission, this API return AUL_R_ERROR. \n
2930 * This API is only available to System user.
2932 int aul_resume_pid_async_for_uid(int pid, uid_t uid);
2936 * This API set the alias appid.
2937 * The alias appid is only available for the aul_svc_set_appid() API.
2938 * If the appid is not available, this API returns an error.
2940 * @privlevel platform
2941 * @privilege %http://tizen.org/privilege/systemsettings.admin
2942 * @param[in] alias_appid an alias application ID
2943 * @param[in] appid an application ID
2944 * @return 0 if success, negative value(<0) if fail
2947 * This API is only available to User Session.
2949 int aul_set_alias_appid(const char *alias_appid, const char *appid);
2953 * This API unset the alias appid.
2955 * @privlevel platform
2956 * @privilege %http://tizen.org/privilege/systemsettings.admin
2957 * @param[in] alias_appid an alias application ID
2958 * @return 0 if success, negative value(<0) if fail
2961 * This API is only available to User Session.
2963 int aul_unset_alias_appid(const char *alias_appid);
2967 * This API activates the alias information based on the given appid.
2969 * @privlevel platform
2970 * @privilege %http://tizen.org/privilege/systemsettings.admin
2971 * @param[in] appid an application ID
2972 * @return 0 if success, negative value(<0) if fail
2975 * This API is only available to User Session.
2977 int aul_enable_alias_info(const char *appid);
2981 * This API deactivates the alias information based on the given appid.
2983 * @privlebel platform
2984 * @privilege %http://tizen.org/privilege/systemsettings.admin
2985 * @param[in] appid an application ID
2986 * @return 0 if success, negative value(<0) if fail
2989 * This API is only available to User Session.
2991 int aul_disable_alias_info(const char *appid);
2994 * This API is only for Appfw internally.
2996 API int aul_listen_app_status(const char *appid,
2997 int (*aul_handler)(const char *appid, const char *pkgid,
2998 int pid, int status, int is_subapp, void *data),
3002 * This API is only for Appfw internally.
3004 int aul_widget_instance_get_content(const char *widget_id, const char *instance_id, char **content);
3008 * Gets running application instance info
3009 * This API calls the iter_fn with the aul_app_info when running app instance info is found.
3011 * @param[in] iter_fn iterative function
3012 * @param[in] user_data User data
3013 * @return 0 if success, negative value(<0) if fail
3014 * @retval AUL_R_OK Successful
3015 * @retval AUL_R_ERROR General error
3016 * @retval AUL_R_EINVAL Invalid parameter
3018 int aul_app_get_running_app_instance_info(aul_app_info_iter_fn iter_fn,
3020 int aul_app_get_running_app_instance_info_for_uid(aul_app_info_iter_fn iter_fn,
3021 void *user_data, uid_t uid);