#include <bundle_cpp.h>
#include <bundle_internal.h>
#include <dlfcn.h>
-#include <glib.h>
#include <launchpad.h>
#include <linux/limits.h>
#include <stdint.h>
_E("Plugin::PrepareApp() is failed. error(%d)", ret);
_exit(EXIT_FAILURE);
}
-
- g_idle_add([](gpointer data) {
- launchpad_loader_create_ready_file();
- return G_SOURCE_REMOVE;
- }, nullptr);
}
static int OnLaunch(int argc, char** argv, const char* app_path,
#include "launchpad-loader/launchpad_loader.hh"
#include <dlfcn.h>
-#include <glib.h>
#include <aul_keys.hh>
#include <procfs.hh>
InitializeElementary();
hw_acc_config_.reset(new launchpad::HWAccelerationConfig());
- g_idle_add([](gpointer user_data) {
- launchpad_loader_create_ready_file();
- return G_SOURCE_REMOVE;
- }, nullptr);
}
int LaunchpadLoader::OnLaunch(const LaunchArgs& args) {
#include <sstream>
#include <utility>
-#include <aul_keys.hh>
-
#include "launchpad-process-pool/log_private.hh"
#include "launchpad-process-pool/util.hh"
on_boot_timeout_(on_boot_timeout),
sched_priority_(sched_priority),
condition_path_exists_(std::move(condition_path_exists)) {
- extra_.Add(kAulLoaderName, name_);
}
LoaderType LoaderInfo::GetType() const {
* @brief Blocks all sub threads of the loader.
* @remarks This function has to be called in the main thread.
*
- * @return @c 0 on success,
+ * @return @c on success,
* otherwise a negative error value
*
* @see #launchpad_loader_unblock_threads()
* @brief Unblocks all sub threads of the loader.
* @remarks This function has to be called in the main thread.
*
- * @return @c 0 on success,
+ * @return @c on success,
* otherwise a negative error value
* @see #launchpad_loader_block_threads()
*/
int launchpad_loader_unblock_threads(void);
-/**
- * @brief Creates a ready file.
- * @details This function creates a ready file.
- * The path of the ready file is "/run/user/<uid>/.<loader_name>.ready".
- *
- * @return @c 0 on success,
- * otherwise a negative error value
- */
-int launchpad_loader_create_ready_file(void);
-
#ifdef __cplusplus
}
#endif
#include <sys/types.h>
#include <unistd.h>
-#include <filesystem>
-#include <fstream>
-#include <iostream>
#include <memory>
#include <app_info.hh>
-#include <aul_keys.hh>
#include <client_socket.hh>
#include <exception.hh>
#include <parcel.hh>
#include <sched_priority.hh>
#include <socket.hh>
-#include <types.hh>
#include <util.hh>
+#include <types.hh>
#include "launchpad/log_private.hh"
#include "launchpad/step_prepare_execution.hh"
return app_info_.GetBundle();
}
-const std::string& LaunchpadLoader::GetLoaderName() const {
- return loader_name_;
-}
-
void LaunchpadLoader::ResetArgs() {
memset(argv_[LoaderArg::Type], 0, strlen(argv_[LoaderArg::Type]));
memset(argv_[LoaderArg::Id], 0, strlen(argv_[LoaderArg::Id]));
threads = std::stoi(threads_str);
}
- loader_name_ = extra.GetString(kAulLoaderName);
- if (!loader_name_.empty())
- _W("name: %s", loader_name_.c_str());
-
callback_.create(extra.GetHandle(), loader_type_, user_data_);
aul_launch_worker_init();
WaitForThreads(threads);
extern "C" EXPORT_API int launchpad_loader_unblock_threads(void) {
return ThreadControl::GetInst().UnblockThreads();
}
-
-extern "C" EXPORT_API int launchpad_loader_create_ready_file(void) {
- if (!::context)
- return -1;
-
- std::string path = "/run/user/" + std::to_string(getuid()) + "/." +
- ::context->GetLoaderName() + ".ready";
- std::filesystem::path file_path(path);
- if (std::filesystem::exists(file_path)) {
- _D("Already exists. path(%s)", path.c_str());
- return 0;
- }
-
- std::ofstream file_stream(file_path);
- if (!file_stream.is_open()) {
- _E("Failed to create the file. path(%s)", path.c_str());
- return -1;
- }
-
- file_stream.close();
- _W("File(%s) created successfully", path.c_str());
- return 0;
-}
void* user_data);
void Quit();
const tizen_base::Bundle& GetBundle() const;
- const std::string& GetLoaderName() const;
private:
void WaitForThreads(int threads);
char** argv_;
int loader_type_;
int loader_id_;
- std::string loader_name_;
loader_lifecycle_callback_s callback_ = { nullptr, };
loader_adapter_s adapter_callback_ = { nullptr, };
void* user_data_ = nullptr;