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>
26 #ifndef AUL_DEPRECATED_API
27 #define AUL_DEPRECATED_API __attribute__((__visibility__("default"), deprecated))
30 /** AUL_SVC OPERATION TYPE*/
31 #define AUL_SVC_OPERATION_DEFAULT "http://tizen.org/appcontrol/operation/default"
32 /** AUL_SVC OPERATION TYPE*/
33 #define AUL_SVC_OPERATION_EDIT "http://tizen.org/appcontrol/operation/edit"
34 /** AUL_SVC OPERATION TYPE*/
35 #define AUL_SVC_OPERATION_VIEW "http://tizen.org/appcontrol/operation/view"
36 /** AUL_SVC OPERATION TYPE*/
37 #define AUL_SVC_OPERATION_PICK "http://tizen.org/appcontrol/operation/pick"
38 /** AUL_SVC OPERATION TYPE*/
39 #define AUL_SVC_OPERATION_CREATE_CONTENT "http://tizen.org/appcontrol/operation/create_content"
40 /** AUL_SVC OPERATION TYPE*/
41 #define AUL_SVC_OPERATION_CALL "http://tizen.org/appcontrol/operation/call"
42 /** AUL_SVC OPERATION TYPE*/
43 #define AUL_SVC_OPERATION_SEND "http://tizen.org/appcontrol/operation/send"
44 /** AUL_SVC OPERATION TYPE*/
45 #define AUL_SVC_OPERATION_SEND_TEXT "http://tizen.org/appcontrol/operation/send_text"
46 /** AUL_SVC OPERATION TYPE*/
47 #define AUL_SVC_OPERATION_DIAL "http://tizen.org/appcontrol/operation/dial"
48 /** AUL_SVC OPERATION TYPE*/
49 #define AUL_SVC_OPERATION_SEARCH "http://tizen.org/appcontrol/operation/search"
50 /** AUL_SVC OPERATION TYPE*/
51 #define AUL_SVC_OPERATION_DOWNLOAD "http://tizen.org/appcontrol/operation/download"
52 /** AUL_SVC OPERATION TYPE*/
53 #define AUL_SVC_OPERATION_SHARE "http://tizen.org/appcontrol/operation/share"
54 /** AUL_SVC OPERATION TYPE*/
55 #define AUL_SVC_OPERATION_MULTI_SHARE "http://tizen.org/appcontrol/operation/multi_share"
56 /** AUL_SVC OPERATION TYPE*/
57 #define AUL_SVC_OPERATION_SHARE_TEXT "http://tizen.org/appcontrol/operation/share_text"
58 /** AUL_SVC_OPERATION_TYPE*/
59 #define AUL_SVC_OPERATION_COMPOSE "http://tizen.org/appcontrol/operation/compose"
60 /** AUL_SVC OPERATION TYPE*/
61 #define AUL_SVC_OPERATION_LOCATION "http://tizen.org/appcontrol/operation/configure/location"
62 /** AUL_SVC OPERATION TYPE*/
63 #define AUL_SVC_OPERATION_FONT_TYPE "http://tizen.org/appcontrol/operation/configure/font/type"
64 /** AUL_SVC OPERATION TYPE*/
65 #define AUL_SVC_OPERATION_FONT_SIZE "http://tizen.org/appcontrol/operation/configure/font/size"
66 #define AUL_SVC_OPERATION_LAUNCH_ON_EVENT "http://tizen.org/appcontrol/operation/launch_on_event"
70 /** AUL_SVC DATA SUBJECT*/
71 #define AUL_SVC_DATA_SUBJECT "http://tizen.org/appcontrol/data/subject"
72 /** AUL_SVC DATA TYPE*/
73 #define AUL_SVC_DATA_TO "http://tizen.org/appcontrol/data/to"
74 /** AUL_SVC DATA TYPE*/
75 #define AUL_SVC_DATA_CC "http://tizen.org/appcontrol/data/cc"
76 /** AUL_SVC DATA TYPE*/
77 #define AUL_SVC_DATA_BCC "http://tizen.org/appcontrol/data/bcc"
78 /** AUL_SVC DATA TYPE*/
79 #define AUL_SVC_DATA_TEXT "http://tizen.org/appcontrol/data/text"
80 /** AUL_SVC DATA TYPE*/
81 #define AUL_SVC_DATA_TITLE "http://tizen.org/appcontrol/data/title"
82 /** AUL_SVC DATA TYPE*/
83 #define AUL_SVC_DATA_SELECTED "http://tizen.org/appcontrol/data/selected"
84 /** AUL_SVC DATA TYPE*/
85 #define AUL_SVC_DATA_KEYWORD "http://tizen.org/appcontrol/data/keyword"
86 /** AUL_SVC DATA TYPE*/
87 #define AUL_SVC_DATA_PATH "http://tizen.org/appcontrol/data/path"
88 /** AUL_SVC DATA TYPE*/
89 #define AUL_SVC_DATA_SELECTION_MODE "http://tizen.org/appcontrol/data/selection_mode"
90 /** AUL_SVC DATA TYPE*/
91 #define AUL_SVC_DATA_RETURN_RESULT "http://tizen.org/appcontrol/data/return_result"
93 /** AUL SVC internal private key */
94 #define AUL_SVC_K_URI_R_INFO "__AUL_SVC_URI_R_INFO__"
96 #define AUL_SVC_K_SELECTOR_EXTRA_LIST "http://tizen.org/appcontrol/data/selector_extra_list"
98 /** AUL SVC internal private key */
99 #define AUL_SVC_OPERATION_LAUNCH_WIDGET "http://tizen.org/appcontrol/operation/launch_widget"
101 #ifdef _APPFW_FEATURE_MULTI_INSTANCE
102 #define AUL_SVC_K_MULTI_INSTANCE "multi_instance"
105 #define APP_SELECTOR "org.tizen.app-selector"
106 #define SHARE_PANEL "org.tizen.share-panel"
108 /** Internal operation for launching application which is other zone */
109 #define AUL_SVC_OPERATION_JUMP "http://tizen.org/appcontrol/operation/jump"
110 #define AUL_SVC_K_JUMP_ZONE_NAME "__K_JUMP_DOMAIN_NAME__"
111 #define AUL_SVC_K_JUMP_ORIGIN_OPERATION "__K_JUMP_ORIGIN_OPERATION__"
112 #define AUL_SVC_K_FOCUS_ZONE "__K_FOCUS_ZONE__"
113 #define AUL_SVC_K_LAUNCH_RESULT_APP_STARTED "__K_LAUNCH_RESULT_APP_STARTED__"
114 #define AUL_SVC_K_CAN_BE_LEADER "__K_CAN_BE_LEADER__"
115 #define AUL_SVC_K_REROUTE "__K_REROUTE__"
116 #define AUL_SVC_K_SHIFT_WINDOW "__K_SHIFT_WINDOW"
117 #define AUL_SVC_K_RECYCLE "__K_RECYCLE"
118 #define AUL_SVC_K_RELOCATE_BELOW "__K_RELOCATE_BELOW"
119 #define AUL_SVC_K_BG_LAUNCH "__K_BG_LAUNCH"
120 #define AUL_SVC_K_SPLASH_SCREEN "__K_SPLASH_SCREEN"
121 #define AUL_SVC_K_ALIAS_INFO "__K_ALIAS_INFO"
123 #define PAD_LOADER_ID_DIRECT 1
126 * @brief Return values in appsvc.
128 typedef enum _aul_svc_return_val {
129 AUL_SVC_RET_ETIMEOUT = -10, /**< Timeout */
130 AUL_SVC_RET_ENOMEM = -9, /**< Out of memory */
131 AUL_SVC_RET_ECANCELED = -8, /**< Operation is canceled */
132 AUL_SVC_RET_EREJECTED = -7, /**< application launch rejected */
133 AUL_SVC_RET_ETERMINATING = -6, /**< application terminating */
134 AUL_SVC_RET_EILLACC = -5, /**< Illegal Access */
135 AUL_SVC_RET_ELAUNCH = -4, /**< Failure on launching the app */
136 AUL_SVC_RET_ENOMATCH = -3, /**< No matching result Error */
137 AUL_SVC_RET_EINVAL = -2, /**< Invalid argument */
138 AUL_SVC_RET_ERROR = -1, /**< General error */
139 AUL_SVC_RET_OK = 0, /**< General success */
140 } aul_svc_return_val;
144 * @brief result values in appsvc.
146 typedef enum _aul_svc_result_val {
147 AUL_SVC_RES_CANCEL = -2, /**< Cancel by system */
148 AUL_SVC_RES_NOT_OK = -1, /**< Fail by user */
149 AUL_SVC_RES_OK = 0 /**< Success by user */
150 } aul_svc_result_val;
154 * @brief aul_svc_res_fn is appsvc result function
155 * @param[out] b result bundle
156 * @param[out] request_code request code
157 * @param[out] result result value
158 * @param[out] data user-supplied data
160 typedef void (*aul_svc_res_fn)(bundle *b, int request_code, aul_svc_result_val result, void *data);
163 * @brief Called when the result of the launch request is delivered.
165 * @param[in] request_code The request code
166 * @param[in] result The result, the process ID of the callee on success otherwise a negative error value
167 * @param[in] user_data The user data passed from the callback registration function
169 typedef void (*aul_svc_err_cb)(int request_code, int result, void *user_data);
172 * @brief iterator function running with aul_svc_get_list
173 * @param[out] appid appid retreived by aul_svc_get_list
174 * @param[out] data user-supplied data
176 typedef int (*aul_svc_info_iter_fn)(const char *appid, void *data);
178 typedef int (*aul_svc_host_res_fn)(void *data);
182 * This function sets an operation to launch application based on appsvc.
184 * @param[in] b bundle object
185 * @param[in] operation operation
187 * @return 0 if success, negative value(<0) if fail
188 * @retval AUL_SVC_RET_OK - success
189 * @retval AUL_SVC_RET_ERROR - general error
190 * @retval AUL_SVC_RET_EINVAL - invalid argument(content)
195 * @remarks An application must call this function before using aul_svc_run_service API.
207 aul_svc_set_operation(b, AUL_SVC_OPERATION_VIEW);
212 int aul_svc_set_operation(bundle *b, const char *operation);
216 * This function sets an uri to launch application based on appsvc.
218 * @param[in] b bundle object
221 * @return 0 if success, negative value(<0) if fail
222 * @retval AUL_SVC_RET_OK - success
223 * @retval AUL_SVC_RET_ERROR - general error
224 * @retval AUL_SVC_RET_EINVAL - invalid argument(content)
241 aul_svc_set_operation(b, AUL_SVC_OPERATION_VIEW);
242 aul_svc_set_uri(b,"http://www.samsung.com");
247 int aul_svc_set_uri(bundle *b, const char *uri);
251 * This function sets a mime-type to launch application based on appsvc.
253 * @param[in] b bundle object
254 * @param[in] mime mime-type
256 * @return 0 if success, negative value(<0) if fail
257 * @retval AUL_SVC_RET_OK - success
258 * @retval AUL_SVC_RET_ERROR - general error
259 * @retval AUL_SVC_RET_EINVAL - invalid argument(content)
276 aul_svc_set_operation(b, AUL_SVC_OPERATION_PICK);
277 aul_svc_set_mime(b,"image/jpg");
282 int aul_svc_set_mime(bundle *b, const char *mime);
286 * This function sets an extra data to launch application based on appsvc.
288 * @param[in] b bundle object
289 * @param[in] key key of extra data
290 * @param[in] val data
292 * @return 0 if success, negative value(<0) if fail
309 aul_svc_set_operation(b, AUL_SVC_OPERATION_SEND);
310 aul_svc_set_uri(b,"mailto:xxx1@xxx");
311 aul_svc_add_data(b,AUL_SVC_DATA_CC,"xxx2@xxx");
316 int aul_svc_add_data(bundle *b, const char *key, const char *val);
320 * This function sets an extra array data to launch application based on appsvc.
322 * @param[in] b bundle object
323 * @param[in] key key of extra data
324 * @param[in] val_array data
325 * @param[in] len Length of array
327 * @return 0 if success, negative value(<0) if fail
341 char *images[] = {"/opt/media/a.jpg", "/opt/media/b.jpg", "/opt/media/c.jpg"};
345 aul_svc_add_data_array(b, AUL_SVC_DATA_SELECTED, images, 3);
350 int aul_svc_add_data_array(bundle *b, const char *key, const char **val_array, int len);
355 * This function sets a package name to launch application based on appsvc.
357 * @param[in] b bundle object
358 * @param[in] pkg_name package name for explict launch
360 * @return 0 if success, negative value(<0) if fail
361 * @retval AUL_SVC_RET_OK - success
362 * @retval AUL_SVC_RET_ERROR - general error
363 * @retval AUL_SVC_RET_EINVAL - invalid argument(content)
380 aul_svc_set_operation(b, AUL_SVC_OPERATION_PICK);
381 aul_svc_set_mime(b,"image/jpg");
382 aul_svc_set_pkgname(b, "org.tizen.mygallery");
388 int aul_svc_set_pkgname(bundle *b, const char *pkg_name); // __attribute__((deprecated));
393 * This function sets a appid to launch application based on appsvc.
395 * @param[in] b bundle object
396 * @param[in] appid application id for explict launch
398 * @return 0 if success, negative value(<0) if fail
399 * @retval AUL_SVC_RET_OK - success
400 * @retval AUL_SVC_RET_ERROR - general error
401 * @retval AUL_SVC_RET_EINVAL - invalid argument(content)
418 aul_svc_set_operation(b, AUL_SVC_OPERATION_PICK);
419 aul_svc_set_mime(b,"image/jpg");
420 aul_svc_set_appid(b, "org.tizen.mygallery");
425 int aul_svc_set_appid(bundle *b, const char *appid);
430 * This function sets a appid to launch application based on appsvc.
432 * @param[in] b bundle object
433 * @param[in] application category
435 * @return 0 if success, negative value(<0) if fail
436 * @retval AUL_SVC_RET_OK - success
437 * @retval AUL_SVC_RET_ERROR - general error
438 * @retval AUL_SVC_RET_EINVAL - invalid argument(content)
455 aul_svc_set_operation(b, AUL_SVC_OPERATION_VIEW);
456 aul_svc_set_category(b, "http://tizen.org/category/app/browser");
461 int aul_svc_set_category(bundle *b, const char *category);
465 * This API launch application based on appsvc.
467 * @param[in] b bundle to be passed to callee
468 * @param[in] request_code request code
469 * @param[in] cbfunc result callback function
470 * @param[in] data user-supplied data passed to callback function
472 * @return callee's pid if success, negative value(<0) if fail
473 * @retval callee's pid - success
474 * @retval AUL_SVC_RET_ERROR - general error
475 * @retval AUL_SVC_RET_EINVAL - invalid argument(content)
476 * @retval AUL_SVC_RET_ENOMATCH - no matching result Error
477 * @retval AUL_SVC_RET_ELAUNCH - failure on launching the app
495 aul_svc_set_operation(b, AUL_SVC_OPERATION_PICK);
496 aul_svc_set_mime(b,"image/jpg");
498 return aul_svc_run_service(b, 0, cb_func, (void*)NULL);
503 int aul_svc_run_service(bundle *b, int request_code, aul_svc_res_fn cbfunc, void *data);
504 int aul_svc_run_service_for_uid(bundle *b, int request_code,
505 aul_svc_res_fn cbfunc, void *data, uid_t uid);
509 * This API use to get application list that is matched with given bundle.
511 * @param[in] b bundle to resolve application
512 * @param[in] iter_fn iterator function
513 * @param[in] data user-supplied data for iter_fn
515 * @return 0 if success, negative value(<0) if fail
516 * @retval AUL_SVC_RET_OK - success
517 * @retval AUL_SVC_RET_EINVAL - invalid argument(content)
518 * @retval AUL_SVC_RET_ENOMATCH - no matching result Error
529 static int iter_fn(const char* appid, void *data)
531 printf("\t==========================\n");
532 printf("\t appid: %s\n", appid);
533 printf("\t==========================\n");
544 aul_svc_set_operation(b, AUL_SVC_OPERATION_PICK);
545 aul_svc_set_mime(b,"image/jpg");
547 return aul_svc_get_list(b, iter_fn, (void*)NULL);
552 int aul_svc_get_list(bundle *b, aul_svc_info_iter_fn iter_fn, void *data);
553 int aul_svc_get_list_for_uid(bundle *b, aul_svc_info_iter_fn iter_fn,
554 void *data, uid_t uid);
558 * This API use to get default applications
560 * @param[in] iter_fn iterator function
561 * @param[in] data user-supplied data for iter_fn
563 * @return 0 if success, negative value(<0) if fail
564 * @retval AUL_SVC_RET_OK - success
565 * @retval AUL_SVC_RET_EINVAL - invalid argument(content)
566 * @retval AUL_SVC_RET_ENOMATCH - no matching result Error
577 static int iter_fn(const char* appid, void *data)
579 printf("\t==========================\n");
580 printf("\t appid : %s\n", appid);
581 printf("\t==========================\n");
587 return aul_svc_get_all_defapps(iter_fn, (void*)NULL);
592 int aul_svc_get_all_defapps(aul_svc_info_iter_fn iter_fn, void *data);
593 int aul_svc_get_all_defapps_for_uid(aul_svc_info_iter_fn iter_fn,
594 void *data, uid_t uid);
598 * This function gets a operation from bundle.
600 * @param[in] b bundle object
602 * @return Pointer for operation string if success, NULL if fail
616 val = aul_svc_get_operation(b);
621 const char *aul_svc_get_operation(bundle *b);
625 * This function gets a uri from bundle.
627 * @param[in] b bundle object
629 * @return Pointer for uri string if success, NULL if fail
643 val = aul_svc_get_uri(b);
648 const char *aul_svc_get_uri(bundle *b);
652 * This function gets a mime-type from bundle.
654 * @param[in] b bundle object
656 * @return Pointer for mime-type string if success, NULL if fail
670 val = aul_svc_get_mime(b);
675 const char *aul_svc_get_mime(bundle *b);
679 * This function gets a package name from bundle.
681 * @param[in] b bundle object
683 * @return Pointer for package name string if success, NULL if fail
697 val = aul_svc_get_pkgname(b);
703 const char *aul_svc_get_pkgname(bundle *b); // __attribute__((deprecated));
707 * This function gets a application id from bundle.
709 * @param[in] b bundle object
711 * @return Pointer for application id string if success, NULL if fail
725 val = aul_svc_get_appid(b);
730 const char *aul_svc_get_appid(bundle *b);
734 * This function gets a application category from bundle.
736 * @param[in] b bundle object
738 * @return Pointer for application category string if success, NULL if fail
752 val = aul_svc_get_category(b);
757 const char *aul_svc_get_category(bundle *b);
761 * This function gets value from key.
763 * @param[in] b bundle object
766 * @return Pointer for value string if success, NULL if fail
780 val = aul_svc_get_data(b, AUL_SVC_DATA_CC);
785 const char *aul_svc_get_data(bundle *b, const char *key);
789 * This function gets value from key.
791 * @param[in] b bundle object
793 * @param[out] len length of array
795 * @return Pointer for value string array if success, NULL if fail
812 if(aul_svc_data_is_array(b, AUL_SVC_DATA_SELECTED))
813 val_array = aul_svc_get_data_array(b, AUL_SVC_DATA_SELECTED, &len);
815 val = aul_svc_get_data(b, AUL_SVC_DATA_SELECTED);
820 const char **aul_svc_get_data_array(bundle *b, const char *key, int *len);
824 * This API create appsvc result bundle based on bundle received in reset event.
826 * @param[in] inb bundle received in reset event
827 * @param[in] outb bundle to use for returning result
829 * @retval AUL_SVC_RET_OK - success
830 * @retval AUL_SVC_RET_ERROR - general error
831 * @retval AUL_SVC_RET_EINVAL - invalid argument(content)
835 * @see aul_svc_send_result.
844 struct appdata *ad = data;
847 aul_svc_create_result_bundle(ad->b,&res_bundle);
848 bundle_add(res_bundle, "result", "1");
849 aul_svc_send_result(res_bundle, 0);
854 int aul_svc_create_result_bundle(bundle *inb, bundle **outb);
858 * This API send appsvc result to caller with bundle.
860 * @param[in] b Result data in bundle format
861 * @param[in] result result value
863 * @retval AUL_SVC_RET_OK - success
864 * @retval AUL_SVC_RET_ERROR - general error
865 * @retval AUL_SVC_RET_EINVAL - invalid argument(content)
867 * @pre aul_svc_create_result_bundle.
869 * @see aul_svc_send_result.
878 struct appdata *ad = data;
881 aul_svc_create_result_bundle(ad->b,&res_bundle);
882 bundle_add(res_bundle, "result", "1");
883 aul_svc_send_result(res_bundle, 0);
888 int aul_svc_send_result(bundle *b, aul_svc_result_val result);
892 * This API ask a extra data is array or not.
894 * @param[in] b bundle object
895 * @param[in] key key of extra data
896 * @return true / false
897 * @retval 1 a extra data is array.
898 * @retval 0 a extra data is not array.
911 * int aul_svc_data_is_array(bundle *b, char *key)
913 * return aul_svc_data_is_array(b, key);
921 int aul_svc_data_is_array(bundle *b, const char *key);
923 int aul_svc_subapp_terminate_request_pid(int pid);
927 * This function sets an uri to launch application based on appsvc.
929 * @param[in] b bundle object
930 * @param[in] char *mode
932 * @return 0 if success, negative value(<0) if fail
933 * @retval AUL_SVC_RET_OK - success
934 * @retval AUL_SVC_RET_ERROR - general error
935 * @retval AUL_SVC_RET_EINVAL - invalid argument(content)
948 aul_svc_set_launch_mode(app_control->data, mode);
953 int aul_svc_set_launch_mode(bundle *b, const char *mode);
957 * This function sets an uri to launch application based on appsvc.
959 * @param[in] b bundle object
961 * @return Pointer for launch mode string if success, NULL if fail
974 aul_svc_get_launch_mode(app_control->data);
979 const char *aul_svc_get_launch_mode(bundle *b);
981 int aul_svc_allow_transient_app(bundle *b, int wid);
983 int aul_svc_request_transient_app(bundle *b, int callee_wid,
984 aul_svc_host_res_fn cbfunc, void *data);
986 int aul_svc_subscribe_launch_result(bundle *b, const char *event);
990 * This function sets loader ID into bundle.
992 * @param[in] b Bundle object
993 * @param[in] loader_id Loader ID from aul_add_loader() or PAD_LOADER_ID_DIRECT to launch apps without loader
995 * @return 0 if success, negative value(<0) if fail
996 * @see aul_add_loader, aul_remove_loader
997 * @remarks This API is only for Appfw internally.
999 int aul_svc_set_loader_id(bundle *b, int loader_id);
1003 * This function sets loader name into bundle. Launchpad will assign a static slot to launch an app.
1005 * @param[in] b Bundle object
1006 * @param[in] loader_name Loader name to assign
1008 * @return 0 if success, negative value(<0) if fail
1009 * @remarks This API is only for Appfw internally.
1011 int aul_svc_set_loader_name(bundle *b, const char *loader_name);
1015 * This API sets the background launch mode.
1016 * If the background launch mode is enabled, a window of the callee process doesn't appear on the screen.
1018 * @param[in] b Bundle object
1019 * @param[in] enabled boolean (true / false)
1021 * @return 0 if success, negative value(<0) if fail
1022 * @remarks This API is only for Appfw internally.
1024 int aul_svc_set_background_launch(bundle *b, int enabled);
1028 * This API gets an application ID by an alias application ID.
1030 * @param[in] alias_appid An alias application ID
1031 * @param[out] appid An application ID
1033 * @return 0 if success, negative value(<0) if fail
1035 int aul_svc_get_appid_by_alias_appid(const char *alias_appid, char **appid);
1036 int aul_svc_get_appid_by_alias_appid_for_uid(const char *alias_appid,
1037 char **appid, uid_t uid);
1041 * Gets the instance ID.
1043 * @param[in] b Bundle object
1045 * @return Pointer for application id string if success, NULL if fail
1047 const char *aul_svc_get_instance_id(bundle *b);
1051 * Sets the instance ID.
1053 * @param[in] b Bundle object
1054 * @param[in] instance ID Instance ID
1056 * @return 0 if success, negative value(<0) if fail
1058 int aul_svc_set_instance_id(bundle *b, const char *instance_id);
1062 * Sends the launch request asynchronous.
1064 * @param[in] b Bundle object
1065 * @param[in] request_code Request Code
1066 * @param[in] cbfunc Callback function
1067 * @param[in] data User data
1069 * @return a pid of the callee on success,
1070 * otherwise a negative error value
1072 int aul_svc_run_service_async(bundle *b, int request_code,
1073 aul_svc_res_fn cbfunc, void *data);
1074 int aul_svc_run_service_async_for_uid(bundle *b, int request_code,
1075 aul_svc_res_fn cbfunc, void *data, uid_t uid);
1079 * @brief Sends the launch request asynchronous.
1081 * @param[in] b The bundle object
1082 * @param[in] request_code The request code
1083 * @param[in] cbfunc The reply callback function
1084 * @param[in] err_cb The result callback function
1085 * @param[in] user_data The user data to be passed to the callback function
1087 * @return a pid of the callee on success,
1088 * otherwise a negative error value
1090 int aul_svc_send_launch_request(bundle *b, int request_code,
1091 aul_svc_res_fn cbfunc, aul_svc_err_cb err_cb,
1095 * @brief Sends the launch request asynchronous.
1097 * @param[in] b The bundle object
1098 * @param[in] request_code The request code
1099 * @param[in] cbfunc The reply callback function
1100 * @param[in] err_cb The result callback function
1101 * @param[in] user_data The user data to be passed to the callback function
1102 * @param[in] uid The user ID
1104 * @return a pid of the callee on success,
1105 * otherwise a negative error value
1107 int aul_svc_send_launch_request_for_uid(bundle *b, int request_code,
1108 aul_svc_res_fn cbfunc, aul_svc_err_cb err_cb,
1109 void *user_data, uid_t uid);
1112 * @brief Sends the launch request synchronous.
1114 * @param[in] b The bundle object
1115 * @param[in] request_code The request code
1116 * @param[out] res_b The bundle object
1117 * @param[out] res The result
1118 * @param[in] uid The user ID
1120 * @return a pid of the callee on success,
1121 * otherwise a negative error value
1123 int aul_svc_send_launch_request_sync_for_uid(bundle *b, int request_code,
1124 bundle **res_b, aul_svc_result_val *res, uid_t uid);
1127 * @brief Sets the ID of the caller instance.
1130 * @param[in] b The bundle object
1131 * @param[in] instance_id The ID of the caller instance
1133 * @return @c 0 on success,
1134 * otherwise a negative error value
1136 int aul_svc_set_caller_instance_id(bundle *b, const char *instance_id);
1139 * @brief Sets the ID of the component.
1142 * @param[in] b The bundle object
1143 * @param[in] comp_id The ID of the component
1145 * @return @c 0 on success,
1146 * otherwise a negative error value
1148 int aul_svc_set_comp_id(bundle *b, const char *comp_id);
1151 * @brief Gets the ID of the component.
1154 * @param[in] b The bundle object
1156 * @return @c a component ID on success,
1157 * otherwise a nullptr
1159 const char *aul_svc_get_comp_id(bundle *b);
1162 * This API is only for App Framework internally.
1164 int aul_svc_subapp_terminate_request(bundle *b, int pid);
1167 * @brief Sends the resumption request asynchronoulsy.
1170 * @param[in] b The bundle object
1171 * @param[in] request code The request code
1172 * @param[in] err_cb The result callback function
1173 * @param[in] user_data The user data to be passed to the callback function
1175 * @return @c 0 on success,
1176 * otherwise a negative error value
1178 int aul_svc_send_resume_request(bundle *b, int request_code,
1179 aul_svc_err_cb err_cb, void *user_data);
1180 int aul_svc_send_resume_request_for_uid(bundle *b, int request_code,
1181 aul_svc_err_cb err_cb, void *user_data, uid_t uid);
1185 * This function sets window position into bundle.
1187 * @param[in] b Bundle object
1188 * @param[in] x x position of window
1189 * @param[in] y y position of window
1190 * @param[in] w width of window
1191 * @param[in] h height of window
1193 * @return 0 if success, negative value(<0) if fail
1194 * @see aul_svc_get_window_position
1195 * @remarks This API is only for Appfw internally.
1197 int aul_svc_set_window_position(bundle *b, int x, int y, int w, int h);
1201 * This function gets window position into bundle.
1203 * @param[in] b Bundle object
1204 * @param[out] x x position of window
1205 * @param[out] y y position of window
1206 * @param[out] w width of window
1207 * @param[out] h height of window
1209 * @return 0 if success, negative value(<0) if fail
1210 * @see aul_svc_set_window_position
1211 * @remarks This API is only for Appfw internally.
1213 int aul_svc_get_window_position(bundle* b, int *x, int *y, int *w, int *h);
1216 * @deprecated Deprecated since 6.5.
1218 int aul_svc_set_defapp(const char *op, const char *mime_type,
1219 const char *uri, const char *defapp) AUL_DEPRECATED_API;
1220 int aul_svc_set_defapp_for_uid(const char *op, const char *mime_type,
1221 const char *uri, const char *defapp, uid_t uid) AUL_DEPRECATED_API;
1224 * @deprecated Deprecated since 6.5.
1226 int aul_svc_unset_defapp(const char *defapp) AUL_DEPRECATED_API;
1227 int aul_svc_unset_defapp_for_uid(const char *defapp, uid_t uid) AUL_DEPRECATED_API;
1230 * @deprecated Deprecated since 6.5.
1232 int aul_svc_unset_all_defapps(void) AUL_DEPRECATED_API;
1233 int aul_svc_unset_all_defapps_for_uid(uid_t uid) AUL_DEPRECATED_API;
1236 * @deprecated Deprecated since 6.5
1238 int aul_svc_is_defapp(const char *appid) AUL_DEPRECATED_API;
1239 int aul_svc_is_defapp_for_uid(const char *pkg_name, uid_t uid) AUL_DEPRECATED_API;
1242 * @deprecated Deprecated since 6.5.
1244 int aul_svc_set_alias_appid(const char *alias_appid, const char *appid) AUL_DEPRECATED_API;
1245 int aul_svc_set_alias_appid_for_uid(const char *alias_appid, const char *appid,
1246 uid_t uid) AUL_DEPRECATED_API;
1249 * @deprecated Deprecated since 6.5.
1251 int aul_svc_unset_alias_appid(const char *alias_appid) AUL_DEPRECATED_API;
1252 int aul_svc_unset_alias_appid_for_uid(const char *alias_appid, uid_t uid) AUL_DEPRECATED_API;
1255 * @deprecated Deprecated since 6.5.
1257 int aul_svc_foreach_alias_info(
1258 void (*callback)(const char *, const char *, void *),
1259 void *user_data) AUL_DEPRECATED_API;
1260 int aul_svc_foreach_alias_info_for_uid(
1261 void (*callback)(const char *, const char *, void *),
1262 uid_t uid, void *user_data) AUL_DEPRECATED_API;
1265 * @deprecated Deprecated since 6.5.
1267 int aul_svc_enable_alias_info(const char *appid) AUL_DEPRECATED_API;
1268 int aul_svc_enable_alias_info_for_uid(const char *appid, uid_t uid) AUL_DEPRECATED_API;
1271 * @deprecated Deprecated since 6.5.
1273 int aul_svc_disable_alias_info(const char *appid) AUL_DEPRECATED_API;
1274 int aul_svc_disable_alias_info_for_uid(const char *appid, uid_t uid) AUL_DEPRECATED_API;
1277 * @deprecated Deprecated since 6.5.
1279 int aul_svc_foreach_alias_info_by_appid(
1280 int (*callback)(const char *, const char *, void *),
1281 const char *appid, void *user_data) AUL_DEPRECATED_API;
1282 int aul_svc_foreach_alias_info_by_appid_for_uid(
1283 int (*callback)(const char *, const char *, void *),
1284 const char *appid, uid_t uid, void *user_data) AUL_DEPRECATED_API;
1287 * @deprecated Deprecated since 6.5.
1289 int aul_svc_foreach_allowed_info(
1290 int (*callback)(const char *, const char *, void *),
1291 void *user_data) AUL_DEPRECATED_API;
1292 int aul_svc_foreach_allowed_info_for_uid(
1293 int (*callback)(const char *, const char *, void *),
1294 uid_t uid, void *user_data) AUL_DEPRECATED_API;
1297 * @deprecated Deprecated since 6.5
1299 int aul_svc_foreach_allowed_info_by_appid(
1300 int (*callback)(const char *, const char *, void *),
1301 const char *appid, void *user_data) AUL_DEPRECATED_API;
1302 int aul_svc_foreach_allowed_info_by_appid_for_uid(
1303 int (*callback)(const char *, const char *, void *),
1304 const char *appid, uid_t uid, void *user_data) AUL_DEPRECATED_API;