Modify amd_launch_start_app function 48/314648/1
authorHwankyu Jhun <h.jhun@samsung.com>
Tue, 16 Jul 2024 23:24:48 +0000 (08:24 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Tue, 16 Jul 2024 23:24:48 +0000 (08:24 +0900)
To check whther the target application is launching or not, the function
calls _request_check_status(). If it returns 1, it means the request is pending.
In that case, the function returns 0.

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

index 1317caff15d7d7b056cfaaf65f38fefcce216212..40574086c60821239a75781d3c6874dc840d0c74 100644 (file)
  * limitations under the License.
  */
 
+#include "lib/api/amd_api_launch.h"
+
 #include "lib/amd_api.h"
 #include "lib/amd_launch.h"
-#include "lib/api/amd_api_launch.h"
+#include "lib/amd_request.h"
 
 extern "C" EXPORT_API int amd_launch_start_app(const char* appid,
-    amd_request_h req, bool* pending, bool* bg_launch, bool new_instance) {
+                                               amd_request_h req, bool* pending,
+                                               bool* bg_launch,
+                                               bool new_instance) {
+  if (_request_check_status(req) == 1) {
+    _W("Request has been pending. appid(%s)", appid);
+    return 0;
+  }
+
   return _launch_start_app(appid, req, pending, bg_launch, new_instance);
 }