2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://www.apache.org/licenses/LICENSE-2.0
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
19 * @file FShell_LiveboxManagerService.cpp
20 * @brief This is the implementation for the LiveboxManagerService class.
25 #include <unique_ptr.h>
30 #include <FBaseSysLog.h>
32 #include <FApp_AppManagerImpl.h>
33 #include <FIo_IpcServer.h>
34 #include <FBase_StringConverter.h>
36 #include "FShell_LiveboxContext.h"
37 #include "FShell_LiveboxPopupContext.h"
38 #include "FShell_LiveboxManagerStub.h"
40 #include "FShell_LiveboxManagerService.h"
42 namespace Tizen { namespace Shell { namespace App {
44 using namespace Tizen::App;
45 using namespace Tizen::Base;
46 using namespace Tizen::Base::Collection;
47 using namespace Tizen::Base::Runtime;
48 using namespace Tizen::Io;
49 using namespace Tizen::System;
50 using namespace Tizen::Shell::App;
55 static const RequestId LOCAL_EVENT_REQUEST_UPDATE = 0;
58 LiveboxManagerService::LiveboxManagerService()
62 LiveboxManagerService::~LiveboxManagerService()
65 DeinitializeMasterDaemonEventReceiver();
68 LiveboxManagerService*
69 LiveboxManagerService::GetInstance(void)
71 static LiveboxManagerService* pSelf = null;
74 pSelf = new LiveboxManagerService();
75 SysTryReturn(NID_APP, pSelf != null, null, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY]");
77 result r = pSelf->Construct();
78 SysAssertf(!IsFailed(r), "Failed to construct LiveboxManagerService");
79 SysLog(NID_APP, "LiveboxManagerService is created.");
85 LiveboxManagerService::Construct()
87 // _AppManagerImpl::GetInstance()->AddEventListener(*this);
89 _LiveboxManagerStub::StartIpcServer();
91 result r = __handlerThread.Construct(THREAD_TYPE_EVENT_DRIVEN);
92 SysTryReturn(NID_APP, IsFailed(r) == false, false, r, "[%s] Event thread creation failure.", GetErrorMessage(r));
94 r = __handlerThread.Start();
95 SysTryReturn(NID_APP, IsFailed(r) == false, false, r, "[%s] Event thread Start failure.", GetErrorMessage(r));
97 return InitializeMasterDaemonEventReceiver("osp-livebox-service");
101 LiveboxManagerService::LiveboxConnected(struct event_arg *arg, void* data)
104 ret = provider_send_hello();
107 SysLog(NID_APP, "success to be connected with master daemon");
108 LiveboxManagerService::GetInstance()->StartPingTimer();
113 SysLog(NID_APP, "failed to provider_send_hello()");
119 LiveboxManagerService::LiveboxDisconnected(struct event_arg *arg, void* data)
121 SysLog(NID_APP, "success to be disconnected with master daemon");
122 // aul_terminate_pid(getpid());
127 LiveboxManagerService::StartPingTimer()
129 __pingTimer.Construct(*this);//, true);
130 __pingTimer.StartAsRepeatable(120000);
134 LiveboxManagerService::OnTimerExpired(Timer& timer)
136 SysLog(NID_APP, "provider_send_ping");
137 provider_send_ping();
141 LiveboxManagerService::Find(const String& appId, const String& instanceId) const
143 for( int i = 0; i < __liveboxContextList.GetCount(); i++ )
145 _LiveboxContext* pLiveboxContext = null;
146 __liveboxContextList.GetAt(i, pLiveboxContext);
147 // SysLog(NID_APP, "%ls", pLiveboxContext->__instanceId.GetPointer());
149 if ( pLiveboxContext->__instanceId == instanceId )
151 // SysAssert(pLiveboxContext->__appId == appId)
152 return pLiveboxContext;
159 LiveboxManagerService::SetClientIds(const Tizen::App::AppId& appId, int clientId)
161 for( int i = 0; i < __liveboxContextList.GetCount(); i++ )
163 _LiveboxContext* pLiveboxContext = null;
164 __liveboxContextList.GetAt(i, pLiveboxContext);
165 SysLog(NID_APP, "%ls", pLiveboxContext->__instanceId.GetPointer());
166 SysLog(NID_APP, "%ls, %ls", pLiveboxContext->__providerId.GetPointer(), appId.GetPointer());
168 if ( pLiveboxContext->__appId == appId )
170 pLiveboxContext->SetClientId(clientId);
171 SysLog(NID_APP, "client is registered.(%d)", clientId);
174 pLiveboxContext->ReleaseSharedMem();
175 if(pLiveboxContext->GetLiveboxPopup())
177 pLiveboxContext->OnPopupDestoyed();
186 LiveboxManagerService::OnIpcClientConnected(const _IpcServer& server, int clientId)
188 //SysLog(NID_APP, "(clientId:%d)\n", clientId);
189 String fullAppId = server.GetClientAppId() + "." + server.GetClientAppExecutableName();
190 SysLog(NID_APP, "(%ls)\n", fullAppId.GetPointer());
191 // this->SetClientIds(fullAppId, clientId);//Todo
196 LiveboxManagerService::OnIpcClientDisconnected(const _IpcServer& server, int clientId)
198 String fullAppId = server.GetClientAppId() + "." + server.GetClientAppExecutableName();
199 SysLog(NID_APP, "(%ls)\n", fullAppId.GetPointer());
200 this->SetClientIds(fullAppId, -1);
204 LiveboxManagerService::AddLivebox(_LiveboxContext* pLiveboxContext)
206 SysLog(NID_APP, "%ls, %ls, count(%d)", pLiveboxContext->__providerId.GetPointer(), pLiveboxContext->__instanceId.GetPointer(), __liveboxContextList.GetCount());
208 return __liveboxContextList.Add(pLiveboxContext);
212 LiveboxManagerService::RemoveLivebox(const char* pPackageName, const char* pId, bool free)
214 SysLog(NID_APP, "%s, %s, count(%d)", pPackageName, pId, __liveboxContextList.GetCount());
216 SysTryReturn(NID_APP, ( pPackageName != null && pId != null), null, E_INVALID_ARG, "[E_INVALID_ARG]");
217 SysLog(NID_APP, "%s, %s", pPackageName, pId);
219 _LiveboxContext* pLiveboxContext = Find(pPackageName, pId);
220 SysTryReturn(NID_APP, pLiveboxContext, null, E_OBJ_NOT_FOUND, "[E_OBJ_NOT_FOUND]");
222 result r = __liveboxContextList.Remove(pLiveboxContext);
224 if( __liveboxContextList.GetCount() == 0 )
226 SysLog(NID_APP, "No running native livebox app remains, terminating osp livebox service...");
227 Tizen::App::App::GetInstance()->Terminate();
234 ///////////////////////////////////////////////////////
235 // MasterDaemonEventReceiver implementation
236 ///////////////////////////////////////////////////////
238 LiveboxManagerService::OnLiveboxCreate(struct event_arg *arg, int *width, int *height, double *priority, void* data)
240 SysTryReturn(NID_APP, arg != null, EINVAL, E_INVALID_ARG, "[E_INVALID_ARG]");
241 SysTryReturn(NID_APP, arg->pkgname != null, EINVAL, E_INVALID_ARG, "[E_INVALID_ARG]");
242 SysTryReturn(NID_APP, arg->id != null, EINVAL, E_INVALID_ARG, "[E_INVALID_ARG]");
243 SysTryReturn(NID_APP, arg->type == event_arg::EVENT_NEW, -EPERM, E_SUCCESS, "invalid argument from master");
245 SysLog(NID_APP, "packageName(%s) id(%s) content(%s) cluster(%s) category(%s)", arg->pkgname, arg->id, arg->info.lb_create.content, arg->info.lb_create.cluster, arg->info.lb_create.category);
246 SysTryReturn (NID_APP, LiveboxManagerService::GetInstance()->Find(arg->pkgname, arg->id) == null, -EBUSY, E_SUCCESS,"already exist");
248 double default_priority = 1.0f;
249 _LiveboxContext* pLiveboxContext = new (std::nothrow)_LiveboxContext( arg->info.lb_create.content, arg->pkgname, arg->id,
250 arg->info.lb_create.width, arg->info.lb_create.height, arg->info.lb_create.period * 1000, default_priority);
251 SysTryReturn(NID_APP, pLiveboxContext, 0, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY]");
253 LiveboxManagerService* pLiveboxService = LiveboxManagerService::GetInstance();
254 pLiveboxService->AddLivebox(pLiveboxContext);
255 pLiveboxContext->OnAdded();
257 *priority = pLiveboxContext->__priority;
258 *height= pLiveboxContext->__height;
259 *width = pLiveboxContext->__width;
261 SysLog(NID_APP, "Exit. %d livebox(es)", pLiveboxService->__liveboxContextList.GetCount());
266 LiveboxManagerService::OnLiveboxUpdate(struct event_arg *arg, void* data)
268 if( arg->id == null || strlen(arg->id) < 1)
270 SysLog(NID_APP, "updating alls");
271 LiveboxManagerService::GetInstance()->UpdateAllLiveboxesByAppId(arg->pkgname);
275 _LiveboxContext* pLiveboxContext = LiveboxManagerService::GetInstance()->Find(arg->pkgname, arg->id);
276 SysTryReturnResult(NID_APP, pLiveboxContext , E_SYSTEM, "[E_SYSTEM] pLiveboxContext is null for appId(%s), instanceId(%s)", arg->pkgname, arg->id);
278 pLiveboxContext->OnUpdate(L"");
285 LiveboxManagerService::UpdateAllLiveboxesByAppId(const String& providerId)
287 for( int i = 0; i < __liveboxContextList.GetCount(); i++ )
289 _LiveboxContext* pLiveboxContext = null;
290 __liveboxContextList.GetAt(i, pLiveboxContext);
292 if ( pLiveboxContext->__providerId == providerId )
294 pLiveboxContext->OnUpdate(L"");
301 LiveboxManagerService::OnLiveboxDestroy(struct event_arg *arg, void* data)
303 SysTryReturn (NID_APP, arg->type == event_arg::EVENT_DELETE, -EPERM, E_SUCCESS, "invalid argument from master");
304 SysLog(NID_APP, "Enter");
306 LiveboxManagerService* pLiveboxManagerService = LiveboxManagerService::GetInstance();
308 _LiveboxContext* pLiveboxContext = pLiveboxManagerService->Find(arg->pkgname, arg->id);
309 SysTryReturnResult(NID_APP, pLiveboxContext , E_SYSTEM, "[E_SYSTEM] pLiveboxContext is null for appId(%s), instanceId(%s)", arg->pkgname, arg->id);
311 pLiveboxContext->OnRemoved();
312 pLiveboxManagerService->RemoveLivebox( arg->pkgname, arg->id, true);
313 delete pLiveboxContext;
315 SysLog(NID_APP, "Exit");
320 LiveboxManagerService::OnLiveboxPopupCreate(struct event_arg *arg, void* data)
322 SysTryReturn (NID_APP, arg->type == event_arg::EVENT_PD_CREATE, -EPERM, E_SUCCESS, "invalid argument from master");
323 SysLog(NID_APP, "packageName(%s), id(%s), width(%d), height(%d), priority(%d)", arg->pkgname, arg->id);
325 _LiveboxContext* pLiveboxContext = LiveboxManagerService::GetInstance()->Find(arg->pkgname, arg->id);
326 SysTryReturnResult(NID_APP, pLiveboxContext , E_SYSTEM, "[E_SYSTEM] pLiveboxContext is null for appId(%s), instanceId(%s)", arg->pkgname, arg->id);
328 /*if( pLiveboxContext->GetLiveboxPopup() )
330 pLiveboxContext->OnPopupDestoyed();
332 pLiveboxContext->OnPopupCreated(arg->info.pd_create.x, arg->info.pd_create.y, arg->info.pd_create.w, arg->info.pd_create.h);
338 LiveboxManagerService::OnLiveboxPopupDestroy(struct event_arg *arg, void* data)
340 SysTryReturn (NID_APP, arg->type == event_arg::EVENT_PD_DESTROY, -EPERM, E_SUCCESS, "invalid argument from master");
341 SysLog(NID_APP, "packageName(%s), id(%s)", arg->pkgname, arg->id);
342 _LiveboxContext* pLiveboxContext = LiveboxManagerService::GetInstance()->Find(arg->pkgname, arg->id);
343 SysTryReturnResult(NID_APP, pLiveboxContext , E_SYSTEM, "[E_SYSTEM] pLiveboxContext is null for appId(%s), instanceId(%s)", arg->pkgname, arg->id);
345 pLiveboxContext->OnPopupDestoyed();
351 LiveboxManagerService::OnLivePause(struct event_arg *arg, void* data)
353 SysTryReturn(NID_APP, arg, 0, E_SUCCESS, "arg is null!");
355 _LiveboxContext* pLiveboxContext = LiveboxManagerService::GetInstance()->Find(arg->pkgname, arg->id);
356 SysTryReturnResult(NID_APP, pLiveboxContext , 0, "[E_SYSTEM] pLiveboxContext is null for appId(%s), instanceId(%s)", arg->pkgname, arg->id);
358 SysLog(NID_APP, "packageName(%s), id(%s)", arg->pkgname, arg->id);
359 pLiveboxContext->OnBackground();
364 LiveboxManagerService::OnLiveboxResume(struct event_arg *arg, void* data)
366 SysTryReturn(NID_APP, arg || arg->id || arg->pkgname, 0, E_SUCCESS, "arg is null!");
368 _LiveboxContext* pLiveboxContext = LiveboxManagerService::GetInstance()->Find(arg->pkgname, arg->id);
369 SysTryReturnResult(NID_APP, pLiveboxContext , E_SYSTEM, "[E_SYSTEM] pLiveboxContext is null for appId(%s), instanceId(%s)", arg->pkgname, arg->id);
371 SysLog(NID_APP, "packageName(%s), id(%s)", arg->pkgname, arg->id);
372 pLiveboxContext->OnForeground();
377 LiveboxManagerService::OnLiveboxClick(struct event_arg *arg, void* data)
379 SysTryReturn (NID_APP, arg->type == event_arg::EVENT_CLICKED, -EPERM, E_SUCCESS, "invalid argument from master");
380 SysTryReturn(NID_APP, arg != null, -EPERM, E_SUCCESS, "arg is null!");
381 SysLog(NID_APP, "packageName(%s), id(%s), clicked.event(%s), clicked.x(%d), clicked.y(%d)", arg->pkgname, arg->id, arg->info.clicked.event, arg->info.clicked.x, arg->info.clicked.y);
387 LiveboxManagerService::OnLiveboxResize(struct event_arg *arg, void* data)
389 SysTryReturn(NID_APP, arg || arg->id || arg->pkgname, 0, E_SUCCESS, "arg is null!");
390 SysTryReturn (NID_APP, arg->type == event_arg::EVENT_RESIZE, -EPERM, E_SUCCESS, "invalid argument from master");
392 SysLog(NID_APP, "packageName(%s), id(%s), resize.w(%d), resize.h(%d)", arg->pkgname, arg->id, arg->info.resize.w, arg->info.resize.h);
394 _LiveboxContext* pLiveboxContext = LiveboxManagerService::GetInstance()->Find(arg->pkgname, arg->id);
395 SysTryReturnResult(NID_APP, pLiveboxContext , E_SYSTEM, "[E_SYSTEM] pLiveboxContext is null for appId(%s), instanceId(%s)", arg->pkgname, arg->id);
397 pLiveboxContext->OnResize(arg->info.resize.w, arg->info.resize.h);
403 LiveboxManagerService::OnLiveboxPeriodChaned(struct event_arg *arg, void* data)
405 SysTryReturn(NID_APP, arg != null, 0, E_SUCCESS, "arg is null!");
406 SysLog(NID_APP, "packageName(%s), id(%s), width(%d), height(%d), priority(%d)", arg->pkgname, arg->id);
411 LiveboxManagerService::InitializeMasterDaemonEventReceiver(const char *pServiceExecutableName)
413 SysTryReturnResult(NID_APP, pServiceExecutableName != null, E_INVALID_ARG, "");
414 SysLog(NID_APP, "Enter.");
416 __liveboxContextList.Construct();
420 * Only for the buffer type
422 struct event_handler cbs;
423 memset(&cbs, 0, sizeof(event_handler));
425 cbs.connected = LiveboxConnected,
426 cbs.disconnected = LiveboxDisconnected,
427 cbs.pause = OnLivePause,
428 cbs.resume = OnLiveboxResume,
429 // cbs.lb_pause = OnLivePause,
430 // cbs.lb_resume = OnLiveboxResume,
431 cbs.lb_create = OnLiveboxCreate,
432 cbs.lb_destroy = OnLiveboxDestroy,
433 cbs.update_content = OnLiveboxUpdate,
434 cbs.pd_create = OnLiveboxPopupCreate,
435 cbs.pd_destroy = OnLiveboxPopupDestroy,
436 cbs.clicked = OnLiveboxClick,
437 cbs.resize = OnLiveboxResize,
438 cbs.set_period = OnLiveboxPeriodChaned;
439 //cbs.lb_recreate = OnLiveboxRecreate,/* Recover from the fault of slave */
440 //cbs.content_event = OnLiveboxContentEvent,
441 //cbs.change_group = OnLiveboxGroupChanged;
443 int ret = provider_init(null, pServiceExecutableName, &cbs, this);
444 SysTryReturnResult(NID_APP, ret == 0, E_SYSTEM, "provider_init failed.");
446 SysLog(NID_APP, "Exit.");
451 LiveboxManagerService::DeinitializeMasterDaemonEventReceiver()
453 SysLog(NID_APP, "Enter.");
455 SysLog(NID_APP, "Exit.");
459 ///////////////////////////////////////////////////////
460 // stub implmentation
461 ///////////////////////////////////////////////////////
464 LiveboxManagerService::RequestUpdate(const Tizen::App::AppId& appId, const Tizen::Base::String& providerName, const Tizen::Base::String& argument)
466 SysLog(NID_APP, "%ls, %ls", appId.GetPointer(), providerName.GetPointer() );
469 for( int i = 0; i < __liveboxContextList.GetCount(); i++ )
471 _LiveboxContext* pLiveboxContext = null;
472 __liveboxContextList.GetAt(i, pLiveboxContext);
474 if ( pLiveboxContext->__appId == appId && pLiveboxContext->__providerName == providerName)
476 SysLog(NID_APP, "OK");
478 ArrayList* pArray = new (std::nothrow) ArrayList();
479 SysTryReturnResult(NID_APP, pArray, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY]");
482 pArray->Add(pLiveboxContext);
483 pArray->Add(new String(argument));
485 result r = __handlerThread.SendUserEvent(LOCAL_EVENT_REQUEST_UPDATE, pArray);
486 SysTryLog(NID_APP, !IsFailed(r), "[%s] Propagated.", GetErrorMessage(r));
491 SysLog(NID_APP, "Exit.");
492 return (found) ? E_SUCCESS : E_OBJ_NOT_FOUND;
497 LiveboxManagerService::RequestUpdateInstance(const Tizen::Base::String& instanceId, const Tizen::Base::String& argument)
499 SysLog(NID_APP, "%ls, %ls", instanceId.GetPointer(), argument.GetPointer() );
501 for( int i = 0; i < __liveboxContextList.GetCount(); i++ )
503 _LiveboxContext* pLiveboxContext = null;
504 __liveboxContextList.GetAt(i, pLiveboxContext);
506 if ( pLiveboxContext->__instanceId == instanceId)
508 SysLog(NID_APP, "OK");
510 ArrayList* pArray = new (std::nothrow) ArrayList();
511 SysTryReturnResult(NID_APP, pArray, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY]");
514 pArray->Add(pLiveboxContext);
515 pArray->Add(new String(argument));
517 result r = __handlerThread.SendUserEvent(LOCAL_EVENT_REQUEST_UPDATE, pArray);
518 SysTryLog(NID_APP, !IsFailed(r), "[%s] Propagated.", GetErrorMessage(r));
523 SysLog(NID_APP, "Exit.");
524 return E_OBJ_NOT_FOUND;
528 LiveboxManagerService::RequestSharedMemoryId(const Tizen::App::AppId& appId, const Tizen::Base::String& instanceId, int width, int height, int& shmId)
530 _LiveboxContext* pLiveboxContext = this->Find(appId, instanceId);
531 SysTryReturnResult(NID_APP, pLiveboxContext , E_SYSTEM, "[E_SYSTEM] pLiveboxContext is null for (%ls) (%ls)", appId.GetPointer(), instanceId.GetPointer());
533 if(pLiveboxContext->HasValidClientId() == false)
535 String fullAppId = __pIpcServer->GetClientAppId() + "." + __pIpcServer->GetClientAppExecutableName();
536 this->SetClientIds(fullAppId, __pIpcServer->GetClientId());
539 shmId = pLiveboxContext->GetSharedMemId(width, height);
540 SysTryReturnResult(NID_APP, pLiveboxContext , shmId != -1, "[E_SYSTEM] failed to GetSharedMemId for (%ls) (%ls)", appId.GetPointer(), instanceId.GetPointer());
545 LiveboxManagerService::RequestSharedMemoryIdForPD(const Tizen::App::AppId& appId, const Tizen::Base::String& instanceId, int width, int height, int& shmId)
547 _LiveboxContext* pLiveboxContext = this->Find(appId, instanceId);
548 SysTryReturnResult(NID_APP, pLiveboxContext , E_SYSTEM, "[E_SYSTEM] pLiveboxContext is null for (%ls) (%ls)", appId.GetPointer(), instanceId.GetPointer());
550 _LiveboxPopupContext* pPd = pLiveboxContext->GetLiveboxPopup();
551 SysTryReturnResult(NID_APP, pPd , E_SYSTEM, "[E_SYSTEM] pPd is null for (%ls) (%ls)", appId.GetPointer(), instanceId.GetPointer());
553 if(pPd->HasValidClientId() == false)
555 String fullAppId = __pIpcServer->GetClientAppId() + "." + __pIpcServer->GetClientAppExecutableName();
556 pPd->SetClientId(__pIpcServer->GetClientId());
559 shmId = pPd->GetSharedMemId(width, height);
560 SysTryReturnResult(NID_APP, pLiveboxContext , shmId != -1, "[E_SYSTEM] failed to GetSharedMemId for (%ls) (%ls)", appId.GetPointer(), instanceId.GetPointer());
566 LiveboxManagerService::RequestSyncSharedMemory(const Tizen::App::AppId& appId, const Tizen::Base::String& instanceId, int width, int height)
568 _LiveboxContext* pLiveboxContext = this->Find(appId, instanceId);
569 SysTryReturnResult(NID_APP, pLiveboxContext , E_SYSTEM, "[E_SYSTEM] pLiveboxContext is null for (%ls) (%ls)", appId.GetPointer(), instanceId.GetPointer());
571 return pLiveboxContext->RequestUpdateRemote(width, height);
575 LiveboxManagerService::RequestSyncSharedMemoryForPD(const Tizen::App::AppId& appId, const Tizen::Base::String& instanceId)
577 _LiveboxContext* pLiveboxContext = this->Find(appId, instanceId);
578 SysTryReturnResult(NID_APP, pLiveboxContext , E_SYSTEM, "[E_SYSTEM] pLiveboxContext is null for (%ls) (%ls)", appId.GetPointer(), instanceId.GetPointer());
579 SysTryReturnResult(NID_APP, pLiveboxContext->GetLiveboxPopup(), E_SYSTEM, "[E_SYSTEM] GetLiveboxPopup() returns null for (%ls) (%ls)", appId.GetPointer(), instanceId.GetPointer());
581 return pLiveboxContext->GetLiveboxPopup()->RequestUpdateRemote();
585 LiveboxManagerService::RequestReleaseSharedMemory(const Tizen::App::AppId& appId, const Tizen::Base::String& instanceId)
587 std::unique_ptr<char[]> pkgname(_StringConverter::CopyToCharArrayN(appId));
588 std::unique_ptr<char[]> id(_StringConverter::CopyToCharArrayN(instanceId));
590 _LiveboxContext* pLiveboxContext = this->Find(appId, instanceId);
591 SysTryReturnResult(NID_APP, pLiveboxContext , E_SYSTEM, "[E_SYSTEM] pLiveboxContext is null for (%ls) (%ls)", appId.GetPointer(), instanceId.GetPointer());
593 return pLiveboxContext->ReleaseSharedMem();
597 LiveboxManagerService::RequestReleaseSharedMemoryForPD(const Tizen::App::AppId& appId, const Tizen::Base::String& instanceId)
599 std::unique_ptr<char[]> pkgname(_StringConverter::CopyToCharArrayN(appId));
600 std::unique_ptr<char[]> id(_StringConverter::CopyToCharArrayN(instanceId));
602 _LiveboxContext* pLiveboxContext = this->Find(appId, instanceId);
603 SysTryReturnResult(NID_APP, pLiveboxContext , E_SYSTEM, "[E_SYSTEM] pLiveboxContext is null for (%ls) (%ls)", appId.GetPointer(), instanceId.GetPointer());
604 SysTryReturnResult(NID_APP, pLiveboxContext->GetLiveboxPopup(), E_SYSTEM, "[E_SYSTEM] GetLiveboxPopup() returns null for (%ls) (%ls)", appId.GetPointer(), instanceId.GetPointer());
606 // return pLiveboxContext->GetLiveboxPopup()->ReleaseSharedMem();
610 LiveboxManagerService::_TaskHandlerThread::~_TaskHandlerThread(void)
616 LiveboxManagerService::_TaskHandlerThread::OnUserEventReceivedN(RequestId reqId, IList* pArgs)
618 SysTryReturnVoidResult(NID_APP, pArgs != null, E_INVALID_STATE, "pArgs is null!.");
620 SysLog(NID_APP, "Enter.");
624 case LOCAL_EVENT_REQUEST_UPDATE:
626 _LiveboxContext* pLiveboxContext = dynamic_cast<_LiveboxContext*>( pArgs->GetAt(0) );
627 SysTryReturnVoidResult(NID_APP, pLiveboxContext != null, E_INVALID_STATE, "_Livebox is null!.");
629 String* pArgument = dynamic_cast<String*>( pArgs->GetAt(1) );
630 SysTryReturnVoidResult(NID_APP, pArgument != null, E_INVALID_STATE, "pArgument is null!.");
632 pLiveboxContext->OnUpdate(*pArgument);
641 SysAssertf(false, "never get here!");
644 SysLog(NID_APP, "Exit.");
647 } } } //namespace Tizen { namespace Shell { namespace App {