Check pending item before processing the launch request
authorHwankyu Jhun <h.jhun@samsung.com>
Mon, 22 Jul 2024 03:25:41 +0000 (12:25 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Mon, 22 Jul 2024 04:58:29 +0000 (13:58 +0900)
When the target application ID is changed, amd should check whether
the target application is starting or not.

Change-Id: I3197e0fa8718ef9d99f6822097a117a7ae1426b5
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
src/lib/amd_launch.cc

index ae6cea7ee68270d8020bdcf9ac1b3702c8c51f00..0d21c5814c95bbe8df7eaf50c24c0c1b8c425625 100644 (file)
@@ -1461,6 +1461,15 @@ int _launch_start_app(const char* appid, request_h request, bool* pending,
   if (b->GetType(AUL_K_APPID) != BUNDLE_TYPE_NONE)
     appid_str = b->GetString(AUL_K_APPID);
 
+  if (appid_str != appid) {
+    _E("Target appid(%s) is changed to %s", appid, appid_str.c_str());
+    if (amd::RequestManager::GetInst().CheckStatus(req) ==
+        amd::Request::Status::Pending) {
+      _W("Request has been pending. appid(%s)", appid_str.c_str());
+      return 0;
+    }
+  }
+
   auto context = std::make_shared<amd::LaunchContext>(req, appid_str,
       new_instance);
   int ret = amd::LaunchManager::GetInst().StartApp(context);