bundle*
_AppArg::GetBundleFromSvc(void* svc)
{
- struct DummyS
- {
- int dummy1;
- int dummy2;
- bundle* pData;
- };
-
- DummyS* pDummy = static_cast<DummyS*>(svc);
-
- if (pDummy && pDummy->pData)
- {
- return pDummy->pData;
- }
+ bundle* pBundle = NULL;
+ int ret = service_to_bundle(static_cast<service_h>(svc), &pBundle);
- return NULL;
+ return (ret == SERVICE_ERROR_NONE) ? pBundle : NULL;
}
if (pAppManager != null)
{
- result r = pAppManager->RegisterApplication(_AppInfo::GetPackageId(), _AppInfo::GetAppExecutableName(), static_cast<_AppType>(_AppInfo::GetAppType()), _AppInfo::GetProcessId());
+ result r = pAppManager->RegisterApplication(_AppInfo::GetApplicationId(), static_cast<_AppType>(_AppInfo::GetAppType()), _AppInfo::GetProcessId());
SysTryLog(NID_APP, !IsFailed(r), "[%s] Application registration failed.", GetErrorMessage(r));
}
SysLogTag(NID_APP, "LAUNCH","[%ls:<RegisterApplication>:done]", _AppInfo::GetAppExecutableName().GetPointer());
result
-_AppManagerProxy::LaunchApplication(const AppId& appId, int req)
-{
- SysTryReturnResult(NID_APP, __pIpcClient != null, E_INVALID_STATE, "__pIpcClient instance must not be null.");
- SysLog(NID_APP, "");
-
- std::auto_ptr<IPC::Message> pMsg (new (std::nothrow) AppManager_LaunchApplication(appId, req));
- result r = __pIpcClient->SendRequest(*pMsg.get());
- SysTryReturn(NID_APP, !IsFailed(r), r, r, "SendRequest is failed.");
-
- return E_SUCCESS;
-}
-
-result
_AppManagerProxy::TerminateApplication(const AppId& appId)
{
SysTryReturnResult(NID_APP, __pIpcClient != null, E_INVALID_STATE, "__pIpcClient instance must not be null.");
return response;
}
-bool
-_AppManagerProxy::IsRunning(const AppId& appId)
-{
- bool isRunning = false;
-
- std::auto_ptr<IPC::Message> pMsg (new (std::nothrow) AppManager_IsRunning(appId, &isRunning));
- result r = __pIpcClient->SendRequest(*pMsg.get());
- SysTryReturn(NID_APP, !IsFailed(r), false, r, "SendRequest is failed.");
-
- return isRunning;
-}
-result
-_AppManagerProxy::GetRunningAppList(Collection::ArrayList* pArray)
-{
- SysTryReturnResult(NID_APP, __pIpcClient != null, E_INVALID_STATE, "__pIpcClient instance must not be null.");
-
- SysLog(NID_APP, "");
-
- result response = E_SUCCESS;
- std::auto_ptr<IPC::Message> pMsg (new (std::nothrow) AppManager_GetRunningAppList(pArray, &response));
- result r = __pIpcClient->SendRequest(*pMsg.get());
- SysTryReturn(NID_APP, !IsFailed(r), r, r, "SendRequest is failed.");
-
- return response;
-}
-
result
-_AppManagerProxy::RegisterApplication(const String& packageId, const String& executableName, _AppType appType, int pId)
+_AppManagerProxy::RegisterApplication(const AppId& appId, _AppType appType, int pId)
{
SysTryReturnResult(NID_APP, __pIpcClient != null, E_INVALID_STATE, "__pIpcClient instance must not be null.");
SysLog(NID_APP, "");
- std::auto_ptr<IPC::Message> pMsg (new (std::nothrow) AppManager_RegisterApplication(packageId, executableName, static_cast<int>(appType), pId));
+ std::auto_ptr<IPC::Message> pMsg (new (std::nothrow) AppManager_RegisterApplication(appId, static_cast<int>(appType), pId));
result r = __pIpcClient->SendRequest(*pMsg.get());
SysTryReturn(NID_APP, !IsFailed(r), r, r, "SendRequest is failed.");
#define IPC_MESSAGE_START AppManagerServiceStart
-IPC_MESSAGE_CONTROL2(AppManager_LaunchApplication, Tizen::App::AppId, int)
IPC_SYNC_MESSAGE_CONTROL1_1(AppManager_TerminateApplication, Tizen::App::AppId, result)
-IPC_SYNC_MESSAGE_CONTROL1_1(AppManager_IsRunning, Tizen::App::AppId, bool)
IPC_SYNC_MESSAGE_CONTROL1_2(AppManager_IsUserPreferredAppForAppControlResolution, Tizen::App::AppId, bool, result)
IPC_SYNC_MESSAGE_CONTROL1_1(AppManager_ClearUserPreferenceForAppControlResolution, Tizen::App::AppId, result)
-IPC_SYNC_MESSAGE_CONTROL0_2(AppManager_GetRunningAppList, Tizen::Base::Collection::ArrayList, result)
-IPC_MESSAGE_CONTROL4(AppManager_RegisterApplication, Tizen::App::AppId, Tizen::Base::String, int, int)
+IPC_MESSAGE_CONTROL3(AppManager_RegisterApplication, Tizen::App::AppId, int, int)
IPC_MESSAGE_CONTROL1(AppManager_UnregisterApplication, int)
IPC_MESSAGE_CONTROL1(AppManager_OnEventReceived, Tizen::App::_AppManagerEventArg)
IPC_MESSAGE_CONTROL1(AppManager_AddEventListener, int)
public:
virtual ~_AppManagerProxy(void);
- virtual result LaunchApplication(const AppId& appId, int req);
-
virtual result TerminateApplication(const AppId& appId);
- virtual bool IsRunning(const AppId& appId);
-
- virtual result GetRunningAppList(Tizen::Base::Collection::ArrayList* pList);
-
// for platform
virtual result InitEventListener(_IAppManagerServiceEventListener* pListener);
- virtual result AddEventListener(int clientId );
+ virtual result AddEventListener(int clientId);
- virtual result RemoveEventListener(int clientId );
+ virtual result RemoveEventListener(int clientId);
- virtual result RegisterApplication(const Tizen::Base::String& packageId, const Tizen::Base::String& executableName, _AppType appType, int pid);
+ virtual result RegisterApplication(const AppId& appId, _AppType appType, int pid);
virtual result UnregisterApplication(int pid);
public:
virtual ~_IAppManager() {}
- virtual result LaunchApplication(const AppId& appId, int req) = 0;
virtual result TerminateApplication(const AppId& appId) = 0;
- virtual bool IsRunning(const AppId& appId) = 0;
- virtual result GetRunningAppList(Tizen::Base::Collection::ArrayList* pArray) = 0;
- virtual result RegisterApplication(const Tizen::Base::String& packageId, const Tizen::Base::String& executableName, _AppType appType, int pid) = 0;
+ virtual result RegisterApplication(const AppId& appId, _AppType appType, int pid) = 0;
virtual result UnregisterApplication(int pid) = 0;
virtual result InitEventListener(_IAppManagerServiceEventListener* pListener) = 0;
#include <new>
#include <sys/sysinfo.h>
#include <sys/time.h>
-#include <time.h>
+#include <ctime>
#include <vconf.h>
#include <FBaseDateTime.h>