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_CREATE_ABORTED = 11
97 } aul_widget_instance_event_e;
99 /** AUL public key - To check caller's secuirty */
100 #define AUL_K_CALLER_PID "__AUL_CALLER_PID__"
101 /** AUL public key - To check callee's secuirty */
102 #define AUL_K_CALLEE_PID "__AUL_CALLEE_PID__"
103 /** AUL public key - added for multiuser mode */
104 #define AUL_K_CALLER_UID "__AUL_CALLER_UID__"
105 /** AUL public key - added for multiuser mode */
106 #define AUL_K_CALLEE_UID "__AUL_CALLEE_UID__"
107 /** AUL public key - added for multiuser mode */
108 #define AUL_K_TARGET_UID "__AUL_TARGET_UID__"
109 /** AUL public key - To check caller's secuirty */
110 #define AUL_K_CALLER_APPID "__AUL_CALLER_APPID__"
111 /** AUL public key - To check caller's secuirty */
112 #define AUL_K_CALLEE_APPID "__AUL_CALLEE_APPID__"
113 /** AUL public key - To find argv0 */
114 #define AUL_K_ARGV0 "__AUL_ARGV0__"
115 /** AUL public key - To measure launching time */
116 #define AUL_K_STARTTIME "__AUL_STARTTIME__"
117 /** AUL public key - To support launching based on mime type */
118 #define AUL_K_MIME_TYPE "__AUL_MIME_TYPE__"
119 /** AUL public key - To support launching based on mime type */
120 #define AUL_K_UNALIASED_MIME_TYPE "__AUL_UNALIASED_MIME_TYPE__"
121 /** AUL public key - To support launching based on mime type */
122 #define AUL_K_MIME_CONTENT "__AUL_MIME_CONTENT__"
123 /** AUL public key - To support launching based on service */
124 #define AUL_K_SERVICE_NAME "__AUL_SERVICE_NAME__"
125 /** AUL public key - To force launch app selector instead of lauchingn default app */
126 #define AUL_K_FORCE_LAUNCH_APP_SELECTOR "__AUL_FORCE_LAUNCH_APP_SELECTOR__"
127 /** AUL public key - To support debug argument */
128 #define AUL_K_DEBUG "__AUL_DEBUG__"
129 /** AUL public key - To support SDK */
130 #define AUL_K_SDK "__AUL_SDK__"
131 /** AUL public key - To support Media key */
132 #define AUL_K_MULTI_KEY "__AUL_MULTI_KEY__"
133 /** AUL public key - To support Media key */
134 #define AUL_K_MULTI_KEY_EVENT "__AUL_MULTI_KEY_EVENT__"
135 /** AUL public bundle value */
136 #define AUL_K_PRIVACY_APPID "__AUL_PRIVACY_APPID__"
137 /** AUL public bundle value - To support Media key*/
138 #define AUL_V_KEY_PRESSED "__AUL_KEY_PRESSED__"
139 /** AUL public bundle value - To support Media key*/
140 #define AUL_V_KEY_RELEASED "__AUL_KEY_RELEASED__"
141 /** AUL public key - To support rua stat */
142 #define AUL_SVC_K_RUA_STAT_CALLER "__K_RUA_STAT_CALLER__"
143 #define AUL_SVC_K_RUA_STAT_TAG "__K_RUA_STAT_TAG__"
144 /** AUL public key - To support rua delete */
145 #define AUL_K_RUA_PKGNAME "__K_RUA_PKGNAME"
146 /** AUL public key - To support rua delete */
147 #define AUL_K_RUA_APPPATH "__K_RUA_APPPATH"
148 /** AUL public key - To support rua add */
149 #define AUL_K_RUA_ARG "__K_RUA_ARG"
150 /** AUL public key - To support rua add */
151 #define AUL_K_RUA_TIME "__K_RUA_TIME"
152 /** AUL public bundle value */
153 #define AUL_K_RUA_INSTANCE_ID "__K_RUA_INSTANCE_ID"
154 /** AUL public bundle value */
155 #define AUL_K_RUA_INSTANCE_NAME "__K_RUA_INSTANCE_NAME"
156 /** AUL public bundle value */
157 #define AUL_K_RUA_ICON "__K_RUA_ICON"
158 /** AUL public bundle value */
159 #define AUL_K_RUA_URI "__K_RUA_URI"
161 /** AUL internal private key */
162 #define AUL_K_PKG_NAME "__AUL_PKG_NAME__"
163 /** AUL internal private key */
164 #define AUL_K_WAIT_RESULT "__AUL_WAIT_RESULT__"
165 /** AUL internal private key */
166 #define AUL_K_SEND_RESULT "__AUL_SEND_RESULT__"
167 /** AUL internal private key */
168 #define AUL_K_TASK_MANAGE "__AUL_TASK_MANAGE__"
169 /** AUL internal private key */
170 #define AUL_K_APP_TYPE "__AUL_APP_TYPE__"
171 /** AUL internal private key - To check original caller's identity */
172 #define AUL_K_ORG_CALLER_PID "__AUL_ORG_CALLER_PID__"
173 /** AUL internal private key - To check forwarded callee app's pid */
174 #define AUL_K_FWD_CALLEE_PID "__AUL_FWD_CALLEE_PID__"
175 /** AUL internal private key */
176 #define AUL_K_NO_CANCEL "__AUL_NO_CANCEL__"
177 /** AUL internal private key */
178 #define AUL_K_EXEC "__AUL_EXEC__"
179 /** AUL internal private key */
180 #define AUL_K_MULTIPLE "__AUL_MULTIPLE__"
181 /** AUL internal private key */
182 #define AUL_K_PACKAGETYPE "__AUL_PACKAGETYPE__"
183 /** AUL internal private key */
184 #define AUL_K_HWACC "__AUL_HWACC__"
185 /** AUL internal private key */
186 #define AUL_K_APPID "__AUL_APPID__"
187 /** AUL internal private key */
188 #define AUL_K_PID "__AUL_PID__"
189 /** AUL internal private key */
190 #define AUL_K_WID "__AUL_WID__"
191 /** AUL internal private key */
192 #define AUL_K_LEADER_PID "__AUL_LEADER_PID__"
193 /** AUL internal private key - To support data control */
194 #define AUL_K_DATA_CONTROL_TYPE "__AUL_DATA_CONTROL_TYPE__"
195 /** AUL internal private key */
196 #define AUL_K_PKGID "__AUL_PKGID_"
197 /** AUL internal private key */
198 #define AUL_K_INTERNAL_POOL "__AUL_INTERNAL_POOL__"
199 /** AUL internal private key */
200 #define AUL_TEP_PATH "_AUL_TEP_PATH_"
201 /** AUL internal private key */
202 #define AUL_K_COMP_TYPE "__AUL_COMP_TYPE__"
203 /** AUL internal private key */
204 #define AUL_K_LOADER_ID "__AUL_LOADER_ID__"
205 /** AUL internal private key */
206 #define AUL_K_LOADER_PATH "__AUL_LOADER_PATH__"
207 /** AUL internal private key */
208 #define AUL_K_LOADER_EXTRA "__AUL_LOADER_EXTRA__"
209 /** AUL internal private key */
210 #define AUL_K_LOADER_NAME "__AUL_LOADER_NAME__"
211 /** AUL internal private key */
212 #define AUL_K_WAYLAND_DISPLAY "__AUL_WAYLAND_DISPLAY__"
213 /** AUL internal private key */
214 #define AUL_K_WAYLAND_WORKING_DIR "__AUL_WAYLAND_WORKING_DIR__"
215 /** AUL internal private key */
216 #define AUL_K_COM_SENDER_PID "__AUL_COM_SENDER_PID__"
217 /** AUL internal private key */
218 #define AUL_K_COM_ENDPOINT "__AUL_COM_ENDPOINT__"
219 /** AUL internal private key */
220 #define AUL_K_COM_PRIVILEGE "__AUL_COM_PRIVILEGE__"
221 /** AUL internal private key */
222 #define AUL_K_COM_PROPAGATE "__AUL_COM_PROPAGATE__"
223 /** AUL internal private key */
224 #define AUL_K_COM_FILTER "__AUL_COM_FILTER__"
225 /** AUL internal private key */
226 #define AUL_K_COM_RESULT "__AUL_COM_RESULT__"
227 /** AUL internal private key */
228 #define AUL_K_ROOT_PATH "__AUL_ROOT_PATH__"
229 /** AUL internal private key */
230 #define AUL_K_SEQ_NUM "__AUL_SEQ_NUM__"
231 /** AUL internal private key */
232 #define AUL_K_API_VERSION "__AUL_API_VERSION__"
233 /** AUL internal private key */
234 #define AUL_K_ALLOWED_BG "__AUL_ALLOWED_BG__"
235 /** AUL internal private key */
236 #define AUL_K_OWNER_PID "__AUL_OWNER_PID__"
237 /** AUL internal private key */
238 #define AUL_K_CHILD_PID "__AUL_CHILD_PID__"
239 /** AUL internal private key */
240 #define AUL_K_WIDGET_VIEWER "__AUL_WIDGET_VIEWER__"
241 /** AUL internal private key */
242 #define AUL_K_WIDGET_ID "__AUL_WIDGET_ID__"
243 /** AUL internal private key */
244 #define AUL_K_WIDGET_INSTANCE_ID "__AUL_WIDGET_INSTANCE_ID__"
245 /** AUL internal private key */
246 #define AUL_K_WIDGET_STATUS "__AUL_WIDGET_STATUS__"
247 /** AUL internal private key */
248 #define AUL_K_WIDGET_CONTENT_INFO "__AUL_WIDGET_CONTENT_INFO__"
249 /** AUL internal private key */
250 #define AUL_K_TARGET_PID "__AUL_TARGET_PID__"
251 /** AUL internal private key */
252 #define AUL_K_ALIAS_APPID "__AUL_ALIAS_APPID__"
253 /** AUL internal private key */
254 #define AUL_K_ORG_APPID "__AUL_ORG_APPID__"
255 /** AUL internal private key */
256 #define AUL_K_STATUS "__AUL_STATUS__"
257 /** AUL internal private key */
258 #define AUL_K_IS_SUBAPP "__AUL_IS_SUBAPP__"
259 /** AUL internal private key */
260 #define AUL_K_INSTANCE_ID "__AUL_INSTANCE_ID__"
261 /** AUL internal private key */
262 #define AUL_K_ORG_CALLER_UID "__AUL_ORG_CALLER_UID__"
263 /** AUL internal private key */
264 #define AUL_K_CHECKSUM "__AUL_CHECKSUM__"
265 /** AUL internal private key */
266 #define AUL_K_PRIVATE "__AUL_PRIVATE__"
267 /** AUL internal private key */
268 #define AUL_K_SCREEN_TYPE "__AUL_SCREEN_TYPE__"
269 /** AUL internal private key */
270 #define AUL_K_VIEWER_REF "__AUL_VIEWER_REF__"
271 /** AUL internal private key */
272 #define AUL_K_PARENT_APPID "__AUL_PARENT_APPID__"
273 /** AUL internal private key */
274 #define AUL_K_CHILD_APPID "__AUL_CHILD_APPID__"
278 * @brief This is callback function for aul_launch_init
279 * @param[in] type event's type received from system
280 * @param[in] b In case of RESET events, bundle which is received from peer
281 * @param[in] data user-supplied data
283 typedef int (*aul_handler_fn)(aul_type type, bundle *b, void *data);
287 * This API install your AUL handler and setup AUL internal connection.
289 * AUL receive START(RESET), RESUME, TERMINATE events from system.\n
290 * This API use to handle the events. \n
291 * @par Typical use case:
292 * In general, you need not use this API.
293 * If you use AppCore, you should NOT use this API.
294 * AppCore will set default aul_handler.
296 * @param[in] handler aul main callback handler function
297 * @param[in] data user-supplied data for start_handler
298 * @return 0 if success, negative value(<0) if fail\n
299 * @retval AUL_R_OK - success
300 * @retval AUL_R_ECANCELD - aul handler was installed already by others
301 * @retval AUL_R_ECOMM - error to create internal ipc
302 * @retval AUL_R_ERROR - error to attach glib main loop
304 * @warning If you use AppCore, you should NOT use this API.\n
305 * You need glib main loop.\n
307 * you must have aul handler to use this API.
308 * aul_luanch_init register aul handler.
311 * #include <bundle.h>
313 * static int aul_handler(aul_type type, bundle *kb,void *data)
318 * // process RESET event
321 * // process RESUME event
323 * case AUL_TERMINATE:
324 * // preocess TERMINATE event
330 * static GMainLoop *mainloop = NULL;
332 * int main(int argc, char **argv)
334 * aul_launch_init(aul_handler,NULL);
335 * aul_launch_argv_handler(argc, argv);
337 * mainloop = g_main_loop_new(NULL, FALSE);
338 * g_main_loop_run(mainloop);
343 * This API is only available in User Session.
345 int aul_launch_init(aul_handler_fn handler, void *data);
349 * This API create internal RESET events with given argc, argv \n
351 * This API's purpose is to generate reset event.
352 * If you want to generate local RESET events with argument vector format, use this API
353 * @par Typical use case:
354 * In general, you need not use this API.
355 * AppCore use this API to create internal reset event.
357 * @param[in] argc # of args
358 * @param[in] argv list of arg strings
359 * @return 0 if success, negative value(<0) if fail
360 * @retval AUL_R_OK - success
361 * @retval AUL_R_ENOINIT - aul handler was NOT yet installed
362 * @retval AUL_R_ECANCLED - error to create internal bundle with given argc,argv.
363 * @retval AUL_R_ERROR - general error
366 * you must have aul handler to use this API.
367 * aul_luanch_init register aul handler.
372 * #include <bundle.h>
374 * int send_local_reset_event()
378 * argv[0] = "local.app";
379 * argv[1] = "event_type";
380 * argv[2] = "my_reset";
382 * aul_launch_argv_handler(argc,argv);
387 * If you use AppCore, you NEED NOT use this API.
388 * This API is only available in User Session.
390 int aul_launch_argv_handler(int argc, char **argv);
394 * This API creates internal RESET events with given bundle \n
396 * This API's purpose is to generate reset event.
397 * If you want to generate local RESET events with argument vector format, first use
398 * bundle_import_from_argv to create a bundle from the argument vector and then use this API
399 * Eventually, this API will replace aul_launch_argv_handler().
400 * @par Typical use case:
401 * In general, you need not use this API.
402 * AppCore use this API to create internal reset event.
404 * @param[in] b bundle
405 * @return 0 if success, negative value(<0) if fail
406 * @retval AUL_R_OK - success
407 * @retval AUL_R_ENOINIT - aul handler was NOT yet installed
408 * @retval AUL_R_ERROR - general error
411 * you must have aul handler to use this API.
412 * aul_luanch_init register aul handler.
416 * aul_launch_init, bundle_import_from_argv
419 * #include <bundle.h>
421 * int send_local_reset_event()
426 * argv[0] = "local.app";
427 * argv[1] = "event_type";
428 * argv[2] = "my_reset";
431 * b = bundle_import_from_argv(argc,argv);
432 * aul_launch_local(b);
437 * If you use AppCore, you NEED NOT to use this API.
438 * This API is only available in User Session.
440 int aul_launch_local(bundle *b);
444 * This API launches application with the given bundle.
445 * If the application is not running or a multiple-instance one, this API launches with the given bundle.
446 * If the application is running, this API sends a RESET event to the App.
447 * While the application is running, if the application cannot receive the RESET event,
448 * this API returns a general error(AUL_R_ERROR).\n
450 * This API is for caller.
451 * This API's purpose is to launch/reset application with given bundle.
452 * @par Typical use case:
453 * If you know the target application's pkgname and bundle types,
454 * you can use this API to launch/reset the application.
456 * @param[in] pkgname package name to be run as callee
457 * @param[in] kb bundle to be passed to callee
458 * @return callee's pid if success, negative value(<0) if fail
459 * @retval AUL_R_OK - success
460 * @retval AUL_R_EINVAL - invaild package name
461 * @retval AUL_R_ECOM - internal AUL IPC error
462 * @retval AUL_R_ERROR - general error
468 * #include <bundle.h>
470 * int launch_inhouse_contact_app()
473 * b = bundle_create();
474 * bundle_add(b,"type","SIM");
475 * aul_launch_app("org.tizen.contact",b);
480 * This API is only available in User Session.
482 int aul_launch_app(const char *appid, bundle *kb);
486 * This API launches application with the given bundle.
487 * If the application is not running or a multiple-instance one, this API launches with the given bundle.
488 * If the application is running, this API sends a RESET event to the App.
489 * While the application is running, if the application cannot receive the RESET event,
490 * this API returns a general error(AUL_R_ERROR).\n
492 * This API is for caller.
493 * This API's purpose is to launch/reset application with given bundle.
494 * @par Typical use case:
495 * If you know the target application's pkgname and bundle types,
496 * you can use this API to launch/reset the application.
498 * @param[in] pkgname package name to be run as callee
499 * @param[in] kb bundle to be passed to callee
500 * @param[in] uid User ID to launch
501 * @return callee's pid if success, negative value(<0) if fail
502 * @retval AUL_R_OK - success
503 * @retval AUL_R_EINVAL - invaild package name
504 * @retval AUL_R_ECOM - internal AUL IPC error
505 * @retval AUL_R_ERROR - general error
510 * This API is also available in System Session.
512 int aul_launch_app_for_uid(const char *appid, bundle *kb, uid_t uid);
516 * This API launches application, as menu screen launches the app.
517 * Thus, if the applocation is running, this API sends a RESUME event to the app.
518 * If the application is not running, this API launches the app.
519 * While the application is running, if the application cannot receive the RESUME event,
520 * AUL tries to raise the application's default window.
523 * This API is for caller.
524 * This API's purpose is to resume/launch application
525 * @par Typical use case:
526 * If you only want to show application with previous state or default state, Use this API.
528 * @param[in] pkgname package name to be resume as callee
529 * @return callee's pid if success, negative value(<0) if fail
530 * @retval AUL_R_OK - success
531 * @retval AUL_R_EINVAL - invaild package name
532 * @retval AUL_R_ECOM - internal AUL IPC error
533 * @retval AUL_R_ERROR - general error
536 * aul_launch_app, aul_app_is_running, aul_resume_pid
539 * #include <bundle.h>
541 * int open_inhouse_contact_app()
543 * if(aul_app_is_running("org.tizen.contact"))
544 * aul_open_app("org.tizen.contact");
549 * If you don't want to launch the app,
550 * you should check app's running state with aul_app_is_running.
551 * This API will launch the application if the application is not running.
552 * This API is only available in User Session.
554 int aul_open_app(const char *appid);
558 * This API launches application, as menu screen launches the app.
559 * Thus, if the applocation is running, this API sends a RESUME event to the app.
560 * If the application is not running, this API launches the app.
561 * While the application is running, if the application cannot receive the RESUME event,
562 * AUL tries to raise the application's default window.
565 * This API is for caller.
566 * This API's purpose is to resume/launch application
567 * @par Typical use case:
568 * If you only want to show application with previous state or default state, Use this API.
570 * @param[in] pkgname package name to be resume as callee
571 * @param[in] uid User ID
572 * @return callee's pid if success, negative value(<0) if fail
573 * @retval AUL_R_OK - success
574 * @retval AUL_R_EINVAL - invaild package name
575 * @retval AUL_R_ECOM - internal AUL IPC error
576 * @retval AUL_R_ERROR - general error
579 * If you don't want to launch the app,
580 * you should check app's running state with aul_app_is_running.
581 * This API will launch the application if the application is not running.
582 * This API is only available to System user.
584 int aul_open_app_for_uid(const char *appid, uid_t uid);
588 * This API trigger to resume application
589 * If the application is running, this API send a resume event to the App.
590 * If the application is not running, this API returns fail.
591 * Although the application is running, if the application cannot receive resume event,
592 * AUL try to raise the application's default windows.
594 * This API is for caller.
595 * This API's purpose is to send resume event.
596 * @par Typical use case:
597 * If you only want to show application with previous state or default state, Use this API.
599 * @param[in] pkgname package name to be resume as callee
600 * @return callee's pid if success, negative value(<0) if fail
601 * @retval AUL_R_OK - success
602 * @retval AUL_R_EINVAL - invaild package name
603 * @retval AUL_R_ECOM - internal AUL IPC error
604 * @retval AUL_R_ERROR - general error
607 * aul_launch_app, aul_app_is_running, aul_resume_pid
609 * This function will be deprecated. Use aul_open_add() instead.
612 * #include <bundle.h>
614 * int resume_inhouse_contact_app()
616 * if(aul_app_is_running("org.tizen.contact"))
617 * aul_resume_app("org.tizen.contact");
622 * If you don't want to launch the app,
623 * you should check app's running state with aul_app_is_running.
624 * This API will launch the application if the application is not running.
625 * If you want to only resume without launching in multiple instance application model,
626 * you should use aul_resume_pid.
627 * This API is only available in User Session.
629 int aul_resume_app(const char *appid);
633 * This API trigger to resume application
634 * If the application is running, this API send a resume event to the App.
635 * If the application is not running, this API returns fail.
636 * Although the application is running, if the application cannot receive resume event,
637 * AUL try to raise the application's default windows.
639 * This API is for caller.
640 * This API's purpose is to send resume event.
641 * @par Typical use case:
642 * If you only want to show application with previous state or default state, Use this API.
644 * @param[in] pkgname package name to be resume as callee
645 * @param[in] uid User ID
646 * @return callee's pid if success, negative value(<0) if fail
647 * @retval AUL_R_OK - success
648 * @retval AUL_R_EINVAL - invaild package name
649 * @retval AUL_R_ECOM - internal AUL IPC error
650 * @retval AUL_R_ERROR - general error
653 * If you don't want to launch the app,
654 * you should check app's running state with aul_app_is_running.
655 * This API will launch the application if the application is not running.
656 * If you want to only resume without launching in multiple instance application model,
657 * you should use aul_resume_pid.
658 * This API is only available to System user.
660 int aul_resume_app_for_uid(const char *appid, uid_t uid);
664 * This API trigger to resume application
665 * If the application is running, this API send a resume event to the App.
666 * If the application is not running, this API return AUL_R_ERROR.
667 * Although the application is running, if the application cannot receive resume event,
668 * AUL try to raise the application's default windows.
670 * This API is for caller.
671 * This API's purpose is to send resume event.
672 * @par Typical use case:
673 * In multiple application model, If you want to only resume specific application, Use this API
675 * @param[in] pid application's pid to be resumed
676 * @return 0 if success, negative value(<0) if fail
677 * @retval AUL_R_OK - success
678 * @retval AUL_R_EINVAL - invaild pid
679 * @retval AUL_R_ECOM - internal AUL IPC error
680 * @retval AUL_R_ERROR - general error (include application is not running)
681 * @warning This API need to require root or inhouse permisssion \n
682 * If you have not the permission, this API return AUL_R_ERROR. \n
687 * #include <bundle.h>
689 * int iterfunc(const aul_app_info *info, void *data)
691 * if(strcmp(info->pkg_name,"org.tizen.contact")==0)
692 * aul_resume_pid(info->pid);
695 * int iterate_running_apps()
697 * return aul_app_get_running_app_info(iterfunc,NULL);
702 * This API is only available in User Session.
704 int aul_resume_pid(int pid);
708 * This API trigger to resume application
709 * If the application is running, this API send a resume event to the App.
710 * If the application is not running, this API return AUL_R_ERROR.
711 * Although the application is running, if the application cannot receive resume event,
712 * AUL try to raise the application's default windows.
714 * This API is for caller.
715 * This API's purpose is to send resume event.
716 * @par Typical use case:
717 * In multiple application model, If you want to only resume specific application, Use this API
719 * @param[in] pid application's pid to be resumed
720 * @param[in] uid User ID
721 * @return 0 if success, negative value(<0) if fail
722 * @retval AUL_R_OK - success
723 * @retval AUL_R_EINVAL - invaild pid
724 * @retval AUL_R_ECOM - internal AUL IPC error
725 * @retval AUL_R_ERROR - general error (include application is not running)
726 * @warning This API need to require root or inhouse permisssion \n
727 * If you have not the permission, this API return AUL_R_ERROR. \n
729 * This API is only available to System user.
731 int aul_resume_pid_for_uid(int pid, uid_t uid);
735 * This API trigger to terminate application
737 * If the application is running, this API send a terminate event to the App. \n
738 * If the app cannot receive the event, AUL kill forcely the application.\n
740 * This API's purpose is to kill application
741 * @par Typical use case:
742 * In general, Application like Task Manager use this API.
744 * This API need to require root or inhouse permisssion. \n
746 * @param[in] pid application's pid to be terminated
747 * @return 0 if success, negative value(<0) if fail
748 * @retval AUL_R_OK - success
749 * @retval AUL_R_EINVAL - invaild pid
750 * @retval AUL_R_ECOM - internal AUL IPC error
751 * @retval AUL_R_ERROR - general error
752 * @warning This API need to require root or inhouse permisssion. \n
756 * #include <bundle.h>
758 * int iterfunc(const aul_app_info *info, void *data)
760 * if(strcmp(info->pkg_name,"org.tizen.contact")==0)
761 * aul_terminate_pid(info->pid);
764 * int iterate_running_apps()
766 * return aul_app_get_running_app_info(iterfunc,NULL);
771 * If you have not the permission, this API return AUL_R_ERROR. \n
772 * This API is only available in User Session.
774 int aul_terminate_pid(int pid);
778 * This API trigger to terminate application
780 * If the application is running, this API send a terminate event to the App. \n
781 * If the app cannot receive the event, AUL kill forcely the application.\n
783 * This API's purpose is to kill application
784 * @par Typical use case:
785 * In general, Application like Task Manager use this API.
787 * This API need to require root or inhouse permisssion. \n
789 * @param[in] pid application's pid to be terminated
790 * @param[in] uid User ID
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
799 * If you have not the permission, this API return AUL_R_ERROR. \n
800 * This API is only available to System user.
802 int aul_terminate_pid_for_uid(int pid, uid_t uid);
806 * This API trigger to terminate application asynchronously
808 * If the application is running, this API send a terminate event to the App. \n
809 * If the app cannot receive the event, AUL kill forcely the application.\n
811 * This API's purpose is to kill application
812 * @par Typical use case:
813 * In general, Application like Task Manager use this API.
815 * This API need to require root or inhouse permisssion. \n
817 * @param[in] pid application's pid to be terminated
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 in User Session.
828 int aul_terminate_pid_async(int pid);
832 * This API trigger to terminate application asynchronously
834 * If the application is running, this API send a terminate event to the App. \n
835 * If the app cannot receive the event, AUL kill forcely the application.\n
837 * This API's purpose is to kill application
838 * @par Typical use case:
839 * In general, Application like Task Manager use this API.
841 * This API need to require root or inhouse permisssion. \n
843 * @param[in] pid application's pid to be terminated
844 * @param[in] uid User ID
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 inhouse permisssion. \n
852 * If you have not the permission, this API return AUL_R_ERROR. \n
853 * This API is only available to System user.
855 int aul_terminate_pid_async_for_uid(int pid, uid_t uid);
859 * This API trigger to terminate application synchronously
861 * If the application is running, this API sends 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 * @return 0 if success, negative value(<0) if fail
873 * @retval AUL_R_OK - success
874 * @retval AUL_R_EINVAL - invaild pid
875 * @retval AUL_R_ECOM - internal AUL IPC error
876 * @retval AUL_R_ERROR - general error
877 * @warning This API need to require root or platform level permisssion. \n
879 * If you have not the permission, this API return AUL_R_ERROR. \n
880 * This API is only available in User Session.
882 int aul_terminate_pid_sync(int pid);
886 * This API trigger to terminate application synchronously
888 * If the application is running, this API send a terminate event to the application. \n
889 * And then, this API waits until the application is terminated successfully. \n
890 * If the app cannot receive the event, AUL kill forcely the application. \n
892 * This API's purpose is to kill application
893 * @par Typical use case:
894 * In general, Application like Task Manager use this API.
896 * This API need to require root or platform level permisssion. \n
898 * @param[in] pid application's pid to be terminated
899 * @param[in] uid User ID
900 * @return 0 if success, negative value(<0) if fail
901 * @retval AUL_R_OK - success
902 * @retval AUL_R_EINVAL - invaild pid
903 * @retval AUL_R_ECOM - internal AUL IPC error
904 * @retval AUL_R_ERROR - general error
905 * @warning This API need to require root or platform level permisssion. \n
907 * If you have not the permission, this API return AUL_R_ERROR. \n
908 * This API is only available to System user.
910 int aul_terminate_pid_sync_for_uid(int pid, uid_t uid);
913 *@brief Running application's information structure retrieved by AUL
915 typedef struct _aul_app_info {
916 int pid; /**< app's pid if running*/
917 char *pkg_name; /**< application id */
918 char *app_path; /**< application excutable path */
920 char *pkgid; /**< package id */
921 int status; /**< app's status */
922 int is_sub_app; /**< state whether sub app of app group */
927 * @brief iterator function running with aul_app_get_running_app_info
928 * @param[out] ainfo aul_app_info retreived by aul_app_get_running_app_info
929 * @param[out] data user-supplied data
931 typedef int (*aul_app_info_iter_fn)(const aul_app_info *ainfo, void *data);
935 * This API ask a application is running by application package name.
937 * To know whether some application is running or not, use this API
938 * @par Typical use case:
939 * For example, If you want to know browser application running,
940 * you can check it by using this API.
942 * @param[in] pkgname application package name
943 * @return true / false
944 * @retval 1 app_name is running now.
945 * @retval 0 app_name is NOT running now.
950 * int is_running_browser_app()
952 * return aul_app_is_running("org.tizen.browser");
957 * This API is only available in User Session.
960 int aul_app_is_running(const char *appid);
964 * This API ask a application is running by application package name.
966 * To know whether some application is running or not, use this API
967 * @par Typical use case:
968 * For example, If you want to know browser application running,
969 * you can check it by using this API.
971 * @param[in] pkgname application package name
972 * @param[in] uid User ID
973 * @return true / false
974 * @retval 1 app_name is running now.
975 * @retval 0 app_name is NOT running now.
979 * This API is only available to System User.
981 int aul_app_is_running_for_uid(const char *appid, uid_t uid);
985 * This API use to get running application list.
986 * This API call iter_fn with each aul_app_info of running apps when running application is found.
988 * If you want to get running application list, use this API
989 * @par Typical use case:
990 * In general, this API is used by task manager appllication. (running application list viewer)
992 * @param[in] iter_fn iterator function
993 * @param[in] user_data user-supplied data for iter_fn
994 * @return 0 if success, negative value(<0) if fail
995 * @retval AUL_R_OK - success
996 * @retval AUL_R_ERROR - internal error
1001 * int iterfunc(const aul_app_info* info, void* data)
1003 * printf("\t==========================\n");
1004 * printf("\t pkg_name: %s\n", info->appid);
1005 * printf("\t app_path: %s\n", info->app_path);
1006 * printf("\t running pid: %d\n", info->pid);
1007 * printf("\t==========================\n");
1011 * int iterate_running_apps()
1013 * return aul_app_get_running_app_info(iterfunc,NULL);
1018 * This API should use if you want to know running application which has desktop files.
1019 * If you want to get all process list, you must iterate process information by using proc filesystem
1020 * Or, If you want to get all window list, you must iterate XWindows by using XWindow APIs
1021 * This API is only available in User Session.
1023 int aul_app_get_running_app_info(aul_app_info_iter_fn iter_fn, void *user_data);
1027 * This API use to get running application list.
1028 * This API call iter_fn with each aul_app_info of running apps when running application is found.
1030 * If you want to get running application list, use this API
1031 * @par Typical use case:
1032 * In general, this API is used by task manager appllication. (running application list viewer)
1034 * @param[in] iter_fn iterator function
1035 * @param[in] user_data user-supplied data for iter_fn
1036 * @param[in] uid User ID
1037 * @return 0 if success, negative value(<0) if fail
1038 * @retval AUL_R_OK - success
1039 * @retval AUL_R_ERROR - internal error
1042 * This API should use if you want to know running application which has desktop files.
1043 * If you want to get all process list, you must iterate process information by using proc filesystem
1044 * Or, If you want to get all window list, you must iterate XWindows by using XWindow APIs
1045 * This API is only available to System user.
1047 int aul_app_get_running_app_info_for_uid(aul_app_info_iter_fn iter_fn, void *user_data, uid_t uid);
1051 * This API use to get all running application list, including sub app.
1052 * This API call iter_fn with each aul_app_info of running apps when running application is found.
1054 * If you want to get all running application list, use this API
1055 * @par Typical use case:
1056 * In general, this API is used by task manager application. (running application list viewer)
1058 * @param[in] iter_fn iterator function
1059 * @param[in] user_data user-supplied data for iter_fn
1060 * @return 0 if success, negative value(<0) if fail
1061 * @retval AUL_R_OK - success
1062 * @retval AUL_R_ERROR - internal error
1067 * int iterfunc_status(const aul_app_info *info, void *data)
1069 * printf("\t==========================\n");
1070 * printf("\t pid: %d\n", info->pid);
1071 * printf("\t appid: %s\n", info->appid);
1072 * printf("\t app_path: %s\n", info->app_path);
1073 * printf("\t pkgid: %s\n", info->pkgid);
1074 * printf("\t status: %d\n", info->status);
1075 * printf("\t is_sub_app : %d\n", info->is_sub_app);
1076 * printf("\t==========================\n");
1080 * int iterate_running_apps()
1082 * return aul_app_get_all_running_app_info(iterfunc_status,NULL);
1087 * This API should use if you want to know running application which has desktop files.
1088 * If you want to get all process list, you must iterate process information by using proc filesystem
1089 * Or, If you want to get all window list, you must iterate XWindows by using XWindow APIs
1090 * This API is only available in User Session.
1092 int aul_app_get_all_running_app_info(aul_app_info_iter_fn iter_fn, void *user_data);
1096 * This API use to get all running application list, including sub app.
1097 * This API call iter_fn with each aul_app_info of running apps when running application is found.
1099 * If you want to get all running application list, use this API
1100 * @par Typical use case:
1101 * In general, this API is used by task manager application. (running application list viewer)
1103 * @param[in] iter_fn iterator function
1104 * @param[in] user_data user-supplied data for iter_fn
1105 * @param[in] uid User ID
1106 * @return 0 if success, negative value(<0) if fail
1107 * @retval AUL_R_OK - success
1108 * @retval AUL_R_ERROR - internal error
1111 * This API should use if you want to know running application which has desktop files.
1112 * If you want to get all process list, you must iterate process information by using proc filesystem
1113 * Or, If you want to get all window list, you must iterate XWindows by using XWindow APIs
1114 * This API is only available to System user.
1116 int aul_app_get_all_running_app_info_for_uid(aul_app_info_iter_fn iter_fn, void *user_data, uid_t uid);
1120 * This API get application package name by pid
1122 * If you want to get package name of running application, use this API
1123 * @par Typical use case:
1124 * In general, You can use this API when you want to know caller's information.
1126 * @param[in] pid given pid
1127 * @param[out] pkgname pkgname to be get
1128 * @param[in] len length of pkgname
1129 * @return 0 if success, negative value(<0) if fail
1130 * @retval AUL_R_OK - success
1131 * @retval AUL_R_ERROR - no such a package name
1134 * #include <bundle.h>
1136 * static int app_reset(bundle *b, void *data)
1139 * char appname[255];
1141 * pid = atoi(bundle_get_val(b,AUL_K_CALLER_PID));
1142 * aul_app_get_pkgname_bypid(pid, appname, sizeof(appname));
1147 * This API is only available in User Session.
1149 int aul_app_get_pkgname_bypid(int pid, char *pkgname, int len);
1153 * This API get application pkgid by pid
1155 * If you want to get pkgid of running application, use this API
1156 * @par Typical use case:
1157 * In general, You can use this API when you want to know caller's information.
1159 * @param[in] pid given pid
1160 * @param[out] pkgid package id
1161 * @param[in] len length of pkgid
1162 * @return 0 if success, negative value(<0) if fail
1163 * @retval AUL_R_OK - success
1164 * @retval AUL_R_ERROR - no such a appid
1168 * #include <bundle.h>
1170 * static int app_reset(bundle *b, void *data)
1175 * pid = atoi(bundle_get_val(b, AUL_K_CALLER_PID));
1176 * aul_app_get_pkgid_bypid(pid, pkgid, sizeof(pkgid));
1181 * This API is only available in User Session.
1183 int aul_app_get_pkgid_bypid(int pid, char *pkgid, int len);
1187 * This API get application pkgid by pid
1189 * If you want to get pkgid of running application, use this API
1190 * @par Typical use case:
1191 * In general, You can use this API when you want to know caller's information.
1193 * @param[in] pid given pid
1194 * @param[out] pkgid package id
1195 * @param[in] len length of pkgid
1196 * @param[in] uid User ID
1197 * @return 0 if success, negative value(<0) if fail
1198 * @retval AUL_R_OK - success
1199 * @retval AUL_R_ERROR - no such a appid
1202 * This API is also available to System user.
1204 int aul_app_get_pkgid_bypid_for_uid(int pid, char *pkgid, int len, uid_t uid);
1208 * This API get application appid by pid
1210 * If you want to get appid of running application, use this API
1211 * @par Typical use case:
1212 * In general, You can use this API when you want to know caller's information.
1214 * @param[in] pid given pid
1215 * @param[out] appid application id
1216 * @param[in] len length of pkgname
1217 * @return 0 if success, negative value(<0) if fail
1218 * @retval AUL_R_OK - success
1219 * @retval AUL_R_ERROR - no such a appid
1222 * #include <bundle.h>
1224 * static int app_reset(bundle *b, void *data)
1229 * pid = atoi(bundle_get_val(b,AUL_K_CALLER_PID));
1230 * aul_app_get_appid_bypid(pid, appid, sizeof(appid));
1235 * This API is only available in User Session.
1237 int aul_app_get_appid_bypid(int pid, char *appid, int len);
1241 * This API get application appid by pid
1243 * If you want to get appid of running application, use this API
1244 * @par Typical use case:
1245 * In general, You can use this API when you want to know caller's information.
1247 * @param[in] pid given pid
1248 * @param[out] appid application id
1249 * @param[in] len length of pkgname
1250 * @param[in] uid User ID
1251 * @return 0 if success, negative value(<0) if fail
1252 * @retval AUL_R_OK - success
1253 * @retval AUL_R_ERROR - no such a appid
1255 * This API is also available to System user.
1257 int aul_app_get_appid_bypid_for_uid(int pid, char *appid, int len, uid_t uid);
1261 * This API launch application associated with given filename
1263 * This API is for caller.
1264 * This API launch application based on mime type.
1265 * This API find mime_type associated with file name,
1266 * and then find default app associated with found mime_type
1267 * and then launch the app with filename argument.
1268 * @par Typical use case:
1269 * You can launch application to process given filename.
1270 * That is, Even if you don't know the specific application's pkgname,
1271 * you can launch the applicaiton processing given filename .
1272 * For example, If you want to process image file, you can simply launch image viewer.
1273 * At that time, you can use this APIs like aul_open_file("myimage.jpg");
1275 * @param[in] filename filename
1276 * @return callee's pid or 0 if success, negative value if fail\n
1277 * (when no found default app, return 0)
1278 * @retval AUL_R_OK - success
1279 * @retval AUL_R_EINVAL - invalid argument(filename)
1280 * @retval AUL_R_ECOM - internal AUL IPC error
1281 * @retval AUL_R_ERROR - general error
1286 * int view_image_file(char *filename)
1288 * aul_open_file(filename);
1293 * This API is only available in User Session.
1296 int aul_open_file(const char* filename);
1300 * This API launch application associated with given specific mimetype
1302 * This API is for caller.
1303 * This API launch application based on mime type like aul_open_file API.
1304 * But, This API don't find mime_type associated with file name.
1305 * This API use mimetype given by user. By using given mimetype, find default application.
1306 * and then launch the app with filename argument.
1307 * @par Typical use case:
1308 * Some files cannot extract exact mimetype automatically.
1309 * For example, To know mime type of files with DRM lock, first we should unlock DRM file.
1310 * In this case, You can use this API.
1311 * First, unlock DRM file, and extract mimetype from unlock file by using aul_get_mime_from_file,
1312 * and then, use this API with DRM file and extracted mime type.
1314 * @param[in] filename filename
1315 * @param[in] mimetype specific mimetype
1316 * @return callee's pid or 0 if success, negative value if fail\n
1317 * (when no found default app, return 0)
1318 * @retval AUL_R_OK - success
1319 * @retval AUL_R_EINVAL - invalid argument(filename,mimetype)
1320 * @retval AUL_R_ECOM - internal AUL IPC error
1321 * @retval AUL_R_ERROR - general error
1324 * aul_open_file, aul_get_mime_from_file
1328 * int view_drm_image_file(char *drm_filename)
1331 * // you must implement this function
1332 * mimetype = get_mimetype_from_drmfile(drm_filename);
1334 * aul_open_file_with_mimetype(drm_filename,mimetype);
1339 * This API is only available in User Session.
1341 int aul_open_file_with_mimetype(const char *filename, const char *mimetype);
1345 * This API launch application associated with content like "http://www.samsung.com"
1347 * This API is for caller.
1348 * This API launch application based on mime type.
1349 * This API find mime_type associated with content,
1350 * and then find default app associated with found mime_type,
1351 * and then launch the app with content argument.
1352 * @par Typical use case:
1353 * You can launch application to process given content.
1354 * That is, Even if you don't know the specific application's pkgname,
1355 * you can launch the applicaiton processing given content.
1356 * For example, If you want to process URL "http://www.samsung.com",
1357 * you can simply launch browser.
1358 * At that time, you can use this APIs like aul_open_content("http://www.samsung.com");
1360 * @param[in] content content
1361 * @return callee's pid or 0 if success, negative value if fail\n
1362 * (when no found default app, return 0)
1363 * @retval AUL_R_OK - success
1364 * @retval AUL_R_EINVAL - invalid argument(content)
1365 * @retval AUL_R_ECOM - internal AUL IPC error
1366 * @retval AUL_R_ERROR - general error or no found mimetype
1371 * int view_url(char *url)
1373 * aul_open_content(url);
1378 * This API is only available in User Session.
1381 int aul_open_content(const char* content);
1385 * This API get the default application(appid) associated with MIME type
1387 * This API use to get default application associteted with mimetype
1388 * In general, Setting Application need this API.
1389 * @par Typical use case:
1390 * Setting Application show mapping of default application / mimetype
1392 * @param[in] mimetype a mime type
1393 * @param[out] defapp a application appid of the app
1394 * @param[in] len length of defapp
1395 * @return 0 if success, negative value if fail
1396 * @retval AUL_R_OK - success
1397 * @retval AUL_R_EINVAL - invalid argument(mimetype)
1398 * @retval AUL_R_ERROR - general error or no found mimetype
1401 * aul_set_defapp_with_mime
1405 * void get_text_html_defapp()
1407 * char appname[255];
1408 * aul_get_defapp_from_mime("text/html",appname,sizeof(appname));
1413 * This API is only available in User Session.
1416 int aul_get_defapp_from_mime(const char *mimetype, char *defapp, int len);
1420 * This API set the default application(appid) associated with MIME type
1422 * This API use to change default application associteted with mimetype
1423 * In general, Setting Application or Installer need this API.
1424 * @par Typical use case:
1425 * Default Application associated with mimetype can be changed by Setting Application or installer
1426 * So, application to process specific mimetype can be substituted.
1428 * @param[in] mimetype a mime type
1429 * @param[in] defapp a application appid of the app to be set
1430 * @return 0 if success, negative value if fail
1431 * @retval AUL_R_OK - success
1432 * @retval AUL_R_EINVAL - invalid argument(mimetype)
1433 * @retval AUL_R_ERROR - general error
1436 * aul_get_defapp_from_mime
1440 * void set_text_html_defapp()
1442 * aul_set_defapp_with_mime("text/html","org.tizen.browser");
1447 * This API is only available in User Session.
1449 int aul_set_defapp_with_mime(const char *mimetype, const char *defapp);
1453 * This API get the mimetype associated with filename
1455 * This API use to get mimetype associteted with given filename
1456 * In general, This API use when you want to know only mimetype given filename.
1457 * @par Typical use case:
1458 * For example, In trasfering data through bluetooth,
1459 * additional information like mimetype should be added.
1460 * In such situation, You can get mimetype by using this API.
1462 * @param[in] filename file name
1463 * @param[out] mimetype a mime type
1464 * @param[in] len length of mimetype
1465 * @return 0 if success, negative value if fail
1466 * @retval AUL_R_OK - success
1467 * @retval AUL_R_EINVAL - invalid argument(filename)
1468 * @retval AUL_R_ERROR - general error
1473 * void get_mimetype()
1475 * char mimetype[255];
1476 * aul_get_mime_from_file("image.jpg",mimetype,sizeof(mimetype));
1481 * This API is only available in User Session.
1483 int aul_get_mime_from_file(const char *filename, char *mimetype, int len);
1487 * This API get the mimetype associated with given content
1489 * This API use to get mimetype associteted with given content
1490 * In general, This API use when you want to know only mimetype given content
1491 * @par Typical use case:
1492 * For example, In trasfering data through bluetooth,
1493 * additional information like mimetype should be added.
1494 * In such situation, You can get mimetype by using this API.
1496 * @param[in] content content string like "011-0000-0000"
1497 * @param[out] mimetype a mime type
1498 * @param[in] len length of mimetype
1499 * @return 0 if success, negative value if fail
1500 * @retval AUL_R_OK - success
1501 * @retval AUL_R_EINVAL - invalid argument(content)
1502 * @retval AUL_R_ERROR - general error
1507 * void get_mimetype()
1509 * char mimetype[255];
1510 * aul_get_mime_from_content("http://www.samsung.com",mimetype,sizeof(mimetype));
1515 * This API is only available in User Session.
1517 int aul_get_mime_from_content(const char *content, char *mimetype, int len);
1521 * This API get the icon's name associated with given mimetype
1523 * This API use to get icon's name associteted with given mimetype
1524 * @par Typical use case:
1525 * If you want to show mimetype's icon, use this API.
1527 * @param[in] mimetype a mime type
1528 * @param[out] iconname icon's name
1529 * @param[in] len length of iconname
1530 * @return 0 if success, negative value if fail
1531 * @retval AUL_R_OK - success
1532 * @retval AUL_R_EINVAL - invalid argument(content)
1533 * @retval AUL_R_ERROR - general error (no such mime type)
1538 * void get_mime_icon()
1541 * aul_get_mime_icon("text/html",icon,sizeof(icon));
1546 * This API is only available in User Session.
1548 int aul_get_mime_icon(const char *mimetype, char *iconname, int len);
1552 * This API get the extensions associated with given mimetype
1554 * This API use to get extensions associteted with given mimetype
1555 * @par Typical use case:
1556 * In general, user is not familiar with mimetype(text/html),
1557 * user is familiar with extenstions(*.html, *.htm)
1558 * So, To show mimetype information to user, use this API
1560 * @param[in] mimetype a mime type
1561 * @param[out] extlist extentions (ex> mpeg,mpg,mpe)
1562 * @param[in] len length of extlist
1563 * @return 0 if success, negative value if fail
1564 * @retval AUL_R_OK - success
1565 * @retval AUL_R_EINVAL - invalid argument(mimetype)
1566 * @retval AUL_R_ERROR - general error (no mimetype or no extenstion)
1569 * aul_get_mime_description
1573 * void get_extension()
1575 * char extlist[255];
1576 * aul_get_mime_extension("text/html",extlist,sizeof(extlist));
1581 * Some mimetype don't have extension.
1582 * In that case, You can use aul_get_mime_description.
1583 * This API is only available in User Session.
1585 int aul_get_mime_extension(const char *mimetype, char *extlist, int len);
1589 * This API get the description associated with given mimetype
1591 * This API use to get description associteted with given mimetype
1592 * @par Typical use case:
1593 * In general, user is not familiar with mimetype(text/html),
1594 * user is familiar with well-knowing information like extenstions(*.html, *.htm)
1595 * But, some mimetype don't have extenstion.
1596 * At that time,to show mimetype information to user, use this API
1598 * @param[in] mimetype a mime type
1599 * @param[out] desc description (ex> Call client)
1600 * @param[in] len length of desc
1601 * @return 0 if success, negative value if fail
1602 * @retval AUL_R_OK - success
1603 * @retval AUL_R_EINVAL - invalid argument(mimetype)
1604 * @retval AUL_R_ERROR - general error (no mimetype or no descrition)
1607 * aul_get_mime_extension
1611 * void get_information_from_mime()
1614 * if(aul_get_mime_extension("text/html",info,sizeof(info))<0){
1615 * aul_get_mime_description("text/html",info,sizeof(info));
1621 * This API is only available in User Session.
1623 int aul_get_mime_description(const char *mimetype, char *desc, int len);
1627 * This API create service result bundle based on bundle received in reset event.
1629 * This API use to create result bundle to send it to caller.
1630 * @par Typical use case:
1631 * This API is for callee which provide application service.\n
1632 * To send result to caller, You must create result bundle. \n
1633 * Callee(application providing the service) can send result by using this API and aul_send_service_result.
1635 * @param[in] inb bundle received in reset event
1636 * @param[out] outb bundle to use for returning result
1637 * @return 0 if success, negative value(<0) if fail
1638 * @retval AUL_R_OK - success
1639 * @retval AUL_R_EINVAL - inb is not bundle created by aul_open_service
1640 * @retval AUL_R_ERROR - general error
1643 * To create result bundle, You need received original bundle.
1644 * The original bundle can get from app_reset handler.
1648 * aul_send_service_result
1651 * #include <bundle.h>
1653 * int app_reset(bundle *b, void *data)
1655 * ad->recved_bundle = bundle_dup(b);
1660 * bundle* res_bundle;
1661 * aul_create_result_bundle(ad->recved_bundle,&res_bundle);
1662 * bundle_add(res_bundle, "result", "1");
1663 * aul_send_service_result(res_bundle);
1667 * This API is only available in User Session.
1670 int aul_create_result_bundle(bundle *inb, bundle **outb);
1674 * This API send service result to caller with bundle
1676 * This API is used to send result bundle to caller.
1677 * @par Typical use case:
1678 * This API is for callee which provide application service.\n
1679 * To send result to caller, You can use this API after creating result bundle. \n
1680 * Callee(application to provide service) can send result by using this API and aul_create_result_bundle.
1682 * @param[in] b Result data in bundle format
1683 * @return 0 if success, negative value(<0) if fail
1684 * @retval AUL_R_OK - success
1685 * @retval AUL_R_EINVAL - invalid result bundle
1686 * @retval AUL_R_ECOMM - internal AUL IPC error
1687 * @retval AUL_R_ERROR - general error
1690 * To send result bundle, You must create result bundle.
1691 * see aul_create_result_bundle
1695 * aul_create_result_bundle
1698 * #include <bundle.h>
1700 * int app_reset(bundle *b, void *data)
1702 * ad->recved_bundle = bundle_dup(b);
1707 * bundle* res_bundle;
1708 * aul_create_result_bundle(ad->recved_bundle,&res_bundle);
1709 * bundle_add(res_bundle, "result", "1");
1710 * aul_send_service_result(res_bundle);
1714 * This API is only available in User Session.
1717 int aul_send_service_result(bundle *b);
1721 * This API sets callback fuction that will be called when applications die.
1723 * This API's purpose is to listen the application dead event.
1724 * In general, task manager Application need this API.
1726 * @param[in] func callback function
1727 * @param[in] data user data
1728 * @return 0 if success, negative value if fail
1729 * @retval AUL_R_OK - success
1730 * @retval AUL_R_ERROR - general error
1733 * aul_listen_app_launch_signal
1737 * int app_dead_handler(int pid, void *data)
1739 * printf("===> %s : %d\n", __FUNCTION__, pid);
1743 * void dead_listen()
1745 * aul_listen_app_dead_signal(app_dead_handler, NULL);
1750 * This API is only available in User Session.
1753 int aul_listen_app_dead_signal(int (*func) (int, void *), void *data);
1757 * This API sets callback fuction that will be called when applications are launched.
1759 * This API's purpose is to listen the application launching event.
1760 * In general, task manager Application need this API.
1762 * @param[in] func callback function
1763 * @param[in] data user data
1764 * @return 0 if success, negative value if fail
1765 * @retval AUL_R_OK - success
1766 * @retval AUL_R_ERROR - general error
1769 * aul_listen_app_dead_signal
1773 * int app_launch_handler(int pid, void *data)
1775 * printf("===> %s : %d\n", __FUNCTION__, pid);
1779 * void dead_listen()
1781 * aul_listen_app_launch_signal(app_launch_handler, NULL);
1786 * This API is only available in User Session.
1789 int aul_listen_app_launch_signal(int (*func) (int, void *), void *data);
1793 * This API sets callback fuction that will be called when applications are launched.
1795 * This API's purpose is to listen the application launching event.
1796 * In general, task manager Application need this API.
1798 * @param[in] func callback function
1799 * @param[in] data user data
1800 * @return 0 if success, negative value if fail
1801 * @retval AUL_R_OK - success
1802 * @retval AUL_R_ERROR - general error
1805 * aul_listen_app_dead_signal
1809 * int app_launch_handler(int pid, const char *app_id, void *data)
1811 * printf("===> %s : %d, %s\n", __FUNCTION__, pid, app_id);
1815 * void dead_listen()
1817 * aul_listen_app_launch_signal(app_launch_handler, NULL);
1822 * This API is only available in User Session.
1825 int aul_listen_app_launch_signal_v2(int (*func) (int, const char *, void *), void *data);
1829 * This API gets status of specified application process id.
1831 * This API's purpose is to get the application's status.
1833 * @param[in] pid pid of application
1834 * @return 0 or greater if success, nagative value if fail
1835 * @retval STATUS_LAUNCHING
1836 * @retval STATUS_VISIBLE
1838 * @retval STATUS_DYING
1839 * @retval STATUS_NORESTART
1845 * int iterfunc(const aul_app_info *info, void *data)
1848 * status = aul_app_get_status_bypid(info->pid);
1849 * if (status == STATUS_VISIBLE) {
1850 * printf("%s has focus", info->app_id);
1851 * (int *)data = info->pid;
1857 * int find_focus_app_pid()
1860 * aul_app_get_running_app_info(iterfunc, &pid);
1865 * This API is only available in User Session.
1867 int aul_app_get_status_bypid(int pid);
1871 * This API gets status of specified application process id.
1873 * This API's purpose is to get the application's status.
1875 * @param[in] pid pid of application
1876 * @param[in] uid User ID
1877 * @return 0 or greater if success, nagative value if fail
1878 * @retval STATUS_LAUNCHING
1879 * @retval STATUS_VISIBLE
1881 * @retval STATUS_DYING
1882 * @retval STATUS_NORESTART
1885 * This API is only available to System user.
1887 int aul_app_get_status_bypid_for_uid(int pid, uid_t uid);
1891 * This API gets the status of specified application id.
1893 * This API's purpose is to get the status of the application.
1895 * @param[in] appid application ID
1896 * @return 0 or greater if success, nagative value if fail
1897 * @retval STATUS_LAUNCHING
1898 * @retval STATUS_FOCUS
1899 * @retval STATUS_VISIBLE
1901 * @retval STATUS_DYING
1902 * @retval STATUS_NORESTART
1912 * status = aul_app_get_status("org.tizen.helloworld");
1913 * if (status == STATUS_FOCUS)
1914 * printf("org.tizen.helloworld has focus");
1921 * This API is only available in User Session.
1923 int aul_app_get_status(const char *appid);
1927 * This API gets the status of specified application id.
1929 * This API's purpose is to get the status of the application
1931 * @param[in] appid application ID
1932 * @param[in] uid User ID
1933 * @return 0 or greater if success, nagative value if fail
1934 * @retval STATUS_LAUNCHING
1935 * @retval STATUS_FOCUS
1936 * @retval STATUS_VISIBLE
1938 * @retval STATUS_DYING
1939 * @retval STATUS_NORESTART
1942 * This API is only available to System user.
1944 int aul_app_get_status_for_uid(const char *appid, uid_t uid);
1948 * This API sets callback function that on application status changed.
1950 * This API's purpose is to listen the application's status changed within
1951 * the caller process. In general, a library that required to release resource on
1952 * application's status may use this API.
1954 * @param[in] func callback function
1955 * @param[in] data user data
1956 * @return 0 if success, negative value if fail
1957 * @retval AUL_R_OK - success
1958 * @retval AUL_R_ERROR - general error
1960 * aul_remove_status_local_cb
1964 * int status_changed(int status, void *data)
1966 * if (status == STATUS_VISIBLE)
1967 * printf("%d resume\n", getpid());
1969 * if (status == STATUS_BG)
1970 * printf("%d pause\n", getpid());
1973 * void listen_app_status()
1975 * aul_add_status_local_cb(status_changed, NULL);
1979 * This API is only available in User Session.
1982 int aul_add_status_local_cb(int (*func) (int, void *), void *data);
1986 * This API unsets callback function that on application status changed.
1988 * This API's purpose is to remove callback that added by
1989 * aul_add_status_local_cb.
1991 * @param[in] func callback function
1992 * @param[in] data user data
1993 * @return 0 if success, negative value if fail
1994 * @retval AUL_R_OK - success
1995 * @retval AUL_R_ERROR - general error
1998 * aul_add_status_local_cb
2002 * int status_changed(int status, void *data)
2004 * if (status == STATUS_VISIBLE)
2005 * printf("%d resume\n", getpid());
2007 * if (status == STATUS_BG)
2008 * printf("%d pause\n", getpid());
2011 * void listen_app_status()
2013 * aul_add_status_local_cb(status_changed, NULL);
2016 * void ignore_app_status()
2018 * aul_remove_status_local_cb(status_changed, NULL);
2023 * This API is only available in User Session.
2026 int aul_remove_status_local_cb(int (*func) (int, void *), void *data);
2029 * This API is only for appfw internally.
2031 int aul_set_process_group(int parent_pid, int child_pid);
2034 * This API is only for Appfw internally.
2036 int aul_terminate_bgapp_pid(int pid);
2039 * This API is only for Appfw internally.
2041 int aul_terminate_pid_without_restart(int pid);
2044 * This API is only for Appfw internally.
2046 int aul_terminate_pid_sync_without_restart(int pid);
2049 * This API is only for Appfw internally.
2051 int aul_terminate_pid_sync_without_restart_for_uid(int pid, uid_t uid);
2054 * This API is only for Appfw internally.
2056 const char *aul_get_app_external_root_path(void);
2059 * This API is only for Appfw internally.
2061 const char *aul_get_app_root_path(void);
2064 * This API is only for Appfw internally.
2066 const char *aul_get_app_data_path(void);
2069 * This API is only for Appfw internally.
2071 const char *aul_get_app_cache_path(void);
2074 * This API is only for Appfw internally.
2076 const char *aul_get_app_resource_path(void);
2079 * This API is only for Appfw internally.
2081 const char *aul_get_app_tep_resource_path(void);
2084 * This API is only for Appfw internally.
2086 int aul_get_app_shared_data_path(char **path);
2089 * This API is only for Appfw internally.
2091 const char *aul_get_app_shared_resource_path(void);
2094 * This API is only for Appfw internally.
2096 const char *aul_get_app_shared_trusted_path(void);
2099 * This API is only for Appfw internally.
2101 const char *aul_get_app_external_data_path(void);
2104 * This API is only for Appfw internally.
2106 const char *aul_get_app_external_cache_path(void);
2109 * This API is only for Appfw internally.
2111 const char *aul_get_app_external_shared_data_path(void);
2114 * This API is only for Appfw internally.
2116 const char *aul_get_app_specific_path(void);
2119 * This API is only for Appfw internally.
2121 int aul_get_app_shared_data_path_by_appid(const char *app_id, char **path);
2124 * This API is only for Appfw internally.
2126 int aul_get_app_shared_resource_path_by_appid(const char *app_id, char **path);
2129 * This API is only for Appfw internally.
2131 int aul_get_app_shared_trusted_path_by_appid(const char *app_id, char **path);
2134 * This API is only for Appfw internally.
2136 int aul_get_app_external_shared_data_path_by_appid(const char *app_id, char **path);
2139 * This API is only for Appfw internally.
2141 int aul_get_usr_app_shared_data_path_by_appid(const char *app_id, char **path, uid_t uid);
2144 * This API is only for Appfw internally.
2146 int aul_get_usr_app_shared_resource_path_by_appid(const char *app_id, char **path, uid_t uid);
2149 * This API is only for Appfw internally.
2151 int aul_get_usr_app_shared_trusted_path_by_appid(const char *app_id, char **path, uid_t uid);
2154 * This API is only for Appfw internally.
2156 int aul_get_usr_app_external_shared_data_path_by_appid(const char *app_id, char **path, uid_t uid);
2159 * This type is only for Appfw internally.
2161 typedef int (*subapp_fn)(void *data);
2164 * This API is only for Appfw internally.
2166 int aul_set_subapp(subapp_fn cb, void *data);
2169 * This API is only for Appfw internally.
2171 int aul_subapp_terminate_request_pid(int pid);
2174 * This API is only for Appfw internally.
2176 int aul_is_subapp(void);
2179 * This API is only for Appfw internally.
2181 int aul_kill_pid(int pid);
2184 * This API is only for Appfw internally.
2186 int aul_add_caller_cb(int pid, void (*caller_cb) (int, void *), void *data);
2189 * This API is only for Appfw internally.
2191 int aul_remove_caller_cb(int pid, void *data);
2194 * This API is only for Appfw internally.
2196 int aul_invoke_caller_cb(void *data);
2199 * This API is only for Appfw internally.
2201 void aul_set_preinit_window(void *evas_object);
2204 * This API is only for Appfw internally.
2206 void* aul_get_preinit_window(const char *win_name);
2209 * This API is only for Appfw internally.
2211 void aul_set_preinit_background(void *evas_object);
2214 * This API is only for Appfw internally.
2216 void* aul_get_preinit_background(void);
2219 * This API is only for Appfw internally.
2221 void aul_set_preinit_conformant(void *evas_object);
2224 * This API is only for Appfw internally.
2226 void* aul_get_preinit_conformant(void);
2229 * This API is only for Appfw internally.
2231 void aul_set_preinit_appid(const char *appid);
2234 * This API is only for Appfw internally.
2236 void aul_set_preinit_pkgid(const char *pkgid);
2239 * This API is only for Appfw internally.
2241 void aul_set_preinit_root_path(const char *root_path);
2244 * This API is only for Appfw internally.
2246 const char *aul_get_preinit_root_path(void);
2249 * This API is only for Appfw internally.
2251 int aul_update_freezer_status(int pid, const char* type);
2254 * This API is only for Appfw internally.
2256 int aul_send_app_launch_request_signal(int pid, const char* appid, const char* pkgid, const char* type);
2259 * This API is only for Appfw internally.
2261 int aul_send_app_resume_request_signal(int pid, const char* appid, const char* pkgid, const char *type);
2264 * This API is only for Appfw internally.
2266 int aul_send_app_terminate_request_signal(int pid, const char* appid, const char* pkgid, const char *type);
2269 * This API is only for Appfw internally.
2271 int aul_send_app_status_change_signal(int pid, const char* appid, const char* pkgid, const char* status, const char *type);
2274 * This API is only for Appfw internally.
2276 int aul_send_app_terminated_signal(int pid);
2279 * This API is only for Appfw internally.
2281 int aul_send_app_group_signal(int owner_pid, int child_pid, const char *child_pkgid);
2284 * This API is only for Appfw internally.
2286 int aul_invoke_status_local_cb(int status);
2289 * This type is only for Appfw internally.
2291 typedef int (*data_control_provider_handler_fn) (bundle *b, int request_id, void *data);
2294 * This API is only for Appfw internally.
2296 int aul_set_data_control_provider_cb(data_control_provider_handler_fn handler);
2299 * This API is only for Appfw internally.
2301 int aul_unset_data_control_provider_cb(void);
2304 * This API is only for Appfw internally.
2306 int aul_pause_app(const char *appid);
2309 * This API is only for Appfw internally.
2311 int aul_pause_app_for_uid(const char *appid, uid_t uid);
2314 * This API is only for Appfw internally.
2316 int aul_pause_pid(int pid);
2319 * This API is only for Appfw internally.
2321 int aul_pause_pid_for_uid(int pid, uid_t uid);
2324 * This API is only for Appfw internally.
2326 int aul_reload_appinfo(void);
2329 * This API is only for Appfw internally.
2331 int aul_status_update(int status);
2334 * This API is only for Appfw internally.
2336 int aul_running_list_update(char *appid, char *app_path, char *pid);
2339 * This API is only for Appfw internally.
2341 int aul_app_group_get_window(int pid);
2344 * This API is only for Appfw internally.
2346 int aul_app_group_set_window(int wid);
2349 * This API is only for Appfw internally.
2351 void aul_app_group_get_leader_pids(int *cnt, int **pids);
2354 * This API is only for Appfw internally.
2356 void aul_app_group_get_group_pids(int leader_pid, int *cnt, int **pids);
2359 * This API is only for Appfw internally.
2361 int aul_app_group_get_leader_pid(int pid);
2364 * This API is only for Appfw internally.
2366 int aul_app_group_clear_top(void);
2369 * This API is only for Appfw internally.
2371 int aul_app_group_is_top(void);
2374 * This API is only for Appfw internally.
2376 int aul_app_group_get_fg_flag(int pid);
2379 * This API is only for Appfw internally.
2381 void aul_app_group_lower(int *exit);
2384 * This API is only for Appfw internally.
2386 void aul_app_group_get_idle_pids(int *cnt, int **pids);
2390 * This API puts some app below the caller app
2392 * This API's purpose is to reorder window stack limitedly.
2394 * @param[in] below_appid The appid to be reordered below the caller app
2395 * @return 0 success, negative value(<0) if fail
2398 * below_appid should be main app which have been launched before.
2399 * This API is only available in User Session.
2401 int aul_app_group_activate_below(const char *below_appid);
2405 * This API puts some app above the caller app
2407 * This API's purpose is to reorder window stack limitedly.
2409 * @param[in] above_appid The appid to be reordered above the caller app
2410 * @return 0 if success, negative value(<0) if fail
2413 * above_appid should be main app which have been launched before.
2414 * This API is only available in User Session.
2416 int aul_app_group_activate_above(const char *above_appid);
2419 * This API is only for Appfw internally.
2421 int aul_request_data_control_socket_pair(bundle *b, int *fd);
2423 * This API is only for Appfw internally.
2425 int aul_request_message_port_socket_pair(int *fd);
2427 * This API is only for Appfw internally.
2429 int aul_listen_booting_done_signal(int (*func) (int, void *), void *data);
2432 * This API is only for Appfw internally.
2434 int aul_listen_cooldown_signal(int (*func) (const char *, void *), void *data);
2438 * This API registers a callback function that will be called when the
2439 * status of the application is changed.
2441 * This API is for monitoring the status of all applications.
2443 * @param[in] func callback function
2444 * @param[in] data user data
2445 * @return 0 if success, negative value if fail
2446 * @retval AUL_R_OK - success
2447 * @retval AUL_R_ERROR - general error
2452 * int app_status_handler(int pid, int status, void *data)
2454 * const char *app_status;
2458 * app_status = "STATUS_LAUNCHING";
2461 * app_status = "STATUS_VISIBLE";
2464 * app_status = "STATUS_BACKGROUND";
2467 * app_status = "STATUS_FOCUS";
2470 * app_status = "STATUS_UNKNOWN";
2473 * printf("pid: %d, status: %s", pid, status);
2477 * int main(int argc, char **argv)
2481 * ret = aul_listen_app_status_signal(app_status_handler, NULL);
2482 * if (ret != AUL_R_OK) {
2483 * printf("Failed to add status handler");
2493 int aul_listen_app_status_signal(int (*func)(int, int, void *), void *data);
2496 * This API is only for Appfw internally.
2498 int aul_check_tep_mount(const char *tep_path);
2501 * This API is only for Appfw internally.
2503 int aul_is_tep_mount_dbus_done(const char *tep_string);
2506 * This API is only for Appfw internally.
2508 int aul_forward_app(const char *appid, bundle *kb);
2512 * This API create custom launchpad-loader
2514 * This API's purpose is to make a slot for custom loader.
2515 * Once it is made, added loader will make a candidate process to use.
2517 * @param[in] loader_path The file name of the custom loader binary including full path
2518 * @param[in] extra A bundle to be passed to the custom loader
2519 * @return Loader ID if success, negative value(<0) if fail
2522 * This API is only for Appfw internally.
2523 * This API is only available in User Session.
2525 int aul_add_loader(const char *loader_path, bundle *extra);
2529 * This API create custom launchpad-loader
2531 * This API's purpose is to make a slot for custom loader.
2532 * Once it is made, added loader will make a candidate process to use.
2534 * @param[in] loader_path The file name of the custom loader binary including full path
2535 * @param[in] extra A bundle to be passed to the custom loader
2536 * @param[in] uid User ID
2537 * @return Loader ID if success, negative value(<0) if fail
2540 * This API is only for Appfw internally.
2541 * This API is only available to System user.
2543 int aul_add_loader_for_uid(const char *loader_path, bundle *extra, uid_t uid);
2548 * This API destroy custom launchpad-loader
2550 * This API's purpose is to remove a slot for custom loader.
2551 * Once it is removed, the prepared process will be removed as well.
2553 * @param[in] loader_id Loader ID
2554 * @return 0 if success, negative value(<0) if fail
2557 * This API is only for Appfw internally.
2558 * This API is only available in User Session.
2560 int aul_remove_loader(int loader_id);
2564 * This API destroy custom launchpad-loader
2566 * This API's purpose is to remove a slot for custom loader.
2567 * Once it is removed, the prepared process will be removed as well.
2569 * @param[in] loader_id Loader ID
2570 * @param[in] uid User ID
2571 * @return 0 if success, negative value(<0) if fail
2574 * This API is only for Appfw internally.
2575 * This API is only available to System user.
2577 int aul_remove_loader_for_uid(int loader_id, uid_t uid);
2581 * This API gets specified application process id.
2583 * The purpose of this API is to get the pid of specified application.
2585 * @param[in] appid application name
2586 * @return callee's pid if success, negative value(<0) if fail
2589 * This API is only available in User Session.
2591 int aul_app_get_pid(const char *appid);
2595 * This API gets specified application process id.
2597 * The purpose of this API is to get the pid of specified application.
2599 * @param[in] appid application name
2600 * @param[in] uid User ID
2601 * @return callee's pid if success, negative value(<0) if fail
2604 * This API is only available to System user.
2606 int aul_app_get_pid_for_uid(const char *appid, uid_t uid);
2610 * This function update rua stat.
2612 * @param[in] b Bundle object contains caller and tag information.
2613 * @param[in] uid Target uid
2615 * @return 0 if success, negative value(<0) if fail
2617 * @remarks This API is only for Appfw internally.
2626 bundle *b = bundle_create();
2627 bundle_add_str(b, AUL_SVC_K_RUA_STAT_CALLER, caller);
2628 bundle_add_str(b, AUL_SVC_K_RUA_STAT_TAG, tag);
2630 r = aul_update_rua_stat_for_uid(b);
2635 int aul_update_rua_stat_for_uid(bundle *b, uid_t uid);
2639 * This function add rua history.
2641 * @param[in] b Bundle object Target Package name or app path.
2642 * @param[in] uid Target uid
2644 * @return 0 if success, negative value(<0) if fail
2646 * @remarks This API is only for Appfw internally.
2655 bundle *b = bundle_create();
2657 bundle_add_str(b, AUL_K_RUA_PKGNAME, pkg_name);
2659 bundle_add_str(b, AUL_K_RUA_APPPATH, app_path);
2661 r = aul_add_rua_history_for_uid(b);
2666 int aul_add_rua_history_for_uid(bundle *b, uid_t uid);
2670 * This function delete rua history.
2672 * @param[in] b Bundle object Target Package name. If NULL or has no value, delete all rua history.
2673 * @param[in] uid Target uid
2675 * @return 0 if success, negative value(<0) if fail
2677 * @remarks This API is only for Appfw internally.
2688 b = bundle_create();
2689 bundle_add_str(b, AUL_K_RUA_PKGNAME, pkg_name);
2691 r = aul_delete_rua_history_for_uid(b, getuid());
2696 int aul_delete_rua_history_for_uid(bundle *b, uid_t uid);
2701 * This function sets the default application(application id) associated with operatioin, uri and mime-type.
2703 * @param[in] b Bundle object Target application id and operation, uri and mime-type.
2705 * @return 0 if success, negative value(<0) if fail
2707 * @remarks This API is only for Appfw internally.
2712 #include <aul_svc.h>
2717 bundle *b = bundle_create();
2719 const char *appid = "org.tizen.test";
2720 const char *operation = "test_operation";
2721 const char *mime_type = "test_mime";
2722 const char *uri = "test_uri";
2724 aul_svc_set_operation(b, operation);
2725 aul_svc_set_mime(b, mime_type);
2726 aul_svc_set_uri(b, uri);
2728 aul_svc_set_appid(b, appid)
2730 r = aul_set_default_app_by_operation(b);
2735 int aul_set_default_app_by_operation(bundle *b);
2739 * This API unset the default application(application id) associated with operation, uri and mime-type.
2741 * @param[in] app_id The ID of the application
2743 * @return 0 if success, negative value(<0) if fail
2756 aul_unset_default_app_by_operation("org.tizen.test");
2761 int aul_unset_default_app_by_operation(const char *app_id);
2765 * Sends the launch request asynchronously.
2767 * @param[in] appid The application ID
2768 * @param[in] kb The Bundle data
2769 * @return a pid of the callee on success,
2770 * otherwise a negative error value
2771 * @retval AUL_R_OK - Successful
2772 * @retval AUL_R_EINVAL - Invalid parameter
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.
2779 * If the caller application is equal to the callee application, this API can return AUL_R_OK.
2781 int aul_launch_app_async(const char *appid, bundle *kb);
2785 * Sends the launch request asynchronously.
2787 * @param[in] appid The application ID
2788 * @param[in] kb The Bundle data
2789 * @param[in] uid User ID
2790 * @return a pid of the callee on success,
2791 * otherwise a negative error value
2792 * @retval AUL_R_OK - Successful
2793 * @retval AUL_R_EINVAL - Invalid parameter
2794 * @retval AUL_R_ECOM - Internal AUL IPC error
2795 * @retval AUL_R_ERROR - General error
2798 * This API is only available to System user.
2799 * This API doesn't check whether the callee application is executed successfully.
2800 * If the caller application is equal to the callee application, this API can return AUL_R_OK.
2802 int aul_launch_app_async_for_uid(const char *appid, bundle *kb, uid_t uid);
2806 * This API request launchpad to make candidate processes.
2808 * @return 0 if success, negative value(<0) if fail
2811 * This API is only available in User Session.
2813 int aul_prepare_candidate_process(void);
2816 * This API is only for Appfw internally.
2818 int aul_widget_instance_add(const char *widget_id, const char *instance_id);
2821 * This API is only for Appfw internally.
2823 int aul_widget_instance_del(const char *widget_id, const char *instance_id);
2826 * This API is only for Appfw internally.
2828 typedef void (*aul_widget_instance_foreach_cb)(const char *instance_id, void *data);
2831 * This API is only for Appfw internally.
2833 int aul_widget_instance_foreach(const char *widget_id, aul_widget_instance_foreach_cb cb, void *data);
2836 * This API is only for Appfw internally.
2838 int aul_widget_instance_update(const char *widget_id, const char *instance_id, bundle *b);
2841 * This API is only for Appfw internally.
2843 int aul_widget_instance_count(const char *widget_id);
2847 * This API gets the last caller process id of specified application process id.
2849 * This API's purpose is to get the application's last caller process id.
2851 * @param[in] pid pid of application
2852 * @return caller pid if success, nagative value if fail
2855 * This API is only available in User Session.
2857 int aul_app_get_last_caller_pid(int pid);
2861 * This API gets the last caller process id of specified application process id.
2863 * This API's purpose is to get the last caller process id of the application.
2865 * @param[in] pid pid of application
2866 * @param[in] uid User ID
2867 * @return caller pid if success, nagative value if fail
2870 * This API is only available in System users.
2872 int aul_app_get_last_caller_pid_for_uid(int pid, uid_t uid);
2876 * This API trigger to resume application asynchronously.
2877 * If the application is running, this API send a resume event to the App.
2878 * If the application is not running, this API return AUL_R_ERROR.
2879 * Although the application is running, if the application cannot receive resume event,
2880 * AUL try to raise the application's default windows.
2882 * This API is for caller.
2883 * This API's purpose is to send resume event.
2884 * @par Typical use case:
2885 * In multiple application model, If you want to only resume specific application, Use this API
2887 * @param[in] pid application's pid to be resumed
2888 * @return 0 if success, negative value(<0) if fail
2889 * @retval AUL_R_OK - success
2890 * @retval AUL_R_EINVAL - invaild pid
2891 * @retval AUL_R_ECOM - internal AUL IPC error
2892 * @retval AUL_R_ERROR - general error (include application is not running)
2893 * @warning This API need to require root or inhouse permisssion \n
2894 * If you have not the permission, this API return AUL_R_ERROR. \n
2896 * This API is only available to User Session.
2898 int aul_resume_pid_async(int pid);
2902 * This API trigger to resume application asynchronously.
2903 * If the application is running, this API send a resume event to the App.
2904 * If the application is not running, this API return AUL_R_ERROR.
2905 * Although the application is running, if the application cannot receive resume event,
2906 * AUL try to raise the application's default windows.
2908 * This API is for caller.
2909 * This API's purpose is to send resume event.
2910 * @par Typical use case:
2911 * In multiple application model, If you want to only resume specific application, Use this API
2913 * @param[in] pid application's pid to be resumed
2914 * @param[in] uid User ID
2915 * @return 0 if success, negative value(<0) if fail
2916 * @retval AUL_R_OK - success
2917 * @retval AUL_R_EINVAL - invaild pid
2918 * @retval AUL_R_ECOM - internal AUL IPC error
2919 * @retval AUL_R_ERROR - general error (include application is not running)
2920 * @warning This API need to require root or inhouse permisssion \n
2921 * If you have not the permission, this API return AUL_R_ERROR. \n
2923 * This API is only available to System user.
2925 int aul_resume_pid_async_for_uid(int pid, uid_t uid);
2929 * This API set the alias appid.
2930 * The alias appid is only available for the aul_svc_set_appid() API.
2931 * If the appid is not available, this API returns an error.
2933 * @privlevel platform
2934 * @privilege %http://tizen.org/privilege/systemsettings.admin
2935 * @param[in] alias_appid an alias application ID
2936 * @param[in] appid an application ID
2937 * @return 0 if success, negative value(<0) if fail
2940 * This API is only available to User Session.
2942 int aul_set_alias_appid(const char *alias_appid, const char *appid);
2946 * This API unset the alias appid.
2948 * @privlevel platform
2949 * @privilege %http://tizen.org/privilege/systemsettings.admin
2950 * @param[in] alias_appid an alias application ID
2951 * @return 0 if success, negative value(<0) if fail
2954 * This API is only available to User Session.
2956 int aul_unset_alias_appid(const char *alias_appid);
2960 * This API activates the alias information based on the given appid.
2962 * @privlevel platform
2963 * @privilege %http://tizen.org/privilege/systemsettings.admin
2964 * @param[in] appid an application ID
2965 * @return 0 if success, negative value(<0) if fail
2968 * This API is only available to User Session.
2970 int aul_enable_alias_info(const char *appid);
2974 * This API deactivates the alias information based on the given appid.
2976 * @privlebel platform
2977 * @privilege %http://tizen.org/privilege/systemsettings.admin
2978 * @param[in] appid an application ID
2979 * @return 0 if success, negative value(<0) if fail
2982 * This API is only available to User Session.
2984 int aul_disable_alias_info(const char *appid);
2987 * This API is only for Appfw internally.
2989 typedef int (*app_status_cb)(aul_app_info *info, int ctx_status, void *data);
2992 * This API is only for Appfw internally.
2994 typedef struct status_listen_s *status_listen_h;
2998 * Registers a callback function to be invoked when the application change status.
3000 * @param[in] appid The application ID to get status
3001 * @param[in] callback The callback function to register
3002 * @param[in] data The user data to be passed to the callback function
3003 * @param[out] handle The status listen handle
3004 * @return @c 0 on success,
3005 * otherwise a negative error value
3007 int aul_listen_app_status(const char *appid, app_status_cb callback,
3008 void *data, status_listen_h *handle);
3009 int aul_listen_app_status_for_uid(const char *appid, app_status_cb callback,
3010 void *data, status_listen_h *handle, uid_t uid);
3013 * This API is only for Appfw internally.
3015 int aul_widget_instance_get_content(const char *widget_id, const char *instance_id, char **content);
3019 * Gets running application instance info
3020 * This API calls the iter_fn with the aul_app_info when running app instance info is found.
3022 * @param[in] iter_fn iterative function
3023 * @param[in] user_data User data
3024 * @return 0 if success, negative value(<0) if fail
3025 * @retval AUL_R_OK Successful
3026 * @retval AUL_R_ERROR General error
3027 * @retval AUL_R_EINVAL Invalid parameter
3029 int aul_app_get_running_app_instance_info(aul_app_info_iter_fn iter_fn,
3031 int aul_app_get_running_app_instance_info_for_uid(aul_app_info_iter_fn iter_fn,
3032 void *user_data, uid_t uid);
3035 * This API is only for Appfw internally.
3037 int aul_app_get_instance_id_bypid(int pid, char *instance_id, int len);
3038 int aul_app_get_instance_id_bypid_for_uid(int pid, char *instance_id,
3039 int len, uid_t uid);
3042 * This API is only for Appfw internally.
3044 int aul_resume_app_by_instance_id(const char *appid, const char *instance_id);
3045 int aul_resume_app_by_instance_id_for_uid(const char *appid,
3046 const char *instance_id, uid_t uid);
3049 * This API is only for Appfw internally.
3051 int aul_ignore_app_status(status_listen_h handle);