Skip tizen_launch_appinfo_set_pid() for fast launched apps. 63/316863/4
authorChanggyu Choi <changyu.choi@samsung.com>
Thu, 19 Dec 2024 00:32:47 +0000 (09:32 +0900)
committerChanggyu Choi <changyu.choi@samsung.com>
Thu, 19 Dec 2024 01:08:23 +0000 (10:08 +0900)
In order to shorten the app initialization time,
the fast launched app is modified to skip the wayland init.

Change-Id: I6f1497457c9f338dadf3ae4415cb66e054a75f6d
Signed-off-by: Changgyu Choi <changyu.choi@samsung.com>
tizen-cpp/app-core-ui-cpp/app_core_ui_base.cc

index 347f7fcdf16347004703abcdb24039bb87fe4380..6f007bc24eb40f56205642f9cf507c35afebfc97 100644 (file)
@@ -63,6 +63,9 @@ class AppCoreUiBase::Impl : public AppCoreRotation::IEventListener {
         handler_(std::make_shared<EcoreHandler>(parent)),
         wl_handler_(new WaylandHandler()),
         wp_manager_(new WindowPositionManager()) {
+    const char* fast_launch = getenv("AUL_FAST_LAUNCH");
+    if (fast_launch != nullptr)
+      fast_launch_ = true;
   }
 
  private:
@@ -148,6 +151,7 @@ class AppCoreUiBase::Impl : public AppCoreRotation::IEventListener {
   std::unique_ptr<WindowPositionManager> wp_manager_;
   std::unique_ptr<AppCoreUiThreadBase> thread_;
   std::unique_ptr<AppCoreRotation> rotation_;
+  bool fast_launch_ = false;
 };
 
 AppCoreUiBase::AppCoreUiBase(unsigned int hint)
@@ -513,10 +517,15 @@ void AppCoreUiBase::DoRun(int argc, char** argv) {
     impl_->SetWindowPosition(b);
   }
 
-  if (impl_->hint_ & HINT_WINDOW_ID_CONTROL)
-    impl_->SetAppId();
+  if (!impl_->fast_launch_) {
+    if (impl_->hint_ & HINT_WINDOW_ID_CONTROL)
+      impl_->SetAppId();
+
+    impl_->SetAppInfo();
+  } else {
+    _I("Skip wayland init for fast-launched app");
+  }
 
-  impl_->SetAppInfo();
   AppCoreBase::Run(argc, argv);
 }