Revert "Create ready files of loader process" 31/297331/1
authorHwankyu Jhun <h.jhun@samsung.com>
Thu, 17 Aug 2023 03:57:54 +0000 (12:57 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Thu, 17 Aug 2023 03:57:59 +0000 (12:57 +0900)
This reverts commit 78f5909518b8e89f5a45e68d0e482352ac503289.

Change-Id: I54e852a6f3f54f2b2c207bd6ad763d60c00d48d3

src/app-defined-loader/app-defined-loader.cc
src/launchpad-loader/launchpad_loader.cc
src/launchpad-process-pool/loader_info.cc
src/lib/launchpad/inc/launchpad.h
src/lib/launchpad/launchpad_loader.cc
src/lib/launchpad/launchpad_loader.hh

index 5c8ebef..57e7ffd 100644 (file)
@@ -18,7 +18,6 @@
 #include <bundle_cpp.h>
 #include <bundle_internal.h>
 #include <dlfcn.h>
-#include <glib.h>
 #include <launchpad.h>
 #include <linux/limits.h>
 #include <stdint.h>
@@ -157,11 +156,6 @@ class AppDefinedLoader {
       _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,
index 2cae7ac..cc62aa1 100644 (file)
@@ -17,7 +17,6 @@
 #include "launchpad-loader/launchpad_loader.hh"
 
 #include <dlfcn.h>
-#include <glib.h>
 
 #include <aul_keys.hh>
 #include <procfs.hh>
@@ -175,10 +174,6 @@ void LaunchpadLoader::OnCreate(const tizen_base::Bundle& extra, int type) {
   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) {
index 4640a0d..df00c5c 100644 (file)
@@ -27,8 +27,6 @@
 #include <sstream>
 #include <utility>
 
-#include <aul_keys.hh>
-
 #include "launchpad-process-pool/log_private.hh"
 #include "launchpad-process-pool/util.hh"
 
@@ -280,7 +278,6 @@ LoaderInfo::LoaderInfo(LoaderType type, std::string name, std::string exe,
       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 {
index d95d624..b7d6c21 100644 (file)
@@ -85,7 +85,7 @@ bundle *launchpad_loader_get_bundle(void);
  * @brief Blocks all sub threads of the loader.
  * @remarks This function has to be called in the main thread.
  *
- * @return @c on success,
+ * @return @c on success,
  *         otherwise a negative error value
  *
  * @see #launchpad_loader_unblock_threads()
@@ -96,22 +96,12 @@ int launchpad_loader_block_threads(void);
  * @brief Unblocks all sub threads of the loader.
  * @remarks This function has to be called in the main thread.
  *
- * @return @c 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
index f967ea6..e7d733c 100644 (file)
 #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"
@@ -126,10 +122,6 @@ const tizen_base::Bundle& LaunchpadLoader::GetBundle() const {
   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]));
@@ -193,10 +185,6 @@ bool LaunchpadLoader::OnCreate() {
     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);
@@ -396,26 +384,3 @@ extern "C" EXPORT_API int launchpad_loader_block_threads(void) {
 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;
-}
index 4277d3a..8f44252 100644 (file)
@@ -41,7 +41,6 @@ class LaunchpadLoader {
       void* user_data);
   void Quit();
   const tizen_base::Bundle& GetBundle() const;
-  const std::string& GetLoaderName() const;
 
  private:
   void WaitForThreads(int threads);
@@ -69,7 +68,6 @@ class LaunchpadLoader {
   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;