APP_GET_RUNNING_CONTEXT = 136,
LAUNCHER_SERVICE_NOTIFY_ANIMATION_STARTED = 137,
LAUNCHER_SERVICE_NOTIFY_ANIMATION_FINISHED = 138,
+ APP_SEND_RESUME_REQUEST = 139,
APP_CMD_MAX
};
*/
int aul_svc_subapp_terminate_request(bundle *b, int pid);
+/**
+ * @brief Sends the resumption request asynchronoulsy.
+ * @since_tizen 5.5
+ *
+ * @param[in] b The bundle object
+ * @param[in] request code The request code
+ * @param[in] err_cb The result callback function
+ * @param[in] user_data The user data to be passed to the callback function
+ *
+ * @return @c 0 on success,
+ * otherwise a negative error value
+ */
+int aul_svc_send_resume_request(bundle *b, int request_code,
+ aul_svc_err_cb err_cb, void *user_data);
+int aul_svc_send_resume_request_for_uid(bundle *b, int request_code,
+ aul_svc_err_cb err_cb, void *user_data, uid_t uid);
+
#ifdef __cplusplus
}
#endif
uid_t uid, bundle **res_b);
int app_request_local(int cmd, bundle *kb);
int aul_subapp_terminate_request(const char *instance_id, int pid);
+int aul_send_resume_request_for_uid(const char *appid, bundle *b, uid_t uid,
+ void (*error_cb)(int, void *), void *user_data);
return "LAUNCHER_SERVICE_NOTIFY_ANIMATION_STARTED";
case LAUNCHER_SERVICE_NOTIFY_ANIMATION_FINISHED:
return "LAUNCHER_SERVICE_NOTIFY_ANIMATION_FINISHED";
+ case APP_SEND_RESUME_REQUEST:
+ return "APP_SEND_RESUME_REQUEST";
default:
return "CUSTOM_COMMAND";
}
case APP_RESUME:
case APP_RESUME_BY_PID:
case APP_RESUME_BY_PID_ASYNC:
+ case APP_SEND_RESUME_REQUEST:
return aul_resume_local();
default:
_E("no support packet");
break;
case APP_SEND_LAUNCH_REQUEST:
case APP_SEND_LAUNCH_REQUEST_SYNC:
+ case APP_SEND_RESUME_REQUEST:
ret = __send_cmd_async_for_uid_opt(AUL_UTIL_PID,
uid, cmd, kb, AUL_SOCK_QUEUE);
break;
#include "aul.h"
#include "aul_api.h"
+#include "aul_error.h"
#include "aul_sock.h"
-#include "aul_util.h"
#include "aul_svc.h"
-#include "aul_error.h"
+#include "aul_util.h"
#include "launch.h"
typedef struct _aul_error_info_t {
return 0;
}
-API int aul_send_launch_request_for_uid(const char *appid, bundle *b, uid_t uid,
+static int __send_request_with_callback(int cmd, const char *appid, bundle *b,
+ uid_t uid,
void (*reply_cb)(bundle *b, int, void *),
void (*error_cb)(int, void *),
void *user_data)
__push_aul_reply_info(r_info);
}
- fd = app_request_to_launchpad_for_uid(APP_SEND_LAUNCH_REQUEST,
+ fd = app_request_to_launchpad_for_uid(cmd,
appid, b, uid);
if (fd < 0 || fd > sysconf(_SC_OPEN_MAX)) {
_E("Failed to send launch request. appid(%s), result(%d)",
return AUL_R_ECOMM;
}
- info = __create_aul_error_info(seq_num ,b, APP_SEND_LAUNCH_REQUEST,
+ info = __create_aul_error_info(seq_num ,b, cmd,
error_cb, user_data);
if (!info) {
_E("Failed to create error info");
return AUL_R_OK;
}
+API int aul_send_launch_request_for_uid(const char *appid, bundle *b, uid_t uid,
+ void (*reply_cb)(bundle *, int, void *),
+ void (*error_cb)(int, void *),
+ void *user_data)
+{
+ int ret;
+
+ ret = __send_request_with_callback(APP_SEND_LAUNCH_REQUEST, appid, b,
+ uid, reply_cb, error_cb, user_data);
+
+ return ret;
+}
+
static int __send_launch_request(const char *appid, bundle *b, uid_t uid)
{
char *seq_num;
return __recv_reply_bundle(fd, res_b);
}
+
+API int aul_send_resume_request_for_uid(const char *appid, bundle *b, uid_t uid,
+ void (*error_cb)(int, void *), void *user_data)
+{
+ int ret;
+
+ ret = __send_request_with_callback(APP_SEND_RESUME_REQUEST, appid, b,
+ uid, NULL, error_cb, user_data);
+
+ return ret;
+}
return aul_app_group_clear_top();
}
+
+API int aul_svc_send_resume_request(bundle *b, int request_code,
+ aul_svc_err_cb err_cb, void *user_data)
+{
+ int ret;
+
+ ret = aul_svc_send_resume_request_for_uid(b, request_code,
+ err_cb, user_data, getuid());
+ return ret;
+}
+
+API int aul_svc_send_resume_request_for_uid(bundle *b, int request_code,
+ aul_svc_err_cb err_cb, void *user_data, uid_t uid)
+{
+ aul_svc_cb_info_t *cb_info;
+ char *appid = NULL;
+ int ret;
+
+ if (!b || !err_cb) {
+ _E("Invalid parameter");
+ return AUL_SVC_RET_EINVAL;
+ }
+
+ ret = __get_appid(b, uid, &appid);
+ if (ret != AUL_SVC_RET_OK) {
+ _E("Failed to get appid");
+ return ret;
+ }
+
+ cb_info = __create_rescb(request_code, NULL, err_cb, user_data);
+ ret = aul_send_resume_request_for_uid(appid, b, uid, __aul_error_cb,
+ cb_info);
+ if (ret < 0) {
+ __remove_rescb(cb_info);
+ ret = __error_convert(ret);
+ }
+ free(appid);
+
+ return ret;
+}