TARGET_LINK_LIBRARIES(${this_target} "-lpthread" )
TARGET_LINK_LIBRARIES(${this_target} "-lcrypto" )
TARGET_LINK_LIBRARIES(${this_target} "-lsoup-2.4" )
+TARGET_LINK_LIBRARIES(${this_target} "-lcapi-appfw-app-manager" )
TARGET_LINK_LIBRARIES(${this_target} "-lcapi-appfw-package-manager" )
TARGET_LINK_LIBRARIES(${this_target} "-L/usr/lib/osp-server -losp-appfw-server")
BuildRequires: pkgconfig(libsmack)
BuildRequires: pkgconfig(message-port)
BuildRequires: pkgconfig(openssl)
+BuildRequires: pkgconfig(capi-appfw-app-manager)
BuildRequires: pkgconfig(capi-appfw-package-manager)
BuildRequires: osp-appfw-internal-devel
#include <ipc/ipc_message.h>
+#include <app_manager.h>
+
#include <FBaseRtMutex.h>
#include <FBaseSysLog.h>
#include <FBase_StringConverter.h>
{
int pid;
bool reverse; // true if the connection is for reverse message
- char appId[256];
};
gboolean
SysTryCatch(NID_IO, client != -1, , E_SYSTEM, "[E_SYSTEM] Accept failed.");
read(client, &helloMessage, sizeof(helloMessage));
- helloMessage.appId[255] = '\0';
pChannel = g_io_channel_unix_new(client);
SysTryCatch(NID_IO, pChannel != null, , E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Not enough memory.");
pClientInfo->pIpcServer = pIpcServer;
pClientInfo->clientId = helloMessage.pid;
- pClientInfo->appId.Append((wchar_t*) helloMessage.appId);
+
+ char* pAppId = NULL;
+ int ret = app_manager_get_app_id(helloMessage.pid, &pAppId);
+ SysTryCatch(NID_IO, ret >= 0, ,E_SYSTEM, "[E_SYSTEM] Failed to get_app_id: %d", ret);
+
+ pClientInfo->appId = pAppId;
+ free(pAppId);
+
pClientInfo->pReverseChannel = null;
pIpcServer->__clients[helloMessage.pid] = pClientInfo;
-
pIpcServer->__pCurrentClientInfo = pClientInfo;
pIpcServer->__pListener->OnIpcClientConnected(*pIpcServer, helloMessage.pid);
pIpcServer->__pCurrentClientInfo = null;