#include "FApp_AppControlRegistry.h"
#include "FApp_AppImpl.h"
#include "FApp_AppInfo.h"
-#include "FApp_AppManagerEventArg.h"
#include "FApp_AppManagerImpl.h"
#include "FApp_AppManagerProxy.h"
#include "FApp_AppMessageImpl.h"
#include "FApp_AppControlImpl.h"
#include "FApp_ConditionManagerProxy.h"
-#include "FApp_IAppManagerEventListener.h"
#include "FApp_IAppEventListener.h"
#include "FApp_MapDataControlImpl.h"
#include "FApp_SqlDataControlImpl.h"
#include "FAppPkg_PackageManagerImpl.h"
#include "FAppPkg_PackageInfoImpl.h"
#include "FApp_AppControlManager.h"
+#include "FApp_TemplateUtil.h"
#include "FApp_Aul.h"
#include "FApp_AppLifecycleEvent.h"
#include "FApp_AppLifecycleEventArg.h"
result
_AppManagerImpl::Construct(void)
{
- __appManagerEvent.Construct();
__appLifecycleEvent.Construct();
- __appListForAppLifecycle.Construct(0, 0, __strHashCodeProvider, __comparer);
+ __appListForAppLifecycle.Construct();
result r = __mutex.Create();
SysTryLog(NID_APP, r == E_SUCCESS, "Creating mutex failed.");
AppControl* pAc = null;
pAc = pRegs->GetTizenAppControlN(aId, oId);
- if (pAc != null)
- {
- SetLastResult(E_SUCCESS);
- return pAc;
- }
-
- pAc = pRegs->GetAppControlN(aId, oId);
-
SysTryReturn(NID_APP, pAc != null, null, E_OBJ_NOT_FOUND, "[%s] No matching AppControl instance found (%ls, %ls).",
GetErrorMessage(E_OBJ_NOT_FOUND), aId.GetPointer(), oId.GetPointer());
SetLastResult(E_SUCCESS);
// "The length of appid exceeded the limit(%d).",
// WIDGET_APP_MAX_APPID_LENGTH);
- std::unique_ptr<AppControl> pAc(_AppControlRegistry::GetInstance()->GetAppControlN(appId, TIZEN_OPERATION_MAIN));
+ std::unique_ptr<AppControl> pAc(FindAppControlN(appId, TIZEN_OPERATION_MAIN));
SysTryReturnResult(NID_APP, pAc.get() != null, E_OBJ_NOT_FOUND, "The target application (%ls) is not found.", appId.GetPointer());
if (pArguments)
return _AppImpl::GetInstance()->SetListener(appEvent, pListener);
}
-result
-_AppManagerImpl::OnServiceEventReceived(int clientId, const _AppManagerEventArg& arg)
-{
- SysLog(NID_APP, "app:%ls, appType:0x%x", arg.GetAppId().GetPointer(), arg.GetAppType());
-
- _AppManagerEventArg* pArg = new (std::nothrow)_AppManagerEventArg(arg);
- SysTryReturnResult(NID_APP, pArg != null, E_OUT_OF_MEMORY, "Memory allocation failed.");
- __appManagerEvent.FireAsync(*pArg);
- return E_SUCCESS;
-}
result
_AppManagerImpl::OnTerminateApplicationRequested(int clientId)
return E_SUCCESS;
}
-result
-_AppManagerImpl::AddEventListener(_IAppManagerEventListener& listener)
-{
- _IAppManager* pMgr = _AppManagerProxy::GetService();
- SysTryReturnResult(NID_APP, pMgr != null, E_INVALID_STATE, "");
-
- result r = __appManagerEvent.AddListener(listener);
- SysTryReturn(NID_APP, IsFailed(r) == false, r, r, "[%s]", GetErrorMessage(r));
-
- const int count = __appManagerEvent.GetListenerCount();
- SysLog(NID_APP, "registered event listener(s) # %d", count);
-
- if (count > 1)
- {
- return E_SUCCESS;
- }
-
- return pMgr->AddEventListener(-1);
-}
-
-result
-_AppManagerImpl::RemoveEventListener(_IAppManagerEventListener& listener)
-{
- _IAppManager* pMgr = _AppManagerProxy::GetService();
- SysTryReturnResult(NID_APP, pMgr != null, E_INVALID_STATE, "");
-
- result r = __appManagerEvent.RemoveListener(listener);
- SysTryReturn(NID_APP, IsFailed(r) == false, r, r, "[%s]", GetErrorMessage(r));
-
- const int count = __appManagerEvent.GetListenerCount();
- SysLog(NID_APP, "registered event listener(s) # %d", count);
-
- if (count == 0)
- {
- return pMgr->RemoveEventListener(-1);
- }
-
- return E_SUCCESS;
-}
-
///////////////////////////////////////////////////////////////////////////////
// LifecycleManager begins.
else
{
r = __appListForAppLifecycle.SetValue(appId, currentRefCnt);
- }
+ }
}
else
{