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 */
63 typedef enum _aul_type {
74 typedef enum aul_widget_lifecycle_event {
75 AUL_WIDGET_LIFE_CYCLE_EVENT_APP_DEAD = 0,
76 AUL_WIDGET_LIFE_CYCLE_EVENT_CREATE = 1, /**< The widget is created */
77 AUL_WIDGET_LIFE_CYCLE_EVENT_DESTROY = 2, /**< The widget is destroyed */
78 AUL_WIDGET_LIFE_CYCLE_EVENT_PAUSE = 3, /**< The widget is paused */
79 AUL_WIDGET_LIFE_CYCLE_EVENT_RESUME = 4 /**< The widget is resumed */
80 } aul_widget_lifecycle_event_e;
82 typedef enum aul_widget_instance_event {
83 AUL_WIDGET_INSTANCE_EVENT_CREATE = 0,
84 AUL_WIDGET_INSTANCE_EVENT_DESTROY = 1,
85 AUL_WIDGET_INSTANCE_EVENT_TERMINATE = 2,
86 AUL_WIDGET_INSTANCE_EVENT_PAUSE = 3,
87 AUL_WIDGET_INSTANCE_EVENT_RESUME = 4,
88 AUL_WIDGET_INSTANCE_EVENT_UPDATE = 5,
89 AUL_WIDGET_INSTANCE_EVENT_PERIOD_CHANGED = 6,
90 AUL_WIDGET_INSTANCE_EVENT_SIZE_CHANGED = 7,
91 AUL_WIDGET_INSTANCE_EVENT_EXTRA_UPDATED = 8,
92 AUL_WIDGET_INSTANCE_EVENT_FAULT = 9,
93 AUL_WIDGET_INSTANCE_EVENT_APP_RESTART_REQUEST = 10
94 } aul_widget_instance_event_e;
96 /** AUL public key - To check caller's secuirty */
97 #define AUL_K_CALLER_PID "__AUL_CALLER_PID__"
98 /** AUL public key - To check callee's secuirty */
99 #define AUL_K_CALLEE_PID "__AUL_CALLEE_PID__"
100 /** AUL public key - added for multiuser mode */
101 #define AUL_K_CALLER_UID "__AUL_CALLER_UID__"
102 /** AUL public key - added for multiuser mode */
103 #define AUL_K_CALLEE_UID "__AUL_CALLEE_UID__"
104 /** AUL public key - added for multiuser mode */
105 #define AUL_K_TARGET_UID "__AUL_TARGET_UID__"
106 /** AUL public key - To check caller's secuirty */
107 #define AUL_K_CALLER_APPID "__AUL_CALLER_APPID__"
108 /** AUL public key - To check caller's secuirty */
109 #define AUL_K_CALLEE_APPID "__AUL_CALLEE_APPID__"
110 /** AUL public key - To find argv0 */
111 #define AUL_K_ARGV0 "__AUL_ARGV0__"
112 /** AUL public key - To measure launching time */
113 #define AUL_K_STARTTIME "__AUL_STARTTIME__"
114 /** AUL public key - To support launching based on mime type */
115 #define AUL_K_MIME_TYPE "__AUL_MIME_TYPE__"
116 /** AUL public key - To support launching based on mime type */
117 #define AUL_K_UNALIASED_MIME_TYPE "__AUL_UNALIASED_MIME_TYPE__"
118 /** AUL public key - To support launching based on mime type */
119 #define AUL_K_MIME_CONTENT "__AUL_MIME_CONTENT__"
120 /** AUL public key - To support launching based on service */
121 #define AUL_K_SERVICE_NAME "__AUL_SERVICE_NAME__"
122 /** AUL public key - To force launch app selector instead of lauchingn default app */
123 #define AUL_K_FORCE_LAUNCH_APP_SELECTOR "__AUL_FORCE_LAUNCH_APP_SELECTOR__"
124 /** AUL public key - To support debug argument */
125 #define AUL_K_DEBUG "__AUL_DEBUG__"
126 /** AUL public key - To support SDK */
127 #define AUL_K_SDK "__AUL_SDK__"
128 /** AUL public key - To support Media key */
129 #define AUL_K_MULTI_KEY "__AUL_MULTI_KEY__"
130 /** AUL public key - To support Media key */
131 #define AUL_K_MULTI_KEY_EVENT "__AUL_MULTI_KEY_EVENT__"
132 /** AUL public bundle value */
133 #define AUL_K_PRIVACY_APPID "__AUL_PRIVACY_APPID__"
134 /** AUL public bundle value - To support Media key*/
135 #define AUL_V_KEY_PRESSED "__AUL_KEY_PRESSED__"
136 /** AUL public bundle value - To support Media key*/
137 #define AUL_V_KEY_RELEASED "__AUL_KEY_RELEASED__"
138 /** AUL public key - To support rua stat */
139 #define AUL_SVC_K_RUA_STAT_CALLER "__K_RUA_STAT_CALLER__"
140 #define AUL_SVC_K_RUA_STAT_TAG "__K_RUA_STAT_TAG__"
141 /** AUL public key - To support rua delete */
142 #define AUL_K_RUA_PKGNAME "__K_RUA_PKGNAME"
143 /** AUL public key - To support rua delete */
144 #define AUL_K_RUA_APPPATH "__K_RUA_APPPATH"
145 /** AUL public key - To support rua add */
146 #define AUL_K_RUA_ARG "__K_RUA_ARG"
147 /** AUL public key - To support rua add */
148 #define AUL_K_RUA_TIME "__K_RUA_TIME"
151 /** AUL internal private key */
152 #define AUL_K_PKG_NAME "__AUL_PKG_NAME__"
153 /** AUL internal private key */
154 #define AUL_K_WAIT_RESULT "__AUL_WAIT_RESULT__"
155 /** AUL internal private key */
156 #define AUL_K_SEND_RESULT "__AUL_SEND_RESULT__"
157 /** AUL internal private key */
158 #define AUL_K_TASK_MANAGE "__AUL_TASK_MANAGE__"
159 /** AUL internal private key */
160 #define AUL_K_APP_TYPE "__AUL_APP_TYPE__"
161 /** AUL internal private key - To check original caller's identity */
162 #define AUL_K_ORG_CALLER_PID "__AUL_ORG_CALLER_PID__"
163 /** AUL internal private key - To check forwarded callee app's pid */
164 #define AUL_K_FWD_CALLEE_PID "__AUL_FWD_CALLEE_PID__"
165 /** AUL internal private key */
166 #define AUL_K_NO_CANCEL "__AUL_NO_CANCEL__"
167 /** AUL internal private key */
168 #define AUL_K_EXEC "__AUL_EXEC__"
169 /** AUL internal private key */
170 #define AUL_K_MULTIPLE "__AUL_MULTIPLE__"
171 /** AUL internal private key */
172 #define AUL_K_PACKAGETYPE "__AUL_PACKAGETYPE__"
173 /** AUL internal private key */
174 #define AUL_K_HWACC "__AUL_HWACC__"
175 /** AUL internal private key */
176 #define AUL_K_APPID "__AUL_APPID__"
177 /** AUL internal private key */
178 #define AUL_K_PID "__AUL_PID__"
179 /** AUL internal private key */
180 #define AUL_K_WID "__AUL_WID__"
181 /** AUL internal private key */
182 #define AUL_K_LEADER_PID "__AUL_LEADER_PID__"
183 /** AUL internal private key - To support data control */
184 #define AUL_K_DATA_CONTROL_TYPE "__AUL_DATA_CONTROL_TYPE__"
185 /** AUL internal private key */
186 #define AUL_K_PKGID "__AUL_PKGID_"
187 /** AUL internal private key */
188 #define AUL_K_INTERNAL_POOL "__AUL_INTERNAL_POOL__"
189 /** AUL internal private key */
190 #define AUL_TEP_PATH "_AUL_TEP_PATH_"
191 /** AUL internal private key */
192 #define AUL_K_COMP_TYPE "__AUL_COMP_TYPE__"
193 /** AUL internal private key */
194 #define AUL_K_LOADER_ID "__AUL_LOADER_ID__"
195 /** AUL internal private key */
196 #define AUL_K_LOADER_PATH "__AUL_LOADER_PATH__"
197 /** AUL internal private key */
198 #define AUL_K_LOADER_EXTRA "__AUL_LOADER_EXTRA__"
199 /** AUL internal private key */
200 #define AUL_K_LOADER_NAME "__AUL_LOADER_NAME__"
201 /** AUL internal private key */
202 #define AUL_K_WAYLAND_DISPLAY "__AUL_WAYLAND_DISPLAY__"
203 /** AUL internal private key */
204 #define AUL_K_WAYLAND_WORKING_DIR "__AUL_WAYLAND_WORKING_DIR__"
205 /** AUL internal private key */
206 #define AUL_K_COM_SENDER_PID "__AUL_COM_SENDER_PID__"
207 /** AUL internal private key */
208 #define AUL_K_COM_ENDPOINT "__AUL_COM_ENDPOINT__"
209 /** AUL internal private key */
210 #define AUL_K_COM_PRIVILEGE "__AUL_COM_PRIVILEGE__"
211 /** AUL internal private key */
212 #define AUL_K_COM_PROPAGATE "__AUL_COM_PROPAGATE__"
213 /** AUL internal private key */
214 #define AUL_K_COM_FILTER "__AUL_COM_FILTER__"
215 /** AUL internal private key */
216 #define AUL_K_COM_RESULT "__AUL_COM_RESULT__"
217 /** AUL internal private key */
218 #define AUL_K_ROOT_PATH "__AUL_ROOT_PATH__"
219 /** AUL internal private key */
220 #define AUL_K_SEQ_NUM "__AUL_SEQ_NUM__"
221 /** AUL internal private key */
222 #define AUL_K_API_VERSION "__AUL_API_VERSION__"
223 /** AUL internal private key */
224 #define AUL_K_ALLOWED_BG "__AUL_ALLOWED_BG__"
225 /** AUL internal private key */
226 #define AUL_K_OWNER_PID "__AUL_OWNER_PID__"
227 /** AUL internal private key */
228 #define AUL_K_CHILD_PID "__AUL_CHILD_PID__"
229 /** AUL internal private key */
230 #define AUL_K_WIDGET_VIEWER "__AUL_WIDGET_VIEWER__"
231 /** AUL internal private key */
232 #define AUL_K_WIDGET_ID "__AUL_WIDGET_ID__"
233 /** AUL internal private key */
234 #define AUL_K_WIDGET_INSTANCE_ID "__AUL_WIDGET_INSTANCE_ID__"
235 /** AUL internal private key */
236 #define AUL_K_WIDGET_STATUS "__AUL_WIDGET_STATUS__"
237 /** AUL internal private key */
238 #define AUL_K_WIDGET_CONTENT_INFO "__AUL_WIDGET_CONTENT_INFO__"
239 /** AUL internal private key */
240 #define AUL_K_TARGET_PID "__AUL_TARGET_PID__"
241 /** AUL internal private key */
242 #define AUL_K_ALIAS_APPID "__AUL_ALIAS_APPID__"
243 /** AUL internal private key */
244 #define AUL_K_ORG_APPID "__AUL_ORG_APPID__"
245 /** AUL internal private key */
246 #define AUL_K_STATUS "__AUL_STATUS__"
247 /** AUL internal private key */
248 #define AUL_K_IS_SUBAPP "__AUL_IS_SUBAPP__"
251 * @brief This is callback function for aul_launch_init
252 * @param[in] type event's type received from system
253 * @param[in] b In case of RESET events, bundle which is received from peer
254 * @param[in] data user-supplied data
256 typedef int (*aul_handler_fn)(aul_type type, bundle *b, void *data);
260 * This API install your AUL handler and setup AUL internal connection.
262 * AUL receive START(RESET), RESUME, TERMINATE events from system.\n
263 * This API use to handle the events. \n
264 * @par Typical use case:
265 * In general, you need not use this API.
266 * If you use AppCore, you should NOT use this API.
267 * AppCore will set default aul_handler.
269 * @param[in] handler aul main callback handler function
270 * @param[in] data user-supplied data for start_handler
271 * @return 0 if success, negative value(<0) if fail\n
272 * @retval AUL_R_OK - success
273 * @retval AUL_R_ECANCELD - aul handler was installed already by others
274 * @retval AUL_R_ECOMM - error to create internal ipc
275 * @retval AUL_R_ERROR - error to attach glib main loop
277 * @warning If you use AppCore, you should NOT use this API.\n
278 * You need glib main loop.\n
280 * you must have aul handler to use this API.
281 * aul_luanch_init register aul handler.
284 * #include <bundle.h>
286 * static int aul_handler(aul_type type, bundle *kb,void *data)
291 * // process RESET event
294 * // process RESUME event
296 * case AUL_TERMINATE:
297 * // preocess TERMINATE event
303 * static GMainLoop *mainloop = NULL;
305 * int main(int argc, char **argv)
307 * aul_launch_init(aul_handler,NULL);
308 * aul_launch_argv_handler(argc, argv);
310 * mainloop = g_main_loop_new(NULL, FALSE);
311 * g_main_loop_run(mainloop);
316 * This API is only available in User Session.
318 int aul_launch_init(aul_handler_fn handler, void *data);
322 * This API create internal RESET events with given argc, argv \n
324 * This API's purpose is to generate reset event.
325 * If you want to generate local RESET events with argument vector format, use this API
326 * @par Typical use case:
327 * In general, you need not use this API.
328 * AppCore use this API to create internal reset event.
330 * @param[in] argc # of args
331 * @param[in] argv list of arg strings
332 * @return 0 if success, negative value(<0) if fail
333 * @retval AUL_R_OK - success
334 * @retval AUL_R_ENOINIT - aul handler was NOT yet installed
335 * @retval AUL_R_ECANCLED - error to create internal bundle with given argc,argv.
336 * @retval AUL_R_ERROR - general error
339 * you must have aul handler to use this API.
340 * aul_luanch_init register aul handler.
345 * #include <bundle.h>
347 * int send_local_reset_event()
351 * argv[0] = "local.app";
352 * argv[1] = "event_type";
353 * argv[2] = "my_reset";
355 * aul_launch_argv_handler(argc,argv);
360 * If you use AppCore, you NEED NOT use this API.
361 * This API is only available in User Session.
363 int aul_launch_argv_handler(int argc, char **argv);
367 * This API creates internal RESET events with given bundle \n
369 * This API's purpose is to generate reset event.
370 * If you want to generate local RESET events with argument vector format, first use
371 * bundle_import_from_argv to create a bundle from the argument vector and then use this API
372 * Eventually, this API will replace aul_launch_argv_handler().
373 * @par Typical use case:
374 * In general, you need not use this API.
375 * AppCore use this API to create internal reset event.
377 * @param[in] b bundle
378 * @return 0 if success, negative value(<0) if fail
379 * @retval AUL_R_OK - success
380 * @retval AUL_R_ENOINIT - aul handler was NOT yet installed
381 * @retval AUL_R_ERROR - general error
384 * you must have aul handler to use this API.
385 * aul_luanch_init register aul handler.
389 * aul_launch_init, bundle_import_from_argv
392 * #include <bundle.h>
394 * int send_local_reset_event()
399 * argv[0] = "local.app";
400 * argv[1] = "event_type";
401 * argv[2] = "my_reset";
404 * b = bundle_import_from_argv(argc,argv);
405 * aul_launch_local(b);
410 * If you use AppCore, you NEED NOT to use this API.
411 * This API is only available in User Session.
413 int aul_launch_local(bundle *b);
417 * This API launches application with the given bundle.
418 * If the application is not running or a multiple-instance one, this API launches with the given bundle.
419 * If the application is running, this API sends a RESET event to the App.
420 * While the application is running, if the application cannot receive the RESET event,
421 * this API returns a general error(AUL_R_ERROR).\n
423 * This API is for caller.
424 * This API's purpose is to launch/reset application with given bundle.
425 * @par Typical use case:
426 * If you know the target application's pkgname and bundle types,
427 * you can use this API to launch/reset the application.
429 * @param[in] pkgname package name to be run as callee
430 * @param[in] kb bundle to be passed to callee
431 * @return callee's pid if success, negative value(<0) if fail
432 * @retval AUL_R_OK - success
433 * @retval AUL_R_EINVAL - invaild package name
434 * @retval AUL_R_ECOM - internal AUL IPC error
435 * @retval AUL_R_ERROR - general error
441 * #include <bundle.h>
443 * int launch_inhouse_contact_app()
446 * b = bundle_create();
447 * bundle_add(b,"type","SIM");
448 * aul_launch_app("org.tizen.contact",b);
453 * This API is only available in User Session.
455 int aul_launch_app(const char *appid, bundle *kb);
459 * This API launches application with the given bundle.
460 * If the application is not running or a multiple-instance one, this API launches with the given bundle.
461 * If the application is running, this API sends a RESET event to the App.
462 * While the application is running, if the application cannot receive the RESET event,
463 * this API returns a general error(AUL_R_ERROR).\n
465 * This API is for caller.
466 * This API's purpose is to launch/reset application with given bundle.
467 * @par Typical use case:
468 * If you know the target application's pkgname and bundle types,
469 * you can use this API to launch/reset the application.
471 * @param[in] pkgname package name to be run as callee
472 * @param[in] kb bundle to be passed to callee
473 * @param[in] uid User ID to launch
474 * @return callee's pid if success, negative value(<0) if fail
475 * @retval AUL_R_OK - success
476 * @retval AUL_R_EINVAL - invaild package name
477 * @retval AUL_R_ECOM - internal AUL IPC error
478 * @retval AUL_R_ERROR - general error
483 * This API is also available in System Session.
485 int aul_launch_app_for_uid(const char *appid, bundle *kb, uid_t uid);
489 * This API launches application, as menu screen launches the app.
490 * Thus, if the applocation is running, this API sends a RESUME event to the app.
491 * If the application is not running, this API launches the app.
492 * While the application is running, if the application cannot receive the RESUME event,
493 * AUL tries to raise the application's default window.
496 * This API is for caller.
497 * This API's purpose is to resume/launch application
498 * @par Typical use case:
499 * If you only want to show application with previous state or default state, Use this API.
501 * @param[in] pkgname package name to be resume as callee
502 * @return callee's pid if success, negative value(<0) if fail
503 * @retval AUL_R_OK - success
504 * @retval AUL_R_EINVAL - invaild package name
505 * @retval AUL_R_ECOM - internal AUL IPC error
506 * @retval AUL_R_ERROR - general error
509 * aul_launch_app, aul_app_is_running, aul_resume_pid
512 * #include <bundle.h>
514 * int open_inhouse_contact_app()
516 * if(aul_app_is_running("org.tizen.contact"))
517 * aul_open_app("org.tizen.contact");
522 * If you don't want to launch the app,
523 * you should check app's running state with aul_app_is_running.
524 * This API will launch the application if the application is not running.
525 * This API is only available in User Session.
527 int aul_open_app(const char *appid);
531 * This API launches application, as menu screen launches the app.
532 * Thus, if the applocation is running, this API sends a RESUME event to the app.
533 * If the application is not running, this API launches the app.
534 * While the application is running, if the application cannot receive the RESUME event,
535 * AUL tries to raise the application's default window.
538 * This API is for caller.
539 * This API's purpose is to resume/launch application
540 * @par Typical use case:
541 * If you only want to show application with previous state or default state, Use this API.
543 * @param[in] pkgname package name to be resume as callee
544 * @param[in] uid User ID
545 * @return callee's pid if success, negative value(<0) if fail
546 * @retval AUL_R_OK - success
547 * @retval AUL_R_EINVAL - invaild package name
548 * @retval AUL_R_ECOM - internal AUL IPC error
549 * @retval AUL_R_ERROR - general error
552 * If you don't want to launch the app,
553 * you should check app's running state with aul_app_is_running.
554 * This API will launch the application if the application is not running.
555 * This API is only available to System user.
557 int aul_open_app_for_uid(const char *appid, uid_t uid);
561 * This API trigger to resume application
562 * If the application is running, this API send a resume event to the App.
563 * If the application is not running, this API returns fail.
564 * Although the application is running, if the application cannot receive resume event,
565 * AUL try to raise the application's default windows.
567 * This API is for caller.
568 * This API's purpose is to send resume event.
569 * @par Typical use case:
570 * If you only want to show application with previous state or default state, Use this API.
572 * @param[in] pkgname package name to be resume as callee
573 * @return callee's pid if success, negative value(<0) if fail
574 * @retval AUL_R_OK - success
575 * @retval AUL_R_EINVAL - invaild package name
576 * @retval AUL_R_ECOM - internal AUL IPC error
577 * @retval AUL_R_ERROR - general error
580 * aul_launch_app, aul_app_is_running, aul_resume_pid
582 * This function will be deprecated. Use aul_open_add() instead.
585 * #include <bundle.h>
587 * int resume_inhouse_contact_app()
589 * if(aul_app_is_running("org.tizen.contact"))
590 * aul_resume_app("org.tizen.contact");
595 * If you don't want to launch the app,
596 * you should check app's running state with aul_app_is_running.
597 * This API will launch the application if the application is not running.
598 * If you want to only resume without launching in multiple instance application model,
599 * you should use aul_resume_pid.
600 * This API is only available in User Session.
602 int aul_resume_app(const char *appid);
606 * This API trigger to resume application
607 * If the application is running, this API send a resume event to the App.
608 * If the application is not running, this API returns fail.
609 * Although the application is running, if the application cannot receive resume event,
610 * AUL try to raise the application's default windows.
612 * This API is for caller.
613 * This API's purpose is to send resume event.
614 * @par Typical use case:
615 * If you only want to show application with previous state or default state, Use this API.
617 * @param[in] pkgname package name to be resume as callee
618 * @param[in] uid User ID
619 * @return callee's pid if success, negative value(<0) if fail
620 * @retval AUL_R_OK - success
621 * @retval AUL_R_EINVAL - invaild package name
622 * @retval AUL_R_ECOM - internal AUL IPC error
623 * @retval AUL_R_ERROR - general error
626 * If you don't want to launch the app,
627 * you should check app's running state with aul_app_is_running.
628 * This API will launch the application if the application is not running.
629 * If you want to only resume without launching in multiple instance application model,
630 * you should use aul_resume_pid.
631 * This API is only available to System user.
633 int aul_resume_app_for_uid(const char *appid, uid_t uid);
637 * This API trigger to resume application
638 * If the application is running, this API send a resume event to the App.
639 * If the application is not running, this API return AUL_R_ERROR.
640 * Although the application is running, if the application cannot receive resume event,
641 * AUL try to raise the application's default windows.
643 * This API is for caller.
644 * This API's purpose is to send resume event.
645 * @par Typical use case:
646 * In multiple application model, If you want to only resume specific application, Use this API
648 * @param[in] pid application's pid to be resumed
649 * @return 0 if success, negative value(<0) if fail
650 * @retval AUL_R_OK - success
651 * @retval AUL_R_EINVAL - invaild pid
652 * @retval AUL_R_ECOM - internal AUL IPC error
653 * @retval AUL_R_ERROR - general error (include application is not running)
654 * @warning This API need to require root or inhouse permisssion \n
655 * If you have not the permission, this API return AUL_R_ERROR. \n
660 * #include <bundle.h>
662 * int iterfunc(const aul_app_info *info, void *data)
664 * if(strcmp(info->pkg_name,"org.tizen.contact")==0)
665 * aul_resume_pid(info->pid);
668 * int iterate_running_apps()
670 * return aul_app_get_running_app_info(iterfunc,NULL);
675 * This API is only available in User Session.
677 int aul_resume_pid(int pid);
681 * This API trigger to resume application
682 * If the application is running, this API send a resume event to the App.
683 * If the application is not running, this API return AUL_R_ERROR.
684 * Although the application is running, if the application cannot receive resume event,
685 * AUL try to raise the application's default windows.
687 * This API is for caller.
688 * This API's purpose is to send resume event.
689 * @par Typical use case:
690 * In multiple application model, If you want to only resume specific application, Use this API
692 * @param[in] pid application's pid to be resumed
693 * @param[in] uid User ID
694 * @return 0 if success, negative value(<0) if fail
695 * @retval AUL_R_OK - success
696 * @retval AUL_R_EINVAL - invaild pid
697 * @retval AUL_R_ECOM - internal AUL IPC error
698 * @retval AUL_R_ERROR - general error (include application is not running)
699 * @warning This API need to require root or inhouse permisssion \n
700 * If you have not the permission, this API return AUL_R_ERROR. \n
702 * This API is only available to System user.
704 int aul_resume_pid_for_uid(int pid, uid_t uid);
708 * This API trigger to terminate application
710 * If the application is running, this API send a terminate event to the App. \n
711 * If the app cannot receive the event, AUL kill forcely the application.\n
713 * This API's purpose is to kill application
714 * @par Typical use case:
715 * In general, Application like Task Manager use this API.
717 * This API need to require root or inhouse permisssion. \n
719 * @param[in] pid application's pid to be terminated
720 * @return 0 if success, negative value(<0) if fail
721 * @retval AUL_R_OK - success
722 * @retval AUL_R_EINVAL - invaild pid
723 * @retval AUL_R_ECOM - internal AUL IPC error
724 * @retval AUL_R_ERROR - general error
725 * @warning This API need to require root or inhouse permisssion. \n
729 * #include <bundle.h>
731 * int iterfunc(const aul_app_info *info, void *data)
733 * if(strcmp(info->pkg_name,"org.tizen.contact")==0)
734 * aul_terminate_pid(info->pid);
737 * int iterate_running_apps()
739 * return aul_app_get_running_app_info(iterfunc,NULL);
744 * If you have not the permission, this API return AUL_R_ERROR. \n
745 * This API is only available in User Session.
747 int aul_terminate_pid(int pid);
751 * This API trigger to terminate application
753 * If the application is running, this API send a terminate event to the App. \n
754 * If the app cannot receive the event, AUL kill forcely the application.\n
756 * This API's purpose is to kill application
757 * @par Typical use case:
758 * In general, Application like Task Manager use this API.
760 * This API need to require root or inhouse permisssion. \n
762 * @param[in] pid application's pid to be terminated
763 * @param[in] uid User ID
764 * @return 0 if success, negative value(<0) if fail
765 * @retval AUL_R_OK - success
766 * @retval AUL_R_EINVAL - invaild pid
767 * @retval AUL_R_ECOM - internal AUL IPC error
768 * @retval AUL_R_ERROR - general error
769 * @warning This API need to require root or inhouse permisssion. \n
772 * If you have not the permission, this API return AUL_R_ERROR. \n
773 * This API is only available to System user.
775 int aul_terminate_pid_for_uid(int pid, uid_t uid);
779 * This API trigger to terminate application asynchronously
781 * If the application is running, this API send a terminate event to the App. \n
782 * If the app cannot receive the event, AUL kill forcely the application.\n
784 * This API's purpose is to kill application
785 * @par Typical use case:
786 * In general, Application like Task Manager use this API.
788 * This API need to require root or inhouse permisssion. \n
790 * @param[in] pid application's pid to be terminated
791 * @return 0 if success, negative value(<0) if fail
792 * @retval AUL_R_OK - success
793 * @retval AUL_R_EINVAL - invaild pid
794 * @retval AUL_R_ECOM - internal AUL IPC error
795 * @retval AUL_R_ERROR - general error
796 * @warning This API need to require root or inhouse permisssion. \n
798 * If you have not the permission, this API return AUL_R_ERROR. \n
799 * This API is only available in User Session.
801 int aul_terminate_pid_async(int pid);
805 * This API trigger to terminate application asynchronously
807 * If the application is running, this API send a terminate event to the App. \n
808 * If the app cannot receive the event, AUL kill forcely the application.\n
810 * This API's purpose is to kill application
811 * @par Typical use case:
812 * In general, Application like Task Manager use this API.
814 * This API need to require root or inhouse permisssion. \n
816 * @param[in] pid application's pid to be terminated
817 * @param[in] uid User ID
818 * @return 0 if success, negative value(<0) if fail
819 * @retval AUL_R_OK - success
820 * @retval AUL_R_EINVAL - invaild pid
821 * @retval AUL_R_ECOM - internal AUL IPC error
822 * @retval AUL_R_ERROR - general error
823 * @warning This API need to require root or inhouse permisssion. \n
825 * If you have not the permission, this API return AUL_R_ERROR. \n
826 * This API is only available to System user.
828 int aul_terminate_pid_async_for_uid(int pid, uid_t uid);
832 * This API trigger to terminate application synchronously
834 * If the application is running, this API sends a terminate event to the application. \n
835 * And then, this API waits until the application is terminated successfully. \n
836 * If the app cannot receive the event, AUL kill forcely the application. \n
838 * This API's purpose is to kill application
839 * @par Typical use case:
840 * In general, Application like Task Manager use this API.
842 * This API need to require root or platform level permisssion. \n
844 * @param[in] pid application's pid to be terminated
845 * @return 0 if success, negative value(<0) if fail
846 * @retval AUL_R_OK - success
847 * @retval AUL_R_EINVAL - invaild pid
848 * @retval AUL_R_ECOM - internal AUL IPC error
849 * @retval AUL_R_ERROR - general error
850 * @warning This API need to require root or platform level permisssion. \n
852 * If you have not the permission, this API return AUL_R_ERROR. \n
853 * This API is only available in User Session.
855 int aul_terminate_pid_sync(int pid);
859 * This API trigger to terminate application synchronously
861 * If the application is running, this API send a terminate event to the application. \n
862 * And then, this API waits until the application is terminated successfully. \n
863 * If the app cannot receive the event, AUL kill forcely the application. \n
865 * This API's purpose is to kill application
866 * @par Typical use case:
867 * In general, Application like Task Manager use this API.
869 * This API need to require root or platform level permisssion. \n
871 * @param[in] pid application's pid to be terminated
872 * @param[in] uid User ID
873 * @return 0 if success, negative value(<0) if fail
874 * @retval AUL_R_OK - success
875 * @retval AUL_R_EINVAL - invaild pid
876 * @retval AUL_R_ECOM - internal AUL IPC error
877 * @retval AUL_R_ERROR - general error
878 * @warning This API need to require root or platform level permisssion. \n
880 * If you have not the permission, this API return AUL_R_ERROR. \n
881 * This API is only available to System user.
883 int aul_terminate_pid_sync_for_uid(int pid, uid_t uid);
886 *@brief Running application's information structure retrieved by AUL
888 typedef struct _aul_app_info {
889 int pid; /**< app's pid if running*/
890 char *pkg_name; /**< application id */
891 char *app_path; /**< application excutable path */
893 char *pkgid; /**< package id */
894 int status; /**< app's status */
895 int is_sub_app; /**< state whether sub app of app group */
899 * @brief iterator function running with aul_app_get_running_app_info
900 * @param[out] ainfo aul_app_info retreived by aul_app_get_running_app_info
901 * @param[out] data user-supplied data
903 typedef int (*aul_app_info_iter_fn)(const aul_app_info *ainfo, void *data);
907 * This API ask a application is running by application package name.
909 * To know whether some application is running or not, use this API
910 * @par Typical use case:
911 * For example, If you want to know browser application running,
912 * you can check it by using this API.
914 * @param[in] pkgname application package name
915 * @return true / false
916 * @retval 1 app_name is running now.
917 * @retval 0 app_name is NOT running now.
922 * int is_running_browser_app()
924 * return aul_app_is_running("org.tizen.browser");
929 * This API is only available in User Session.
932 int aul_app_is_running(const char *appid);
936 * This API ask a application is running by application package name.
938 * To know whether some application is running or not, use this API
939 * @par Typical use case:
940 * For example, If you want to know browser application running,
941 * you can check it by using this API.
943 * @param[in] pkgname application package name
944 * @param[in] uid User ID
945 * @return true / false
946 * @retval 1 app_name is running now.
947 * @retval 0 app_name is NOT running now.
951 * This API is only available to System User.
953 int aul_app_is_running_for_uid(const char *appid, uid_t uid);
957 * This API use to get running application list.
958 * This API call iter_fn with each aul_app_info of running apps when running application is found.
960 * If you want to get running application list, use this API
961 * @par Typical use case:
962 * In general, this API is used by task manager appllication. (running application list viewer)
964 * @param[in] iter_fn iterator function
965 * @param[in] data user-supplied data for iter_fn
966 * @return 0 if success, negative value(<0) if fail
967 * @retval AUL_R_OK - success
968 * @retval AUL_R_ERROR - internal error
973 * int iterfunc(const aul_app_info* info, void* data)
975 * printf("\t==========================\n");
976 * printf("\t pkg_name: %s\n", info->appid);
977 * printf("\t app_path: %s\n", info->app_path);
978 * printf("\t running pid: %d\n", info->pid);
979 * printf("\t==========================\n");
983 * int iterate_running_apps()
985 * return aul_app_get_running_app_info(iterfunc,NULL);
990 * This API should use if you want to know running application which has desktop files.
991 * If you want to get all process list, you must iterate process information by using proc filesystem
992 * Or, If you want to get all window list, you must iterate XWindows by using XWindow APIs
993 * This API is only available in User Session.
995 int aul_app_get_running_app_info(aul_app_info_iter_fn iter_fn, void *data);
999 * This API use to get running application list.
1000 * This API call iter_fn with each aul_app_info of running apps when running application is found.
1002 * If you want to get running application list, use this API
1003 * @par Typical use case:
1004 * In general, this API is used by task manager appllication. (running application list viewer)
1006 * @param[in] iter_fn iterator function
1007 * @param[in] data user-supplied data for iter_fn
1008 * @param[in] uid User ID
1009 * @return 0 if success, negative value(<0) if fail
1010 * @retval AUL_R_OK - success
1011 * @retval AUL_R_ERROR - internal error
1014 * This API should use if you want to know running application which has desktop files.
1015 * If you want to get all process list, you must iterate process information by using proc filesystem
1016 * Or, If you want to get all window list, you must iterate XWindows by using XWindow APIs
1017 * This API is only available to System user.
1019 int aul_app_get_running_app_info_for_uid(aul_app_info_iter_fn iter_fn, void *data, uid_t uid);
1023 * This API use to get all running application list, including sub app.
1024 * This API call iter_fn with each aul_app_info of running apps when running application is found.
1026 * If you want to get all running application list, use this API
1027 * @par Typical use case:
1028 * In general, this API is used by task manager application. (running application list viewer)
1030 * @param[in] iter_fn iterator function
1031 * @param[in] data user-supplied data for iter_fn
1032 * @return 0 if success, negative value(<0) if fail
1033 * @retval AUL_R_OK - success
1034 * @retval AUL_R_ERROR - internal error
1039 * int iterfunc_status(const aul_app_info *info, void *data)
1041 * printf("\t==========================\n");
1042 * printf("\t pid: %d\n", info->pid);
1043 * printf("\t appid: %s\n", info->appid);
1044 * printf("\t app_path: %s\n", info->app_path);
1045 * printf("\t pkgid: %s\n", info->pkgid);
1046 * printf("\t status: %d\n", info->status);
1047 * printf("\t is_sub_app : %d\n", info->is_sub_app);
1048 * printf("\t==========================\n");
1052 * int iterate_running_apps()
1054 * return aul_app_get_all_running_app_info(iterfunc_status,NULL);
1059 * This API should use if you want to know running application which has desktop files.
1060 * If you want to get all process list, you must iterate process information by using proc filesystem
1061 * Or, If you want to get all window list, you must iterate XWindows by using XWindow APIs
1062 * This API is only available in User Session.
1064 int aul_app_get_all_running_app_info(aul_app_info_iter_fn iter_fn, void *data);
1068 * This API use to get all running application list, including sub app.
1069 * This API call iter_fn with each aul_app_info of running apps when running application is found.
1071 * If you want to get all running application list, use this API
1072 * @par Typical use case:
1073 * In general, this API is used by task manager application. (running application list viewer)
1075 * @param[in] iter_fn iterator function
1076 * @param[in] data user-supplied data for iter_fn
1077 * @param[in] uid User ID
1078 * @return 0 if success, negative value(<0) if fail
1079 * @retval AUL_R_OK - success
1080 * @retval AUL_R_ERROR - internal error
1083 * This API should use if you want to know running application which has desktop files.
1084 * If you want to get all process list, you must iterate process information by using proc filesystem
1085 * Or, If you want to get all window list, you must iterate XWindows by using XWindow APIs
1086 * This API is only available to System user.
1088 int aul_app_get_all_running_app_info_for_uid(aul_app_info_iter_fn iter_fn, void *data, uid_t uid);
1092 * This API get application package name by pid
1094 * If you want to get package name of running application, use this API
1095 * @par Typical use case:
1096 * In general, You can use this API when you want to know caller's information.
1098 * @param[in] pid given pid
1099 * @param[out] pkgname pkgname to be get
1100 * @param[in] len length of pkgname
1101 * @return 0 if success, negative value(<0) if fail
1102 * @retval AUL_R_OK - success
1103 * @retval AUL_R_ERROR - no such a package name
1106 * #include <bundle.h>
1108 * static int app_reset(bundle *b, void *data)
1111 * char appname[255];
1113 * pid = atoi(bundle_get_val(b,AUL_K_CALLER_PID));
1114 * aul_app_get_pkgname_bypid(pid, appname, sizeof(appname));
1119 * This API is only available in User Session.
1121 int aul_app_get_pkgname_bypid(int pid, char *pkgname, int len);
1125 * This API get application pkgid by pid
1127 * If you want to get pkgid of running application, use this API
1128 * @par Typical use case:
1129 * In general, You can use this API when you want to know caller's information.
1131 * @param[in] pid given pid
1132 * @param[out] pkgid package id
1133 * @param[in] len length of pkgid
1134 * @return 0 if success, negative value(<0) if fail
1135 * @retval AUL_R_OK - success
1136 * @retval AUL_R_ERROR - no such a appid
1140 * #include <bundle.h>
1142 * static int app_reset(bundle *b, void *data)
1147 * pid = atoi(bundle_get_val(b, AUL_K_CALLER_PID));
1148 * aul_app_get_pkgid_bypid(pid, pkgid, sizeof(pkgid));
1153 * This API is only available in User Session.
1155 int aul_app_get_pkgid_bypid(int pid, char *pkgid, int len);
1159 * This API get application pkgid by pid
1161 * If you want to get pkgid of running application, use this API
1162 * @par Typical use case:
1163 * In general, You can use this API when you want to know caller's information.
1165 * @param[in] pid given pid
1166 * @param[out] pkgid package id
1167 * @param[in] len length of pkgid
1168 * @param[in] uid User ID
1169 * @return 0 if success, negative value(<0) if fail
1170 * @retval AUL_R_OK - success
1171 * @retval AUL_R_ERROR - no such a appid
1174 * This API is also available to System user.
1176 int aul_app_get_pkgid_bypid_for_uid(int pid, char *pkgid, int len, uid_t uid);
1180 * This API get application appid by pid
1182 * If you want to get appid of running application, use this API
1183 * @par Typical use case:
1184 * In general, You can use this API when you want to know caller's information.
1186 * @param[in] pid given pid
1187 * @param[out] appid application id
1188 * @param[in] len length of pkgname
1189 * @return 0 if success, negative value(<0) if fail
1190 * @retval AUL_R_OK - success
1191 * @retval AUL_R_ERROR - no such a appid
1194 * #include <bundle.h>
1196 * static int app_reset(bundle *b, void *data)
1201 * pid = atoi(bundle_get_val(b,AUL_K_CALLER_PID));
1202 * aul_app_get_appid_bypid(pid, appid, sizeof(appid));
1207 * This API is only available in User Session.
1209 int aul_app_get_appid_bypid(int pid, char *appid, int len);
1213 * This API get application appid by pid
1215 * If you want to get appid of running application, use this API
1216 * @par Typical use case:
1217 * In general, You can use this API when you want to know caller's information.
1219 * @param[in] pid given pid
1220 * @param[out] appid application id
1221 * @param[in] len length of pkgname
1222 * @param[in] uid User ID
1223 * @return 0 if success, negative value(<0) if fail
1224 * @retval AUL_R_OK - success
1225 * @retval AUL_R_ERROR - no such a appid
1227 * This API is also available to System user.
1229 int aul_app_get_appid_bypid_for_uid(int pid, char *appid, int len, uid_t uid);
1233 * This API launch application associated with given filename
1235 * This API is for caller.
1236 * This API launch application based on mime type.
1237 * This API find mime_type associated with file name,
1238 * and then find default app associated with found mime_type
1239 * and then launch the app with filename argument.
1240 * @par Typical use case:
1241 * You can launch application to process given filename.
1242 * That is, Even if you don't know the specific application's pkgname,
1243 * you can launch the applicaiton processing given filename .
1244 * For example, If you want to process image file, you can simply launch image viewer.
1245 * At that time, you can use this APIs like aul_open_file("myimage.jpg");
1247 * @param[in] filename filename
1248 * @return callee's pid or 0 if success, negative value if fail\n
1249 * (when no found default app, return 0)
1250 * @retval AUL_R_OK - success
1251 * @retval AUL_R_EINVAL - invalid argument(filename)
1252 * @retval AUL_R_ECOM - internal AUL IPC error
1253 * @retval AUL_R_ERROR - general error
1258 * int view_image_file(char *filename)
1260 * aul_open_file(filename);
1265 * This API is only available in User Session.
1268 int aul_open_file(const char* filename);
1272 * This API launch application associated with given specific mimetype
1274 * This API is for caller.
1275 * This API launch application based on mime type like aul_open_file API.
1276 * But, This API don't find mime_type associated with file name.
1277 * This API use mimetype given by user. By using given mimetype, find default application.
1278 * and then launch the app with filename argument.
1279 * @par Typical use case:
1280 * Some files cannot extract exact mimetype automatically.
1281 * For example, To know mime type of files with DRM lock, first we should unlock DRM file.
1282 * In this case, You can use this API.
1283 * First, unlock DRM file, and extract mimetype from unlock file by using aul_get_mime_from_file,
1284 * and then, use this API with DRM file and extracted mime type.
1286 * @param[in] filename filename
1287 * @param[in] mimetype specific mimetype
1288 * @return callee's pid or 0 if success, negative value if fail\n
1289 * (when no found default app, return 0)
1290 * @retval AUL_R_OK - success
1291 * @retval AUL_R_EINVAL - invalid argument(filename,mimetype)
1292 * @retval AUL_R_ECOM - internal AUL IPC error
1293 * @retval AUL_R_ERROR - general error
1296 * aul_open_file, aul_get_mime_from_file
1300 * int view_drm_image_file(char *drm_filename)
1303 * // you must implement this function
1304 * mimetype = get_mimetype_from_drmfile(drm_filename);
1306 * aul_open_file_with_mimetype(drm_filename,mimetype);
1311 * This API is only available in User Session.
1313 int aul_open_file_with_mimetype(const char *filename, const char *mimetype);
1317 * This API launch application associated with content like "http://www.samsung.com"
1319 * This API is for caller.
1320 * This API launch application based on mime type.
1321 * This API find mime_type associated with content,
1322 * and then find default app associated with found mime_type,
1323 * and then launch the app with content argument.
1324 * @par Typical use case:
1325 * You can launch application to process given content.
1326 * That is, Even if you don't know the specific application's pkgname,
1327 * you can launch the applicaiton processing given content.
1328 * For example, If you want to process URL "http://www.samsung.com",
1329 * you can simply launch browser.
1330 * At that time, you can use this APIs like aul_open_content("http://www.samsung.com");
1332 * @param[in] content content
1333 * @return callee's pid or 0 if success, negative value if fail\n
1334 * (when no found default app, return 0)
1335 * @retval AUL_R_OK - success
1336 * @retval AUL_R_EINVAL - invalid argument(content)
1337 * @retval AUL_R_ECOM - internal AUL IPC error
1338 * @retval AUL_R_ERROR - general error or no found mimetype
1343 * int view_url(char *url)
1345 * aul_open_content(url);
1350 * This API is only available in User Session.
1353 int aul_open_content(const char* content);
1357 * This API get the default application(appid) associated with MIME type
1359 * This API use to get default application associteted with mimetype
1360 * In general, Setting Application need this API.
1361 * @par Typical use case:
1362 * Setting Application show mapping of default application / mimetype
1364 * @param[in] mimetype a mime type
1365 * @param[out] defapp a application appid of the app
1366 * @param[in] len length of defapp
1367 * @return 0 if success, negative value if fail
1368 * @retval AUL_R_OK - success
1369 * @retval AUL_R_EINVAL - invalid argument(mimetype)
1370 * @retval AUL_R_ERROR - general error or no found mimetype
1373 * aul_set_defapp_with_mime
1377 * void get_text_html_defapp()
1379 * char appname[255];
1380 * aul_get_defapp_from_mime("text/html",appname,sizeof(appname));
1385 * This API is only available in User Session.
1388 int aul_get_defapp_from_mime(const char *mimetype, char *defapp, int len);
1392 * This API set the default application(appid) associated with MIME type
1394 * This API use to change default application associteted with mimetype
1395 * In general, Setting Application or Installer need this API.
1396 * @par Typical use case:
1397 * Default Application associated with mimetype can be changed by Setting Application or installer
1398 * So, application to process specific mimetype can be substituted.
1400 * @param[in] mimetype a mime type
1401 * @param[in] defapp a application appid of the app to be set
1402 * @return 0 if success, negative value if fail
1403 * @retval AUL_R_OK - success
1404 * @retval AUL_R_EINVAL - invalid argument(mimetype)
1405 * @retval AUL_R_ERROR - general error
1408 * aul_get_defapp_from_mime
1412 * void set_text_html_defapp()
1414 * aul_set_defapp_with_mime("text/html","org.tizen.browser");
1419 * This API is only available in User Session.
1421 int aul_set_defapp_with_mime(const char *mimetype, const char *defapp);
1425 * This API get the mimetype associated with filename
1427 * This API use to get mimetype associteted with given filename
1428 * In general, This API use when you want to know only mimetype given filename.
1429 * @par Typical use case:
1430 * For example, In trasfering data through bluetooth,
1431 * additional information like mimetype should be added.
1432 * In such situation, You can get mimetype by using this API.
1434 * @param[in] filename file name
1435 * @param[out] mimetype a mime type
1436 * @param[in] len length of mimetype
1437 * @return 0 if success, negative value if fail
1438 * @retval AUL_R_OK - success
1439 * @retval AUL_R_EINVAL - invalid argument(filename)
1440 * @retval AUL_R_ERROR - general error
1445 * void get_mimetype()
1447 * char mimetype[255];
1448 * aul_get_mime_from_file("image.jpg",mimetype,sizeof(mimetype));
1453 * This API is only available in User Session.
1455 int aul_get_mime_from_file(const char *filename, char *mimetype, int len);
1459 * This API get the mimetype associated with given content
1461 * This API use to get mimetype associteted with given content
1462 * In general, This API use when you want to know only mimetype given content
1463 * @par Typical use case:
1464 * For example, In trasfering data through bluetooth,
1465 * additional information like mimetype should be added.
1466 * In such situation, You can get mimetype by using this API.
1468 * @param[in] content content string like "011-0000-0000"
1469 * @param[out] mimetype a mime type
1470 * @param[in] len length of mimetype
1471 * @return 0 if success, negative value if fail
1472 * @retval AUL_R_OK - success
1473 * @retval AUL_R_EINVAL - invalid argument(content)
1474 * @retval AUL_R_ERROR - general error
1479 * void get_mimetype()
1481 * char mimetype[255];
1482 * aul_get_mime_from_content("http://www.samsung.com",mimetype,sizeof(mimetype));
1487 * This API is only available in User Session.
1489 int aul_get_mime_from_content(const char *content, char *mimetype, int len);
1493 * This API get the icon's name associated with given mimetype
1495 * This API use to get icon's name associteted with given mimetype
1496 * @par Typical use case:
1497 * If you want to show mimetype's icon, use this API.
1499 * @param[in] mimetype a mime type
1500 * @param[out] iconname icon's name
1501 * @param[in] len length of iconname
1502 * @return 0 if success, negative value if fail
1503 * @retval AUL_R_OK - success
1504 * @retval AUL_R_EINVAL - invalid argument(content)
1505 * @retval AUL_R_ERROR - general error (no such mime type)
1510 * void get_mime_icon()
1513 * aul_get_mime_icon("text/html",icon,sizeof(icon));
1518 * This API is only available in User Session.
1520 int aul_get_mime_icon(const char *mimetype, char *iconname, int len);
1524 * This API get the extensions associated with given mimetype
1526 * This API use to get extensions associteted with given mimetype
1527 * @par Typical use case:
1528 * In general, user is not familiar with mimetype(text/html),
1529 * user is familiar with extenstions(*.html, *.htm)
1530 * So, To show mimetype information to user, use this API
1532 * @param[in] mimetype a mime type
1533 * @param[out] extlist extentions (ex> mpeg,mpg,mpe)
1534 * @param[in] len length of extlist
1535 * @return 0 if success, negative value if fail
1536 * @retval AUL_R_OK - success
1537 * @retval AUL_R_EINVAL - invalid argument(mimetype)
1538 * @retval AUL_R_ERROR - general error (no mimetype or no extenstion)
1541 * aul_get_mime_description
1545 * void get_extension()
1547 * char extlist[255];
1548 * aul_get_mime_extension("text/html",extlist,sizeof(extlist));
1553 * Some mimetype don't have extension.
1554 * In that case, You can use aul_get_mime_description.
1555 * This API is only available in User Session.
1557 int aul_get_mime_extension(const char *mimetype, char *extlist, int len);
1561 * This API get the description associated with given mimetype
1563 * This API use to get description associteted with given mimetype
1564 * @par Typical use case:
1565 * In general, user is not familiar with mimetype(text/html),
1566 * user is familiar with well-knowing information like extenstions(*.html, *.htm)
1567 * But, some mimetype don't have extenstion.
1568 * At that time,to show mimetype information to user, use this API
1570 * @param[in] mimetype a mime type
1571 * @param[out] desc description (ex> Call client)
1572 * @param[in] len length of desc
1573 * @return 0 if success, negative value if fail
1574 * @retval AUL_R_OK - success
1575 * @retval AUL_R_EINVAL - invalid argument(mimetype)
1576 * @retval AUL_R_ERROR - general error (no mimetype or no descrition)
1579 * aul_get_mime_extension
1583 * void get_information_from_mime()
1586 * if(aul_get_mime_extension("text/html",info,sizeof(info))<0){
1587 * aul_get_mime_description("text/html",info,sizeof(info));
1593 * This API is only available in User Session.
1595 int aul_get_mime_description(const char *mimetype, char *desc, int len);
1599 * This API create service result bundle based on bundle received in reset event.
1601 * This API use to create result bundle to send it to caller.
1602 * @par Typical use case:
1603 * This API is for callee which provide application service.\n
1604 * To send result to caller, You must create result bundle. \n
1605 * Callee(application providing the service) can send result by using this API and aul_send_service_result.
1607 * @param[in] inb bundle received in reset event
1608 * @param[out] outb bundle to use for returning result
1609 * @return 0 if success, negative value(<0) if fail
1610 * @retval AUL_R_OK - success
1611 * @retval AUL_R_EINVAL - inb is not bundle created by aul_open_service
1612 * @retval AUL_R_ERROR - general error
1615 * To create result bundle, You need received original bundle.
1616 * The original bundle can get from app_reset handler.
1620 * aul_send_service_result
1623 * #include <bundle.h>
1625 * int app_reset(bundle *b, void *data)
1627 * ad->recved_bundle = bundle_dup(b);
1632 * bundle* res_bundle;
1633 * aul_create_result_bundle(ad->recved_bundle,&res_bundle);
1634 * bundle_add(res_bundle, "result", "1");
1635 * aul_send_service_result(res_bundle);
1639 * This API is only available in User Session.
1642 int aul_create_result_bundle(bundle *inb, bundle **outb);
1646 * This API send service result to caller with bundle
1648 * This API is used to send result bundle to caller.
1649 * @par Typical use case:
1650 * This API is for callee which provide application service.\n
1651 * To send result to caller, You can use this API after creating result bundle. \n
1652 * Callee(application to provide service) can send result by using this API and aul_create_result_bundle.
1654 * @param[in] b Result data in bundle format
1655 * @return 0 if success, negative value(<0) if fail
1656 * @retval AUL_R_OK - success
1657 * @retval AUL_R_EINVAL - invalid result bundle
1658 * @retval AUL_R_ECOMM - internal AUL IPC error
1659 * @retval AUL_R_ERROR - general error
1662 * To send result bundle, You must create result bundle.
1663 * see aul_create_result_bundle
1667 * aul_create_result_bundle
1670 * #include <bundle.h>
1672 * int app_reset(bundle *b, void *data)
1674 * ad->recved_bundle = bundle_dup(b);
1679 * bundle* res_bundle;
1680 * aul_create_result_bundle(ad->recved_bundle,&res_bundle);
1681 * bundle_add(res_bundle, "result", "1");
1682 * aul_send_service_result(res_bundle);
1686 * This API is only available in User Session.
1689 int aul_send_service_result(bundle *b);
1693 * This API sets callback fuction that will be called when applications die.
1695 * This API's purpose is to listen the application dead event.
1696 * In general, task manager Application need this API.
1698 * @param[in] func callback function
1699 * @param[in] data user data
1700 * @return 0 if success, negative value if fail
1701 * @retval AUL_R_OK - success
1702 * @retval AUL_R_ERROR - general error
1705 * aul_listen_app_launch_signal
1709 * int app_dead_handler(int pid, void *data)
1711 * printf("===> %s : %d\n", __FUNCTION__, pid);
1715 * void dead_listen()
1717 * aul_listen_app_dead_signal(app_dead_handler, NULL);
1722 * This API is only available in User Session.
1725 int aul_listen_app_dead_signal(int (*func) (int, void *), void *data);
1729 * This API sets callback fuction that will be called when applications are launched.
1731 * This API's purpose is to listen the application launching event.
1732 * In general, task manager Application need this API.
1734 * @param[in] func callback function
1735 * @param[in] data user data
1736 * @return 0 if success, negative value if fail
1737 * @retval AUL_R_OK - success
1738 * @retval AUL_R_ERROR - general error
1741 * aul_listen_app_dead_signal
1745 * int app_launch_handler(int pid, void *data)
1747 * printf("===> %s : %d\n", __FUNCTION__, pid);
1751 * void dead_listen()
1753 * aul_listen_app_launch_signal(app_launch_handler, NULL);
1758 * This API is only available in User Session.
1761 int aul_listen_app_launch_signal(int (*func) (int, void *), void *data);
1765 * This API sets callback fuction that will be called when applications are launched.
1767 * This API's purpose is to listen the application launching event.
1768 * In general, task manager Application need this API.
1770 * @param[in] func callback function
1771 * @param[in] data user data
1772 * @return 0 if success, negative value if fail
1773 * @retval AUL_R_OK - success
1774 * @retval AUL_R_ERROR - general error
1777 * aul_listen_app_dead_signal
1781 * int app_launch_handler(int pid, const char *app_id, void *data)
1783 * printf("===> %s : %d, %s\n", __FUNCTION__, pid, app_id);
1787 * void dead_listen()
1789 * aul_listen_app_launch_signal(app_launch_handler, NULL);
1794 * This API is only available in User Session.
1797 int aul_listen_app_launch_signal_v2(int (*func) (int, const char *, void *), void *data);
1801 * This API gets status of specified application process id.
1803 * This API's purpose is to get the application's status.
1805 * @param[in] pid pid of application
1806 * @return 0 or greater if success, nagative value if fail
1807 * @retval STATUS_LAUNCHING
1808 * @retval STATUS_VISIBLE
1810 * @retval STATUS_DYING
1811 * @retval STATUS_NORESTART
1817 * int iterfunc(const aul_app_info *info, void *data)
1820 * status = aul_app_get_status_bypid(info->pid);
1821 * if (status == STATUS_VISIBLE) {
1822 * printf("%s has focus", info->app_id);
1823 * (int *)data = info->pid;
1829 * int find_focus_app_pid()
1832 * aul_app_get_running_app_info(iterfunc, &pid);
1837 * This API is only available in User Session.
1839 int aul_app_get_status_bypid(int pid);
1843 * This API gets status of specified application process id.
1845 * This API's purpose is to get the application's status.
1847 * @param[in] pid pid of application
1848 * @param[in] uid User ID
1849 * @return 0 or greater if success, nagative value if fail
1850 * @retval STATUS_LAUNCHING
1851 * @retval STATUS_VISIBLE
1853 * @retval STATUS_DYING
1854 * @retval STATUS_NORESTART
1857 * This API is only available to System user.
1859 int aul_app_get_status_bypid_for_uid(int pid, uid_t uid);
1863 * This API gets the status of specified application id.
1865 * This API's purpose is to get the status of the application.
1867 * @param[in] appid application ID
1868 * @return 0 or greater if success, nagative value if fail
1869 * @retval STATUS_LAUNCHING
1870 * @retval STATUS_FOCUS
1871 * @retval STATUS_VISIBLE
1873 * @retval STATUS_DYING
1874 * @retval STATUS_NORESTART
1884 * status = aul_app_get_status("org.tizen.helloworld");
1885 * if (status == STATUS_FOCUS)
1886 * printf("org.tizen.helloworld has focus");
1893 * This API is only available in User Session.
1895 int aul_app_get_status(const char *appid);
1899 * This API gets the status of specified application id.
1901 * This API's purpose is to get the status of the application
1903 * @param[in] appid application ID
1904 * @param[in] uid User ID
1905 * @return 0 or greater if success, nagative value if fail
1906 * @retval STATUS_LAUNCHING
1907 * @retval STATUS_FOCUS
1908 * @retval STATUS_VISIBLE
1910 * @retval STATUS_DYING
1911 * @retval STATUS_NORESTART
1914 * This API is only available to System user.
1916 int aul_app_get_status_for_uid(const char *appid, uid_t uid);
1920 * This API sets callback function that on application status changed.
1922 * This API's purpose is to listen the application's status changed within
1923 * the caller process. In general, a library that required to release resource on
1924 * application's status may use this API.
1926 * @param[in] func callback function
1927 * @param[in] data user data
1928 * @return 0 if success, negative value if fail
1929 * @retval AUL_R_OK - success
1930 * @retval AUL_R_ERROR - general error
1932 * aul_remove_status_local_cb
1936 * int status_changed(int status, void *data)
1938 * if (status == STATUS_VISIBLE)
1939 * printf("%d resume\n", getpid());
1941 * if (status == STATUS_BG)
1942 * printf("%d pause\n", getpid());
1945 * void listen_app_status()
1947 * aul_add_status_local_cb(status_changed, NULL);
1951 * This API is only available in User Session.
1954 int aul_add_status_local_cb(int (*func) (int, void *), void *data);
1958 * This API unsets callback function that on application status changed.
1960 * This API's purpose is to remove callback that added by
1961 * aul_add_status_local_cb.
1963 * @param[in] func callback function
1964 * @param[in] data user data
1965 * @return 0 if success, negative value if fail
1966 * @retval AUL_R_OK - success
1967 * @retval AUL_R_ERROR - general error
1970 * aul_add_status_local_cb
1974 * int status_changed(int status, void *data)
1976 * if (status == STATUS_VISIBLE)
1977 * printf("%d resume\n", getpid());
1979 * if (status == STATUS_BG)
1980 * printf("%d pause\n", getpid());
1983 * void listen_app_status()
1985 * aul_add_status_local_cb(status_changed, NULL);
1988 * void ignore_app_status()
1990 * aul_remove_status_local_cb(status_changed, NULL);
1995 * This API is only available in User Session.
1998 int aul_remove_status_local_cb(int (*func) (int, void *), void *data);
2001 * This API is only for appfw internally.
2003 int aul_set_process_group(int parent_pid, int child_pid);
2006 * This API is only for Appfw internally.
2008 int aul_terminate_bgapp_pid(int pid);
2011 * This API is only for Appfw internally.
2013 int aul_terminate_pid_without_restart(int pid);
2016 * This API is only for Appfw internally.
2018 int aul_terminate_pid_sync_without_restart(int pid);
2021 * This API is only for Appfw internally.
2023 int aul_terminate_pid_sync_without_restart_for_uid(int pid, uid_t uid);
2026 * This API is only for Appfw internally.
2028 const char *aul_get_app_external_root_path(void);
2031 * This API is only for Appfw internally.
2033 const char *aul_get_app_root_path(void);
2036 * This API is only for Appfw internally.
2038 const char *aul_get_app_data_path(void);
2041 * This API is only for Appfw internally.
2043 const char *aul_get_app_cache_path(void);
2046 * This API is only for Appfw internally.
2048 const char *aul_get_app_resource_path(void);
2051 * This API is only for Appfw internally.
2053 const char *aul_get_app_tep_resource_path(void);
2056 * This API is only for Appfw internally.
2058 int aul_get_app_shared_data_path(char **path);
2061 * This API is only for Appfw internally.
2063 const char *aul_get_app_shared_resource_path(void);
2066 * This API is only for Appfw internally.
2068 const char *aul_get_app_shared_trusted_path(void);
2071 * This API is only for Appfw internally.
2073 const char *aul_get_app_external_data_path(void);
2076 * This API is only for Appfw internally.
2078 const char *aul_get_app_external_cache_path(void);
2081 * This API is only for Appfw internally.
2083 const char *aul_get_app_external_shared_data_path(void);
2086 * This API is only for Appfw internally.
2088 const char *aul_get_app_specific_path(void);
2091 * This API is only for Appfw internally.
2093 const char *aul_get_app_external_specific_path(void);
2096 * This API is only for Appfw internally.
2098 int aul_get_app_shared_data_path_by_appid(const char *app_id, char **path);
2101 * This API is only for Appfw internally.
2103 int aul_get_app_shared_resource_path_by_appid(const char *app_id, char **path);
2106 * This API is only for Appfw internally.
2108 int aul_get_app_shared_trusted_path_by_appid(const char *app_id, char **path);
2111 * This API is only for Appfw internally.
2113 int aul_get_app_external_shared_data_path_by_appid(const char *app_id, char **path);
2116 * This API is only for Appfw internally.
2118 int aul_get_usr_app_shared_data_path_by_appid(const char *app_id, char **path, uid_t uid);
2121 * This API is only for Appfw internally.
2123 int aul_get_usr_app_shared_resource_path_by_appid(const char *app_id, char **path, uid_t uid);
2126 * This API is only for Appfw internally.
2128 int aul_get_usr_app_shared_trusted_path_by_appid(const char *app_id, char **path, uid_t uid);
2131 * This API is only for Appfw internally.
2133 int aul_get_usr_app_external_shared_data_path_by_appid(const char *app_id, char **path, uid_t uid);
2136 * This type is only for Appfw internally.
2138 typedef int (*subapp_fn)(void *data);
2141 * This API is only for Appfw internally.
2143 int aul_set_subapp(subapp_fn cb, void *data);
2146 * This API is only for Appfw internally.
2148 int aul_subapp_terminate_request_pid(int pid);
2151 * This API is only for Appfw internally.
2153 int aul_is_subapp(void);
2156 * This API is only for Appfw internally.
2158 int aul_kill_pid(int pid);
2161 * This API is only for Appfw internally.
2163 int aul_add_caller_cb(int pid, void (*caller_cb) (int, void *), void *data);
2166 * This API is only for Appfw internally.
2168 int aul_remove_caller_cb(int pid, void *data);
2171 * This API is only for Appfw internally.
2173 int aul_invoke_caller_cb(void *data);
2176 * This API is only for Appfw internally.
2178 void aul_set_preinit_window(void *evas_object);
2181 * This API is only for Appfw internally.
2183 void* aul_get_preinit_window(const char *win_name);
2186 * This API is only for Appfw internally.
2188 void aul_set_preinit_background(void *evas_object);
2191 * This API is only for Appfw internally.
2193 void* aul_get_preinit_background(void);
2196 * This API is only for Appfw internally.
2198 void aul_set_preinit_conformant(void *evas_object);
2201 * This API is only for Appfw internally.
2203 void* aul_get_preinit_conformant(void);
2206 * This API is only for Appfw internally.
2208 void aul_set_preinit_appid(const char *appid);
2211 * This API is only for Appfw internally.
2213 void aul_set_preinit_pkgid(const char *pkgid);
2216 * This API is only for Appfw internally.
2218 void aul_set_preinit_root_path(const char *root_path);
2221 * This API is only for Appfw internally.
2223 const char *aul_get_preinit_root_path(void);
2226 * This API is only for Appfw internally.
2228 int aul_update_freezer_status(int pid, const char* type);
2231 * This API is only for Appfw internally.
2233 int aul_send_app_launch_request_signal(int pid, const char* appid, const char* pkgid, const char* type);
2236 * This API is only for Appfw internally.
2238 int aul_send_app_resume_request_signal(int pid, const char* appid, const char* pkgid, const char *type);
2241 * This API is only for Appfw internally.
2243 int aul_send_app_terminate_request_signal(int pid, const char* appid, const char* pkgid, const char *type);
2246 * This API is only for Appfw internally.
2248 int aul_send_app_status_change_signal(int pid, const char* appid, const char* pkgid, const char* status, const char *type);
2251 * This API is only for Appfw internally.
2253 int aul_send_app_terminated_signal(int pid);
2256 * This API is only for Appfw internally.
2258 int aul_send_app_group_signal(int owner_pid, int child_pid, const char *child_pkgid);
2261 * This API is only for Appfw internally.
2263 int aul_invoke_status_local_cb(int status);
2266 * This type is only for Appfw internally.
2268 typedef int (*data_control_provider_handler_fn) (bundle *b, int request_id, void *data);
2271 * This API is only for Appfw internally.
2273 int aul_set_data_control_provider_cb(data_control_provider_handler_fn handler);
2276 * This API is only for Appfw internally.
2278 int aul_unset_data_control_provider_cb(void);
2281 * This API is only for Appfw internally.
2283 int aul_pause_app(const char *appid);
2286 * This API is only for Appfw internally.
2288 int aul_pause_app_for_uid(const char *appid, uid_t uid);
2291 * This API is only for Appfw internally.
2293 int aul_pause_pid(int pid);
2296 * This API is only for Appfw internally.
2298 int aul_pause_pid_for_uid(int pid, uid_t uid);
2301 * This API is only for Appfw internally.
2303 int aul_reload_appinfo(void);
2306 * This API is only for Appfw internally.
2308 int aul_status_update(int status);
2311 * This API is only for Appfw internally.
2313 int aul_running_list_update(char *appid, char *app_path, char *pid);
2316 * This API is only for Appfw internally.
2318 int aul_app_group_get_window(int pid);
2321 * This API is only for Appfw internally.
2323 int aul_app_group_set_window(int wid);
2326 * This API is only for Appfw internally.
2328 void aul_app_group_get_leader_pids(int *cnt, int **pids);
2331 * This API is only for Appfw internally.
2333 void aul_app_group_get_group_pids(int leader_pid, int *cnt, int **pids);
2336 * This API is only for Appfw internally.
2338 int aul_app_group_get_leader_pid(int pid);
2341 * This API is only for Appfw internally.
2343 int aul_app_group_clear_top(void);
2346 * This API is only for Appfw internally.
2348 int aul_app_group_is_top(void);
2351 * This API is only for Appfw internally.
2353 int aul_app_group_get_fg_flag(int pid);
2356 * This API is only for Appfw internally.
2358 void aul_app_group_lower(int *exit);
2361 * This API is only for Appfw internally.
2363 void aul_app_group_get_idle_pids(int *cnt, int **pids);
2367 * This API puts some app below the caller app
2369 * This API's purpose is to reorder window stack limitedly.
2371 * @param[in] below_appid The appid to be reordered below the caller app
2372 * @return 0 success, negative value(<0) if fail
2375 * below_appid should be main app which have been launched before.
2376 * This API is only available in User Session.
2378 int aul_app_group_activate_below(const char *below_appid);
2382 * This API puts some app above the caller app
2384 * This API's purpose is to reorder window stack limitedly.
2386 * @param[in] above_appid The appid to be reordered above the caller app
2387 * @return 0 if success, negative value(<0) if fail
2390 * above_appid should be main app which have been launched before.
2391 * This API is only available in User Session.
2393 int aul_app_group_activate_above(const char *above_appid);
2396 * This API is only for Appfw internally.
2398 int aul_request_data_control_socket_pair(bundle *b, int *fd);
2400 * This API is only for Appfw internally.
2402 int aul_request_message_port_socket_pair(int *fd);
2404 * This API is only for Appfw internally.
2406 int aul_listen_booting_done_signal(int (*func) (int, void *), void *data);
2409 * This API is only for Appfw internally.
2411 int aul_listen_cooldown_signal(int (*func) (const char *, void *), void *data);
2415 * This API registers a callback function that will be called when the
2416 * status of the application is changed.
2418 * This API is for monitoring the status of all applications.
2420 * @param[in] func callback function
2421 * @param[in] data user data
2422 * @return 0 if success, negative value if fail
2423 * @retval AUL_R_OK - success
2424 * @retval AUL_R_ERROR - general error
2429 * int app_status_handler(int pid, int status, void *data)
2431 * const char *app_status;
2435 * app_status = "STATUS_LAUNCHING";
2438 * app_status = "STATUS_VISIBLE";
2441 * app_status = "STATUS_BACKGROUND";
2444 * app_status = "STATUS_FOCUS";
2447 * app_status = "STATUS_UNKNOWN";
2450 * printf("pid: %d, status: %s", pid, status);
2454 * int main(int argc, char **argv)
2458 * ret = aul_listen_app_status_signal(app_status_handler, NULL);
2459 * if (ret != AUL_R_OK) {
2460 * printf("Failed to add status handler");
2470 int aul_listen_app_status_signal(int (*func)(int, int, void *), void *data);
2473 * This API is only for Appfw internally.
2475 int aul_check_tep_mount(const char *tep_path);
2478 * This API is only for Appfw internally.
2480 int aul_is_tep_mount_dbus_done(const char *tep_string);
2483 * This API is only for Appfw internally.
2485 int aul_forward_app(const char *appid, bundle *kb);
2489 * This API create custom launchpad-loader
2491 * This API's purpose is to make a slot for custom loader.
2492 * Once it is made, added loader will make a candidate process to use.
2494 * @param[in] loader_path The file name of the custom loader binary including full path
2495 * @param[in] extra A bundle to be passed to the custom loader
2496 * @return Loader ID if success, negative value(<0) if fail
2499 * This API is only for Appfw internally.
2500 * This API is only available in User Session.
2502 int aul_add_loader(const char *loader_path, bundle *extra);
2506 * This API create custom launchpad-loader
2508 * This API's purpose is to make a slot for custom loader.
2509 * Once it is made, added loader will make a candidate process to use.
2511 * @param[in] loader_path The file name of the custom loader binary including full path
2512 * @param[in] extra A bundle to be passed to the custom loader
2513 * @param[in] uid User ID
2514 * @return Loader ID if success, negative value(<0) if fail
2517 * This API is only for Appfw internally.
2518 * This API is only available to System user.
2520 int aul_add_loader_for_uid(const char *loader_path, bundle *extra, uid_t uid);
2525 * This API destroy custom launchpad-loader
2527 * This API's purpose is to remove a slot for custom loader.
2528 * Once it is removed, the prepared process will be removed as well.
2530 * @param[in] loader_id Loader ID
2531 * @return 0 if success, negative value(<0) if fail
2534 * This API is only for Appfw internally.
2535 * This API is only available in User Session.
2537 int aul_remove_loader(int loader_id);
2541 * This API destroy custom launchpad-loader
2543 * This API's purpose is to remove a slot for custom loader.
2544 * Once it is removed, the prepared process will be removed as well.
2546 * @param[in] loader_id Loader ID
2547 * @param[in] uid User ID
2548 * @return 0 if success, negative value(<0) if fail
2551 * This API is only for Appfw internally.
2552 * This API is only available to System user.
2554 int aul_remove_loader_for_uid(int loader_id, uid_t uid);
2558 * This API gets specified application process id.
2560 * The purpose of this API is to get the pid of specified application.
2562 * @param[in] appid application name
2563 * @return callee's pid if success, negative value(<0) if fail
2566 * This API is only available in User Session.
2568 int aul_app_get_pid(const char *appid);
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 * @param[in] uid User ID
2578 * @return callee's pid if success, negative value(<0) if fail
2581 * This API is only available to System user.
2583 int aul_app_get_pid_for_uid(const char *appid, uid_t uid);
2587 * This function update rua stat.
2589 * @param[in] b Bundle object contains caller and tag information.
2590 * @param[in] uid Target uid
2592 * @return 0 if success, negative value(<0) if fail
2594 * @remarks This API is only for Appfw internally.
2603 bundle *b = bundle_create();
2604 bundle_add_str(b, AUL_SVC_K_RUA_STAT_CALLER, caller);
2605 bundle_add_str(b, AUL_SVC_K_RUA_STAT_TAG, tag);
2607 r = aul_update_rua_stat_for_uid(b);
2612 int aul_update_rua_stat_for_uid(bundle *b, uid_t uid);
2616 * This function add rua history.
2618 * @param[in] b Bundle object Target Package name or app path.
2619 * @param[in] uid Target uid
2621 * @return 0 if success, negative value(<0) if fail
2623 * @remarks This API is only for Appfw internally.
2632 bundle *b = bundle_create();
2634 bundle_add_str(b, AUL_K_RUA_PKGNAME, pkg_name);
2636 bundle_add_str(b, AUL_K_RUA_APPPATH, app_path);
2638 r = aul_add_rua_history_for_uid(b);
2643 int aul_add_rua_history_for_uid(bundle *b, uid_t uid);
2647 * This function delete rua history.
2649 * @param[in] b Bundle object Target Package name. If NULL or has no value, delete all rua history.
2650 * @param[in] uid Target uid
2652 * @return 0 if success, negative value(<0) if fail
2654 * @remarks This API is only for Appfw internally.
2665 b = bundle_create();
2666 bundle_add_str(b, AUL_K_RUA_PKGNAME, pkg_name);
2668 r = aul_delete_rua_history_for_uid(b, getuid());
2673 int aul_delete_rua_history_for_uid(bundle *b, uid_t uid);
2678 * This function sets the default application(application id) associated with operatioin, uri and mime-type.
2680 * @param[in] b Bundle object Target application id and operation, uri and mime-type.
2682 * @return 0 if success, negative value(<0) if fail
2684 * @remarks This API is only for Appfw internally.
2689 #include <aul_svc.h>
2694 bundle *b = bundle_create();
2696 const char *appid = "org.tizen.test";
2697 const char *operation = "test_operation";
2698 const char *mime_type = "test_mime";
2699 const char *uri = "test_uri";
2701 aul_svc_set_operation(b, operation);
2702 aul_svc_set_mime(b, mime_type);
2703 aul_svc_set_uri(b, uri);
2705 aul_svc_set_appid(b, appid)
2707 r = aul_set_default_app_by_operation(b);
2712 int aul_set_default_app_by_operation(bundle *b);
2716 * This API unset the default application(application id) associated with operation, uri and mime-type.
2718 * @param[in] app_id The ID of the application
2720 * @return 0 if success, negative value(<0) if fail
2733 aul_unset_default_app_by_operation("org.tizen.test");
2738 int aul_unset_default_app_by_operation(const char *app_id);
2742 * This API launches application with the given bundle asynchronously.
2743 * If the application is not running or a multiple-instance one, this API launches with the given bundle.
2744 * If the application is running, this API sends a RESET event to the App.
2745 * While the application is running, if the application cannot receive the RESET event,
2746 * this API returns a general error(AUL_R_ERROR).\n
2748 * This API is for caller.
2749 * This API's purpose is to launch/reset application with given bundle.
2750 * @par Typical use case:
2751 * If you know the target application's pkgname and bundle types,
2752 * you can use this API to launch/reset the application.
2754 * @param[in] pkgname package name to be run as callee
2755 * @param[in] kb bundle to be passed to callee
2756 * @return 0 if success, negative value(<0) if fail
2757 * @retval AUL_R_OK - success
2758 * @retval AUL_R_EINVAL - invaild package name
2759 * @retval AUL_R_ECOM - internal AUL IPC error
2760 * @retval AUL_R_ERROR - general error
2763 * This API is only available in User Session.
2764 * This API doesn't check whether the callee application is executed successfully.
2766 int aul_launch_app_async(const char *appid, bundle *kb);
2770 * This API launches application with the given bundle asynchronously.
2771 * If the application is not running or a multiple-instance one, this API launches with the given bundle.
2772 * If the application is running, this API sends a RESET event to the App.
2773 * While the application is running, if the application cannot receive the RESET event,
2774 * this API returns a general error(AUL_R_ERROR).\n
2776 * This API is for caller.
2777 * This API's purpose is to launch/reset application with given bundle.
2778 * @par Typical use case:
2779 * If you know the target application's pkgname and bundle types,
2780 * you can use this API to launch/reset the application.
2782 * @param[in] pkgname package name to be run as callee
2783 * @param[in] kb bundle to be passed to callee
2784 * @param[in] uid User ID
2785 * @return 0 if success, negative value(<0) if fail
2786 * @retval AUL_R_OK - success
2787 * @retval AUL_R_EINVAL - invaild package name
2788 * @retval AUL_R_ECOM - internal AUL IPC error
2789 * @retval AUL_R_ERROR - general error
2792 * This API is only available to System user.
2793 * This API doesn't check whether the callee application is executed successfully.
2795 int aul_launch_app_async_for_uid(const char *appid, bundle *kb, uid_t uid);
2799 * This API request launchpad to make candidate processes.
2801 * @return 0 if success, negative value(<0) if fail
2804 * This API is only available in User Session.
2806 int aul_prepare_candidate_process(void);
2809 * This API is only for Appfw internally.
2811 int aul_widget_instance_add(const char *widget_id, const char *instance_id);
2814 * This API is only for Appfw internally.
2816 int aul_widget_instance_del(const char *widget_id, const char *instance_id);
2819 * This API is only for Appfw internally.
2821 typedef void (*aul_widget_instance_foreach_cb)(const char *instance_id, void *data);
2824 * This API is only for Appfw internally.
2826 int aul_widget_instance_foreach(const char *widget_id, aul_widget_instance_foreach_cb cb, void *data);
2829 * This API is only for Appfw internally.
2831 int aul_widget_instance_update(const char *widget_id, const char *instance_id, bundle *b);
2834 * This API is only for Appfw internally.
2836 int aul_widget_instance_count(const char *widget_id);
2840 * This API gets the last caller process id of specified application process id.
2842 * This API's purpose is to get the application's last caller process id.
2844 * @param[in] pid pid of application
2845 * @return caller pid if success, nagative value if fail
2848 * This API is only available in User Session.
2850 int aul_app_get_last_caller_pid(int pid);
2854 * This API gets the last caller process id of specified application process id.
2856 * This API's purpose is to get the last caller process id of the application.
2858 * @param[in] pid pid of application
2859 * @param[in] uid User ID
2860 * @return caller pid if success, nagative value if fail
2863 * This API is only available in System users.
2865 int aul_app_get_last_caller_pid_for_uid(int pid, uid_t uid);
2869 * This API trigger to resume application asynchronously.
2870 * If the application is running, this API send a resume event to the App.
2871 * If the application is not running, this API return AUL_R_ERROR.
2872 * Although the application is running, if the application cannot receive resume event,
2873 * AUL try to raise the application's default windows.
2875 * This API is for caller.
2876 * This API's purpose is to send resume event.
2877 * @par Typical use case:
2878 * In multiple application model, If you want to only resume specific application, Use this API
2880 * @param[in] pid application's pid to be resumed
2881 * @return 0 if success, negative value(<0) if fail
2882 * @retval AUL_R_OK - success
2883 * @retval AUL_R_EINVAL - invaild pid
2884 * @retval AUL_R_ECOM - internal AUL IPC error
2885 * @retval AUL_R_ERROR - general error (include application is not running)
2886 * @warning This API need to require root or inhouse permisssion \n
2887 * If you have not the permission, this API return AUL_R_ERROR. \n
2889 * This API is only available to User Session.
2891 int aul_resume_pid_async(int pid);
2895 * This API trigger to resume application asynchronously.
2896 * If the application is running, this API send a resume event to the App.
2897 * If the application is not running, this API return AUL_R_ERROR.
2898 * Although the application is running, if the application cannot receive resume event,
2899 * AUL try to raise the application's default windows.
2901 * This API is for caller.
2902 * This API's purpose is to send resume event.
2903 * @par Typical use case:
2904 * In multiple application model, If you want to only resume specific application, Use this API
2906 * @param[in] pid application's pid to be resumed
2907 * @param[in] uid User ID
2908 * @return 0 if success, negative value(<0) if fail
2909 * @retval AUL_R_OK - success
2910 * @retval AUL_R_EINVAL - invaild pid
2911 * @retval AUL_R_ECOM - internal AUL IPC error
2912 * @retval AUL_R_ERROR - general error (include application is not running)
2913 * @warning This API need to require root or inhouse permisssion \n
2914 * If you have not the permission, this API return AUL_R_ERROR. \n
2916 * This API is only available to System user.
2918 int aul_resume_pid_async_for_uid(int pid, uid_t uid);
2922 * This API set the alias appid.
2923 * The alias appid is only available for the aul_svc_set_appid() API.
2924 * If the appid is not available, this API returns an error.
2926 * @privlevel platform
2927 * @privilege %http://tizen.org/privilege/systemsettings.admin
2928 * @param[in] alias_appid an alias application ID
2929 * @param[in] appid an application ID
2930 * @return 0 if success, negative value(<0) if fail
2933 * This API is only available to User Session.
2935 int aul_set_alias_appid(const char *alias_appid, const char *appid);
2939 * This API unset the alias appid.
2941 * @privlevel platform
2942 * @privilege %http://tizen.org/privilege/systemsettings.admin
2943 * @param[in] alias_appid an alias application ID
2944 * @return 0 if success, negative value(<0) if fail
2947 * This API is only available to User Session.
2949 int aul_unset_alias_appid(const char *alias_appid);
2953 * This API activates the alias information based on the given appid.
2955 * @privlevel platform
2956 * @privilege %http://tizen.org/privilege/systemsettings.admin
2957 * @param[in] appid an application ID
2958 * @return 0 if success, negative value(<0) if fail
2961 * This API is only available to User Session.
2963 int aul_enable_alias_info(const char *appid);
2967 * This API deactivates the alias information based on the given appid.
2969 * @privlebel 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_disable_alias_info(const char *appid);
2980 * This API is only for Appfw internally.
2982 API int aul_listen_app_status(const char *appid,
2983 int (*aul_handler)(const char *appid, const char *pkgid,
2984 int pid, int status, int is_subapp, void *data),
2988 * This API is only for Appfw internally.
2990 int aul_widget_instance_get_content(const char *widget_id, const char *instance_id, char **content);