int width, int height, int period, int priority);
virtual ~_Livebox();
void OnAdded(void);
- void OnUpdate(void);
+ void OnUpdate(const Tizen::Base::String& argument);
void OnResize(int width, int height);
void OnRemoved();
void OnForeground();
private:
result SendAddRequest(int width, int height);
- result SendUpdateRequest(int width, int height);
+ result SendUpdateRequest(int width, int height, const Tizen::Base::String& argument);
result SendResizeRequest(int width, int height);
result SendRemoveRequest();
int __priority;
protected:
- struct livebox_buffer *__buffer_info;
- void *__buffer;
bool __isForeground;// LB only?
int __ipcClientId;
+private:
+ void *__buffer;
+ struct livebox_buffer *__buffer_info;
};
class _LiveboxRequestHelper
#include <FBaseObject.h>
#include <FBaseString.h>
#include <FBaseRtTimer.h>
-#include <FApp_IAppManagerEventListener.h>
+//#include <FApp_IAppManagerEventListener.h>
#include <FShell_Livebox.h>
//#include <FBaseColHashMapT.h>
#include <FBaseColArrayListT.h>
class LiveboxManagerService
:public Tizen::Shell::App::_LiveboxManagerStub
- ,public Tizen::App::_IAppManagerEventListener
+// ,public Tizen::App::_IAppManagerEventListener
,public Tizen::Base::Runtime::ITimerEventListener
{
public:
static int OnLiveboxPeriodChaned(struct event_arg *arg, void* data);
// stub implementations
- virtual result RequestUpdate(const Tizen::App::AppId& appId, const Tizen::Base::String& providerName);
+ virtual result RequestUpdate(const Tizen::App::AppId& appId, const Tizen::Base::String& providerName, const Tizen::Base::String& argument);
+ virtual result RequestUpdateInstance(const Tizen::Base::String& instanceId, const Tizen::Base::String& argument);
virtual result RequestSharedMemoryId(const Tizen::App::AppId& appId, const Tizen::Base::String& instanceId, int w, int h, int& shmId);
virtual result RequestSharedMemoryIdForPD(const Tizen::App::AppId& appId, const Tizen::Base::String& instanceId, int w, int h, int& shmId);
virtual result RequestSyncSharedMemory(const Tizen::App::AppId& appId, const Tizen::Base::String& instanceId, int width, int height);
LiveboxManagerService();
virtual ~LiveboxManagerService();
- virtual void OnApplicationLaunched(const Tizen::App::AppId& appId, Tizen::App::_AppType type);
- virtual void OnApplicationTerminated(const Tizen::App::AppId& appId, Tizen::App::_AppType type);
+// virtual void OnApplicationLaunched(const Tizen::App::AppId& appId, Tizen::App::_AppType type);
+// virtual void OnApplicationTerminated(const Tizen::App::AppId& appId, Tizen::App::_AppType type);
virtual void OnIpcClientConnected(const Tizen::Io::_IpcServer& server, int clientId);
virtual void OnIpcClientDisconnected(const Tizen::Io::_IpcServer&server, int clientId);
virtual ~_LiveboxManagerStub(void);
// handlers
- bool OnRequestUpdate(const Tizen::App::AppId& appId, const Tizen::Base::String& providerName, result* pRes);
+ bool OnRequestUpdate(const Tizen::App::AppId& appId, const Tizen::Base::String& providerName, const Tizen::Base::String& argument, result* pRes);
+ bool OnRequestUpdateInstance(const Tizen::Base::String& instanceId, const Tizen::Base::String& argument, result* pRes);
bool OnRequestSharedMemoryId(const Tizen::Base::String& instanceId, int width, int height, int* pShmId);
bool OnRequestSharedMemoryIdForPD(const Tizen::Base::String& instanceId, int width, int height, int* pShmId);
bool OnRequestSyncSharedMemory(const Tizen::Base::String& instanceId, int width, int height, result* pRes);
bool OnRequestReleaseSharedMemoryForPD(const Tizen::Base::String& instanceId, result* pRes);
// interface to service
- virtual result RequestUpdate(const Tizen::App::AppId& appId, const Tizen::Base::String& providerName) = 0;
+ virtual result RequestUpdate(const Tizen::App::AppId& appId, const Tizen::Base::String& providerName, const Tizen::Base::String& argument) = 0;
+ virtual result RequestUpdateInstance(const Tizen::Base::String& instanceId, const Tizen::Base::String& argument) = 0;
virtual result RequestSharedMemoryId(const Tizen::App::AppId& appId, const Tizen::Base::String& instanceId, int width, int height, int& shmId) = 0;
virtual result RequestSharedMemoryIdForPD(const Tizen::App::AppId& appId, const Tizen::Base::String& instanceId, int width, int height, int& shmId) = 0;
virtual result RequestSyncSharedMemory(const Tizen::App::AppId& appId, const Tizen::Base::String& instanceId, int width, int height) = 0;
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<Manifest xmlns="http://schemas.tizen.org/2012/06/manifest">
+<Manifest xmlns="http://schemas.tizen.org/2012/12/manifest">
<Id>gi2qxenosh</Id>
<Version>1.0.0</Version>
<Type>C++App</Type>
- <Vendors>
- <Vendor Locale="eng-GB"/>
- </Vendors>
+ <Author/>
<Descriptions>
<Description Locale="eng-GB"/>
</Descriptions>
- <Url/>
<Requirements>
<Feature Name="http://tizen.org/feature/platform.core.cpu.arch">x86</Feature>
<Feature Name="http://tizen.org/feature/platform.core.fpu.arch">vfpv3</Feature>
</Requirements>
<Apps>
<ApiVersion>2.1</ApiVersion>
- <Secret/>
<Privileges>
<Privilege>http://tizen.org/privilege/application.launch</Privilege>
<Privilege>http://tizen.org/privilege/appmanager.launch</Privilege>
+ <Privilege>http://tizen.org/privilege/application.kill</Privilege>
</Privileges>
- <ServiceApp AutoRestart="False" Default="True" ExecutableName="osp-livebox-service" LaunchOnBoot="False">
- <Names>
- <Name Locale="eng-GB">tizen livebox service</Name>
- </Names>
+ <ServiceApp Name="osp-livebox-service" Main="True">
+ <DisplayNames>
+ <DisplayName Locale="eng-GB">tizen livebox service</DisplayName>
+ </DisplayNames>
<Icons/>
- <AppControls/>
<DataControls/>
<LaunchConditions/>
<Notifications/>
}
void
-_Livebox::OnUpdate(void)
+_Livebox::OnUpdate(const String& argument)
{
SysLog(NID_APP, "appId(%ls), instanceId(%ls), width(%d), height(%d), priority(%d)", __providerId.GetPointer(), __instanceId.GetPointer(), __width, __height, __priority);
- SendUpdateRequest(__width, __height);
+ SendUpdateRequest(__width, __height, argument);
}
void
if (__pLiveboxPopup)
{
__pLiveboxPopup->OnPopupDestoyed();
- __pLiveboxPopup->ReleaseSharedMem();
delete __pLiveboxPopup;
+ __pLiveboxPopup = null;
}
-
- __pLiveboxPopup = null;
-
RestartLifeDurationTimer();
}
}
result
-_Livebox::SendUpdateRequest(int width, int height)
+_Livebox::SendUpdateRequest(int width, int height, const String& argument)
{
std::unique_ptr<HashMap, AllElementsDeleter> pArgs (CreateRequestArgs() );
{
SysLog(NID_APP, "lifeDuration timer is expired, so terminating livebox app(%ls)..", __providerId.GetPointer() );
+ ReleaseSharedMem();
AppManager::GetInstance()->TerminateApplication(__appId);
+
}
else if( &timer == &__UpdateTimer)
{
SysLog(NID_APP, "update timer is expired for livebox app(%ls)..", __providerId.GetPointer() );
- OnUpdate();
+ OnUpdate(L"");
}
}
,__width(width)
,__height(height)
,__priority(priority)
- ,__buffer_info(null)
- ,__buffer(null) // __pEcoreEvas(null), __pEvas(null), __current(0)
,__isForeground(true)
,__ipcClientId(-1)
+ ,__buffer_info(null)
+ ,__buffer(null) // __pEcoreEvas(null), __pEvas(null), __current(0)
{
_LiveboxManagerImpl::ExtractAppIdAndProviderName(providerId, __appId, __providerName);
_LiveboxBase::ReleaseSharedMem()
{
SysLog(NID_APP, "Enter");
+
int ret;
if( __buffer)
result
LiveboxManagerService::Construct()
{
- _AppManagerImpl::GetInstance()->AddEventListener(*this);
+// _AppManagerImpl::GetInstance()->AddEventListener(*this);
_LiveboxManagerStub::StartIpcServer();
{
pLivebox->SetClientId(clientId);
SysLog(NID_APP, "client is registered.(%d)", clientId);
+ if( clientId == -1)
+ {
+ pLivebox->ReleaseSharedMem();
+ if(pLivebox->GetLiveboxPopup())
+ {
+ pLivebox->OnPopupDestoyed();
+ }
+ }
}
}
return E_SUCCESS;
}
-void
-LiveboxManagerService::OnApplicationLaunched(const AppId& appId, _AppType type)
-{
-
-}
-
-void
-LiveboxManagerService::OnApplicationTerminated(const AppId& appId, _AppType type)
-{
- this->SetClientIds(appId, -1);
-}
+//void
+//LiveboxManagerService::OnApplicationLaunched(const AppId& appId, _AppType type)
+//{
+//
+//}
+//
+//void
+//LiveboxManagerService::OnApplicationTerminated(const AppId& appId, _AppType type)
+//{
+// this->SetClientIds(appId, -1);
+//}
void
LiveboxManagerService::OnIpcClientConnected(const _IpcServer& server, int clientId)
{
String fullAppId = server.GetClientAppId() + "." + server.GetClientAppExecutableName();
SysLog(NID_APP, "(%ls)\n", fullAppId.GetPointer());
-// SysLog(NID_APP, "(appId:%ls, pid:%d, clientId:%d)\n", server.GetClientAppId().GetPointer(), server.GetClientProcessId(), clientId);
-// this->SetClientIds(server.GetClientAppId(), -1);
+ this->SetClientIds(fullAppId, -1);
}
result
_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->OnUpdate();
+ pLivebox->OnUpdate(L"");
}
return 0;
if ( pLivebox->__providerId == providerId )
{
- pLivebox->OnUpdate();
+ pLivebox->OnUpdate(L"");
}
}
return E_SUCCESS;
_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);
+ /*if( pLivebox->GetLiveboxPopup() )
+ {
+ pLivebox->OnPopupDestoyed();
+ }*/
pLivebox->OnPopupCreated(arg->info.pd_create.w, arg->info.pd_create.h);
return 0;
LiveboxManagerService::OnLiveboxPopupDestroy(struct event_arg *arg, void* data)
{
SysTryReturn (NID_APP, arg->type == event_arg::EVENT_PD_DESTROY, -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");
-
+ 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);
pLivebox->OnPopupDestoyed();
- SysLog(NID_APP, "Exit");
return 0;
}
cbs.disconnected = LiveboxDisconnected,
cbs.pause = OnLivePause,
cbs.resume = OnLiveboxResume,
+// cbs.lb_pause = OnLivePause,
+// cbs.lb_resume = OnLiveboxResume,
cbs.lb_create = OnLiveboxCreate,
cbs.lb_destroy = OnLiveboxDestroy,
cbs.update_content = OnLiveboxUpdate,
///////////////////////////////////////////////////////
result
-LiveboxManagerService::RequestUpdate(const Tizen::App::AppId& appId, const Tizen::Base::String& providerName)//, const Tizen::Base::String& param)
+LiveboxManagerService::RequestUpdate(const Tizen::App::AppId& appId, const Tizen::Base::String& providerName, const Tizen::Base::String& argument)
{
SysLog(NID_APP, "%ls, %ls", appId.GetPointer(), providerName.GetPointer() );
pArray->Construct();
pArray->Add(pLivebox);
+ pArray->Add(new String(argument));
result r = __handlerThread.SendUserEvent(LOCAL_EVENT_REQUEST_UPDATE, pArray);
SysTryLog(NID_APP, !IsFailed(r), "[%s] Propagated.", GetErrorMessage(r));
}
result
+LiveboxManagerService::RequestUpdateInstance(const Tizen::Base::String& instanceId, const Tizen::Base::String& argument)
+{
+ SysLog(NID_APP, "%ls, %ls", instanceId.GetPointer(), argument.GetPointer() );
+
+ for( int i = 0; i < __liveboxes.GetCount(); i++ )
+ {
+ _Livebox* pLivebox = null;
+ __liveboxes.GetAt(i, pLivebox);
+
+ if ( pLivebox->__instanceId == instanceId)
+ {
+ SysLog(NID_APP, "OK");
+
+ ArrayList* pArray = new ArrayList();
+ SysTryReturnResult(NID_APP, pArray, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY]");
+
+ pArray->Construct();
+ pArray->Add(pLivebox);
+ pArray->Add(new String(argument));
+
+ result r = __handlerThread.SendUserEvent(LOCAL_EVENT_REQUEST_UPDATE, pArray);
+ SysTryLog(NID_APP, !IsFailed(r), "[%s] Propagated.", GetErrorMessage(r));
+
+ return E_SUCCESS;
+ }
+ }
+ SysLog(NID_APP, "Exit.");
+ return E_OBJ_NOT_FOUND;
+}
+
+result
LiveboxManagerService::RequestSharedMemoryId(const Tizen::App::AppId& appId, const Tizen::Base::String& instanceId, int width, int height, int& shmId)
{
_Livebox* pLivebox = this->Find(appId, instanceId);
SysTryReturnResult(NID_APP, pLivebox , E_SYSTEM, "[E_SYSTEM] pLivebox is null for (%ls) (%ls)", appId.GetPointer(), instanceId.GetPointer());
SysTryReturnResult(NID_APP, pLivebox->GetLiveboxPopup(), E_SYSTEM, "[E_SYSTEM] GetLiveboxPopup() returns null for (%ls) (%ls)", appId.GetPointer(), instanceId.GetPointer());
- return pLivebox->GetLiveboxPopup()->ReleaseSharedMem();
+// return pLivebox->GetLiveboxPopup()->ReleaseSharedMem();
+ return E_SUCCESS;
}
LiveboxManagerService::_TaskHandlerThread::~_TaskHandlerThread(void)
_Livebox* pLivebox = dynamic_cast<_Livebox*>( pArgs->GetAt(0) );
SysTryReturnVoidResult(NID_APP, pLivebox != null, E_INVALID_STATE, "_Livebox is null!.");
- pLivebox->OnUpdate();
+ String* pArgument = dynamic_cast<String*>( pArgs->GetAt(1) );
+ SysTryReturnVoidResult(NID_APP, pArgument != null, E_INVALID_STATE, "pArgument is null!.");
+
+ pLivebox->OnUpdate(*pArgument);
+ delete pArgument;
pArgs->RemoveAll();
delete pArgs;
}
bool
-_LiveboxManagerStub::OnRequestUpdate(const Tizen::App::AppId& appId, const Tizen::Base::String& providerName, result* pRes)
+_LiveboxManagerStub::OnRequestUpdate(const Tizen::App::AppId& appId, const Tizen::Base::String& providerName, const Tizen::Base::String& argument, result* pRes)
{
SysLog(NID_APP, "");
- *pRes = RequestUpdate(appId, providerName);
+ *pRes = RequestUpdate(appId, providerName, argument);
+ return true;
+}
+
+bool
+_LiveboxManagerStub::OnRequestUpdateInstance(const Tizen::Base::String& instanceId, const Tizen::Base::String& argument, result* pRes)
+{
+ SysLog(NID_APP, "");
+ *pRes = RequestUpdateInstance(instanceId, argument);
return true;
}
IPC_BEGIN_MESSAGE_MAP(_LiveboxManagerStub, message)
IPC_MESSAGE_HANDLER_EX(LiveboxManager_RequestUpdate, &server, OnRequestUpdate)
+ IPC_MESSAGE_HANDLER_EX(LiveboxManager_RequestUpdateInstance, &server, OnRequestUpdateInstance)
IPC_MESSAGE_HANDLER_EX(LiveboxManager_RequestSharedMemoryId, &server, OnRequestSharedMemoryId)
IPC_MESSAGE_HANDLER_EX(LiveboxManager_RequestSharedMemoryIdForPD, &server, OnRequestSharedMemoryIdForPD)
IPC_MESSAGE_HANDLER_EX(LiveboxManager_RequestSyncSharedMemory, &server, OnRequestSyncSharedMemory)
_LiveboxPopup::~_LiveboxPopup()
{
SysLog(NID_APP, "appId(%ls), instanceId(%ls), width(%d), height(%d))", __providerId.GetPointer(), __instanceId.GetPointer(), __width, __height);
+ ReleaseSharedMem();
}