2 * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
20 #include <sys/types.h>
27 /** AUL_SVC OPERATION TYPE*/
28 #define AUL_SVC_OPERATION_DEFAULT "http://tizen.org/appcontrol/operation/default"
29 /** AUL_SVC OPERATION TYPE*/
30 #define AUL_SVC_OPERATION_EDIT "http://tizen.org/appcontrol/operation/edit"
31 /** AUL_SVC OPERATION TYPE*/
32 #define AUL_SVC_OPERATION_VIEW "http://tizen.org/appcontrol/operation/view"
33 /** AUL_SVC OPERATION TYPE*/
34 #define AUL_SVC_OPERATION_PICK "http://tizen.org/appcontrol/operation/pick"
35 /** AUL_SVC OPERATION TYPE*/
36 #define AUL_SVC_OPERATION_CREATE_CONTENT "http://tizen.org/appcontrol/operation/create_content"
37 /** AUL_SVC OPERATION TYPE*/
38 #define AUL_SVC_OPERATION_CALL "http://tizen.org/appcontrol/operation/call"
39 /** AUL_SVC OPERATION TYPE*/
40 #define AUL_SVC_OPERATION_SEND "http://tizen.org/appcontrol/operation/send"
41 /** AUL_SVC OPERATION TYPE*/
42 #define AUL_SVC_OPERATION_SEND_TEXT "http://tizen.org/appcontrol/operation/send_text"
43 /** AUL_SVC OPERATION TYPE*/
44 #define AUL_SVC_OPERATION_DIAL "http://tizen.org/appcontrol/operation/dial"
45 /** AUL_SVC OPERATION TYPE*/
46 #define AUL_SVC_OPERATION_SEARCH "http://tizen.org/appcontrol/operation/search"
47 /** AUL_SVC OPERATION TYPE*/
48 #define AUL_SVC_OPERATION_DOWNLOAD "http://tizen.org/appcontrol/operation/download"
49 /** AUL_SVC OPERATION TYPE*/
50 #define AUL_SVC_OPERATION_SHARE "http://tizen.org/appcontrol/operation/share"
51 /** AUL_SVC OPERATION TYPE*/
52 #define AUL_SVC_OPERATION_MULTI_SHARE "http://tizen.org/appcontrol/operation/multi_share"
53 /** AUL_SVC OPERATION TYPE*/
54 #define AUL_SVC_OPERATION_SHARE_TEXT "http://tizen.org/appcontrol/operation/share_text"
55 /** AUL_SVC_OPERATION_TYPE*/
56 #define AUL_SVC_OPERATION_COMPOSE "http://tizen.org/appcontrol/operation/compose"
57 /** AUL_SVC OPERATION TYPE*/
58 #define AUL_SVC_OPERATION_LOCATION "http://tizen.org/appcontrol/operation/configure/location"
59 /** AUL_SVC OPERATION TYPE*/
60 #define AUL_SVC_OPERATION_FONT_TYPE "http://tizen.org/appcontrol/operation/configure/font/type"
61 /** AUL_SVC OPERATION TYPE*/
62 #define AUL_SVC_OPERATION_FONT_SIZE "http://tizen.org/appcontrol/operation/configure/font/size"
63 #define AUL_SVC_OPERATION_LAUNCH_ON_EVENT "http://tizen.org/appcontrol/operation/launch_on_event"
67 /** AUL_SVC DATA SUBJECT*/
68 #define AUL_SVC_DATA_SUBJECT "http://tizen.org/appcontrol/data/subject"
69 /** AUL_SVC DATA TYPE*/
70 #define AUL_SVC_DATA_TO "http://tizen.org/appcontrol/data/to"
71 /** AUL_SVC DATA TYPE*/
72 #define AUL_SVC_DATA_CC "http://tizen.org/appcontrol/data/cc"
73 /** AUL_SVC DATA TYPE*/
74 #define AUL_SVC_DATA_BCC "http://tizen.org/appcontrol/data/bcc"
75 /** AUL_SVC DATA TYPE*/
76 #define AUL_SVC_DATA_TEXT "http://tizen.org/appcontrol/data/text"
77 /** AUL_SVC DATA TYPE*/
78 #define AUL_SVC_DATA_TITLE "http://tizen.org/appcontrol/data/title"
79 /** AUL_SVC DATA TYPE*/
80 #define AUL_SVC_DATA_SELECTED "http://tizen.org/appcontrol/data/selected"
81 /** AUL_SVC DATA TYPE*/
82 #define AUL_SVC_DATA_KEYWORD "http://tizen.org/appcontrol/data/keyword"
83 /** AUL_SVC DATA TYPE*/
84 #define AUL_SVC_DATA_PATH "http://tizen.org/appcontrol/data/path"
85 /** AUL_SVC DATA TYPE*/
86 #define AUL_SVC_DATA_SELECTION_MODE "http://tizen.org/appcontrol/data/selection_mode"
87 /** AUL_SVC DATA TYPE*/
88 #define AUL_SVC_DATA_RETURN_RESULT "http://tizen.org/appcontrol/data/return_result"
90 /** AUL SVC internal private key */
91 #define AUL_SVC_K_URI_R_INFO "__AUL_SVC_URI_R_INFO__"
93 #define AUL_SVC_K_SELECTOR_EXTRA_LIST "http://tizen.org/appcontrol/data/selector_extra_list"
95 /** AUL SVC internal private key */
96 #define AUL_SVC_OPERATION_LAUNCH_WIDGET "http://tizen.org/appcontrol/operation/launch_widget"
98 #ifdef _APPFW_FEATURE_MULTI_INSTANCE
99 #define AUL_SVC_K_MULTI_INSTANCE "multi_instance"
102 #define APP_SELECTOR "org.tizen.app-selector"
103 #define SHARE_PANEL "org.tizen.share-panel"
105 /** Internal operation for launching application which is other zone */
106 #define AUL_SVC_OPERATION_JUMP "http://tizen.org/appcontrol/operation/jump"
107 #define AUL_SVC_K_JUMP_ZONE_NAME "__K_JUMP_DOMAIN_NAME__"
108 #define AUL_SVC_K_JUMP_ORIGIN_OPERATION "__K_JUMP_ORIGIN_OPERATION__"
109 #define AUL_SVC_K_FOCUS_ZONE "__K_FOCUS_ZONE__"
110 #define AUL_SVC_K_LAUNCH_RESULT_APP_STARTED "__K_LAUNCH_RESULT_APP_STARTED__"
111 #define AUL_SVC_K_CAN_BE_LEADER "__K_CAN_BE_LEADER__"
112 #define AUL_SVC_K_REROUTE "__K_REROUTE__"
113 #define AUL_SVC_K_SHIFT_WINDOW "__K_SHIFT_WINDOW"
114 #define AUL_SVC_K_RECYCLE "__K_RECYCLE"
115 #define AUL_SVC_K_RELOCATE_BELOW "__K_RELOCATE_BELOW"
116 #define AUL_SVC_K_BG_LAUNCH "__K_BG_LAUNCH"
117 #define AUL_SVC_K_SPLASH_SCREEN "__K_SPLASH_SCREEN"
118 #define AUL_SVC_K_ALIAS_INFO "__K_ALIAS_INFO"
120 #define PAD_LOADER_ID_DIRECT 1
123 * @brief Return values in appsvc.
125 typedef enum _aul_svc_return_val {
126 AUL_SVC_RET_ECANCELED = -8, /**< Operation is canceled */
127 AUL_SVC_RET_EREJECTED = -7, /**< application launch rejected */
128 AUL_SVC_RET_ETERMINATING = -6, /**< application terminating */
129 AUL_SVC_RET_EILLACC = -5, /**< Illegal Access */
130 AUL_SVC_RET_ELAUNCH = -4, /**< Failure on launching the app */
131 AUL_SVC_RET_ENOMATCH = -3, /**< No matching result Error */
132 AUL_SVC_RET_EINVAL = -2, /**< Invalid argument */
133 AUL_SVC_RET_ERROR = -1, /**< General error */
134 AUL_SVC_RET_OK = 0 /**< General success */
135 } aul_svc_return_val;
139 * @brief result values in appsvc.
141 typedef enum _aul_svc_result_val {
142 AUL_SVC_RES_CANCEL = -2, /**< Cancel by system */
143 AUL_SVC_RES_NOT_OK = -1, /**< Fail by user */
144 AUL_SVC_RES_OK = 0 /**< Success by user */
145 } aul_svc_result_val;
149 * @brief aul_svc_res_fn is appsvc result function
150 * @param[out] b result bundle
151 * @param[out] request_code request code
152 * @param[out] result result value
153 * @param[out] data user-supplied data
155 typedef void (*aul_svc_res_fn)(bundle *b, int request_code, aul_svc_result_val result, void *data);
158 * @brief Called when the result of the launch request is delivered.
160 * @param[in] request_code The request code
161 * @param[in] result The result, the process ID of the callee on success otherwise a negative error value
162 * @param[in] user_data The user data passed from the callback registration function
164 typedef void (*aul_svc_err_cb)(int request_code, int result, void *user_data);
167 * @brief iterator function running with aul_svc_get_list
168 * @param[out] appid appid retreived by aul_svc_get_list
169 * @param[out] data user-supplied data
171 typedef int (*aul_svc_info_iter_fn)(const char *appid, void *data);
173 typedef int (*aul_svc_host_res_fn)(void *data);
177 * This function sets an operation to launch application based on appsvc.
179 * @param[in] b bundle object
180 * @param[in] operation operation
182 * @return 0 if success, negative value(<0) if fail
183 * @retval AUL_SVC_RET_OK - success
184 * @retval AUL_SVC_RET_ERROR - general error
185 * @retval AUL_SVC_RET_EINVAL - invalid argument(content)
190 * @remarks An application must call this function before using aul_svc_run_service API.
202 aul_svc_set_operation(b, AUL_SVC_OPERATION_VIEW);
207 int aul_svc_set_operation(bundle *b, const char *operation);
211 * This function sets an uri to launch application based on appsvc.
213 * @param[in] b bundle object
216 * @return 0 if success, negative value(<0) if fail
217 * @retval AUL_SVC_RET_OK - success
218 * @retval AUL_SVC_RET_ERROR - general error
219 * @retval AUL_SVC_RET_EINVAL - invalid argument(content)
236 aul_svc_set_operation(b, AUL_SVC_OPERATION_VIEW);
237 aul_svc_set_uri(b,"http://www.samsung.com");
242 int aul_svc_set_uri(bundle *b, const char *uri);
246 * This function sets a mime-type to launch application based on appsvc.
248 * @param[in] b bundle object
249 * @param[in] mime mime-type
251 * @return 0 if success, negative value(<0) if fail
252 * @retval AUL_SVC_RET_OK - success
253 * @retval AUL_SVC_RET_ERROR - general error
254 * @retval AUL_SVC_RET_EINVAL - invalid argument(content)
271 aul_svc_set_operation(b, AUL_SVC_OPERATION_PICK);
272 aul_svc_set_mime(b,"image/jpg");
277 int aul_svc_set_mime(bundle *b, const char *mime);
281 * This function sets an extra data to launch application based on appsvc.
283 * @param[in] b bundle object
284 * @param[in] key key of extra data
285 * @param[in] val data
287 * @return 0 if success, negative value(<0) if fail
304 aul_svc_set_operation(b, AUL_SVC_OPERATION_SEND);
305 aul_svc_set_uri(b,"mailto:xxx1@xxx");
306 aul_svc_add_data(b,AUL_SVC_DATA_CC,"xxx2@xxx");
311 int aul_svc_add_data(bundle *b, const char *key, const char *val);
315 * This function sets an extra array data to launch application based on appsvc.
317 * @param[in] b bundle object
318 * @param[in] key key of extra data
319 * @param[in] val_array data
320 * @param[in] len Length of array
322 * @return 0 if success, negative value(<0) if fail
336 char *images[] = {"/opt/media/a.jpg", "/opt/media/b.jpg", "/opt/media/c.jpg"};
340 aul_svc_add_data_array(b, AUL_SVC_DATA_SELECTED, images, 3);
345 int aul_svc_add_data_array(bundle *b, const char *key, const char **val_array, int len);
350 * This function sets a package name to launch application based on appsvc.
352 * @param[in] b bundle object
353 * @param[in] pkg_name package name for explict launch
355 * @return 0 if success, negative value(<0) if fail
356 * @retval AUL_SVC_RET_OK - success
357 * @retval AUL_SVC_RET_ERROR - general error
358 * @retval AUL_SVC_RET_EINVAL - invalid argument(content)
375 aul_svc_set_operation(b, AUL_SVC_OPERATION_PICK);
376 aul_svc_set_mime(b,"image/jpg");
377 aul_svc_set_pkgname(b, "org.tizen.mygallery");
383 int aul_svc_set_pkgname(bundle *b, const char *pkg_name); // __attribute__((deprecated));
388 * This function sets a appid to launch application based on appsvc.
390 * @param[in] b bundle object
391 * @param[in] appid application id for explict launch
393 * @return 0 if success, negative value(<0) if fail
394 * @retval AUL_SVC_RET_OK - success
395 * @retval AUL_SVC_RET_ERROR - general error
396 * @retval AUL_SVC_RET_EINVAL - invalid argument(content)
413 aul_svc_set_operation(b, AUL_SVC_OPERATION_PICK);
414 aul_svc_set_mime(b,"image/jpg");
415 aul_svc_set_appid(b, "org.tizen.mygallery");
420 int aul_svc_set_appid(bundle *b, const char *appid);
425 * This function sets a appid to launch application based on appsvc.
427 * @param[in] b bundle object
428 * @param[in] application category
430 * @return 0 if success, negative value(<0) if fail
431 * @retval AUL_SVC_RET_OK - success
432 * @retval AUL_SVC_RET_ERROR - general error
433 * @retval AUL_SVC_RET_EINVAL - invalid argument(content)
450 aul_svc_set_operation(b, AUL_SVC_OPERATION_VIEW);
451 aul_svc_set_category(b, "http://tizen.org/category/app/browser");
456 int aul_svc_set_category(bundle *b, const char *category);
460 * This API launch application based on appsvc.
462 * @param[in] b bundle to be passed to callee
463 * @param[in] request_code request code
464 * @param[in] cbfunc result callback function
465 * @param[in] data user-supplied data passed to callback function
467 * @return callee's pid if success, negative value(<0) if fail
468 * @retval callee's pid - success
469 * @retval AUL_SVC_RET_ERROR - general error
470 * @retval AUL_SVC_RET_EINVAL - invalid argument(content)
471 * @retval AUL_SVC_RET_ENOMATCH - no matching result Error
472 * @retval AUL_SVC_RET_ELAUNCH - failure on launching the app
490 aul_svc_set_operation(b, AUL_SVC_OPERATION_PICK);
491 aul_svc_set_mime(b,"image/jpg");
493 return aul_svc_run_service(b, 0, cb_func, (void*)NULL);
498 int aul_svc_run_service(bundle *b, int request_code, aul_svc_res_fn cbfunc, void *data);
499 int aul_svc_run_service_for_uid(bundle *b, int request_code,
500 aul_svc_res_fn cbfunc, void *data, uid_t uid);
504 * This API use to get application list that is matched with given bundle.
506 * @param[in] b bundle to resolve application
507 * @param[in] iter_fn iterator function
508 * @param[in] data user-supplied data for iter_fn
510 * @return 0 if success, negative value(<0) if fail
511 * @retval AUL_SVC_RET_OK - success
512 * @retval AUL_SVC_RET_EINVAL - invalid argument(content)
513 * @retval AUL_SVC_RET_ENOMATCH - no matching result Error
524 static int iter_fn(const char* appid, void *data)
526 printf("\t==========================\n");
527 printf("\t appid: %s\n", appid);
528 printf("\t==========================\n");
539 aul_svc_set_operation(b, AUL_SVC_OPERATION_PICK);
540 aul_svc_set_mime(b,"image/jpg");
542 return aul_svc_get_list(b, iter_fn, (void*)NULL);
547 int aul_svc_get_list(bundle *b, aul_svc_info_iter_fn iter_fn, void *data);
548 int aul_svc_get_list_for_uid(bundle *b, aul_svc_info_iter_fn iter_fn,
549 void *data, uid_t uid);
553 * This API use to get default applications
555 * @param[in] iter_fn iterator function
556 * @param[in] data user-supplied data for iter_fn
558 * @return 0 if success, negative value(<0) if fail
559 * @retval AUL_SVC_RET_OK - success
560 * @retval AUL_SVC_RET_EINVAL - invalid argument(content)
561 * @retval AUL_SVC_RET_ENOMATCH - no matching result Error
572 static int iter_fn(const char* appid, void *data)
574 printf("\t==========================\n");
575 printf("\t appid : %s\n", appid);
576 printf("\t==========================\n");
582 return aul_svc_get_all_defapps(iter_fn, (void*)NULL);
587 int aul_svc_get_all_defapps(aul_svc_info_iter_fn iter_fn, void *data);
588 int aul_svc_get_all_defapps_for_uid(aul_svc_info_iter_fn iter_fn,
589 void *data, uid_t uid);
593 * This function gets a operation from bundle.
595 * @param[in] b bundle object
597 * @return Pointer for operation string if success, NULL if fail
611 val = aul_svc_get_operation(b);
616 const char *aul_svc_get_operation(bundle *b);
620 * This function gets a uri from bundle.
622 * @param[in] b bundle object
624 * @return Pointer for uri string if success, NULL if fail
638 val = aul_svc_get_uri(b);
643 const char *aul_svc_get_uri(bundle *b);
647 * This function gets a mime-type from bundle.
649 * @param[in] b bundle object
651 * @return Pointer for mime-type string if success, NULL if fail
665 val = aul_svc_get_mime(b);
670 const char *aul_svc_get_mime(bundle *b);
674 * This function gets a package name from bundle.
676 * @param[in] b bundle object
678 * @return Pointer for package name string if success, NULL if fail
692 val = aul_svc_get_pkgname(b);
698 const char *aul_svc_get_pkgname(bundle *b); // __attribute__((deprecated));
702 * This function gets a application id from bundle.
704 * @param[in] b bundle object
706 * @return Pointer for application id string if success, NULL if fail
720 val = aul_svc_get_appid(b);
725 const char *aul_svc_get_appid(bundle *b);
729 * This function gets a application category from bundle.
731 * @param[in] b bundle object
733 * @return Pointer for application category string if success, NULL if fail
747 val = aul_svc_get_category(b);
752 const char *aul_svc_get_category(bundle *b);
756 * This function gets value from key.
758 * @param[in] b bundle object
761 * @return Pointer for value string if success, NULL if fail
775 val = aul_svc_get_data(b, AUL_SVC_DATA_CC);
780 const char *aul_svc_get_data(bundle *b, const char *key);
784 * This function gets value from key.
786 * @param[in] b bundle object
788 * @param[out] len length of array
790 * @return Pointer for value string array if success, NULL if fail
807 if(aul_svc_data_is_array(b, AUL_SVC_DATA_SELECTED))
808 val_array = aul_svc_get_data_array(b, AUL_SVC_DATA_SELECTED, &len);
810 val = aul_svc_get_data(b, AUL_SVC_DATA_SELECTED);
815 const char **aul_svc_get_data_array(bundle *b, const char *key, int *len);
819 * This API create appsvc result bundle based on bundle received in reset event.
821 * @param[in] inb bundle received in reset event
822 * @param[in] outb bundle to use for returning result
824 * @retval AUL_SVC_RET_OK - success
825 * @retval AUL_SVC_RET_ERROR - general error
826 * @retval AUL_SVC_RET_EINVAL - invalid argument(content)
830 * @see aul_svc_send_result.
839 struct appdata *ad = data;
842 aul_svc_create_result_bundle(ad->b,&res_bundle);
843 bundle_add(res_bundle, "result", "1");
844 aul_svc_send_result(res_bundle, 0);
849 int aul_svc_create_result_bundle(bundle *inb, bundle **outb);
853 * This API send appsvc result to caller with bundle.
855 * @param[in] b Result data in bundle format
856 * @param[in] result result value
858 * @retval AUL_SVC_RET_OK - success
859 * @retval AUL_SVC_RET_ERROR - general error
860 * @retval AUL_SVC_RET_EINVAL - invalid argument(content)
862 * @pre aul_svc_create_result_bundle.
864 * @see aul_svc_send_result.
873 struct appdata *ad = data;
876 aul_svc_create_result_bundle(ad->b,&res_bundle);
877 bundle_add(res_bundle, "result", "1");
878 aul_svc_send_result(res_bundle, 0);
883 int aul_svc_send_result(bundle *b, aul_svc_result_val result);
887 * This API set the default application(package name) associated with op, uri and mime-type.
889 * @param[in] op operation
890 * @param[in] mime_type mime-type
891 * @param[in] scheme scheme of uri
892 * @param[in] defapp default application
894 * @retval AUL_SVC_RET_OK - success
895 * @retval AUL_SVC_RET_ERROR - general error
896 * @retval AUL_SVC_RET_EINVAL - invalid argument(content)
909 aul_svc_set_defapp(AUL_SVC_OPERATION_VIEW, NULL,"http", "org.tizen.mybrowser");
914 int aul_svc_set_defapp(const char *op, const char *mime_type, const char *uri,
916 int aul_svc_set_defapp_for_uid(const char *op, const char *mime_type, const char *uri,
917 const char *defapp, uid_t uid);
921 * This API unset the default application(package name) associated with op, uri and mime-type.
923 * @param[in] defapp default application
925 * @retval AUL_SVC_RET_OK - success
926 * @retval AUL_SVC_RET_ERROR - general error
939 aul_svc_unset_defapp("org.tizen.test");
944 int aul_svc_unset_defapp(const char *defapp);
945 int aul_svc_unset_defapp_for_uid(const char *defapp, uid_t uid);
949 * This API unset all of default applications associated with op, uri and mime-type.
952 * @retval AUL_SVC_RET_OK - success
953 * @retval AUL_SVC_RET_ERROR - general error
966 aul_svc_unset_all_defapps();
971 int aul_svc_unset_all_defapps();
972 int aul_svc_unset_all_defapps_for_uid(uid_t uid);
976 * This API ask a application is default application or not.
978 * @param[in] appid application appid
979 * @return true / false
980 * @retval 1 app_name is default application in appsvc.
981 * @retval 0 app_name is NOT default application in appsvc.
994 * int is_defapp_browser_app()
996 * return aul_svc_is_defapp("org.tizen.browser");
1004 int aul_svc_is_defapp(const char *appid);
1005 int aul_svc_is_defapp_for_uid(const char *pkg_name, uid_t uid);
1010 * This API ask a extra data is array or not.
1012 * @param[in] b bundle object
1013 * @param[in] key key of extra data
1014 * @return true / false
1015 * @retval 1 a extra data is array.
1016 * @retval 0 a extra data is not array.
1025 #include <aul_svc.h>
1029 * int aul_svc_data_is_array(bundle *b, char *key)
1031 * return aul_svc_data_is_array(b, key);
1039 int aul_svc_data_is_array(bundle *b, const char *key);
1041 int aul_svc_subapp_terminate_request_pid(int pid);
1045 * This function sets an uri to launch application based on appsvc.
1047 * @param[in] b bundle object
1048 * @param[in] char *mode
1050 * @return 0 if success, negative value(<0) if fail
1051 * @retval AUL_SVC_RET_OK - success
1052 * @retval AUL_SVC_RET_ERROR - general error
1053 * @retval AUL_SVC_RET_EINVAL - invalid argument(content)
1062 #include <aul_svc.h>
1066 aul_svc_set_launch_mode(app_control->data, mode);
1071 int aul_svc_set_launch_mode(bundle *b, const char *mode);
1075 * This function sets an uri to launch application based on appsvc.
1077 * @param[in] b bundle object
1079 * @return Pointer for launch mode string if success, NULL if fail
1088 #include <aul_svc.h>
1092 aul_svc_get_launch_mode(app_control->data);
1097 const char *aul_svc_get_launch_mode(bundle *b);
1099 int aul_svc_allow_transient_app(bundle *b, int wid);
1101 int aul_svc_request_transient_app(bundle *b, int callee_wid,
1102 aul_svc_host_res_fn cbfunc, void *data);
1104 int aul_svc_subscribe_launch_result(bundle *b, const char *event);
1108 * This function sets loader ID into bundle.
1110 * @param[in] b Bundle object
1111 * @param[in] loader_id Loader ID from aul_add_loader() or PAD_LOADER_ID_DIRECT to launch apps without loader
1113 * @return 0 if success, negative value(<0) if fail
1114 * @see aul_add_loader, aul_remove_loader
1115 * @remarks This API is only for Appfw internally.
1117 int aul_svc_set_loader_id(bundle *b, int loader_id);
1121 * This function sets loader name into bundle. Launchpad will assign a static slot to launch an app.
1123 * @param[in] b Bundle object
1124 * @param[in] loader_name Loader name to assign
1126 * @return 0 if success, negative value(<0) if fail
1127 * @remarks This API is only for Appfw internally.
1129 int aul_svc_set_loader_name(bundle *b, const char *loader_name);
1133 * This API sets the background launch mode.
1134 * If the background launch mode is enabled, a window of the callee process doesn't appear on the screen.
1136 * @param[in] b Bundle object
1137 * @param[in] enabled boolean (true / false)
1139 * @return 0 if success, negative value(<0) if fail
1140 * @remarks This API is only for Appfw internally.
1142 int aul_svc_set_background_launch(bundle *b, int enabled);
1146 * This API set the alias appid.
1148 * @param[in] alias_appid an alias application ID
1149 * @param[in] appid an application ID
1150 * @return 0 if success, negative value(<0) if fail
1152 int aul_svc_set_alias_appid(const char *alias_appid, const char *appid);
1153 int aul_svc_set_alias_appid_for_uid(const char *alias_appid,
1154 const char *appid, uid_t uid);
1158 * This API unset the alias appid.
1160 * @param[in] alias_appid an alias application ID
1162 * @return 0 if success, negative value(<0) if fail
1164 int aul_svc_unset_alias_appid(const char *alias_appid);
1165 int aul_svc_unset_alias_appid_for_uid(const char *alias_appid, uid_t uid);
1169 * This API retrieves all alias information.
1171 * @param[in] callback The callback function to be invoked
1172 * @param[in] user_data The user data to be passed to the callback function
1174 * @return 0 if success, negative value(<0) if fail
1176 int aul_svc_foreach_alias_info(void (*callback)(const char *alias_appid,
1177 const char *appid, void *data), void *user_data);
1178 int aul_svc_foreach_alias_info_for_uid(void (*callback)(const char *alias_appid,
1179 const char *appid, void *data),
1180 uid_t uid, void *user_data);
1184 * This API activates the alias information based on the given appid.
1186 * @param[in] appid an application ID
1187 * @return 0 if success, negative value(<0) if fail
1189 int aul_svc_enable_alias_info(const char *appid);
1190 int aul_svc_enable_alias_info_for_uid(const char *appid, uid_t uid);
1194 * This API deactivates the alias information based on the given appid.
1196 * @param[in] appid an application ID
1197 * @return 0 if success, negative value(<0) if fail
1199 int aul_svc_disable_alias_info(const char *appid);
1200 int aul_svc_disable_alias_info_for_uid(const char *appid, uid_t uid);
1204 * This API gets an application ID by an alias application ID.
1206 * @param[in] alias_appid An alias application ID
1207 * @param[out] appid An application ID
1209 * @return 0 if success, negative value(<0) if fail
1211 int aul_svc_get_appid_by_alias_appid(const char *alias_appid, char **appid);
1212 int aul_svc_get_appid_by_alias_appid_for_uid(const char *alias_appid,
1213 char **appid, uid_t uid);
1217 * This API retrieves all alias information based on the given appid.
1219 * @param[in] callback The callback function to be invoked
1220 * @param[in] appid An application ID
1221 * @param[in] user_data The user data to be passed to the callback function
1223 * @return 0 if success, negative value(<0) if fail
1225 int aul_svc_foreach_alias_info_by_appid(int (*callback)(
1226 const char *alias_appid, const char *appid, void *data),
1227 const char *appid, void *user_data);
1228 int aul_svc_foreach_alias_info_by_appid_for_uid(int (*callback)(
1229 const char *alias_appid, const char *appid, void *data),
1230 const char *appid, uid_t uid, void *user_data);
1234 * This API retrieves all allowed information.
1236 * @param[in] callback The callback function to be invoked
1237 * @param[in] user_data The user data to be passed to the callback function
1239 * @return 0 if success, negative value(<0) if fail
1241 int aul_svc_foreach_allowed_info(int (*callback)(const char *appid,
1242 const char *allowed_appid, void *data),
1244 int aul_svc_foreach_allowed_info_for_uid(int (*callback)(const char *appid,
1245 const char *allowed_appid, void *data),
1246 uid_t uid, void *user_data);
1250 * This API retrieves all allowed information based on the given appid.
1252 * @param[in] callback The callback function to be invoked
1253 * @param[in] appid An application ID
1254 * @param[in] user_data The user data to be passed to the callback function
1256 * @return 0 if success, negative value(<0) if fail
1258 int aul_svc_foreach_allowed_info_by_appid(int (*callback)(
1259 const char *appid, const char *allowed_appid, void *data),
1260 const char *appid, void *user_data);
1261 int aul_svc_foreach_allowed_info_by_appid_for_uid(int (*callback)(
1262 const char *appid, const char *allowed_appid, void *data),
1263 const char *appid, uid_t uid, void *user_data);
1267 * Gets the instance ID.
1269 * @param[in] b Bundle object
1271 * @return Pointer for application id string if success, NULL if fail
1273 const char *aul_svc_get_instance_id(bundle *b);
1277 * Sets the instance ID.
1279 * @param[in] b Bundle object
1280 * @param[in] instance ID Instance ID
1282 * @return 0 if success, negative value(<0) if fail
1284 int aul_svc_set_instance_id(bundle *b, const char *instance_id);
1288 * Sends the launch request asynchronous.
1290 * @param[in] b Bundle object
1291 * @param[in] request_code Request Code
1292 * @param[in] cbfunc Callback function
1293 * @param[in] data User data
1295 * @return a pid of the callee on success,
1296 * otherwise a negative error value
1298 int aul_svc_run_service_async(bundle *b, int request_code,
1299 aul_svc_res_fn cbfunc, void *data);
1300 int aul_svc_run_service_async_for_uid(bundle *b, int request_code,
1301 aul_svc_res_fn cbfunc, void *data, uid_t uid);
1305 * @brief Sends the launch request asynchronous.
1307 * @param[in] b The bundle object
1308 * @param[in] request_code The request code
1309 * @param[in] cbfunc The reply callback function
1310 * @param[in] err_cb The result callback function
1311 * @param[in] user_data The user data to be passed to the callback function
1313 * @return a pid of the callee on success,
1314 * otherwise a negative error value
1316 int aul_svc_send_launch_request(bundle *b, int request_code,
1317 aul_svc_res_fn cbfunc, aul_svc_err_cb err_cb,
1321 * @brief Sends the launch request asynchronous.
1323 * @param[in] b The bundle object
1324 * @param[in] request_code The request code
1325 * @param[in] cbfunc The reply callback function
1326 * @param[in] err_cb The result callback function
1327 * @param[in] user_data The user data to be passed to the callback function
1328 * @param[in] uid The user ID
1330 * @return a pid of the callee on success,
1331 * otherwise a negative error value
1333 int aul_svc_send_launch_request_for_uid(bundle *b, int request_code,
1334 aul_svc_res_fn cbfunc, aul_svc_err_cb err_cb,
1335 void *user_data, uid_t uid);
1338 * @brief Sends the launch request synchronous.
1340 * @param[in] b The bundle object
1341 * @param[in] request_code The request code
1342 * @param[out] res_b The bundle object
1343 * @param[out] res The result
1344 * @param[in] uid The user ID
1346 * @return a pid of the callee on success,
1347 * otherwise a negative error value
1349 int aul_svc_send_launch_request_sync_for_uid(bundle *b, int request_code,
1350 bundle **res_b, aul_svc_result_val *res, uid_t uid);
1353 * @brief Sets the ID of the caller instance.
1356 * @param[in] b The bundle object
1357 * @param[in] instance_id The ID of the caller instance
1359 * @return @c 0 on success,
1360 * otherwise a negative error value
1362 int aul_svc_set_caller_instance_id(bundle *b, const char *instance_id);
1365 * @brief Sets the ID of the component.
1368 * @param[in] b The bundle object
1369 * @param[in] comp_id The ID of the component
1371 * @return @c 0 on success,
1372 * otherwise a negative error value
1374 int aul_svc_set_comp_id(bundle *b, const char *comp_id);
1377 * @brief Gets the ID of the component.
1380 * @param[in] b The bundle object
1382 * @return @c a component ID on success,
1383 * otherwise a nullptr
1385 const char *aul_svc_get_comp_id(bundle *b);