#include "aul_svc.h"
#include "aul_svc_priv_key.h"
#include "aul_util.h"
+#include "cpu_inheritance.hh"
#include "launch.h"
using namespace aul::internal;
public:
ErrorInfo(std::string seq_num, tizen_base::Bundle b, int cmd,
ErrCb error_cb, void* user_data)
- : seq_num_(std::move(seq_num)), b_(std::move(b)), cmd_(cmd),
- error_cb_(std::move(error_cb)), user_data_(user_data) {
+ : seq_num_(std::move(seq_num)),
+ b_(std::move(b)), cmd_(cmd),
+ error_cb_(std::move(error_cb)),
+ user_data_(user_data) {
}
ErrorInfo(const ErrorInfo&) = delete;
int cmd_;
ErrCb error_cb_;
void* user_data_;
+ CPUInheritance inheritance_;
};
std::string __gen_seq_num() {
- static std::atomic<int> num;
- char buf[MAX_LOCAL_BUFSZ];
-
- int n = num.fetch_add(1);
- unsigned int seed = static_cast<unsigned int>(time(nullptr) + n);
- snprintf(buf, sizeof(buf), "%d@%d", rand_r(&seed), n);
-
- return buf;
+ char uuid[37];
+ uuid_t u;
+ uuid_generate(u);
+ uuid_unparse(u, uuid);
+ return std::string(uuid);
}
int __get_caller_pid(const tizen_base::Bundle& b) {
int ret = aul_sock_recv_reply_pkt(fd, &pkt);
if (ret != 0) {
_E("Failed to receive the packet. result(%d)", ret);
+ if (ret == -EAGAIN)
+ return AUL_R_ETIMEOUT;
+
return AUL_R_ECOMM;
}
ret = pkt_auto->cmd;
if (ret < 0) {
_E("The launch request is failed. result(%d)", ret);
+ if (ret == -EAGAIN)
+ return AUL_R_ETIMEOUT;
+
return AUL_R_ERROR;
}
}
extern "C" 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) {
+ bundle* b, uid_t uid, aul_reply_cb reply_cb,
+ aul_result_cb result_cb, void* user_data) {
return __send_request_with_callback(APP_SEND_LAUNCH_REQUEST, appid, b,
- uid, reply_cb, error_cb, user_data);
+ uid, reply_cb, result_cb, user_data);
}
-extern "C" API int aul_send_launch_request_sync_for_uid(const char* appid,
+extern "C" API int aul_send_launch_request_sync_for_uid(const char* appid,
bundle* b, uid_t uid, bundle** res_b) {
if (!aul_is_initialized()) {
if (aul_launch_init(nullptr, nullptr) < 0) {