From 8ecacc424d57db1a19dbaa6946579865411830a4 Mon Sep 17 00:00:00 2001 From: "jungmin76.park" Date: Thu, 24 Jan 2013 20:37:39 +0900 Subject: [PATCH] change IpcService to run on seperated thread Change-Id: I4fae818f7938bf87d3bb1638fd1cd831dccb4ffb Signed-off-by: jungmin76.park --- src/FShell_LiveboxBase.cpp | 26 +------------------------- src/FShell_LiveboxManagerService.cpp | 12 ++++-------- src/FShell_LiveboxManagerStub.cpp | 2 +- 3 files changed, 6 insertions(+), 34 deletions(-) diff --git a/src/FShell_LiveboxBase.cpp b/src/FShell_LiveboxBase.cpp index f8d6916..9db8092 100644 --- a/src/FShell_LiveboxBase.cpp +++ b/src/FShell_LiveboxBase.cpp @@ -212,34 +212,10 @@ _LiveboxRequestHelper::SendRequestToApp(const AppId& appId, const String& operat { SysLog(NID_APP, "appId(%ls), operation(%ls), arg count(%d)", appId.GetPointer(), operation.GetPointer(), pArgs->GetCount() ); -/* std::unique_ptr pMapEnum(pArgs->GetMapEnumeratorN()); - SysTryReturnResult(NID_APP, pMapEnum.get(), E_SYSTEM, "failed to get GetMapEnumeratorN"); - - while( pMapEnum->MoveNext() == E_SUCCESS) - { - const String* pKey = dynamic_cast(pMapEnum->GetKey()); - const String* pValue = dynamic_cast(pMapEnum->GetValue()); - - if( pKey == null) - { - SysLog(NID_APP, "key is null"); - continue; - } - if( pValue == null) - { - SysLog(NID_APP, "pValue is null"); - continue; - } - - SysLog(NID_APP, "key(%ls), value(%ls)", pKey->GetPointer(), pValue->GetPointer() ); - - }*/ - _AppMessageImpl msg; - msg.AddData(OSP_K_APPCONTROL_INTERNAL_OPERATION, L"livebox"); - // AddStrArrayToBundle(msg.GetBundle(), OSP_K_ARG, pArgs); Tizen::App::_AppArg::AddStrMap(msg.GetBundle(), pArgs); + std::unique_ptr pAppId(_StringConverter::CopyToCharArrayN(appId) ); std::unique_ptr pOperation(_StringConverter::CopyToCharArrayN(operation) ); diff --git a/src/FShell_LiveboxManagerService.cpp b/src/FShell_LiveboxManagerService.cpp index 224c8d8..8f2625b 100644 --- a/src/FShell_LiveboxManagerService.cpp +++ b/src/FShell_LiveboxManagerService.cpp @@ -139,7 +139,7 @@ LiveboxManagerService::Find(const String& appId, const String& instanceId) const { _Livebox* pLivebox = null; __liveboxes.GetAt(i, pLivebox); - SysLog(NID_APP, "%ls", pLivebox->__instanceId.GetPointer()); +// SysLog(NID_APP, "%ls", pLivebox->__instanceId.GetPointer()); if ( pLivebox->__instanceId == instanceId ) { @@ -278,7 +278,6 @@ LiveboxManagerService::OnLiveboxUpdate(struct event_arg *arg, void* data) pLivebox->OnUpdate(); } - SysLog(NID_APP, "Exit"); return 0; } @@ -323,13 +322,11 @@ LiveboxManagerService::OnLiveboxPopupCreate(struct event_arg *arg, void* data) SysTryReturn (NID_APP, arg->type == event_arg::EVENT_PD_CREATE, -EPERM, E_SUCCESS, "invalid argument from master"); SysLog(NID_APP, "packageName(%s), id(%s), width(%d), height(%d), priority(%d)", arg->pkgname, arg->id); - SysLog(NID_APP, "Enter"); _Livebox* pLivebox = LiveboxManagerService::GetInstance()->Find(arg->pkgname, arg->id); SysTryReturnResult(NID_APP, pLivebox , E_SYSTEM, "[E_SYSTEM] pLivebox is null for appId(%s), instanceId(%s)", arg->pkgname, arg->id); pLivebox->OnPopupCreated(arg->info.pd_create.w, arg->info.pd_create.h); - SysLog(NID_APP, "Exit"); return 0; } @@ -352,14 +349,13 @@ LiveboxManagerService::OnLiveboxPopupCreate(struct event_arg *arg, void* data) int LiveboxManagerService::OnLivePause(struct event_arg *arg, void* data) { - SysTryReturn(NID_APP, arg || arg->id || arg->pkgname, 0, E_SUCCESS, "arg is null!"); - SysLog(NID_APP, "packageName(%s), id(%s)", arg->pkgname, arg->id); + SysTryReturn(NID_APP, arg, 0, E_SUCCESS, "arg is null!"); _Livebox* pLivebox = LiveboxManagerService::GetInstance()->Find(arg->pkgname, arg->id); SysTryReturnResult(NID_APP, pLivebox , 0, "[E_SYSTEM] pLivebox is null for appId(%s), instanceId(%s)", arg->pkgname, arg->id); + SysLog(NID_APP, "packageName(%s), id(%s)", arg->pkgname, arg->id); pLivebox->OnBackground(); - return 0; } @@ -367,11 +363,11 @@ int LiveboxManagerService::OnLiveboxResume(struct event_arg *arg, void* data) { SysTryReturn(NID_APP, arg || arg->id || arg->pkgname, 0, E_SUCCESS, "arg is null!"); - SysLog(NID_APP, "packageName(%s), id(%s)", arg->pkgname, arg->id); _Livebox* pLivebox = LiveboxManagerService::GetInstance()->Find(arg->pkgname, arg->id); SysTryReturnResult(NID_APP, pLivebox , E_SYSTEM, "[E_SYSTEM] pLivebox is null for appId(%s), instanceId(%s)", arg->pkgname, arg->id); + SysLog(NID_APP, "packageName(%s), id(%s)", arg->pkgname, arg->id); pLivebox->OnForeground(); return 0; } diff --git a/src/FShell_LiveboxManagerStub.cpp b/src/FShell_LiveboxManagerStub.cpp index 761a932..4ead778 100644 --- a/src/FShell_LiveboxManagerStub.cpp +++ b/src/FShell_LiveboxManagerStub.cpp @@ -65,7 +65,7 @@ _LiveboxManagerStub::StartIpcServer(void) __pIpcServer = new (std::nothrow) _IpcServer(); SysTryReturn(NID_APP, __pIpcServer != null, E_OUT_OF_MEMORY, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Not enough memory."); - result r = __pIpcServer->Construct( IPC_SERVER_NAME, *this); + result r = __pIpcServer->Construct( IPC_SERVER_NAME, *this, false); SysTryCatch(NID_APP, !IsFailed(r), , r, "[%s] Failed to create IPC server(%s)", GetErrorMessage(r), "osp.app.ipcserver.appmanager"); SysLog(NID_APP, "Exit."); -- 2.7.4