app_control_reply_cb reply_cb;
void *user_data;
char callee[255] = {0, };
- char instance_id[256] = {0,};
int ret;
if (data == NULL)
ret = aul_app_get_appid_bypid(launched_pid, callee, sizeof(callee));
if (ret < 0)
LOGE("aul_app_get_appid_bypid failed: %d", launched_pid);
+ else
+ app_control_set_app_id(reply, callee);
- app_control_set_app_id(reply, callee);
LOGI("app control async result callback callee pid:%d", launched_pid);
- ret = aul_app_get_instance_id_bypid(launched_pid, instance_id,
- sizeof(instance_id));
- if (ret == AUL_R_OK) {
- app_control_set_instance_id(reply, instance_id);
- LOGI("instance id(%s)", instance_id);
- }
-
result = APP_CONTROL_RESULT_APP_STARTED;
request = request_context->app_control;
user_data = request_context->user_data;
return APP_CONTROL_ERROR_NONE;
}
+static void __copy_callee_info(app_control_h dst, app_control_h src)
+{
+ const char *id;
+
+ if (!dst || !src)
+ return;
+
+ id = bundle_get_val(src->data, AUL_K_APPID);
+ if (id) {
+ bundle_del(dst->data, AUL_K_APPID);
+ bundle_add(dst->data, AUL_K_APPID, id);
+ }
+
+ id = bundle_get_val(src->data, AUL_K_INSTANCE_ID);
+ if (id) {
+ bundle_del(dst->data, AUL_K_INSTANCE_ID);
+ bundle_add(dst->data, AUL_K_INSTANCE_ID, id);
+ }
+}
+
static int __launch_request_complete(struct launch_request_s *req)
{
app_control_h app_control = req->app_control;
app_control_request_context_h request_context = req->request_context;
+ if (request_context)
+ __copy_callee_info(request_context->app_control, app_control);
+
if (req->result_cb)
return APP_CONTROL_ERROR_NONE;
if (app_control->type != APP_CONTROL_TYPE_REQUEST || app_control->launch_pid < 0)
return app_control_error(APP_CONTROL_ERROR_INVALID_PARAMETER, __FUNCTION__, NULL);
- aul_svc_subapp_terminate_request_pid(app_control->launch_pid);
+ aul_svc_subapp_terminate_request(app_control->data,
+ app_control->launch_pid);
return APP_CONTROL_ERROR_NONE;
}