Modify -f option of app_launcher 49/309049/1
authorHwankyu Jhun <h.jhun@samsung.com>
Thu, 4 Apr 2024 07:34:18 +0000 (16:34 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Thu, 4 Apr 2024 07:34:48 +0000 (16:34 +0900)
If amd is ready, the tool should send the launch request to amd.
Before getting the application information from the pkgmgr db, the tool
checks whether amd is ready or not.

Change-Id: I1eaed48176bc0fdd2fa83dcb0cedc7671c6518b6
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
src/tool/app_launcher/app_launcher.c

index 44b411a..302a90f 100644 (file)
@@ -52,6 +52,7 @@ struct launch_arg {
        bool debug;
        bool web_debug;
        bool sync;
+       bool amd_ready;
 };
 
 enum command_e {
@@ -604,6 +605,11 @@ static int __cmd_fast_start_init(struct launch_arg *arg)
        char buf[PATH_MAX];
        int retry_count = 0;
 
+       if (!access(PATH_AMD_READY, F_OK)) {
+               arg->amd_ready = true;
+               return 0;
+       }
+
        if (__set_appinfo_for_launchpad(arg->b, arg->appid, arg->uid) < 0) {
                fprintf(stderr, "Failed to set appinfo. appid(%s), uid(%u)\n",
                                arg->appid, arg->uid);
@@ -627,7 +633,7 @@ static int __cmd_fast_start_run(struct launch_arg *arg)
 {
        int fd;
 
-       if (!access(PATH_AMD_READY, F_OK)) {
+       if (arg->amd_ready) {
                bundle_del(arg->b, AUL_K_FAST_LAUNCH);
                return __cmd_start_run(arg);
        }