Name: @PC_NAME@
Description: @PACKAGE_DESCRIPTION@
Version: @VERSION@
-Requires: @PC_REQUIRED@
+Requires: @PC_REQUIRED@
Libs: -L${libdir} @PC_LDFLAGS@
-Cflags: -I${includedir}
+Cflags: -I${includedir} -I${includedir}/app -I${includedir}/base -I${includedir}/io -I${includedir}/system -I${includedir}/security
Summary: osp app framework internel (Internal)
Group: TO_BE/FILLED_IN
Requires: %{name} = %{version}-%{release}
+Requires: %{name}-devel
%description internal-devel
The App Framework library of OSP (Internal-DEV)
%files devel
%{_includedir}/osp/*.h
%{_includedir}/osp/*.hpp
-%{_libdir}/pkgconfig/osp-appfw.pc
%files internal-devel
%{_includedir}/osp/app/*
%{_includedir}/osp/text/*
%{_includedir}/osp/server/*
%{_includedir}/osp/system-server/*
+%{_libdir}/pkgconfig/osp-appfw.pc
%{_libdir}/pkgconfig/osp-appfw-server.pc
%{_libdir}/pkgconfig/osp-system-server.pc
FApp_SqlDataControlImpl.cpp
FAppMapDataControl.cpp
FApp_MapDataControlImpl.cpp
- FApp_AppManagerEvent.cpp
FAppDataControlProviderManager.cpp
FApp_DataControlProviderManagerImpl.cpp
FAppAppControlProviderManager.cpp
#include "FApp_AppControlImpl.h"
#include "FApp_AppImpl.h"
#include "FApp_AppInfo.h"
-#include "FApp_AppManagerEventArg.h"
#include "FApp_Aul.h"
#include "FApp_AppControlManager.h"
#include "FApp_AppManagerProxy.h"
#include "FApp_ConditionManagerProxy.h"
-#include "FApp_IAppManagerEventListener.h"
#include "FApp_MapDataControlImpl.h"
#include "FApp_SqlDataControlImpl.h"
#include "FAppPkg_PackageManagerImpl.h"
#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"
result
_AppManagerImpl::Construct(void)
{
- __appManagerEvent.Construct();
__appLifecycleEvent.Construct();
__appListForAppLifecycle.Construct();
result r = __mutex.Create();
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.
#include "FApp_Types.h"
#include "FApp_AppInfo.h"
-#include "FApp_IAppManagerEventListener.h"
#include "FApp_IAppManagerServiceEventListener.h"
-#include "FApp_AppManagerEventArg.h"
#include "FApp_AppManagerProxy.h"
#include "FApp_AppManagerIpcMessage.h"
_AppManagerProxy::OnIpcResponseReceived(_IpcClient& client, const IPC::Message& message)
{
IPC_BEGIN_MESSAGE_MAP(_AppManagerProxy, message)
- IPC_MESSAGE_HANDLER_EX(AppManager_OnEventReceived, &client, OnEventReceived )
IPC_MESSAGE_HANDLER_EX(AppManager_OnTerminateApplicationRequested, &client, OnTerminateApplicationRequested )
IPC_MESSAGE_HANDLER_EX(AppManager_OnAppLifecycleEventReceived, &client, OnAppLifecycleEventReceived )
IPC_END_MESSAGE_MAP()
}
-bool
-_AppManagerProxy::OnEventReceived(const _AppManagerEventArg& arg)
-{
- SysTryReturnResult(NID_APP, __pServiceEventListener != null, E_INVALID_STATE, "__pServiceEventListener instance must not be null.");
-
- __pServiceEventListener->OnServiceEventReceived(-1, arg);
-
- return true;
-}
void
_AppManagerProxy::OnTerminateApplicationRequested(void)
return E_SUCCESS;
}
-result
-_AppManagerProxy::AddEventListener(int clientId)
-{
- 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_AddEventListener(_AppInfo::GetProcessId()));
- result r = __pIpcClient->SendRequest(*pMsg);
- SysTryReturn(NID_APP, !IsFailed(r), r, r, "SendRequest is failed.");
-
- return E_SUCCESS;
-}
-
-result
-_AppManagerProxy::RemoveEventListener(int clientId)
-{
- 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_RemoveEventListener(_AppInfo::GetProcessId()));
- result r = __pIpcClient->SendRequest(*pMsg);
- SysTryReturn(NID_APP, !IsFailed(r), r, r, "SendRequest is failed.");
-
- return E_SUCCESS;
-}
bool
_AppManagerProxy::IsUserPreferredAppForAppControlResolution(const AppId& appId)
#include "FApp_Types.h"
#include "FApp_AppControlEvent.h"
#include "FApp_IAppControlSysEventListener.h"
-#include "FApp_AppManagerEvent.h"
#include "FApp_IAppManagerServiceEventListener.h"
#include "FApp_RequestManagerT.h"
#include "FApp_IAppControlResponseEventListener.h"
class _IAppManager;
class _ConditionManagerProxy;
class _AppArg;
-class _AppControlEventArg;
-class _IAppManagerEventListener;
-class _AppManagerEventArg;
class _AppMessageImpl;
class _AppControlResponseEvent;
class IAppControlEventListener;
#include <FApp_Types.h>\r
#include <FBaseRtIEventArg.h>\r
\r
-#include "FApp_AppManagerEvent.h"\r
\r
namespace Tizen { namespace App\r
{\r
+++ /dev/null
-//
-// Copyright (c) 2012 Samsung Electronics Co., Ltd.
-//
-// Licensed under the Apache License, Version 2.0 (the License);
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-/**
- * @file FIo_IpcCommonParamTraits.h
- * @brief This is the header file for common param traits.
- */
-
-#ifndef _FAPP_INTERNAL_APPMANAGER_EVENT_ARG_PARAM_TRAITS_H_
-#define _FAPP_INTERNAL_APPMANAGER_EVENT_ARG_PARAM_TRAITS_H_
-
-#include "FBaseString.h"
-#include "FBaseColIList.h"
-#include "FBaseColArrayList.h"
-#include "FIo_IpcCommonDataTypes.h"
-
-#include "base/tuple.h"
-#include "ipc/ipc_param_traits.h"
-
-#include "FApp_AppManagerEventArg.h"
-
-
-//namespace Tizen { namespace App { class _AppManagerEventArg; } }
-
-namespace IPC
-{
-template <>
-struct ParamTraits<Tizen::App::_AppManagerEventArg>
-{
- typedef Tizen::App::_AppManagerEventArg param_type;
-
- static void Write(Message* m, const param_type& p)
- {
- WriteParam(m, p.GetAppId());
- m->WriteInt(p.GetAppType());
- m->WriteInt(p.GetEventType());
- }
-
- static bool Read(const Message* m, void** iter, param_type* r)
- {
- Tizen::App::AppId appId;
- int appType = Tizen::App::_APP_TYPE_UI_APP;
- int eventType = Tizen::App::_AppManagerEvent::_APP_MANAGER_EVENT_INVALID;
-
- if (!ReadParam(m, iter, &appId))
- {
- return false;
- }
- m->ReadInt(iter, &appType);
- m->ReadInt(iter, &eventType);
-
- Tizen::App::_AppManagerEventArg arg(appId, static_cast<Tizen::App::_AppType>(appType), static_cast<Tizen::App::_AppManagerEvent::_Type>(eventType));
- *r = arg;
-
- return true;
- }
-
- static void Log(const param_type& p, std::string* l)
- {
- }
-};
-}
-
-#endif //_FAPP_INTERNAL_APPMANAGER_EVENT_ARG_PARAM_TRAITS_H_
#include <FBaseSysLog.h>
#include "FApp_Types.h"
-#include "FApp_AppManagerEvent.h"
#include "FApp_IAppManagerServiceEventListener.h"
#include "FApp_AppLifecycleEvent.h"
class _IAppManager;
class _ConditionManagerProxy;
-class _IAppManagerEventListener;
class _IAppEventListener;
-class _AppManagerEventArg;
class _IAppLifecycleEventListener;
class _ActiveWindowManager;
* @exception E_SUCCESS This method was successful.
* @exception E_OBJ_ALREADY_EXIST The listener was already exist.
*/
- result AddEventListener(_IAppManagerEventListener& listener);
+ result AddAppEventListener(_IAppEventListener& listener);
/**
* Adds a listener object.
* @exception E_SUCCESS This method was successful.
* @exception E_OBJ_ALREADY_EXIST The listener was already exist.
*/
- result RemoveEventListener(_IAppManagerEventListener& listener);
-
- result AddAppEventListener(_IAppEventListener& listener);
-
result RemoveAppEventListener(_IAppEventListener& listener);
- virtual result OnServiceEventReceived(const int clientId, const _AppManagerEventArg& arg);
-
virtual result OnTerminateApplicationRequested(int clientId);
virtual result OnAppLifecycleEventReceived(int clientId, const AppId& appId, _AppLifecycleEventType appLifecycleEventType);
std::unique_ptr<_ActiveWindowManager> __pActiveWindowManager;
Tizen::Base::Runtime::_LibraryImpl* __pUiLibrary;
_AppLifecycleManager __lifeManager;
- _AppManagerEvent __appManagerEvent;
Tizen::App::_AppLifecycleEvent __appLifecycleEvent;
Tizen::Base::Collection::HashMapT<Tizen::Base::String, int> __appListForAppLifecycle;
Tizen::Base::Runtime::Mutex __mutex;
#include "ipc/ipc_message_macros.h"
#include "FIo_IpcCommonParamTraits.h"
#include "FIo_IpcMessageStart.h"
-#include "FApp_AppManagerEventParamTraits.h"
#define IPC_MESSAGE_START AppManagerServiceStart
IPC_SYNC_MESSAGE_CONTROL1_1(AppManager_ClearUserPreferenceForAppControlResolution, Tizen::App::AppId, result)
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)
-IPC_MESSAGE_CONTROL1(AppManager_RemoveEventListener, int)
IPC_MESSAGE_CONTROL0(AppManager_OnTerminateApplicationRequested)
IPC_MESSAGE_CONTROL2(AppManager_OnAppLifecycleEventReceived, Tizen::App::AppId, int)
IPC_SYNC_MESSAGE_CONTROL1_1(AppManager_RegisterAppForAppLifecycleEvent, Tizen::App::AppId, result)
#include <FIo_IIpcClientEventListener.h>
#include "FApp_Types.h"
#include "FApp_IAppManager.h"
-#include "FApp_AppManagerEvent.h"
namespace Tizen { namespace Io { class _IpcClient; } }
namespace Tizen { namespace App
{
-class _IAppManagerEventListener;
class _IAppManagerServiceEventListener;
-class _AppManagerEventArg;
class _IAppLifecycleEventListener;
// for platform
virtual result InitEventListener(_IAppManagerServiceEventListener* pListener);
- virtual result AddEventListener(int clientId);
-
- virtual result RemoveEventListener(int clientId);
-
virtual result RegisterApplication(const AppId& appId, _AppType appType, int pid);
virtual result UnregisterApplication(int pid);
virtual void OnIpcResponseReceived(Tizen::Io::_IpcClient& client, const IPC::Message& message);
- bool OnEventReceived(const Tizen::App::_AppManagerEventArg& arg);
void OnTerminateApplicationRequested(void);
+
void OnAppLifecycleEventReceived(const AppId& appId, int appLifecycleEventType);
private:
virtual result UnregisterApplication(int pid) = 0;
virtual result InitEventListener(_IAppManagerServiceEventListener* pListener) = 0;
- virtual result AddEventListener(int clientId) = 0;//, _IAppManagerServiceEventListener* pListener) = 0;
- virtual result RemoveEventListener(int clientId) = 0;//, _IAppManagerServiceEventListener* pListener) = 0;
virtual bool IsUserPreferredAppForAppControlResolution(const AppId& appId) = 0;
virtual result ClearUserPreferenceForAppControlResolution(const AppId& appId) = 0;
namespace Tizen { namespace App
{
-class _AppManagerEventArg;
-
/**
* @interface _IAppManagerServiceEventListener
* @brief This interface defines the listener for the event from _AppManangerService
: virtual public Tizen::Base::Runtime::IEventListener
{
public:
- virtual result OnServiceEventReceived(int clientId, const _AppManagerEventArg& arg) = 0;
virtual result OnTerminateApplicationRequested(int clientId) = 0;
virtual result OnAppLifecycleEventReceived(int clientId, const AppId& appId, _AppLifecycleEventType appLifecycleEventType) = 0;
app/FApp_AulServer.cpp
app/FApp_AppLaunchCondition.cpp
app/FApp_AppLaunchConditionHandlerBase.cpp
+ app/FApp_AppManagerEvent.cpp
app/package/FAppPkg_PackageManagerServer.cpp
io/FIo_IpcServer.cpp
security/FSec_PrivilegeManagerServer.cpp
+++ /dev/null
-SET (this_target osp-appfw-server)
-
-INCLUDE_DIRECTORIES (
- ${SLP_INCLUDE_DIRS}
- ${CMAKE_SOURCE_DIR}/inc
- ${CMAKE_SOURCE_DIR}/src/base/inc
- ${CMAKE_SOURCE_DIR}/src/io/inc
- ${CMAKE_SOURCE_DIR}/src/system/inc
- ${CMAKE_SOURCE_DIR}/src/security/inc
- ${CMAKE_SOURCE_DIR}/src/app/inc
- inc
- )
-
-SET (${this_target}_SOURCE_FILES
- app/FApp_AulServer.cpp
- package/FAppPkg_PackageManagerServer.cpp
- )
-
-## SET EXTRA COMPILER FLAGS
-SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fPIC -Wall" )
-
-## SET C COMPILER FLAGS
-SET(CMAKE_C_FLAGS "${OSP_DEBUG_FLAGS} ${OSP_OPT_FLAGS} ${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} ${OSP_COMPILER_FLAGS}")
-
-## SET CPP COMPILER FLAGS
-SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden")
-SET(CMAKE_CXX_FLAGS "${OSP_DEBUG_FLAGS} ${OSP_OPT_FLAGS} ${CMAKE_CXX_FLAGS} ${EXTRA_CFLAGS} ${OSP_COMPILER_FLAGS}")
-
-## Create Library
-ADD_LIBRARY (${this_target} SHARED ${${this_target}_SOURCE_FILES})
-
-TARGET_LINK_LIBRARIES(${this_target} osp-appfw)
-
-SET_TARGET_PROPERTIES(${this_target}
- PROPERTIES
- VERSION ${FULLVER}
- SOVERSION ${MAJORVER}
- CLEAN_DIRECT_OUTPUT 1
-)
-
* @brief This class contains application manager event
* @since 2.1
*/
-class _AppManagerEvent
+class _OSP_EXPORT_ _AppManagerEvent
: public Tizen::Base::Runtime::_Event
{
public: