Fix for Web/C# TCT fail 31/264531/1
authorJihoon Jung <jh8801.jung@samsung.com>
Fri, 24 Sep 2021 03:22:05 +0000 (12:22 +0900)
committerJihoon Jung <jh8801.jung@samsung.com>
Fri, 24 Sep 2021 03:24:25 +0000 (12:24 +0900)
- Change logic to get focused app pid

Change-Id: I8782fbf2d3e8acff90e67ff91e0f85022a126ac6
Signed-off-by: Jihoon Jung <jh8801.jung@samsung.com>
src/manager/net_nfc_app_util.c

index b113111..eb0019c 100644 (file)
@@ -32,6 +32,7 @@
 #include <bundle_internal.h>
 #include "appsvc.h"
 #include "aul.h"
+#include "aul_window.h"
 #include "vconf.h"
 
 #include "net_nfc_typedef.h"
@@ -1036,39 +1037,17 @@ int net_nfc_app_util_decode_base64(const char *buffer, uint32_t buf_len, uint8_t
        return ret;
 }
 
-int _iter_func(const aul_app_info * info, void *data)
-{
-       uid_t uid = 0;
-       int *pid = (int *)data;
-       int status;
-
-       net_nfc_util_get_login_user(&uid);
-
-       status = aul_app_get_status_bypid_for_uid(info->pid, uid);
-
-       DEBUG_SERVER_MSG("login user is %d, pid is %d, status is %d", (int)uid, info->pid, status);
-
-       if (status == STATUS_VISIBLE || status == STATUS_FOCUS) {
-               *pid = info->pid;
-               return -1;
-       }
-       return 0;
-}
-
 pid_t net_nfc_app_util_get_focus_app_pid()
 {
        int ret;
-       uid_t uid = 0;
        int pid = 0;
 
-       net_nfc_util_get_login_user(&uid);
-
-       ret = aul_app_get_all_running_app_info_for_uid(_iter_func, &pid, uid);
+       ret = aul_window_get_focused_pid(&pid);
 
        if (ret == AUL_R_OK) {
                return pid;
        } else {
-               DEBUG_ERR_MSG("aul_app_get_all_running_app_info_for_uid is failed");
+               DEBUG_ERR_MSG("aul_window_get_focused_pid is failed");
                return -1;
        }
 }