Modify app-defined-loader for linux container
authorHwankyu Jhun <h.jhun@samsung.com>
Wed, 3 May 2023 06:57:40 +0000 (06:57 +0000)
committerHwankyu Jhun <h.jhun@samsung.com>
Wed, 10 May 2023 00:15:49 +0000 (00:15 +0000)
Some product developer wants to use the app-defined-loader for executing
an application which will be attached to the linux container.
This patch adds the plugin function call while calling the OnCreate() method.

Change-Id: Ied702faffcc6097b22f71646ee1a21f318b5ab31
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
src/app-defined-loader/src/app-defined-loader.cc

index f0f42bc7654ff067bbfd245ebf448cc86751cf6e..2a5f1e2ba7495a4cc45996ae20facf96242545ec 100644 (file)
  */
 
 #include <Ecore.h>
+#include <bundle_cpp.h>
 #include <bundle_internal.h>
 #include <dlfcn.h>
+#include <launchpad.h>
 #include <linux/limits.h>
 #include <stdint.h>
 #include <stdio.h>
 #include <sys/prctl.h>
 
-#include <bundle_cpp.h>
-
 #include <memory>
 #include <vector>
 
+#include "config.hh"
 #include "key.h"
-#include "launchpad.h"
 #include "launchpad_common.h"
+#include "launchpad_plugin.h"
 #include "launchpad_types.h"
-
-#include "config.hh"
 #include "log-private.hh"
 #include "proc.hh"
 
@@ -126,6 +125,12 @@ class AppDefinedLoader {
 
   static void OnCreate(bundle* extra, int type, void* user_data) {
     _I("on create");
+    int ret = _launchpad_plugin_prepare_app(nullptr, extra);
+    if (ret != 0) {
+      _E("_launchpad_plugin_prepare_app() is failed. error(%d)", ret);
+      exit(EXIT_FAILURE);
+    }
+
     AppDefinedLoader* loader = static_cast<AppDefinedLoader*>(user_data);
     tizen_base::Bundle ex = tizen_base::Bundle(extra, false, false);
     std::string loader_type = ex.GetString(KEY_LOADER_TYPE);