Name: nfc-manager
Summary: NFC framework manager
-Version: 0.0.44
+Version: 0.0.45
Release: 0
Group: libs
License: Flora Software License
BuildRequires: pkgconfig(pkgmgr)
BuildRequires: pkgconfig(pkgmgr-info)
BuildRequires: pkgconfig(ecore-x)
+BuildRequires: pkgconfig(capi-appfw-app-manager)
BuildRequires: cmake
BuildRequires: gettext-tools
Requires(post): /sbin/ldconfig
ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "")
INCLUDE(FindPkgConfig)
-pkg_check_modules(commonlib_pkges REQUIRED glib-2.0 dlog bluetooth-api libssl)
+pkg_check_modules(commonlib_pkges REQUIRED glib-2.0 dlog bluetooth-api libssl capi-appfw-app-manager)
FOREACH(flag ${commonlib_pkges_CFLAGS})
SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
void net_nfc_util_compute_CRC(CRC_type_e CRC_type, uint8_t *buffer, uint32_t length);
const char *net_nfc_util_get_schema_string(int index);
+pid_t net_nfc_util_get_current_app_pgid(pid_t pid);
#endif
// platform header
#include <bluetooth-api.h>
#include <vconf.h>
+#include <app_manager.h>
// nfc-manager header
#include "net_nfc_util_private.h"
else
return schema[index];
}
+
+pid_t net_nfc_util_get_current_app_pgid(pid_t pid)
+{
+ char *app_id = NULL;
+ app_context_h context = NULL;
+ pid_t pgid = NULL;
+
+ app_manager_get_app_id(pid, &app_id);
+ app_manager_get_app_context(app_id, &context);
+
+ app_context_get_pid(context, &pgid);
+
+ free(app_id);
+ app_context_destroy(context);
+
+ return pgid;
+}
+
typedef struct _net_nfc_client_info_t
{
pid_t pid;
+ pid_t pgid;
int socket;
GIOChannel *channel;
uint32_t src_id;
return result;
}
-static gint _client_context_compare_by_pid(gconstpointer a, gconstpointer b)
+static gint _client_context_compare_by_pgid(gconstpointer a, gconstpointer b)
{
gint result = -1;
net_nfc_client_info_t *info = (net_nfc_client_info_t *)a;
- if (info->pid == (int)b)
+ if (info->pgid == (pid_t)b)
result = 0;
else
result = 1;
if (info != NULL)
{
info->pid = pid;
+ info->pgid = net_nfc_util_get_current_app_pgid(pid);
info->socket = socket;
info->channel = channel;
info->src_id = src_id;
pthread_mutex_lock(&g_client_context_lock);
- item = g_list_find_custom(g_client_contexts, (gconstpointer)pid, _client_context_compare_by_pid);
+ item = g_list_find_custom(g_client_contexts, (gconstpointer)pid, _client_context_compare_by_pgid);
if (item != NULL)
{
state = ((net_nfc_client_info_t *)item->data)->launch_popup_state;